pokeemerald-expansion/data/scripts/debug.inc
LOuroboros 916e4814bd
Implemented Custom/Complex/Expanded GiveMon scripting command (#3924)
* Introducing an expanded givemon

* Added debug features to check a Pokémon's EV and IV

* Added a parameter to set a custom mon's gender

* Added a debug feature to clear the party

* Defined the EV/IV getters in gSpecials

* Added Gigantamax Factor toggle to givecustommon

* Updated Gigantamax Factor label in givecustommon macro

* Added tera type parameter to givecustommon

Misc. changes:
-Added a few harmless comments to CreateCustomMon for consistency reasons.

* Cleaned up the code inside CreateCustomMon a bit

Also updated the values assigned to the parameters of ScriptGiveCustomMon
This is temporary though. I'll probably end up turning them into 2byte parameters so they can be filled when the scripting command is called by using variables once I solve the bigger problem that the scripting command is currently facing.

* Foolproofed the Poké Ball check in CreateCustomMon

* Assigned a default gender to givecustommon
This solved the nasty issue by which the command wasn't working properly if you didn't fill in each parameter when calling givecustommon in a script.

* Reinforced the gender checks at CreateCustomMon

* Re-reinforced the gender checks at CreateCustomMon

* Compressed givecustommon and added tests

-Made givecustommon skip unspecified parameters.
-Added scripting variables support for every parameter.
-Added tests.

* Updated the default values of some ScriptGiveCustomMon parameters

* Replaced vanilla's givemon with givecustommon

Misc. Changes:
-Renamed CreateCustomMon to ScriptGiveMonParameterized.
 -The truth is that the function was never limited to creating the skeleton of a Pokémon like the actual CreateMon functions do, so that label was never correct. The function was always an expanded ScriptGiveMon.
-Moved the core functions to src/script_pokemon_util.c which is where they actually belong.
-Updated ScriptGiveMonParameterized a little to incorporateb changes that were applied to the original ScriptGiveMon, namely, Synchronize ability and form change handling.
-Introduced a new ScriptGiveMon to replace the original one.

* Corrected givecustommon tests

* Fixed the default IV values for the new givemon

* Updated DebugAction_Party_ClearParty for consistency with the other debug functions

* Updated the text strings used by the Check EV/IV debug features

---------

Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-08 09:11:13 +01:00

292 lines
7.8 KiB
PHP

.if DEBUG_OVERWORLD_MENU == TRUE
Debug_MessageEnd:
waitmessage
waitbuttonpress
releaseall
end
Debug_ShowFieldMessageStringVar4::
special ShowFieldMessageStringVar4
goto Debug_MessageEnd
Debug_CheatStart::
setflag FLAG_SYS_POKEMON_GET
setflag FLAG_RESCUED_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE
setflag FLAG_ADVENTURE_STARTED
clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH
setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG
setvar VAR_BIRCH_LAB_STATE, 2
setvar VAR_ROUTE101_STATE, 3
givemon SPECIES_TREECKO, 20, ITEM_NONE
givemon SPECIES_TORCHIC, 20, ITEM_NONE
givemon SPECIES_MUDKIP, 20, ITEM_NONE
setflag FLAG_SYS_POKEDEX_GET
special SetUnlockedPokedexFlags
setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH
setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 2
setflag FLAG_SYS_NATIONAL_DEX
special EnableNationalPokedex
setflag FLAG_RECEIVED_RUNNING_SHOES
setflag FLAG_SYS_B_DASH
setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes
setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival
setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender)
setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex
setflag FLAG_RECEIVED_BIKE
additem ITEM_ACRO_BIKE
setvar VAR_BRINEY_HOUSE_STATE, 1
setvar VAR_ROUTE116_STATE, 2
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
setflag FLAG_BADGE01_GET
setflag FLAG_BADGE02_GET
setflag FLAG_BADGE03_GET
setflag FLAG_BADGE04_GET
setflag FLAG_BADGE05_GET
setflag FLAG_BADGE06_GET
setflag FLAG_BADGE07_GET
setflag FLAG_BADGE08_GET
setflag FLAG_VISITED_LITTLEROOT_TOWN
setflag FLAG_VISITED_OLDALE_TOWN
setflag FLAG_VISITED_DEWFORD_TOWN
setflag FLAG_VISITED_LAVARIDGE_TOWN
setflag FLAG_VISITED_FALLARBOR_TOWN
setflag FLAG_VISITED_VERDANTURF_TOWN
setflag FLAG_VISITED_PACIFIDLOG_TOWN
setflag FLAG_VISITED_PETALBURG_CITY
setflag FLAG_VISITED_SLATEPORT_CITY
setflag FLAG_VISITED_MAUVILLE_CITY
setflag FLAG_VISITED_RUSTBORO_CITY
setflag FLAG_VISITED_FORTREE_CITY
setflag FLAG_VISITED_LILYCOVE_CITY
setflag FLAG_VISITED_MOSSDEEP_CITY
setflag FLAG_VISITED_SOOTOPOLIS_CITY
setflag FLAG_VISITED_EVER_GRANDE_CITY
setflag FLAG_LANDMARK_POKEMON_LEAGUE
setflag FLAG_LANDMARK_BATTLE_FRONTIER
clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
release
end
Debug_FlagsNotSetOverworldConfigMessage::
message Debug_FlagsNotSetOverworldConfigMessage_Text
goto Debug_MessageEnd
Debug_FlagsNotSetOverworldConfigMessage_Text:
.string "Feature unavailable!\n"
.string "Please define a usable flag in:\l"
.string "'include/config/overworld.h'!$"
Debug_FlagsNotSetBattleConfigMessage::
message Debug_FlagsNotSetBattleConfigMessage_Text
goto Debug_MessageEnd
Debug_FlagsNotSetBattleConfigMessage_Text:
.string "Feature unavailable!\n"
.string "Please define a usable flag in:\l"
.string "'include/config/battle.h'!$"
Debug_BoxFilledMessage::
message Debug_BoxFilledMessage_Text
goto Debug_MessageEnd
Debug_BoxFilledMessage_Text:
.string "Storage boxes filled!$"
Debug_EventScript_CheckEV::
lockall
getpartysize
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
special ChoosePartyMon
waitstate
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckEV_End
callnative Script_GetChosenMonOffensiveEV
msgbox Debug_EventScript_Text_OffensiveEV, MSGBOX_DEFAULT
callnative Script_GetChosenMonDefensiveEV
msgbox Debug_EventScript_Text_DefensiveEV, MSGBOX_DEFAULT
Debug_EventScript_CheckEV_End::
releaseall
end
Debug_EventScript_Text_OffensiveEV:
.string "ATK EV: {STR_VAR_1}, SPATK EV: {STR_VAR_2}, SPEED EV: {STR_VAR_3}$"
Debug_EventScript_Text_DefensiveEV:
.string "HP EV: {STR_VAR_1}, DEF EV: {STR_VAR_2}, SPDEF EV: {STR_VAR_3}$"
Debug_EventScript_CheckIV::
lockall
getpartysize
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
special ChoosePartyMon
waitstate
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_EventScript_CheckIV_End
callnative Script_GetChosenMonOffensiveIV
msgbox Debug_EventScript_Text_OffensiveIV, MSGBOX_DEFAULT
callnative Script_GetChosenMonDefensiveIV
msgbox Debug_EventScript_Text_DefensiveIV, MSGBOX_DEFAULT
Debug_EventScript_CheckIV_End::
releaseall
end
Debug_EventScript_Text_OffensiveIV:
.string "ATK IV: {STR_VAR_1}, SPATK IV: {STR_VAR_2}, SPEED IV: {STR_VAR_3}$"
Debug_EventScript_Text_DefensiveIV:
.string "HP IV: {STR_VAR_1}, DEF IV: {STR_VAR_2}, SPDEF IV: {STR_VAR_3}$"
Debug_EventScript_Script_1::
end
Debug_EventScript_Script_2::
end
Debug_EventScript_Script_3::
end
Debug_EventScript_Script_4::
end
Debug_EventScript_Script_5::
end
Debug_EventScript_Script_6::
end
Debug_EventScript_Script_7::
end
Debug_EventScript_Script_8::
end
Debug_CheckSaveBlock::
callnative CheckSaveBlock1Size
msgbox Debug_SaveBlock1Size, MSGBOX_DEFAULT
callnative CheckSaveBlock2Size
msgbox Debug_SaveBlock2Size, MSGBOX_DEFAULT
callnative CheckPokemonStorageSize
msgbox Debug_PokemonStorageSize, MSGBOX_DEFAULT
release
end
Debug_SaveBlock1Size::
.string "SaveBlock1 size: {STR_VAR_1}b/{STR_VAR_2}b.\n"
.string "Free space: {STR_VAR_3}b.$"
Debug_SaveBlock2Size::
.string "SaveBlock2 size: {STR_VAR_1}b/{STR_VAR_2}b.\n"
.string "Free space: {STR_VAR_3}b.$"
Debug_PokemonStorageSize::
.string "{PKMN}Storage size: {STR_VAR_1}b/{STR_VAR_2}b.\n"
.string "Free space: {STR_VAR_3}b.$"
Debug_CheckROMSpace::
callnative CheckROMSize
msgbox Debug_ROMSize, MSGBOX_DEFAULT
release
end
Debug_ROMSize::
.string "ROM size: {STR_VAR_1}MB/32MB.\n"
.string "Free space: {STR_VAR_2}MB.$"
Debug_HatchAnEgg::
lockall
getpartysize
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
special ChoosePartyMon
waitstate
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_HatchAnEgg_End
specialvar VAR_RESULT, ScriptGetPartyMonSpecies
goto_if_ne VAR_RESULT, SPECIES_EGG, DebugScript_HatchAnEgg_CantForceHatch
special EggHatch
waitstate
Debug_HatchAnEgg_End::
releaseall
end
Debug_HatchAnEgg_NoPokemon::
msgbox DebugScript_HatchAnEgg_Text_EmptyParty, MSGBOX_DEFAULT
releaseall
end
DebugScript_HatchAnEgg_CantForceHatch::
msgbox DebugScript_HatchAnEgg_Text_NotAnEgg, MSGBOX_DEFAULT
releaseall
end
DebugScript_HatchAnEgg_Text_EmptyParty::
.string "You have no Pokémon nor Eggs.$"
DebugScript_HatchAnEgg_Text_NotAnEgg::
.string "That's not a Pokémon Egg.$"
DebugScript_ZeroDaycareMons::
msgbox DebugText_DaycareNoPokemon, MSGBOX_DEFAULT
releaseall
end
DebugScript_OneDaycareMons::
msgbox DebugText_DaycareOnePokemon, MSGBOX_DEFAULT
releaseall
end
DebugScript_DaycareMonsNotCompatible::
msgbox DebugText_DaycarePokemonNotCompatible, MSGBOX_DEFAULT
releaseall
end
DebugText_DaycareNoPokemon:
.string "You have no Pokémon at Daycare.$"
DebugText_DaycareOnePokemon:
.string "You have only one Pokémon at Daycare.$"
DebugText_DaycarePokemonNotCompatible:
.string "Your Pokémon at Daycare can't\nhave babies together!$"
Debug_ShowExpansionVersion::
callnative BufferExpansionVersion
msgbox Debug_ExpansionVersion, MSGBOX_DEFAULT
release
end
Debug_ExpansionVersion:
.string "pokeemerald-expansion {STR_VAR_1}$"
Debug_BerryPestsDisabled::
msgbox DebugText_BerryPestsDisabled, MSGBOX_DEFAULT
release
end
DebugText_BerryPestsDisabled:
.string "OW_BERRY_PESTS is disabled.\n"
.string "Unable to force pests onto berry trees.$"
Debug_BerryWeedsDisabled::
msgbox DebugText_BerryWeedsDisabled, MSGBOX_DEFAULT
release
end
DebugText_BerryWeedsDisabled:
.string "OW_BERRY_WEEDS is disabled.\n"
.string "Unable to force weeds onto berry trees.$"
.endif
Debug_FlagsAndVarNotSetBattleConfigMessage::
lockall
message Debug_FlagsAndVarNotSetBattleConfigMessage_Text
waitmessage
waitbuttonpress
releaseall
end
Debug_FlagsAndVarNotSetBattleConfigMessage_Text:
.string "Feature unavailable! Please define a\n"
.string "usable flag and a usable var in:\l"
.string "'include/config/battle.h'!$"