repl.it
@HarperframeInc/

Dystopian

Python

Can you take care of your country?

fork
loading
Files
  • main.py
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import colored
import time, os
import getch
import random

prog_bar_empt = colored.bg(22) + " "
prog_bar_full = colored.bg(2) + " "
print_reset = colored.attr("reset")

global faith, pop, army, money

faith = 5
pop = 5
army = 5
money = 5

types = [
  {
    "NAME":"POPE_ASK",
    "ACTION_Y":["FAITH_ADD", "MONEY_SUB"],
    "ACTION_N":["FAITH_SUB", "MONEY_ADD"],
    "MESSAGE":"""
        [Pope]: The people are asking for new curches.
        Will you give them new curches? [Y]es or [N]o
    """
  },
  {
    "NAME":"GENERAL_ASK",
    "ACTION_Y":["PEOPLE_ADD", "ARMY_SUB"],
    "ACTION_N":["PEOPLE_SUB", "ARMY_SUB"],
    "MESSAGE":"""
        [General Alexander]: The people are rioting. What should we do?
          [N] Shoot them all        [Y] Calm them down.
    """
  },
  {
    "NAME":"TRADE_DEAL",
    "ACTION_Y":["ARMY_SUB", "MONEY_ADD"],
    "ACTION_N":["ARMY_ADD", "MONEY_SUB"],
    "MESSAGE":"""
        [President Jones of Texas]: We need some forces to fight off mutants, in exchange for money.
          [N] No Deal               [Y] Deal
    """
  },
  {
    "NAME":"FARMER_ASK",
    "ACTION_Y":["MONEY_ADD", "MONEY_ADD", "ARMY_SUB"],
    "ACTION_N":["MONEY_SUB", "MONEY_SUB", "ARMY_ADD"],
    "MESSAGE":"""
        [Farmer]: Our crops are dying from mutants! Please send troops!
          [N] Shut Up                [Y] Sure
    """
  },
  {
    "NAME":"POPE_ASK_2",
    "ACTION_Y":["FAITH_ADD", "MONEY_SUB", "ARMY_SUB"],
    "ACTION_N":["FAITH_SUB", "MONEY_ADD"],
    "MESSAGE":"""
        [Pope]: We want to host a religous event. Can we borrow some money and troops?.
          [N] No event, sorry         [Y] Sure, I'll attend!
    """
  }
]

random.shuffle(types)

while 1:
  for x in types:
    action_y = x["ACTION_Y"]
    action_n = x["ACTION_N"]
    print("\n" * 2)
    print(x["MESSAGE"])
    print("\n" * 3)

    # v Print % Bars

    print(prog_bar_full * faith + prog_bar_empt * (10 - faith) + print_reset + " ✚ Faith\n")
    print(prog_bar_full * pop + prog_bar_empt * (10 - pop) + print_reset + " 👪  Population\n")
    print(prog_bar_full * army + prog_bar_empt * (10 - army) + print_reset + " 🔫  Army\n")
    print(prog_bar_full * money + prog_bar_empt * (10 - money) + print_reset + " ₴ Money\n")

    # ^ Print % Bars

    yn = getch.getch()
    if yn == "y":
      for y in action_y:
        if y == "FAITH_ADD": #add faith
          faith = faith + 1
        if y == "POP_ADD": #add pop
          pop = pop + 1
        if y == "ARMY_ADD": #add army
          army = army + 1
        if y == "MONEY_ADD": #add money
          money = money + 1
        if y == "FAITH_SUB": #subtract faith
          faith = faith - 1
        if y == "POP_SUB": #subtract pop
          pop = pop - 1
        if y == "ARMY_SUB": #subtract army
          army = army - 1
        if y == "MONEY_SUB": #subtract money
          money = money - 1
    else:
        for y in action_n:
          if y == "FAITH_ADD": #add faith
            faith = faith + 1
          if y == "POP_ADD": #add pop
            pop = pop + 1
          if y == "ARMY_ADD": #add army
            army = army + 1
          if y == "MONEY_ADD": #add money
            money = money + 1
          if y == "FAITH_SUB": #subtract faith
            faith = faith - 1
          if y == "POP_SUB": #subtract pop
            pop = pop - 1
          if y == "ARMY_SUB": #subtract army
            army = army - 1
          if y == "MONEY_SUB": #subtract money
            money = money - 1
    os.system('clear')
?