Skip to content

Commit

Permalink
Cleaned up log files
Browse files Browse the repository at this point in the history
Also reorganized Amazing Mirror template
  • Loading branch information
Mode8fx committed Jan 6, 2021
1 parent 0577ad6 commit 07fb7ab
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 16 deletions.
62 changes: 48 additions & 14 deletions Template (Amazing Mirror).py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,40 @@ def value(name):
print("This attribute does not exist: "+name)
return None

"""
Ability Values:
00 - Nothing
01 - Fire
02 - Ice
03 - Burning
04 - Wheel
05 - Parasol
06 - Cutter
07 - Beam
08 - Stone
09 - Bomb
0A - Throw
0B - Sleep
0C - Cook
0D - Laser
0E - UFO
0F - Spark
10 - Tornado
11 - Hammer
12 - Sword
13 - Cupid
14 - Fighter
15 - Magic
16 - Smash
17 - Mini
18 - Crash
19 - Missile
1A - Master
The remaining values are either some sort of bug/crash, mix (like when you inhale two abilities at one), or duplicate.
"""

########################
# EDIT BELOW THIS LINE #
########################
Expand Down Expand Up @@ -99,20 +133,6 @@ def value(name):
]

Optional_Rulesets = [
Ruleset(
name="All Enemies Give An Ability",
description="All enemies are guaranteed to give an ability.",
rules=[
Rule(
description="All Enemies Give An Ability",
left_side=[value("Waddle Dee"), value("Droppy"), value("Leap"), value("Big Waddle Dee"), value("Flamer"), value("Sword Knight"), value("Cupie")],
rule_type="count",
right_side=("==", 0, "==", 0),
),
],
must_be_enabled=None,
must_be_disabled=None,
),
Ruleset(
name="All Unique",
description="All enemies give different abilities.",
Expand Down Expand Up @@ -147,6 +167,20 @@ def value(name):
must_be_enabled=None,
must_be_disabled=["All Unique", "At Least 1 UFO", "Smashing!"],
),
Ruleset(
name="All Enemies Give An Ability",
description="All enemies are guaranteed to give an ability.",
rules=[
Rule(
description="All Enemies Give An Ability",
left_side=[value("Waddle Dee"), value("Droppy"), value("Leap"), value("Big Waddle Dee"), value("Flamer"), value("Sword Knight"), value("Cupie")],
rule_type="count",
right_side=("==", 0, "==", 0),
),
],
must_be_enabled=None,
must_be_disabled=None,
),
Ruleset(
name="At Least 1 UFO",
description="At least one enemy gives the UFO ability (ability #14).",
Expand Down
16 changes: 14 additions & 2 deletions srm.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,14 @@ def generateTextLog():
newLog = path.join(outputFolder, start+"-"+seedString+".txt")
file = open(newLog, "w")
file.writelines(Program_Name+"\nSeed: "+seedString+"\n\nValues:\n")
maxNameLen = max([len(att.name) for att in Attributes])
maxIntLen = max([len(str(att.value)) for att in Attributes])
maxHexLen = max([len(str(hex(att.value))) for att in Attributes])-2
for att in Attributes:
file.writelines(att.name+": "+str(att.value)+"\n")
nameStr = att.name.ljust(maxNameLen)
intStr = str(att.value).rjust(maxIntLen)
hexStr = "[0x"+str(hex(att.value))[2:].rjust(maxHexLen, "0").upper()+"]"
file.writelines(nameStr+": "+intStr+" "+hexStr+"\n")
file.close()

def shuffleAllAttributes():
Expand All @@ -348,8 +354,14 @@ def resetAttributesAndSeed(printAttributes=False):

Attributes.sort(key=getAttributeNum)
if printAttributes:
maxNameLen = max([len(att.name) for att in Attributes])
maxIntLen = max([len(str(att.value)) for att in Attributes])
maxHexLen = max([len(str(hex(att.value))) for att in Attributes])-2
for att in Attributes:
print(att.name+": "+str(att.value))
nameStr = att.name.ljust(maxNameLen)
intStr = str(att.value).rjust(maxIntLen)
hexStr = "[0x"+str(hex(att.value))[2:].rjust(maxHexLen, "0").upper()+"]"
print(nameStr+": "+intStr+" "+hexStr)
Attributes = copy.copy(originalAttributes)
random.seed(time())
resetRuleCounter()
Expand Down

0 comments on commit 07fb7ab

Please sign in to comment.