From 23b773d5c254e2dc3d859a8cc28a5e600c4207f7 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 14 Feb 2018 11:51:47 +0100 Subject: Label some daycare-related functions --- engine/events/daycare.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/events') diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index 3d36bbfd7..ed1b2ef2b 100755 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -44,7 +44,7 @@ Special_DayCareMan: ; 166d6 call GetPriceToRetrieveBreedmon call DayCare_AskWithdrawBreedMon jr c, .print_text - farcall RetrievePokemonFromDayCareMan + farcall RetrieveMonFromDayCareMan call DayCare_GetBackMonForMoney ld hl, wDayCareMan res 0, [hl] @@ -83,7 +83,7 @@ Special_DayCareLady: ; 1672a call GetPriceToRetrieveBreedmon call DayCare_AskWithdrawBreedMon jr c, .print_text - farcall RetrievePokemonFromDayCareLady + farcall RetrieveMonFromDayCareLady call DayCare_GetBackMonForMoney ld hl, wDayCareLady res 0, [hl] -- cgit v1.2.3 From e8bc86d1fedfc6be5a99d426ffc236c4fcf494f4 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 22 Feb 2018 17:13:29 +0100 Subject: Pkmn -> Mon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we're aiming for consistency across the codebase, I believe it includes a uniform way to refer to the creatures this game consists of in the labels of the code. The only exceptions to this rule are labels referring to things named through the use of the or characters, in which case PKMN is used. Most of this was already consistent enoughâ„¢, I just picked the convention with the most occurences and fixed the outliers. --- engine/events/battle_tower/battle_tower.asm | 36 +++++----- engine/events/battle_tower/load_trainer.asm | 100 ++++++++++++++-------------- engine/events/battle_tower/rules.asm | 18 ++--- engine/events/daycare.asm | 2 +- engine/events/poisonstep.asm | 2 +- 5 files changed, 79 insertions(+), 79 deletions(-) (limited to 'engine/events') diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 4b4494925..5c430d39b 100755 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -95,7 +95,7 @@ Function170139: ; 170139 ld [wMisc], a ld a, l ld [wMisc + 1], a - ld hl, wBT_OTTempPkmn1DVs + ld hl, wBT_OTTempMon1DVs ld a, [wPlayerID] ld [hli], a ld a, [wPlayerID + 1] @@ -112,7 +112,7 @@ Function170139: ; 170139 ld bc, wPlayerID ld de, wPlayerGender farcall GetMobileOTTrainerClass - ld de, wBT_OTTempPkmn1CaughtGender + ld de, wBT_OTTempMon1CaughtGender ld a, c ld [de], a inc de @@ -279,59 +279,59 @@ RunBattleTowerTrainer: ; 17024d ReadBTTrainerParty: ; 1702b7 -; Initialise the BattleTower-Trainer and his Pkmn +; Initialise the BattleTower-Trainer and his mon call CopyBTTrainer_FromBT_OT_TowBT_OTTemp ; Check the nicknames for illegal characters, and replace bad nicknames ; with their species names. - ld de, wBT_OTTempPkmn1Name ; $c643 + ld de, wBT_OTTempMon1Name ; $c643 ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_1 - ld a, [wBT_OTTempPkmn1] + ld a, [wBT_OTTempMon1] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempPkmn1Name ; $c643 + ld de, wBT_OTTempMon1Name ; $c643 ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_1 - ld de, wBT_OTTempPkmn2Name ; $c67e + ld de, wBT_OTTempMon2Name ; $c67e ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_2 - ld a, [wBT_OTTempPkmn2] ; [$c64e] + ld a, [wBT_OTTempMon2] ; [$c64e] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempPkmn2Name ; $c67e + ld de, wBT_OTTempMon2Name ; $c67e ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_2 - ld de, wBT_OTTempPkmn3Name ; $c686 + 51 = $c6b9 + ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9 ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_3 - ld a, [wBT_OTTempPkmn3] ; [$c689] + ld a, [wBT_OTTempMon3] ; [$c689] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempPkmn3Name ; $c686 + 51 = $c6b9 + ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9 ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_3 ; Add the terminator character to each of these names ld a, "@" - ld [wBT_OTTempPkmn1NameEnd - 1], a ; $c64d - ld [wBT_OTTempPkmn2NameEnd - 1], a ; $c688 - ld [wBT_OTTempPkmn3NameEnd - 1], a ; $c68a + 57 = $c6c3 + ld [wBT_OTTempMon1NameEnd - 1], a ; $c64d + ld [wBT_OTTempMon2NameEnd - 1], a ; $c688 + ld [wBT_OTTempMon3NameEnd - 1], a ; $c68a + 57 = $c6c3 ; Fix errors in the movesets call CheckBTMonMovesForErrors ; Repair the trainer name if needed, then copy it to wOTPlayerName @@ -360,7 +360,7 @@ ReadBTTrainerParty: ; 1702b7 ld a, HIGH(wOTPartyMonNicknames) ld [wBGMapBuffer + 1], a - ; Copy Pkmn into Memory from the address in hl + ; Copy mon into Memory from the address in hl ld de, wOTPartyMon1Species ld bc, wOTPartyCount ld a, BATTLETOWER_PARTY_LENGTH @@ -398,7 +398,7 @@ ReadBTTrainerParty: ; 1702b7 ValidateBTParty: ; 170394 ; Check for and fix errors in party data - ld hl, wBT_OTTempPkmn1Species + ld hl, wBT_OTTempMon1Species ld d, BATTLETOWER_PARTY_LENGTH .pkmn_loop push de @@ -484,7 +484,7 @@ endr ld hl, MON_STAT_EXP - 1 add hl, bc ld b, $1 - predef CalcPkmnStats + predef CalcMonStats pop de pop hl dec de diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm index bfb5cf885..f3db16293 100644 --- a/engine/events/battle_tower/load_trainer.asm +++ b/engine/events/battle_tower/load_trainer.asm @@ -12,9 +12,9 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000 ; Write $ff into the Item-Slots ld a, $ff - ld [wBT_OTPkmn1Item], a - ld [wBT_OTPkmn2Item], a - ld [wBT_OTPkmn3Item], a + ld [wBT_OTMon1Item], a + ld [wBT_OTMon2Item], a + ld [wBT_OTMon3Item], a ; Set wBT_OTTrainer as start address to write the following data to ld de, wBT_OTTrainer @@ -32,8 +32,8 @@ if DEF(_CRYSTAL11) else ; Crystal 1.0 used the wrong constant here, so only the first 21 ; trainers in BattleTowerTrainers can be sampled. - maskbits BATTLETOWER_NUM_UNIQUE_PKMN - cp BATTLETOWER_NUM_UNIQUE_PKMN + maskbits BATTLETOWER_NUM_UNIQUE_MON + cp BATTLETOWER_NUM_UNIQUE_MON endc jr nc, .resample ld b, a @@ -68,7 +68,7 @@ endc ld bc, NAME_LENGTH call CopyBytes - call Function_LoadRandomBattleTowerPkmn + call Function_LoadRandomBattleTowerMon pop af ld hl, BattleTowerTrainerData @@ -92,15 +92,15 @@ endc ret -Function_LoadRandomBattleTowerPkmn: ; 1f8081 +Function_LoadRandomBattleTowerMon: ; 1f8081 ld c, BATTLETOWER_PARTY_LENGTH .loop push bc - ld a, BANK(sBTPkmnPrevTrainer1) + ld a, BANK(sBTMonPrevTrainer1) call GetSRAMBank -.FindARandomBattleTowerPkmn: - ; From Which LevelGroup are the Pkmn loaded +.FindARandomBattleTowerMon: + ; From Which LevelGroup are the mon loaded ; a = 1..10 ld a, [wBTChoiceOfLvlGroup] dec a @@ -115,12 +115,12 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081 ld a, [hRandomAdd] add b ld b, a - maskbits BATTLETOWER_NUM_UNIQUE_PKMN - cp BATTLETOWER_NUM_UNIQUE_PKMN + maskbits BATTLETOWER_NUM_UNIQUE_MON + cp BATTLETOWER_NUM_UNIQUE_MON jr nc, .resample - ; in register 'a' is the chosen Pkmn of the LevelGroup + ; in register 'a' is the chosen mon of the LevelGroup - ; Check if Pkmn was already loaded before + ; Check if mon was already loaded before ; Check current and the 2 previous teams ; includes check if item is double at the current team ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH @@ -129,42 +129,42 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081 ld b, a ld a, [hld] ld c, a - ld a, [wBT_OTPkmn1] + ld a, [wBT_OTMon1] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [wBT_OTPkmn1Item] + jr z, .FindARandomBattleTowerMon + ld a, [wBT_OTMon1Item] cp c - jr z, .FindARandomBattleTowerPkmn - ld a, [wBT_OTPkmn2] + jr z, .FindARandomBattleTowerMon + ld a, [wBT_OTMon2] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [wBT_OTPkmn2Item] + jr z, .FindARandomBattleTowerMon + ld a, [wBT_OTMon2Item] cp c - jr z, .FindARandomBattleTowerPkmn - ld a, [wBT_OTPkmn3] + jr z, .FindARandomBattleTowerMon + ld a, [wBT_OTMon3] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [wBT_OTPkmn3Item] + jr z, .FindARandomBattleTowerMon + ld a, [wBT_OTMon3Item] cp c - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevTrainer1] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevTrainer1] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevTrainer2] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevTrainer2] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevTrainer3] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevTrainer3] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevPrevTrainer1] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevPrevTrainer1] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevPrevTrainer2] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevPrevTrainer2] cp b - jr z, .FindARandomBattleTowerPkmn - ld a, [sBTPkmnPrevPrevTrainer3] + jr z, .FindARandomBattleTowerMon + ld a, [sBTMonPrevPrevTrainer3] cp b - jr z, .FindARandomBattleTowerPkmn + jr z, .FindARandomBattleTowerMon ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH call CopyBytes @@ -193,18 +193,18 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081 dec c jp nz, .loop - ld a, [sBTPkmnPrevTrainer1] - ld [sBTPkmnPrevPrevTrainer1], a - ld a, [sBTPkmnPrevTrainer2] - ld [sBTPkmnPrevPrevTrainer2], a - ld a, [sBTPkmnPrevTrainer3] - ld [sBTPkmnPrevPrevTrainer3], a - ld a, [wBT_OTPkmn1] - ld [sBTPkmnPrevTrainer1], a - ld a, [wBT_OTPkmn2] - ld [sBTPkmnPrevTrainer2], a - ld a, [wBT_OTPkmn3] - ld [sBTPkmnPrevTrainer3], a + ld a, [sBTMonPrevTrainer1] + ld [sBTMonPrevPrevTrainer1], a + ld a, [sBTMonPrevTrainer2] + ld [sBTMonPrevPrevTrainer2], a + ld a, [sBTMonPrevTrainer3] + ld [sBTMonPrevPrevTrainer3], a + ld a, [wBT_OTMon1] + ld [sBTMonPrevTrainer1], a + ld a, [wBT_OTMon2] + ld [sBTMonPrevTrainer2], a + ld a, [wBT_OTMon3] + ld [sBTMonPrevTrainer3], a call CloseSRAM ret ; 1f814e diff --git a/engine/events/battle_tower/rules.asm b/engine/events/battle_tower/rules.asm index fc9fa948a..3b0c9f930 100644 --- a/engine/events/battle_tower/rules.asm +++ b/engine/events/battle_tower/rules.asm @@ -56,9 +56,9 @@ CheckForBattleTowerRules: ; 8b201 .TextPointers: ; 8b222 dw JumpText_ExcuseMeYoureNotReady - dw JumpText_OnlyThreePkmnMayBeEntered - dw JumpText_ThePkmnMustAllBeDifferentKinds - dw JumpText_ThePkmnMustNotHoldTheSameItems + dw JumpText_OnlyThreeMonMayBeEntered + dw JumpText_TheMonMustAllBeDifferentKinds + dw JumpText_TheMonMustNotHoldTheSameItems dw JumpText_YouCantTakeAnEgg ; 8b22c @@ -92,21 +92,21 @@ JumpText_EggDoesNotQualify: ; 0x8b242 db "@" ; 0x8b247 -JumpText_OnlyThreePkmnMayBeEntered: ; 0x8b247 +JumpText_OnlyThreeMonMayBeEntered: ; 0x8b247 ; Only three #MON may be entered. - text_jump Text_OnlyThreePkmnMayBeEntered + text_jump Text_OnlyThreeMonMayBeEntered db "@" ; 0x8b24c -JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c +JumpText_TheMonMustAllBeDifferentKinds: ; 0x8b24c ; The @ #MON must all be different kinds. - text_jump Text_ThePkmnMustAllBeDifferentKinds + text_jump Text_TheMonMustAllBeDifferentKinds db "@" ; 0x8b251 -JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251 +JumpText_TheMonMustNotHoldTheSameItems: ; 0x8b251 ; The @ #MON must not hold the same items. - text_jump Text_ThePkmnMustNotHoldTheSameItems + text_jump Text_TheMonMustNotHoldTheSameItems db "@" ; 0x8b256 diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index ed1b2ef2b..8dfdc8c47 100755 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -567,7 +567,7 @@ DayCare_GiveEgg: ; 169ac pop hl push bc ld b, $0 - predef CalcPkmnStats + predef CalcMonStats pop bc ld hl, MON_HP add hl, bc diff --git a/engine/events/poisonstep.asm b/engine/events/poisonstep.asm index 47916076f..5ea094db9 100755 --- a/engine/events/poisonstep.asm +++ b/engine/events/poisonstep.asm @@ -145,7 +145,7 @@ DoPoisonStep:: ; 505da ld a, [wPartyCount] cp [hl] jr nz, .party_loop - predef CheckPlayerPartyForFitPkmn + predef CheckPlayerPartyForFitMon ld a, d ld [wScriptVar], a ret -- cgit v1.2.3 From a22343d32c9f81b9cd2a4f2ff49725cfbed6671d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 22 Feb 2018 18:12:43 +0100 Subject: Fix TRUE/FALSE constants for CalcMonStats --- engine/events/battle_tower/battle_tower.asm | 2 +- engine/events/daycare.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/events') diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 5c430d39b..ec2f5a13c 100755 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -483,7 +483,7 @@ endr push de ld hl, MON_STAT_EXP - 1 add hl, bc - ld b, $1 + ld b, TRUE predef CalcMonStats pop de pop hl diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index 8dfdc8c47..1a00cc71f 100755 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -566,7 +566,7 @@ DayCare_GiveEgg: ; 169ac ld e, l pop hl push bc - ld b, $0 + ld b, FALSE predef CalcMonStats pop bc ld hl, MON_HP -- cgit v1.2.3 From 3d34f5a5a371ad2b9979ae36763cdfb52c581dab Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 22 Feb 2018 21:35:11 +0100 Subject: Label wPokemonWithdrawDepositParameter of RemoveMonFromPartyOrBox It takes a clearly different parameter, completely unrelated and different in function to PC_DEPOSIT and PC_WITHDRAW. --- engine/events/special.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/events') diff --git a/engine/events/special.asm b/engine/events/special.asm index 081606512..e23aaae8c 100755 --- a/engine/events/special.asm +++ b/engine/events/special.asm @@ -118,7 +118,7 @@ Special_ReturnShuckle: ; 737e cp 150 ld a, SHUCKIE_HAPPY jr nc, .HappyToStayWithYou - xor a ; take from pc + xor a ; REMOVE_PARTY ld [wPokemonWithdrawDepositParameter], a callfar RemoveMonFromPartyOrBox ld a, SHUCKIE_RETURNED -- cgit v1.2.3