diff options
| author | Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> | 2025-09-10 06:31:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 00:31:11 -0400 |
| commit | d237b01cfb241f417567c964e0df0658cf921570 (patch) | |
| tree | 799e92e48259443aa6cf4c553ed7adf38bd442d4 /engine/pikachu | |
| parent | Merge branch 'master' of https://github.com/pret/pokered (diff) | |
| download | pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.gz pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.tar.xz pokeyellow-d237b01cfb241f417567c964e0df0658cf921570.zip | |
Misc. naming and cleanup (#139)
* Name some printer/diploma routines
* Name `wd434`
* Name `NAME_LENGTH_JP`
* Rename `callabd`/`calladb` to `farcall`/`callfar`
Diffstat (limited to 'engine/pikachu')
| -rw-r--r-- | engine/pikachu/pikachu_emotions.asm | 8 | ||||
| -rw-r--r-- | engine/pikachu/pikachu_follow.asm | 4 | ||||
| -rw-r--r-- | engine/pikachu/pikachu_pic_animation.asm | 2 | ||||
| -rw-r--r-- | engine/pikachu/pikachu_status.asm | 44 | ||||
| -rw-r--r-- | engine/pikachu/respawn_overworld_pikachu.asm | 2 |
5 files changed, 31 insertions, 29 deletions
diff --git a/engine/pikachu/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm index a29fd781..3fc08363 100644 --- a/engine/pikachu/pikachu_emotions.asm +++ b/engine/pikachu/pikachu_emotions.asm @@ -3,7 +3,7 @@ IsPlayerTalkingToPikachu:: and a ret z ldh a, [hSpriteIndex] - cp $f + cp PIKACHU_SPRITE_INDEX ret nz call InitializePikachuTextID xor a @@ -111,7 +111,7 @@ StarterPikachuEmotionCommand_emote: ShowPikachuEmoteBubble: ld [wWhichEmotionBubble], a - ld a, $f ; Pikachu + ld a, PIKACHU_SPRITE_INDEX ld [wEmotionBubbleSpriteIndex], a predef EmotionBubble ret @@ -333,7 +333,7 @@ MapSpecificPikachuExpression: call IsPlayerPikachuAsleepInParty ldpikaemotion a, PikachuEmotion11 jr c, .play_emotion - callfar CheckPikachuFaintedOrStatused ; same bank + callfar CheckPikachuStatusCondition ; same bank ldpikaemotion a, PikachuEmotion28 jr c, .play_emotion ld a, [wCurMap] @@ -383,7 +383,7 @@ IsPlayerPikachuAsleepInParty: jr z, .done cp STARTER_PIKACHU jr nz, .curMonNotStarterPikachu - callfar IsThisPartymonStarterPikachu + callfar IsThisPartyMonStarterPikachu jr nc, .curMonNotStarterPikachu ld a, [wWhichPokemon] ld hl, wPartyMon1Status diff --git a/engine/pikachu/pikachu_follow.asm b/engine/pikachu/pikachu_follow.asm index 14331682..11093c29 100644 --- a/engine/pikachu/pikachu_follow.asm +++ b/engine/pikachu/pikachu_follow.asm @@ -6,7 +6,7 @@ ShouldPikachuSpawn:: ld a, [wPikachuOverworldStateFlags] bit 7, a jr nz, .hide - call IsStarterPikachuInOurParty + call IsStarterPikachuAliveInOurParty jr nc, .hide ld a, [wWalkBikeSurfState] and a @@ -1375,7 +1375,7 @@ Func_fcc92: ld a, $ff .asm_fcca8 ld d, [hl] - ldd [hl], a + ld [hld], a ld a, d dec e jr nz, .asm_fcca8 diff --git a/engine/pikachu/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm index a7fd80f3..40f88dc5 100644 --- a/engine/pikachu/pikachu_pic_animation.asm +++ b/engine/pikachu/pikachu_pic_animation.asm @@ -665,7 +665,7 @@ DecompressRequestPikaPicAnimGFX: jr c, .failed ld a, b call UncompressSpriteFromDE - ld a, BANK(sSpriteBuffer1) + ld a, BANK("Sprite Buffers") call OpenSRAM ld hl, sSpriteBuffer1 ld de, sSpriteBuffer0 diff --git a/engine/pikachu/pikachu_status.asm b/engine/pikachu/pikachu_status.asm index 5fc92ead..ffd2b718 100644 --- a/engine/pikachu/pikachu_status.asm +++ b/engine/pikachu/pikachu_status.asm @@ -1,4 +1,4 @@ -IsStarterPikachuInOurParty:: +IsStarterPikachuAliveInOurParty:: ld hl, wPartySpecies ld de, wPartyMon1OTID ld bc, wPartyMonOT @@ -20,10 +20,11 @@ IsStarterPikachuInOurParty:: ld a, [wPlayerID+1] cp [hl] jr nz, .curMonNotPlayerPikachu + push de push bc ld hl, wPlayerName - ld d, $6 ; possible player length - 1 + ld d, NAME_LENGTH_JP .nameCompareLoop dec d jr z, .sameOT @@ -34,6 +35,7 @@ IsStarterPikachuInOurParty:: jr z, .nameCompareLoop pop bc pop de + .curMonNotPlayerPikachu ld hl, wPartyMon2 - wPartyMon1 add hl, de @@ -50,11 +52,11 @@ IsStarterPikachuInOurParty:: pop de ld h, d ld l, e - ld bc, -NAME_LENGTH + ld bc, wPartyMon1HP - wPartyMon1OTID add hl, bc ld a, [hli] or [hl] - jr z, .noPlayerPikachu ; XXX how is this determined? + jr z, .noPlayerPikachu ; fainted Starter Pikachu pop hl scf ret @@ -64,18 +66,17 @@ IsStarterPikachuInOurParty:: and a ret -IsThisPartymonStarterPikachu_Box:: +IsThisBoxMonStarterPikachu:: ld hl, wBoxMon1 ld bc, wBoxMon2 - wBoxMon1 ld de, wBoxMonOT - jr asm_fce21 + jr IsThisMonStarterPikachu -IsThisPartymonStarterPikachu_Party:: -IsThisPartymonStarterPikachu:: +IsThisPartyMonStarterPikachu:: ld hl, wPartyMon1 ld bc, wPartyMon2 - wPartyMon1 ld de, wPartyMonOT -asm_fce21: +IsThisMonStarterPikachu: ld a, [wWhichPokemon] call AddNTimes ld a, [hl] @@ -96,7 +97,7 @@ asm_fce21: ld bc, NAME_LENGTH call AddNTimes ld de, wPlayerName - ld b, $6 + ld b, NAME_LENGTH_JP .loop dec b jr z, .isPlayerPikachu @@ -117,7 +118,7 @@ UpdatePikachuMoodAfterBattle:: ; because d is always $82 at this function, it serves to ; ensure Pikachu's mood is at least 130 after battle push de - call IsStarterPikachuInOurParty + call IsStarterPikachuAliveInOurParty pop de ret nc ld a, d @@ -136,8 +137,9 @@ UpdatePikachuMoodAfterBattle:: ld [wPikachuMood], a ret -CheckPikachuFaintedOrStatused:: -; function to test if Pikachu is alive? +CheckPikachuStatusCondition:: +; set carry flag if Starter Pikachu has a status condition +; also return d = 0 if fainted, but no function uses it xor a ld [wWhichPokemon], a ld hl, wPartyCount @@ -145,9 +147,9 @@ CheckPikachuFaintedOrStatused:: inc hl ld a, [hl] cp $ff - jr z, .dead_or_not_in_party + jr z, .noAilment push hl - call IsThisPartymonStarterPikachu_Party + call IsThisPartyMonStarterPikachu pop hl jr nc, .next ld a, [wWhichPokemon] @@ -161,8 +163,8 @@ CheckPikachuFaintedOrStatused:: inc hl ld a, [hl] ; status and a - jr nz, .alive - jr .dead_or_not_in_party + jr nz, .hasAilment + jr .noAilment .next ld a, [wWhichPokemon] @@ -170,15 +172,15 @@ CheckPikachuFaintedOrStatused:: ld [wWhichPokemon], a jr .loop -.alive +.hasAilment scf ret -.dead_or_not_in_party +.noAilment and a ret -IsSurfingPikachuInThePlayersParty:: +IsSurfingStarterPikachuInParty:: ld hl, wPartySpecies ld de, wPartyMon1Moves ld bc, wPartyMonOT @@ -223,7 +225,7 @@ IsSurfingPikachuInThePlayersParty:: push de push bc ld hl, wPlayerName - ld d, $6 + ld d, NAME_LENGTH_JP .nameCompareLoop dec d jr z, .foundSurfingPlayerPikachu diff --git a/engine/pikachu/respawn_overworld_pikachu.asm b/engine/pikachu/respawn_overworld_pikachu.asm index 4b610085..e412df5d 100644 --- a/engine/pikachu/respawn_overworld_pikachu.asm +++ b/engine/pikachu/respawn_overworld_pikachu.asm @@ -1,5 +1,5 @@ RespawnOverworldPikachu: - callfar IsThisPartymonStarterPikachu_Party + callfar IsThisPartyMonStarterPikachu ret nc ld a, $3 ld [wPikachuSpawnState], a |
