Skip to content

Commit

Permalink
Ported and modded Deokishisu's Wonder Trade
Browse files Browse the repository at this point in the history
I also added a script to do Wonder Trades, because why not.
Special thanks to Zeturic and Ghoulslash, as their Dynamic Trade Names feature is used here.
And to Hungry Pickle for providing the IsMegaPreEvolution function.
  • Loading branch information
LOuroboros committed May 14, 2021
1 parent f62b42e commit 8d47338
Show file tree
Hide file tree
Showing 6 changed files with 1,848 additions and 3 deletions.
23 changes: 23 additions & 0 deletions data/event_scripts.s
Expand Up @@ -1005,6 +1005,29 @@ Common_EventScript_LegendaryFlewAway:: @ 8273776
release
end

EventScript_DoWonderTrade::
special ChoosePartyMon
waitstate
compare VAR_0x8004, PARTY_SIZE
goto_if_ge EventScript_End
copyvar VAR_0x8005, VAR_0x8004
special CreateWonderTradePokemon
special DoInGameTradeScene
waitstate
msgbox EventScript_DoWonderTrade_Text_WannaDoAnotherWonderTrade, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq EventScript_DoWonderTrade
msgbox EventScript_DoWonderTrade_Text_Done, MSGBOX_DEFAULT
closemessage
EventScript_End:
end

EventScript_DoWonderTrade_Text_WannaDoAnotherWonderTrade:
.string "Do you want to do\nanother Wonder Trade?$"

EventScript_DoWonderTrade_Text_Done:
.string "Enjoy your new Pokémon.$"

.include "data/scripts/pc_transfer.inc"
.include "data/scripts/mevent.inc"
.include "data/scripts/abnormal_weather.inc"
Expand Down
1 change: 1 addition & 0 deletions data/specials.inc
Expand Up @@ -535,3 +535,4 @@ gSpecials:: @ 81DBA64
def_special RemoveRecordsWindow
def_special CloseDeptStoreElevatorWindow
def_special TrySetBattleTowerLinkType
def_special CreateWonderTradePokemon
2 changes: 2 additions & 0 deletions ld_script.txt
Expand Up @@ -333,6 +333,7 @@ SECTIONS {
src/gym_leader_rematch.o(.text);
src/battle_transition_frontier.o(.text);
src/international_string_util.o(.text);
src/wonder_trade.o(.text);
} =0

script_data :
Expand Down Expand Up @@ -689,6 +690,7 @@ SECTIONS {
data/fonts.o(.rodata);
src/mystery_event_msg.o(.rodata);
data/mystery_event.o(.rodata);
src/wonder_trade.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);
} =0
Expand Down

0 comments on commit 8d47338

Please sign in to comment.