Skip to content

Commit

Permalink
MP2 bonus stars
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowTabitha committed Sep 16, 2024
1 parent 0018f61 commit dd20fcd
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
39 changes: 39 additions & 0 deletions codes/marioParty2.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,43 @@ def getItemReplaceTwo(itemHex1, itemHex2, spaceName, spaceName2):
800FD341 00{itemHex2}
D00FD375 00{itemHex1}
800FD375 00{itemHex2}
'''

def getStarReplaceTwo1(amount, amountDec):
return f'''
MP5 - Replace Minigame Star with {amountDec}
D10FA63E 0052
80103F04 0080
D10FA63E 0052
80103F07 00{amount}
D10FA63E 0052
80103F50 0080
D10FA63E 0052
80103F53 00{amount}
'''

def getStarReplaceTwo2(amount, amountDec):
return f'''
MP5 - Replace Coin Star with {amountDec}
D10FA63E 0052
80104314 0080
D10FA63E 0052
80104317 00{amount}
D10FA63E 0052
80104360 0080
D10FA63E 0052
80104363 00{amount}
'''

def getStarReplaceTwo3(amount, amountDec):
return f'''
MP5 - Replace Happening Star with {amountDec}
D10FA63E 0052
80104724 0080
D10FA63E 0052
80104727 00{amount}
D10FA63E 0052
80104770 0080
D10FA63E 0052
80104773 00{amount}
'''
46 changes: 46 additions & 0 deletions events/marioParty2_bonusStarReplace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ============================================
# Mario Party Toolkit
# Author: Nayla Hanegan ([email protected])
# Date: 7/12/2024
# License: MIT
# ============================================

from codes.marioParty2 import *
from functions import *

import pyperclip

def customBonusStarEvent_mp2(star1, star2, star3, stars2):
starSlot1 = star1.get()
starSlot2 = star2.get()
starSlot3 = star3.get()

starHex = ["NONE", "E8", "EA", "EC", "ED", "EE", "EF", "F0", "F1", "F2", "F3"]

starSlot1Num = stars2.index(starSlot1)
starSlot1Hex = starHex[starSlot1Num]

starSlot2Num = stars2.index(starSlot2)
starSlot2Hex = starHex[starSlot2Num]

starSlot3Num = stars2.index(starSlot3)
starSlot3Hex = starHex[starSlot3Num]

mpStar21 = getStarReplaceTwo1(starSlot1Hex, starSlot1)
mpStar22 = getStarReplaceTwo2(starSlot2Hex, starSlot2)
mpStar23 = getStarReplaceTwo3(starSlot3Hex, starSlot3)

if starSlot1Hex == "NONE":
mpStar21 = ""
if starSlot2Hex == "NONE":
mpStar22 = ""
if starSlot3Hex == "NONE":
mpStar23 = ""

generatedCode = mpStar21 + mpStar22 + mpStar23

generatedCode = generatedCode.strip()
pyperclip.copy(generatedCode)

print("Generated codes copied to the clipboard.")
createDialog("Operation Sucessful", "success", "Generated codes copied to clipboard!.", None)
25 changes: 25 additions & 0 deletions frames/marioParty2_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from events.marioParty2_itemReplace import *
from events.marioParty2_handicap import *
from events.marioParty2_mgreplace import *
from events.marioParty2_bonusStarReplace import *

# Import custom tkinter module as ctk
import customtkinter as ctk
Expand All @@ -26,6 +27,7 @@ def create_mario_party_2_interface(frame):
tabview.add("Item Prices")
tabview.add("Item Replacement")
tabview.add("Star Handicaps")
tabview.add("Bonus Star Replacement")
tabview.set("Coins Mods")

# Function to create an entry field and checkbox
Expand Down Expand Up @@ -180,4 +182,27 @@ def create_entry(tab, row, icon_path, label_text, color, placeholder):

parse_stars_button = ctk.CTkButton(master=tabview.tab("Star Handicaps"), command=lambda: handicapEvent_mp2(p1Stars, p2Stars, p3Stars, p4Stars), text="Generate Codes")
parse_stars_button.place(x=10, y=800)

stars2 = ["None", "Minigame Star", "Coin Star", "Happening Star", "Red Star", "Blue Star", "Chance Time Star", "Bowser Space Star", "Battle Space Star", "Item Space Star", "Bank Space Star"]

label = ctk.CTkLabel(master=tabview.tab("Bonus Star Replacement"), text=" Replace Minigame Star with: ", font=("Arial", 16))
label.grid(row=0, column=0, sticky="w")

star1 = ctk.CTkComboBox(master=tabview.tab("Bonus Star Replacement"), values=stars2)
star1.grid(row=0, column=1, pady=10)

label = ctk.CTkLabel(master=tabview.tab("Bonus Star Replacement"), text=" Replace Coin Star with: ", font=("Arial", 16))
label.grid(row=1, column=0, sticky="w")

star2 = ctk.CTkComboBox(master=tabview.tab("Bonus Star Replacement"), values=stars2)
star2.grid(row=1, column=1, pady=10)

label = ctk.CTkLabel(master=tabview.tab("Bonus Star Replacement"), text=" Replace Happening Star with: ", font=("Arial", 16))
label.grid(row=2, column=0, sticky="w")

star3 = ctk.CTkComboBox(master=tabview.tab("Bonus Star Replacement"), values=stars2)
star3.grid(row=2, column=1, pady=10)

parseButton = ctk.CTkButton(master=tabview.tab("Bonus Star Replacement"), command=lambda: customBonusStarEvent_mp2(star1, star2, star3, stars2), text="Generate Codes")
parseButton.place(x=10, y=800)
return frame

0 comments on commit dd20fcd

Please sign in to comment.