mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 22:52:15 +13:00
Add subdirectories to engine/ similar to pokecrystal
This commit is contained in:
parent
5559d51c86
commit
f275790aec
124 changed files with 342 additions and 346 deletions
46
engine/events/black_out.asm
Normal file
46
engine/events/black_out.asm
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
ResetStatusAndHalveMoneyOnBlackout::
|
||||
; Reset player status on blackout.
|
||||
xor a
|
||||
ld [wBattleResult], a
|
||||
ld [wWalkBikeSurfState], a
|
||||
ld [wIsInBattle], a
|
||||
ld [wMapPalOffset], a
|
||||
ld [wNPCMovementScriptFunctionNum], a
|
||||
ld [hJoyHeld], a
|
||||
ld [wNPCMovementScriptPointerTableNum], a
|
||||
ld [wFlags_0xcd60], a
|
||||
|
||||
ld [hMoney], a
|
||||
ld [hMoney + 1], a
|
||||
ld [hMoney + 2], a
|
||||
call HasEnoughMoney
|
||||
jr c, .lostmoney ; never happens
|
||||
|
||||
; Halve the player's money.
|
||||
ld a, [wPlayerMoney]
|
||||
ld [hMoney], a
|
||||
ld a, [wPlayerMoney + 1]
|
||||
ld [hMoney + 1], a
|
||||
ld a, [wPlayerMoney + 2]
|
||||
ld [hMoney + 2], a
|
||||
xor a
|
||||
ld [hDivideBCDDivisor], a
|
||||
ld [hDivideBCDDivisor + 1], a
|
||||
ld a, 2
|
||||
ld [hDivideBCDDivisor + 2], a
|
||||
predef DivideBCDPredef3
|
||||
ld a, [hDivideBCDQuotient]
|
||||
ld [wPlayerMoney], a
|
||||
ld a, [hDivideBCDQuotient + 1]
|
||||
ld [wPlayerMoney + 1], a
|
||||
ld a, [hDivideBCDQuotient + 2]
|
||||
ld [wPlayerMoney + 2], a
|
||||
|
||||
.lostmoney
|
||||
ld hl, wd732
|
||||
set 2, [hl]
|
||||
res 3, [hl]
|
||||
set 6, [hl]
|
||||
ld a, %11111111
|
||||
ld [wJoyIgnore], a
|
||||
predef_jump HealParty
|
||||
Loading…
Add table
Add a link
Reference in a new issue