Skip to content

Instantly share code, notes, and snippets.

@XChrisUnknownX
Created December 18, 2018 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XChrisUnknownX/fcde9134eb9f5a0afa8572cf59530f14 to your computer and use it in GitHub Desktop.
Save XChrisUnknownX/fcde9134eb9f5a0afa8572cf59530f14 to your computer and use it in GitHub Desktop.
A Gears of War 4 Metagame for Python. Sets a random population at start or allows you input your own populations, then chooses random losses on each side per battle, with the winner more likely to take less losses. Has different classes of severity for each battle, impacting how many millions of humans or monsters die in any given battle. Also r…
import random
import time
humanpop = random.randint(1000000000,50000000000)
monsterpop = random.randint(1000000000,50000000000)
continue3 = input("If continuing game, type yes, no spaces or punctuation, lower case. ")
if continue3 == "yes":
continue1 = input("If continuing game, input humanpop. ")
continue2 = input("If continuing game, input monsterpop. ")
try:
humanpop = int(continue1)
monsterpop = int(continue2)
except:
print("Error. Population values may error.")
print("Current human population: ",end="")
print(humanpop)
print("Current monster population: ",end="")
print(monsterpop)
else:
pass
while True:
map = random.choice(["Avalanche","Blood Drive","Canals","Checkout","Clocktower","Dam","Dawn","Diner","Drydock","Fallout","Forge","Forge Blitz","Foundation","Fuel Depot","Glory","Gridlock","Harbor","Harbor Haze","Hotel","Impact","Impact Dark","Lift","Lift Apex","Mercy","Old Town","Raven Down","Reclaimed","Reclaimed Windflare","Relic","Rustlung","Security","Speyer","The Slab","War Machine"])
estimateh = humanpop/1000000000
estimatem = monsterpop/1000000000
print("Human population: ",end="")
print(humanpop)
print(estimateh,end="")
print(" billion humans.")
print()
print("Monster population: ",end="")
print(monsterpop)
print(estimatem,end="")
print(" billion monsters.")
print()
save = input("To save populations, type SAVE: ")
if save == "SAVE":
newfile = open("GearsPopulations.txt","w")
humanpops = str(humanpop)
monsterpops = str(monsterpop)
newfile.write(humanpops)
newfile.write(" humans.")
newfile.write("""
""")
newfile.write(monsterpops)
newfile.write(" monsters.")
newfile.close()
else:
pass
side = input("Input side, human or monster: ")
print()
print("Battle taking place at: ",end="")
print(map,end="")
print(".")
print()
severity = random.choice(["CATASTROPHIC","HIGH","HIGH","HIGH","LOW","LOW","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM","MEDIUM"])
print("This battle's devastation level will be: ",end="")
print(severity,end="")
print(".")
print()
if severity == "CATASTROPHIC":
multiplier = 10
elif severity == "HIGH":
multiplier = 2
elif severity == "MEDIUM":
multiplier = 1
elif severity == "LOW":
multiplier = .5
else:
pass
result = input("Input result, win or lose: ")
print()
if side == "human" and result == "win":
death = random.randint(1000000,500000000)
deaths = death * multiplier
monsterpop -= deaths
print("There have been ",end="")
print(deaths,end="")
print(" monster deaths.")
print()
estm = deaths / 1000000
print("There have been ",end="")
print(estm,end="")
print(" million monster deaths.")
print()
print()
casualties = random.randint(250000,125000000)
actual = casualties * multiplier
print("There have been ",end="")
print(actual,end="")
print(" human deaths.")
print()
esth = actual / 1000000
print("There have been ",end="")
print(esth,end="")
print(" million human deaths.")
print()
print()
humanpop -= actual
elif side == "human" and result == "lose":
death = random.randint(1000000,500000000)
deaths = death * multiplier
humanpop -= deaths
print("There have been ",end="")
print(deaths,end="")
print(" human deaths.")
print()
#check out esth language above.
esth = deaths / 1000000
print("There have been ",end="")
print(esth,end="")
print(" million human deaths.")
print()
print()
casualties = random.randint(250000,125000000)
actual = casualties * multiplier
print("There have been ",end="")
print(actual,end="")
print(" monster deaths.")
print()
estm = actual / 1000000
print("There have been ",end="")
print(estm,end="")
print(" million monster deaths.")
print()
print()
monsterpop -= actual
elif side == "monster" and result == "win":
death = random.randint(1000000,500000000)
deaths = death * multiplier
humanpop -= deaths
print("There have been ",end="")
print(deaths,end="")
print(" human deaths.")
# esth language here.
print()
esth = deaths / 1000000
print("There have been ",end="")
print(esth,end="")
print(" million human deaths.")
print()
print()
casualties = random.randint(250000,125000000)
actual = casualties * multiplier
print("There have been ",end="")
print(actual,end="")
print(" monster deaths.")
print()
estm = actual / 1000000
print("There have been ",end="")
print(estm,end="")
print(" million monster deaths.")
print()
print()
monsterpop -= actual
elif side == "monster" and result == "lose":
death = random.randint(1000000,500000000)
deaths = death * multiplier
monsterpop -= deaths
print("There have been ",end="")
print(deaths,end="")
print(" monster deaths.")
print()
estm = deaths / 1000000
print("There have been ",end="")
print(estm,end="")
print(" million monster deaths.")
print()
print()
casualties = random.randint(250000,125000000)
actual = casualties * multiplier
print("There have been ",end="")
print(actual,end="")
print(" human deaths.")
print()
esth = actual / 1000000
print("There have been ",end="")
print(esth,end="")
print(" million human deaths.")
print()
print()
humanpop -= actual
else:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment