diff options
| author | mid-kid <esteve.varela@gmail.com> | 2018-04-04 22:26:07 +0200 |
|---|---|---|
| committer | mid-kid <esteve.varela@gmail.com> | 2018-04-04 22:26:07 +0200 |
| commit | d3cc861d334c8b773c1b6c662ed9924c43cef009 (patch) | |
| tree | 0e8df3581a081f77167785502c093fbfc5535d73 /engine/events | |
| parent | 81fff9bb80af3db0ee381c824261b8963e1cc221 (diff) | |
Fix snake_case filenames
Renamed a bunch of files, most of them one-off functions, to better fit
the general snake_case naming scheme. Also renamed some awfully long filenames.
Diffstat (limited to 'engine/events')
| -rw-r--r-- | engine/events/fishing_gfx.asm (renamed from engine/events/loadfishinggfx.asm) | 0 | ||||
| -rw-r--r-- | engine/events/haircut.asm | 82 | ||||
| -rw-r--r-- | engine/events/play_slow_cry.asm (renamed from engine/events/playslowcry.asm) | 0 | ||||
| -rw-r--r-- | engine/events/shuckle.asm (renamed from engine/events/specials_2.asm) | 83 |
4 files changed, 82 insertions, 83 deletions
diff --git a/engine/events/loadfishinggfx.asm b/engine/events/fishing_gfx.asm index 3d3ab0ba0..3d3ab0ba0 100644 --- a/engine/events/loadfishinggfx.asm +++ b/engine/events/fishing_gfx.asm diff --git a/engine/events/haircut.asm b/engine/events/haircut.asm new file mode 100644 index 000000000..0e4400235 --- /dev/null +++ b/engine/events/haircut.asm @@ -0,0 +1,82 @@ +BillsGrandfather: ; 73f7 + farcall SelectMonFromParty + jr c, .cancel + ld a, [wCurPartySpecies] + ld [wScriptVar], a + ld [wNamedObjectIndexBuffer], a + call GetPokemonName + jp CopyPokemonName_Buffer1_Buffer3 + +.cancel + xor a + ld [wScriptVar], a + ret + +YoungerHaircutBrother: ; 7413 + ld hl, HappinessData_YoungerHaircutBrother + jr HaircutOrGrooming + +OlderHaircutBrother: ; 7418 + ld hl, HappinessData_OlderHaircutBrother + jr HaircutOrGrooming + +DaisysGrooming: ; 741d + ld hl, HappinessData_DaisysGrooming + ; fallthrough + +HaircutOrGrooming: ; 7420 + push hl + farcall SelectMonFromParty + pop hl + jr c, .nope + ld a, [wCurPartySpecies] + cp EGG + jr z, .egg + push hl + call GetCurNick + call CopyPokemonName_Buffer1_Buffer3 + pop hl + call Random +; Bug: Subtracting $ff from $ff fails to set c. +; This can result in overflow into the next data array. +; In the case of getting a grooming from Daisy, we bleed +; into CopyPokemonName_Buffer1_Buffer3, which passes +; $d0 to ChangeHappiness and returns $73 to the script. +; The end result is that there is a 0.4% chance your +; Pokemon's happiness will not change at all. +.loop + sub [hl] + jr c, .ok + inc hl + inc hl + inc hl + jr .loop + +.ok + inc hl + ld a, [hli] + ld [wScriptVar], a + ld c, [hl] + call ChangeHappiness + ret + +.nope + xor a + ld [wScriptVar], a + ret + +.egg + ld a, 1 + ld [wScriptVar], a + ret + +INCLUDE "data/events/happiness_probabilities.asm" + +CopyPokemonName_Buffer1_Buffer3: ; 746e + ld hl, wStringBuffer1 + ld de, wStringBuffer3 + ld bc, MON_NAME_LENGTH + jp CopyBytes + +DummyPredef1: ; 747a + ret diff --git a/engine/events/playslowcry.asm b/engine/events/play_slow_cry.asm index 1f27a7ca4..1f27a7ca4 100644 --- a/engine/events/playslowcry.asm +++ b/engine/events/play_slow_cry.asm diff --git a/engine/events/specials_2.asm b/engine/events/shuckle.asm index 9a83b982b..99fcd7924 100644 --- a/engine/events/specials_2.asm +++ b/engine/events/shuckle.asm @@ -140,86 +140,3 @@ ReturnShuckle: ; 737e ld a, SHUCKIE_FAINTED ld [wScriptVar], a ret - -BillsGrandfather: ; 73f7 - farcall SelectMonFromParty - jr c, .cancel - ld a, [wCurPartySpecies] - ld [wScriptVar], a - ld [wNamedObjectIndexBuffer], a - call GetPokemonName - jp CopyPokemonName_Buffer1_Buffer3 - -.cancel - xor a - ld [wScriptVar], a - ret - -YoungerHaircutBrother: ; 7413 - ld hl, HappinessData_YoungerHaircutBrother - jr HaircutOrGrooming - -OlderHaircutBrother: ; 7418 - ld hl, HappinessData_OlderHaircutBrother - jr HaircutOrGrooming - -DaisysGrooming: ; 741d - ld hl, HappinessData_DaisysGrooming - ; fallthrough - -HaircutOrGrooming: ; 7420 - push hl - farcall SelectMonFromParty - pop hl - jr c, .nope - ld a, [wCurPartySpecies] - cp EGG - jr z, .egg - push hl - call GetCurNick - call CopyPokemonName_Buffer1_Buffer3 - pop hl - call Random -; Bug: Subtracting $ff from $ff fails to set c. -; This can result in overflow into the next data array. -; In the case of getting a grooming from Daisy, we bleed -; into CopyPokemonName_Buffer1_Buffer3, which passes -; $d0 to ChangeHappiness and returns $73 to the script. -; The end result is that there is a 0.4% chance your -; Pokemon's happiness will not change at all. -.loop - sub [hl] - jr c, .ok - inc hl - inc hl - inc hl - jr .loop - -.ok - inc hl - ld a, [hli] - ld [wScriptVar], a - ld c, [hl] - call ChangeHappiness - ret - -.nope - xor a - ld [wScriptVar], a - ret - -.egg - ld a, 1 - ld [wScriptVar], a - ret - -INCLUDE "data/events/happiness_probabilities.asm" - -CopyPokemonName_Buffer1_Buffer3: ; 746e - ld hl, wStringBuffer1 - ld de, wStringBuffer3 - ld bc, MON_NAME_LENGTH - jp CopyBytes - -DummyPredef1: ; 747a - ret |
