Skip to content

Commit

Permalink
Update to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
78Alpha authored Jan 5, 2019
1 parent 72f05ca commit 609f25f
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 250 deletions.
26 changes: 17 additions & 9 deletions Generation.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
import secrets, json
import secrets, json, random

def dna_weekly(): # Weekly supply of DNA for research, used for LAB purchases
with open("UniData.txt", 'r') as f:
variables = json.load(f)
variables["dna_points"] += int(float(variables["infected"])/(1 + (variables["healthy"] * 100)))
dna_random()
#print("DNA POINTS (DEBUG): " + str(variables["dna_points"]))
variables["dna_points"] += 1 + int(float(variables["infected"])/(1 + (variables["healthy"] * 100)))
#print("DNA POINTS (DEBUG): " + str(variables["dna_points"]))
#dna_random()
#print("DNA POINTS (DEBUG): " + str(variables["dna_points"]))
with open("UniData.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
print("Research Points: " + str(variables["dna_points"]))
with open("UniData.txt", 'r') as f3:
variables = json.load(f3)


def dna_random(): # Random DNA per week, can determine victory or defeat
with open("UniData.txt", 'r') as f:
variables = json.load(f)
rand_value1 = secrets.randbelow(10)
if rand_value1 > 4:
random_dna = secrets.randbelow(3)
rand_value1 = secrets.randbelow(100)
#print("RAND VALUE (DEBUG): " + str(rand_value1))
if rand_value1 >= 70:
random_dna = random.randint(1, 5)
# print("RANDOM DNA (DEBUG: " + str(random_dna))
variables["dna_points"] += int(random_dna)
# print("DNA POINTS (DEBUG): " + str(variables["dna_points"]))
with open("UniData.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
else:
return
# print("DNA POINTS (DEBUG): " + str(variables["dna_points"]))
print("Research Points: " + str(variables["dna_points"]))
92 changes: 46 additions & 46 deletions Globals.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"healthy": 100000,
"infected": 1,
"zombies": 0,
"dead": 0,
"cure": 0,
"week": 0,
"infectivity": 0,
"infectivity_limit": 10000,
"severity": 0,
"severity_limit": 100,
"lethality": 0,
"lethality_limit": 10,
"weekly_infections": 10,
"dna_points": 0,
"burst": 0,
"burst_price": 10,
"necrosis": 0,
"necrosis_price": 20,
"water": 0,
"water_price": 10,
"air": 0,
"air_price": 10,
"blood": 0,
"blood_price": 20,
"saliva": 0,
"saliva_price": 20,
"zombify": 0,
"zombify_price": 20,
"rise": 0,
"rise_price": 20,
"limit": 100001,
"cure_percent": 0,
"old": 0,
"color": 0,
"influence[0]": "Infectivity",
"influence[1]": "Severity",
"influence[2]": "Lethality",
"gene[0]": "BURST",
"gene[1]": "NECROSIS",
"gene[2]": "WATER",
"gene[3]": "AIR",
"gene[4]": "BLOOD",
"gene[5]": "SALIVA",
"gene[6]": "ZOMBIFY",
"gene[7]": "RISE"
{
"healthy": 100000,
"infected": 1,
"zombies": 0,
"dead": 0,
"cure": 0,
"week": 0,
"infectivity": 0,
"infectivity_limit": 10000,
"severity": 0,
"severity_limit": 100,
"lethality": 0,
"lethality_limit": 10,
"weekly_infections": 10,
"dna_points": 0,
"burst": 0,
"burst_price": 10,
"necrosis": 0,
"necrosis_price": 20,
"water": 0,
"water_price": 10,
"air": 0,
"air_price": 10,
"blood": 0,
"blood_price": 20,
"saliva": 0,
"saliva_price": 20,
"zombify": 0,
"zombify_price": 20,
"rise": 0,
"rise_price": 20,
"limit": 100001,
"cure_percent": 0,
"old": 0,
"color": 1,
"influence[0]": "Infectivity",
"influence[1]": "Severity",
"influence[2]": "Lethality",
"gene[0]": "BURST",
"gene[1]": "NECROSIS",
"gene[2]": "WATER",
"gene[3]": "AIR",
"gene[4]": "BLOOD",
"gene[5]": "SALIVA",
"gene[6]": "ZOMBIFY",
"gene[7]": "RISE"
}
76 changes: 28 additions & 48 deletions Level1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os, platform, time, secrets, gc, sys, threading, Clear, WordCore, Loading, UI, Graph, Generation, json
from json_system import *
from ColorSplash import *

OS = platform.system()

Expand Down Expand Up @@ -37,8 +38,10 @@ def infecting_agent(): # Determines how many infections occur
with open("UniData.txt", 'r') as f:
variables = json.load(f)
inf_value = float(variables["infectivity"])/(1 + variables["lethality"]) # Must be kept as int() + lethality, inflates lethality otherwise
variables["infected"] += int(inf_value)
variables["healthy"] -= int(inf_value)
variables["infected"] += int(inf_value) + int(variables["weekly_infections"])
variables["healthy"] -= int(inf_value) + int(variables["weekly_infections"])
with open("UniData.txt", 'w') as f2:
json.dump(variables, f2, indent=3)


def enforce_value_maximums(): #Makes sure that maximum/minumum values are never violated
Expand Down Expand Up @@ -842,30 +845,12 @@ def player_menu():
if variables["color"] != 0:
UI.Color_lux()
UI.Color_player_menu_UI()
answer = input(str(Green_Blackxx + "Command: "))
print(Reset, end='')
else:
UI.lux()
UI.player_menu_UI()
#WordCore.word_corey("@@@@", " Week: " + str(week), "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> WORLD | ", "View world data", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> VIRUS | ", "View nano-virus data", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> LAB | ", "Work on your virus in the lab", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> TURN | ", "Move onto the next week", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> FAST | ", "Enter fast turn mode", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> SAVE | ", "Save your progress", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> LOAD | ", "Load a previous save", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#WordCore.word_corey("@@@@ >>> EXIT | ", "Quit the game without saving", "@@@@\n")
#WordCore.word_corey("@@@@", "", "@@@@\n")
#print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
#print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
answer = input(str("Command: "))
answer = input(str("Command: "))
if answer == "WORLD":
Clear.clear()
if variables["color"] != 0:
Expand Down Expand Up @@ -916,13 +901,17 @@ def turn():
Clear.clear()
with open("UniData.txt", 'r') as f:
variables = json.load(f)
#variables["week"] += 1
#f.close()
variables["week"] += 1
with open("UniData.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
#f2.close()
WordCore.word_core("A new week has come...", 0.01)
print("\n")
print("Week Number: " + str(variables["week"]))
Generation.dna_weekly()
Generation.dna_random()
infecting_agent()
check_cure_start()
BURST_check()
Expand All @@ -931,7 +920,7 @@ def turn():
enforce_value_maximums()
print("\n")
Graph.graphical_analysis_mini()
time.sleep(3)
#time.sleep(3)
player_menu()


Expand All @@ -946,6 +935,7 @@ def turn_fast():
print("\n")
print("Week Number: " + str(variables["week"]))
Generation.dna_weekly()
Generation.dna_random()
infecting_agent()
check_cure_start()
BURST_check()
Expand Down Expand Up @@ -985,30 +975,20 @@ def Save_Check():

def start_turn():
Clear.clear()
UI.mail()
WordCore.word_corez("@@@@ [email protected] TO [email protected] @@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
Loading.loading("@@@@ ", "Decrypting Message", "...."," Done! @@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
WordCore.word_corey("@@@@ >>>", "Hello, Doctor, I see the project is going smoothly...","@@@@\n")
WordCore.word_corey("@@@@ >>>", "5/19/XX", "@@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
Loading.loading("@@@@ ", "Decrypting Message", "...."," Done! @@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
WordCore.word_corey("@@@@ >>>", "The Nano-Virus you've been working on finally managed to infect someone", "@@@@\n")
WordCore.word_corey("@@@@ >>>", "Make sure to keep control, we wouldn't want you to die prematurely on us, now would we?", "@@@@\n")
WordCore.word_corey("@@@@ >>>", "9/04/XX", "@@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
Loading.loading("@@@@ ", "Decrypting Message", "...."," Done! @@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
WordCore.word_corey("@@@@ >>>", "I assure you that you, your family, and whomever else you so wish will be kept safe, so","@@@@\n")
WordCore.word_corey("@@@@ >>>", "Worry not. Now, without further ado, let us begin the transition to a new age!","@@@@\n")
WordCore.word_corey("@@@@ >>>", "9/012/XX", "@@@@\n")
WordCore.word_corez("@@@@ @@@@\n")
WordCore.word_corez("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n")
WordCore.word_corez("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n")
input(str("press ENTER to exit Magus..."))
with open("UniData.txt", 'r') as f:
variables = json.load(f)
if variables["color"] != 0:
UI.Color_Mail()
UI.intro_sq_c_nano()
input(str(Green_Blackxx + "press ENTER to exit Magus..."))
print(Reset, end='')
#time.sleep(3)
#answer = input(str(Green_Blackxx + "Command: "))
else:
UI.mail()
UI.intro_sq()
input(str("press ENTER to exit Magus..."))
#answer = input(str("Command: "))
player_menu()


Expand Down
49 changes: 15 additions & 34 deletions Main.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import time, os, platform, sys, Clear, Level1, WordCore
import time, os, platform, sys, Clear, Level1, WordCore, UI
from json_system import *
from ColorSplash import *
from Settings import *

def intro(): #The intro to the game
print(Reset, end='')
Clear.clear()
WordCore.word_core("@@; #@@ @@@@@@@@@@@@@@@@ .@@@@@@@@@@@@@@ @@@@@@@@@@@@@@+ '@@@@@@@@@@@@`\n", 0.0001)
WordCore.word_core("@@@@ #@@ @@@@@@@@@@@@@@@@ ,@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@`\n", 0.0001)
WordCore.word_core("@@@@@ #@@ @@@::::::::::::: @@@@:::::::::::: @@@:::::::::+@@@ @@@+::::::::@@@@\n", 0.0001)
WordCore.word_core("@@@@@@ #@@ @@@ @@@ @@@ `@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@.@@@@. #@@ @@@@@@@@@@@@@@ @@@ @@@ `@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@. ;@@@+ #@@ @@@@@@@@@@@@@@ @@@ @@@ ;@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@. `@@@@ #@@ @@@@@@@@@@@@@@ @@@ @@@@@@@@@@@@@@@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@. @@@@ #@@ @@@ @@@ @@@@@@@@@@@@@@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@. @@@@`#@@ @@@ @@@ @@@ @@@@ @@. @@@\n", 0.0001)
WordCore.word_core("@@. ;@@@@@@ @@@ @@@ @@@ '@@@+ @@. @@@\n", 0.0001)
WordCore.word_core("@@. `@@@@@ @@@::::::::::::: @@@@:::::::::::: @@@ `@@@@ @@@+::::::::@@@@\n", 0.0001)
WordCore.word_core("@@. @@@@ @@@@@@@@@@@@@@@@ ,@@@@@@@@@@@@@@@ @@@ @@@@: @@@@@@@@@@@@@@@`\n", 0.0001)
WordCore.word_core("@@. @@@ @@@@@@@@@@@@@@@@ .@@@@@@@@@@@@@@ @@@ +@@@@ +@@@@@@@@@@@@.\n", 0.0001)
with open("Globals.txt", 'r') as file:
variables = json.load(file)
if variables["color"] != 0:
UI.necro_color()
print(Green_Blackxx, end='')
else:
UI.necro()
print("\n")
WordCore.word_corex("DEVELOPER |", "78 Alpha\n")
print("\n")
time.sleep(0.5)
WordCore.word_corex("START |", "Start the game")
WordCore.word_corex("CONTINUE |", "Start the game from previous save")
print("\n")
time.sleep(0.5)
WordCore.word_corex("NEW |", "Create a new game")
Expand All @@ -32,35 +30,18 @@ def intro(): #The intro to the game
print("\n")
time.sleep(0.5)
action = input(str("What would you like to do: "))
if action == "START":
if action == "CONTINUE":
Level1.Save_Check()
elif action == "NEW":
load_3()
Level1.Save_Check()
elif action == "SETTINGS":
settings()
intro()
elif action == "EXIT":
Clear.clear()
exit()
else:
intro()

def settings():
with open("Globals.txt", 'r') as f:
variables = json.load(f)
print("This feature is in [alpha], and may cause [Program Termination]")
color_ = str(input("Enable color (Current value [" + str(variables["color"]) + "]): "))
if color_ == "YES":
variables["color"] = 1
with open("Globals.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
intro()
elif color_ == "NO":
variables["color"] = 0
with open("Globals.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
intro()
else:
settings()

intro()
18 changes: 18 additions & 0 deletions Settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import json_system, json
#from Main import *
def settings():
with open("Globals.txt", 'r') as f:
variables = json.load(f)
print("This feature is in [alpha], and may cause [Program Termination]")
color_ = str(input("Enable color (Current value [" + str(variables["color"]) + "]): "))
if color_ == "YES":
variables["color"] = 1
with open("Globals.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
#intro()
elif color_ == "NO":
variables["color"] = 0
with open("Globals.txt", 'w') as f2:
json.dump(variables, f2, indent=3)
else:
settings()
Loading

0 comments on commit 609f25f

Please sign in to comment.