|
|
@@ -1,3 +1,5 @@ |
|
|
|
import random |
|
|
|
|
|
|
|
class MetroidState: |
|
|
|
def __init__(self): |
|
|
|
self.itemsCollected = { |
|
|
@@ -263,12 +265,62 @@ class MetroidState: |
|
|
|
kb = "Bosses Killed: {}".format(self.killedBosses()) |
|
|
|
rs = "Statues Raised: {}".format(self.raisedStatues()) |
|
|
|
sw = "Swimsuit?: {}".format(self.inBailey()) |
|
|
|
sl = "Start Location: {}".format(self.locations[self.startLocation]) |
|
|
|
dr = "" |
|
|
|
return "\n".join([ic, mt, et, zb, kb, rs, sw, dr]) |
|
|
|
return "\n".join([ic, mt, et, zb, kb, rs, sw, sl, dr]) |
|
|
|
|
|
|
|
def randomize(self): |
|
|
|
# Items |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("Maru Mari") |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("Bombs") |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("Varia") |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("High Jump Boots") |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("Screw Attack") |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleItem("Long Beam") |
|
|
|
beam = random.randint(0,2) |
|
|
|
if beam == 1: |
|
|
|
self.toggleItem("Ice Beam") |
|
|
|
elif beam == 2: |
|
|
|
self.toggleItem("Wave Beam") |
|
|
|
# Missile Tanks |
|
|
|
for i in range(21): |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleMissileTank(i+1) |
|
|
|
# Energy Tanks |
|
|
|
for i in range(8): |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleEnergyTank(i+1) |
|
|
|
# Zebetites |
|
|
|
for i in range(5): |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleZebetite(i+1) |
|
|
|
# Bosses killed |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleKraid() |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleRidley() |
|
|
|
if random.randint(0,1) == 1: |
|
|
|
self.toggleMotherBrain() |
|
|
|
# Statues raised |
|
|
|
if not self.kraidKilled and random.randint(0,1) == 1: |
|
|
|
self.toggleKraidStatue() |
|
|
|
if not self.ridleyKilled and random.randint(0,1) == 1: |
|
|
|
self.toggleRidleyStatue() |
|
|
|
# Swimsuit |
|
|
|
if random.randint(0,2) == 2: |
|
|
|
self.toggleSwimsuit() |
|
|
|
# Start Location |
|
|
|
self.startLocation = random.randint(0,4) |
|
|
|
|
|
|
|
def main(): |
|
|
|
gs = MetroidState() |
|
|
|
gs.kraidKilled = True |
|
|
|
gs.randomize() |
|
|
|
print(gs.toString()) |
|
|
|
|
|
|
|
if __name__ == "__main__": |