Skip to content

Commit

Permalink
MP6: Castaway and Clockwork Castle Support for Stars
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowTabitha committed Jan 23, 2024
1 parent faceabc commit 3507be4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
24 changes: 5 additions & 19 deletions codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,34 +163,20 @@ def getRedSpaceCodeSix(amount):
0415F278 3880{amount}
'''

def getStarSpaceCodeSix(amount):
def getStarSpaceCodeSix(amount, negAmount):
return f'''
MP6 - Stars Cost SIXSTAR Coins
0418333C 2C03{amount}
0418342C 2C03{amount}
041834C4 2C03{amount}
044F0E28 2C03{amount}
0415F668 2C03{amount}
0415FA18 2C03{negAmount}
C2183590 00000002
3880{amount} 7C8400D0
60000000 00000000
'''

def getStarSpaceCodeSixFS(one, two, three, four, five):
return f'''
MP6 - Stars Can cost SIXSTARFS1, SIXSTARFS2, SIXSTARFS3, SIXSTARFS4, SIXSTARFS5 Coins during Faire Square Nighttime
04248064 0000{one}
04248068 0000{two}
0424806C 0000{three}
04248070 0000{four}
04248074 0000{five}
204DDF88 01020405
044DDF74 0000{one}
044DDF78 0000{two}
044DDF7C 0000{three}
044DDF80 0000{five}
044DDF84 0000{five}
E2000001 80008000
'''

def getBlueSpaceCodeSeven(amount):
return f'''
MP7 - Blue Spaces Give SEVENBLUE Coins
Expand All @@ -205,7 +191,7 @@ def getRedSpaceCodeSeven(amount):
04168604 3880{amount}
'''

def getStarSpaceCodeSeven(amount,):
def getStarSpaceCodeSeven(amount):
return f'''
MP7 - Stars Cost SEVENSTAR Coins
04188774 3B80{amount}
Expand Down
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ def actionSpaceButtonFour(self):
pyperclip.copy(generatedCode)
print("Generated codes copied to the clipboard.")
createDialog("Operation Sucesssful", "success", "Generated codes copied to clipboard!", None)

def actionSpaceButtonFive(self):
if not self.blueSpaceAmountFive.get() and not self.redSpaceAmountFive.get() and not self.starSpaceAmountFive.get() and not self.wigglerSpaceAmountFive.get():
createDialog("Error", "error", "No information provided.", None)
Expand Down Expand Up @@ -815,6 +816,7 @@ def actionSpaceButtonFive(self):
pyperclip.copy(generatedCode)
print("Generated codes copied to the clipboard.")
createDialog("Operation Sucesssful", "success", "Generated codes copied to clipboard!", None)

def actionSpaceButtonSix(self):
if not self.blueSpaceAmountSix.get() and not self.redSpaceAmountSix.get() and not self.starSpaceAmountSix.get():
createDialog("Error", "error", "No information provided.", None)
Expand Down Expand Up @@ -847,12 +849,15 @@ def actionSpaceButtonSix(self):
starSpaceAmountSix = "00" + starSpaceAmountSix[2:]
elif len(starSpaceAmountSix) == 3:
starSpaceAmountSix = "000" + starSpaceAmountSix[2:]

negativeRedSpaceAmountBaseSix = -int(starSpaceAmountSixBase)
starSpaceAmountNegativeSix = format(negativeRedSpaceAmountBaseSix & 0xFFFFFFFFFFFFFFFF, 'X')[12:]
except:
starSpaceAmountSix = "DUMMY"

marioPartySixBlueSpace = getBlueSpaceCodeSix(blueSpaceAmountSix)
marioPartySixRedSpace = getRedSpaceCodeSix(redSpaceAmountSix)
marioPartySixStarSpace = getStarSpaceCodeSix(starSpaceAmountSix)
marioPartySixStarSpace = getStarSpaceCodeSix(starSpaceAmountSix, starSpaceAmountNegativeSix)

if redSpaceAmountSix == "DUMMY":
marioPartySixRedSpace = ""
Expand Down Expand Up @@ -939,6 +944,7 @@ def actionSpaceButtonSeven(self):
pyperclip.copy(generatedCode)
print("Generated codes copied to the clipboard.")
createDialog("Operation Sucesssful", "success", "Generated codes copied to clipboard!", None)

def actionSpaceButtonEight(self):
if not self.blueSpaceAmountEight.get() and not self.redSpaceAmountEight.get() and not self.starSpaceAmountEight.get():
createDialog("Error", "error", "No information provided.", None)
Expand Down

0 comments on commit 3507be4

Please sign in to comment.