From 61edd43974bf53aaacf96a355ebf2d1e35b59c91 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Thu, 9 Apr 2015 01:17:56 +0200 Subject: Document DisableEffect and CheckEnemyStatusConditions basically copy/paste comments and labels from CheckPlayerStatusConditions --- wram.asm | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'wram.asm') diff --git a/wram.asm b/wram.asm index ee7d2afe..8e1c8e48 100755 --- a/wram.asm +++ b/wram.asm @@ -432,16 +432,22 @@ wSafariBaitFactor:: ; cce9 wcceb:: ds 1 wccec:: ds 1 -wMonIsDisobedient:: ds 1 -wccee:: ds 1 -wccef:: ds 1 + +wMonIsDisobedient:: ds 1 ; cced + +wPlayerDisabledMoveNumber:: ds 1 ; ccee +wEnemyDisabledMoveNumber:: ds 1 ; ccef + wccf0:: ds 1 -wPlayerUsedMove:: ds 1 -wEnemyUsedMove:: ds 1 + +wPlayerUsedMove:: ds 1 ; ccf1 +wEnemyUsedMove:: ds 1 ; ccf2 + wccf3:: ds 1 -wMoveDidntMiss:: ds 1 -wPartyFoughtCurrentEnemyFlags:: +wMoveDidntMiss:: ds 1 ; ccf4 + +wPartyFoughtCurrentEnemyFlags:: ; ccf5 ; flags that indicate which party members have fought the current enemy mon flag_array 6 @@ -1066,11 +1072,13 @@ W_PLAYERCONFUSEDCOUNTER:: ; wd06b W_PLAYERTOXICCOUNTER:: ; d06c ds 1 W_PLAYERDISABLEDMOVE:: ; d06d +; high nibble: which move is disabled (1-4) +; low nibble: disable turns left ds 1 ds 1 -wEnemyNumAttacksLeft:: +wEnemyNumAttacksLeft:: ; d06f ; when the enemy is attacking multiple times, the number of attacks left ds 1 @@ -1080,6 +1088,8 @@ W_ENEMYCONFUSEDCOUNTER:: ; wd070 W_ENEMYTOXICCOUNTER:: ; d071 ds 1 W_ENEMYDISABLEDMOVE:: ; d072 +; high nibble: which move is disabled (1-4) +; low nibble: disable turns left ds 1 ds 1 -- cgit v1.3.1-sl0p From 9739c26ed7fa89492cbc8609445d292ced48ee65 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Thu, 9 Apr 2015 13:05:57 +0200 Subject: money won and trainer pic constants --- engine/battle/core.asm | 7 ++++--- engine/battle/read_trainer_party.asm | 12 +++++++----- home.asm | 4 ++-- text.asm | 2 +- wram.asm | 12 +++++++----- 5 files changed, 21 insertions(+), 16 deletions(-) (limited to 'wram.asm') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 905c649c..04a6de1c 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1023,10 +1023,11 @@ TrainerBattleVictory: ; 3c696 (f:4696) ld c, $28 call DelayFrames call PrintEndBattleText +; win money ld hl, MoneyForWinningText call PrintText ld de, wPlayerMoney + 2 - ld hl, wd07b + ld hl, wAmountMoneyWon + 2 ld c, $3 predef_jump AddBCDPredef @@ -6959,9 +6960,9 @@ InitBattle_Common: ; 3efeb (f:6feb) _LoadTrainerPic: ; 3f04b (f:704b) ; wd033-wd034 contain pointer to pic - ld a, [wd033] + ld a, [wTrainerPicPointer] ; wd033 ld e, a - ld a, [wd034] + ld a, [wTrainerPicPointer + 1] ; wd034 ld d, a ; de contains pointer to trainer pic ld a, [wLinkState] and a diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index f1e3aaf1..3cdfb5cb 100644 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -141,9 +141,10 @@ ReadTrainer: ; 39c53 (e:5c53) .GiveStarterMove ld a,b ld [wEnemyMon6Moves + 2],a -.FinishUp ; XXX this needs documenting - xor a ; clear D079-D07B - ld de,wd079 +.FinishUp +; clear wAmountMoneyWon addresses + xor a + ld de,wAmountMoneyWon ld [de],a inc de ld [de],a @@ -152,13 +153,14 @@ ReadTrainer: ; 39c53 (e:5c53) ld a,[W_CURENEMYLVL] ld b,a .LastLoop +; update wAmountMoneyWon addresses (money to win) based on enemy's level ld hl,wd047 - ld c,2 + ld c,2 ; wAmountMoneyWon is a 3-byte number push bc predef AddBCDPredef pop bc inc de inc de dec b - jr nz,.LastLoop + jr nz,.LastLoop ; repeat W_CURENEMYLVL times ret \ No newline at end of file diff --git a/home.asm b/home.asm index ed5f4db9..53d08d64 100644 --- a/home.asm +++ b/home.asm @@ -2908,7 +2908,7 @@ GetTrainerInformation:: ; 3566 (0:3566) ld hl, TrainerPicAndMoneyPointers ld bc, $5 call AddNTimes - ld de, wd033 + ld de, wTrainerPicPointer ld a, [hli] ld [de], a inc de @@ -2922,7 +2922,7 @@ GetTrainerInformation:: ; 3566 (0:3566) ld [de], a jp BankswitchBack .linkBattle - ld hl, wd033 + ld hl, wTrainerPicPointer ld de, RedPicFront ld [hl], e inc hl diff --git a/text.asm b/text.asm index 10ff8511..7dfe797a 100644 --- a/text.asm +++ b/text.asm @@ -1114,7 +1114,7 @@ _EnemyMonFaintedText:: ; 0x896c7 _MoneyForWinningText:: ; 896dd (22:56dd) text $52, " got ¥@" - TX_BCD wd079, $c3 + TX_BCD wAmountMoneyWon, $c3 db $0 line "for winning!" prompt diff --git a/wram.asm b/wram.asm index 8e1c8e48..91b864d9 100755 --- a/wram.asm +++ b/wram.asm @@ -949,8 +949,9 @@ W_TRAINERCLASS:: ; d031 ds 1 -wd033:: ds 1 -wd034:: ds 2 +wTrainerPicPointer:: ; wd033 + ds 2 + ds 1 wd036:: ds 16 wd046:: ds 1 wd047:: ds 1 @@ -1103,15 +1104,16 @@ wPlayerBideAccumulatedDamage:: ; d074 wUnknownSerialCounter2:: ; d075 ; 2 bytes -ds 4 + ds 4 wEscapedFromBattle:: ; non-zero when an item or move that allows escape from battle was used ds 1 -wd079:: ds 1 +wd079:: +wAmountMoneyWon:: ds 1 ; wd079 - wd07b wd07a:: ds 1 -wd07b:: ds 1 + ds 1 W_ANIMATIONID:: ; d07c ; ID number of the current battle animation -- cgit v1.3.1-sl0p