Skip to content

Commit

Permalink
MP2 item replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowTabitha committed Aug 19, 2024
1 parent b4f29e5 commit e346103
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 25 deletions.
13 changes: 13 additions & 0 deletions codes/marioParty2.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,17 @@ def getKoopaBankCodeTwo(amount, negAmount, koopaPrice):
81108AFE {amount}
D10FA63E 0049
81108B0A {amount}
'''

def getItemReplaceTwo(itemHex1, itemHex2, spaceName, spaceName2):
return f'''
MP2 - Replace {spaceName} with {spaceName2}
D00FD2D9 00{itemHex1}
800FD2D9 00{itemHex2}
D00FD30D 00{itemHex1}
800FD30D 00{itemHex2}
D00FD341 00{itemHex1}
800FD341 00{itemHex2}
D00FD375 00{itemHex1}
800FD375 00{itemHex2}
'''
38 changes: 38 additions & 0 deletions events/marioParty2_itemReplace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ============================================
# Mario Party Toolkit
# Author: Nayla Hanegan ([email protected])
# Date: 5/7/2024
# License: MIT
# ============================================

from codes.marioParty2 import *
from functions import *

import pyperclip

def itemReplace_mp2(spaceRep411, spaceRep412, spaces4):
spaceSlot1 = spaceRep411.get()
spaceSlot2 = spaceRep412.get()

spaceHex = ["FF", "00", "01", "02", "03", "04", "05", "06", "07", "09"]

spaceSlot1Num = spaces4.index(spaceSlot1)
spaceSlot1Hex = spaceHex[spaceSlot1Num]

spaceSlot2Num = spaces4.index(spaceSlot2)
spaceSlot2Hex = spaceHex[spaceSlot2Num]

mpSpace41 = getItemReplaceTwo(spaceSlot1Hex, spaceSlot2Hex, spaceSlot1, spaceSlot2)

if spaceSlot1Hex == "NONE":
mpSpace41 = ""
if spaceSlot2Hex == "NONE":
mpSpace41 = ""

generatedCode = mpSpace41

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

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

Expand All @@ -22,7 +23,8 @@ def create_mario_party_2_interface(frame):
tabview.grid(padx=10, pady=10)
tabview.add("Coins Mods")
tabview.add("Minigame Replacement")
tabview.add("Item Mods")
tabview.add("Item Prices")
tabview.add("Item Replacement")
tabview.add("Star Handicaps")
tabview.set("Coins Mods")

Expand Down Expand Up @@ -75,55 +77,73 @@ def create_entry(tab, row, icon_path, label_text, color, placeholder):
parse_minigame_button = ctk.CTkButton(master=tabview.tab("Minigame Replacement"), command=lambda: mgReplaceEvent_mp2(combobox_mingames_1, combobox_mingames_2, minigames_list), text="Generate Codes")
parse_minigame_button.place(x=10, y=800)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/mushroom.png", 1, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
# List of minigame names
items2 = ["None", "Mushroom", "Skeleton Key", "Plunder Chest", "Bowser BOMB", "Dueling Glove", "Warp Block", "Golden Mushroom", "Boo Bell", "Bowser Suit", "Magic Lamp"]

label = ctk.CTkLabel(master=tabview.tab("Item Replacement"), text=" Replace ", font=("Arial", 16))
label.grid(row=0, column=0)

itemSwap411 = ctk.CTkComboBox(master=tabview.tab("Item Replacement"), values=items2)
itemSwap411.grid(row=0, column=1)

label = ctk.CTkLabel(master=tabview.tab("Item Replacement"), text=" with ", font=("Arial", 16))
label.grid(row=0, column=2)

itemSwap412 = ctk.CTkComboBox(master=tabview.tab("Item Replacement"), values=items2)
itemSwap412.grid(row=0, column=3)

parseButton = ctk.CTkButton(master=tabview.tab("Item Replacement"), command=lambda: itemReplace_mp2(itemSwap411, itemSwap412, items2), text="Generate Codes")
parseButton.place(x=10, y=800)

icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/mushroom.png", 1, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=1, column=2)
mushroom2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="10")
mushroom2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="10")
mushroom2.grid(row=1, column=3)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/skeletonKey.png", 2, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/skeletonKey.png", 2, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=2, column=2)
skeletonKey2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="10")
skeletonKey2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="10")
skeletonKey2.grid(row=2, column=3)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/plunderChest.png", 3, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/plunderChest.png", 3, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=3, column=2)
plunderChest2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
plunderChest2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
plunderChest2.grid(row=3, column=3)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/duelingGlove.png", 4, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/duelingGlove.png", 4, 1)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=4, column=2)
duelingGlove2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
duelingGlove2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
duelingGlove2.grid(row=4, column=3)

label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" ", font=("Arial", 16))
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" ", font=("Arial", 16))
label.grid(row=4, column=5)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/warpBlock.png", 1, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/warpBlock.png", 1, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=1, column=7)
warpBlock2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
warpBlock2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="15")
warpBlock2.grid(row=1, column=8)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/goldenMushroom.png", 2, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/goldenMushroom.png", 2, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=2, column=7)
goldenMushroom2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="20")
goldenMushroom2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="20")
goldenMushroom2.grid(row=2, column=8)

icon = create_image_icon(tabview.tab("Item Mods"), "assets/items/magicLamp.png", 3, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Mods"), text=" Costs ", font=("Arial", 16))
icon = create_image_icon(tabview.tab("Item Prices"), "assets/items/magicLamp.png", 3, 6)
label = ctk.CTkLabel(master=tabview.tab("Item Prices"), text=" Costs ", font=("Arial", 16))
label.grid(row=3, column=7)
magicLamp2 = ctk.CTkEntry(master=tabview.tab("Item Mods"), width=48, font=("Arial", 16, "bold"), placeholder_text="30")
magicLamp2 = ctk.CTkEntry(master=tabview.tab("Item Prices"), width=48, font=("Arial", 16, "bold"), placeholder_text="30")
magicLamp2.grid(row=3, column=8)

parseButtonTwo = ctk.CTkButton(master=tabview.tab("Item Mods"), command=lambda: itemsEvent_mp2(mushroom2, skeletonKey2, plunderChest2, duelingGlove2, warpBlock2, goldenMushroom2, magicLamp2), text="Generate Codes")
parseButtonTwo = ctk.CTkButton(master=tabview.tab("Item Prices"), command=lambda: itemsEvent_mp2(mushroom2, skeletonKey2, plunderChest2, duelingGlove2, warpBlock2, goldenMushroom2, magicLamp2), text="Generate Codes")
parseButtonTwo.place(x=10, y=800)

warningLabel = ctk.CTkLabel(master=tabview.tab("Item Mods"), text="These are not weights! 0 doesnt mean disabled.", font=("Arial", 16, "bold"))
warningLabel = ctk.CTkLabel(master=tabview.tab("Item Prices"), text="These are not weights! 0 doesnt mean disabled.", font=("Arial", 16, "bold"))
warningLabel.place(x=5, y=210)

icon = create_image_icon(tabview.tab("Star Handicaps"), "assets/eventTags/starSpace.png", 0, 0)
Expand Down

0 comments on commit e346103

Please sign in to comment.