diff options
Diffstat (limited to 'engine/battle/1a.asm')
-rwxr-xr-x | engine/battle/1a.asm | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/engine/battle/1a.asm b/engine/battle/1a.asm index 6b502a31..ecf5040b 100755 --- a/engine/battle/1a.asm +++ b/engine/battle/1a.asm @@ -7,16 +7,19 @@ DecrementPP: ; 68000 (1a:4000) ld hl, W_PLAYERBATTSTATUS1 ld a, [hli] ; load the W_PLAYERBATTSTATUS1 pokemon status flags and increment hl to load the ; W_PLAYERBATTSTATUS2 status flags later - and a, 7 ; check to see if bits 0, 1, or 2 are set + and a, (1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << AttackingMultipleTimes) ret nz ; if any of these statuses are true, don't decrement PP - bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2 - ret nz ; and return if it is set + bit UsingRage, [hl] + ret nz ; don't decrement PP either if Pokemon is using Rage ld hl, wBattleMonPP ; PP of first move (in battle) - call .DecrementPP - - ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits? - bit 3, a ; XXX transform status? - ret nz ; If it is, return. Pokemon Red stores the "current pokemon's" PP + +; decrement PP in the battle struct + call .DecrementPP + +; decrement PP in the party struct + ld a, [W_PLAYERBATTSTATUS3] + bit Transformed, a + ret nz ; Return if transformed. Pokemon Red stores the "current pokemon's" PP ; separately from the "Pokemon in your party's" PP. This is ; duplication -- in all cases *other* than Pokemon with Transform. ; Normally, this means we have to go on and make the same @@ -26,12 +29,12 @@ DecrementPP: ; 68000 (1a:4000) ; its opponent, which is *not* the same as its real PP as part of your ; party. So we return, and don't do that part. - ld hl, wPartyMon1PP ; PP of first move (in party) - ld a, [wPlayerMonNumber] ; which mon in party is active - ld bc, $2C ; XXX probably size of party pokemon's data structure + ld hl, wPartyMon1PP ; PP of first move (in party) + ld a, [wPlayerMonNumber] ; which mon in party is active + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ; calculate address of the mon to modify .DecrementPP - ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use? + ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use? ld c, a ld b, 0 add hl ,bc ; calculate the address in memory of the PP we need to decrement |