pokecrystal-board/engine/events/haircut.asm

76 lines
1.1 KiB
NASM
Raw Permalink Normal View History

2018-06-24 07:09:41 -07:00
BillsGrandfather:
farcall SelectMonFromParty
jr c, .cancel
ld a, [wCurPartySpecies]
2023-09-30 10:12:57 -07:00
ldh [hScriptVar], a
ld [wNamedObjectIndex], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
.cancel
xor a
2023-09-30 10:12:57 -07:00
ldh [hScriptVar], a
ret
2018-06-24 07:09:41 -07:00
OlderHaircutBrother:
ld hl, HappinessData_OlderHaircutBrother
jr HaircutOrGrooming
YoungerHaircutBrother:
ld hl, HappinessData_YoungerHaircutBrother
jr HaircutOrGrooming
2018-06-24 07:09:41 -07:00
DaisysGrooming:
ld hl, HappinessData_DaisysGrooming
; fallthrough
2018-06-24 07:09:41 -07:00
HaircutOrGrooming:
push hl
farcall SelectMonFromParty
pop hl
jr c, .nope
ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
push hl
call GetCurNickname
call CopyPokemonName_Buffer1_Buffer3
pop hl
call Random
.loop
sub [hl]
jr c, .ok
inc hl
inc hl
inc hl
jr .loop
.ok
inc hl
ld a, [hli]
2023-09-30 10:12:57 -07:00
ldh [hScriptVar], a
ld c, [hl]
call ChangeHappiness
ret
.nope
xor a
2023-09-30 10:12:57 -07:00
ldh [hScriptVar], a
ret
.egg
ld a, 1
2023-09-30 10:12:57 -07:00
ldh [hScriptVar], a
ret
INCLUDE "data/events/happiness_probabilities.asm"
2018-06-24 07:09:41 -07:00
CopyPokemonName_Buffer1_Buffer3:
ld hl, wStringBuffer1
ld de, wStringBuffer3
ld bc, MON_NAME_LENGTH
jp CopyBytes
2018-06-24 07:09:41 -07:00
DummyPredef1:
ret