diff options
-rwxr-xr-x | engine/battle/15.asm | 6 | ||||
-rwxr-xr-x | engine/battle/animations.asm | 2 | ||||
-rwxr-xr-x | engine/battle/b.asm | 2 | ||||
-rwxr-xr-x | engine/battle/core.asm | 30 | ||||
-rwxr-xr-x | engine/items/items.asm | 2 | ||||
-rwxr-xr-x | wram.asm | 16 |
6 files changed, 34 insertions, 24 deletions
diff --git a/engine/battle/15.asm b/engine/battle/15.asm index 0acf3514..9bd67654 100755 --- a/engine/battle/15.asm +++ b/engine/battle/15.asm @@ -82,7 +82,7 @@ GainExperience: ; 5524f (15:524f) call BoostExp ; traded mon exp boost ld a, $1 .next - ld [wcf4d], a + ld [wGainBoostedExp], a ld a, [W_ISINBATTLE] dec a ; is it a trainer battle? call nz, BoostExp ; if so, boost exp @@ -342,12 +342,12 @@ BoostExp: ; 5549f (15:549f) GainedText: ; 554b2 (15:54b2) TX_FAR _GainedText db $08 ; asm - ld a, [wcc5b] + ld a, [wBoostExpByExpAll] ld hl, WithExpAllText and a ret nz ld hl, ExpPointsText - ld a, [wcf4d] + ld a, [wGainBoostedExp] and a ret z ld hl, BoostedText diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index d4cebb44..17033282 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -2931,7 +2931,7 @@ TossBallAnimation: ; 79e16 (1e:5e16) Func_79e6a: ; 79e6a (1e:5e6a) call WaitForSoundToFinish - ld a, [wd05b] + ld a, [wDamageMultipliers] and $7f ret z cp $a diff --git a/engine/battle/b.asm b/engine/battle/b.asm index 32534b17..17f0bd5b 100755 --- a/engine/battle/b.asm +++ b/engine/battle/b.asm @@ -1,5 +1,5 @@ DisplayEffectiveness: ; 2fb7b (b:7b7b) - ld a, [wd05b] + ld a, [wDamageMultipliers] and a, $7F cp a, $0A ret z diff --git a/engine/battle/core.asm b/engine/battle/core.asm index f0f92615..eb4a2fcd 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -919,7 +919,7 @@ FaintEnemyPokemon ; 0x3c567 ; if exp all is in the bag, this will be only be half of the stat exp and normal exp, due to the above loop .giveExpToMonsThatFought xor a - ld [wcc5b], a + ld [wBoostExpByExpAll], a callab GainExperience pop af ret z ; return if no exp all @@ -928,7 +928,7 @@ FaintEnemyPokemon ; 0x3c567 ; now, set the gain exp flag for every party member ; half of the total stat exp and normal exp will divided evenly amongst every party member ld a, $1 - ld [wcc5b], a + ld [wBoostExpByExpAll], a ld a, [wPartyCount] ld b, 0 .gainExpFlagsLoop @@ -1811,8 +1811,8 @@ SendOutMon: ; 3cc91 (f:4c91) ld hl, wcc2d ld [hli], a ld [hl], a - ld [wcc5b], a - ld [wd05b], a + ld [wBoostExpByExpAll], a + ld [wDamageMultipliers], a ld [W_PLAYERMOVENUM], a ld hl, wPlayerUsedMove ld [hli], a @@ -3129,9 +3129,9 @@ ExecutePlayerMove: ; 3d65e (f:565e) xor a ld [W_MOVEMISSED], a ld [wcced], a - ld [wccf4], a + ld [wMoveDidntMiss], a ld a, $a - ld [wd05b], a + ld [wDamageMultipliers], a ld a, [wcd6a] and a jp nz, ExecutePlayerMoveDone @@ -3277,7 +3277,7 @@ MirrorMoveCheck call PrintCriticalOHKOText callab DisplayEffectiveness ld a,1 - ld [wccf4],a + ld [wMoveDidntMiss],a .notDone ld a,[W_PLAYERMOVEEFFECT] ld hl,AlwaysHappenSideEffects @@ -3901,7 +3901,7 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2) ld de, W_ENEMYMOVEEFFECT .playersTurn ld hl, DoesntAffectMonText - ld a, [wd05b] + ld a, [wDamageMultipliers] and $7f jr z, .gotTextToPrint ld hl, AttackMissedText @@ -5306,7 +5306,7 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5) ld [W_DAMAGE],a ld a,l ld [W_DAMAGE + 1],a - ld hl,wd05b + ld hl,wDamageMultipliers set 7,[hl] .skipSameTypeAttackBonus ld a,[wd11e] @@ -5329,13 +5329,13 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5) push hl push bc inc hl - ld a,[wd05b] + ld a,[wDamageMultipliers] and a,$80 ld b,a ld a,[hl] ; a = damage multiplier ld [H_MULTIPLIER],a add b - ld [wd05b],a + ld [wDamageMultipliers],a xor a ld [H_MULTIPLICAND],a ld hl,W_DAMAGE @@ -5659,9 +5659,9 @@ ExecuteEnemyMove: ; 3e6bc (f:66bc) inc [hl] xor a ld [W_MOVEMISSED], a - ld [wccf4], a + ld [wMoveDidntMiss], a ld a, $a - ld [wd05b], a + ld [wDamageMultipliers], a call CheckEnemyStatusConditions jr nz, .enemyHasNoSpecialConditions jp [hl] @@ -5812,7 +5812,7 @@ asm_3e7ef: ; 3e7ef (f:67ef) call PrintCriticalOHKOText callab DisplayEffectiveness ld a, 1 - ld [wccf4], a + ld [wMoveDidntMiss], a .asm_3e83e ld a, [W_ENEMYMOVEEFFECT] ld hl, AlwaysHappenSideEffects @@ -8614,7 +8614,7 @@ NoEffectText: ; 3fb49 (f:7b49) db "@" Func_3fb4e: ; 3fb4e (f:7b4e) - ld a, [wccf4] + ld a, [wMoveDidntMiss] and a ret nz diff --git a/engine/items/items.asm b/engine/items/items.asm index 605e5dde..3dc17010 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -321,7 +321,7 @@ ItemUseBall: ; d687 (3:5687) xor a ld [$fff3],a ld [wcc5b],a - ld [wd05b],a + ld [wDamageMultipliers],a ld a,[wWhichPokemon] push af ld a,[wcf91] @@ -351,6 +351,7 @@ wNPCMovementScriptBank:: ; cc58 ds 2 wHallOfFame:: ; cc5b +wBoostExpByExpAll:: ; cc5b wcc5b:: ds 1 wcc5c:: ds 1 wcc5d:: ds 1 @@ -431,7 +432,7 @@ wccf0:: ds 1 wPlayerUsedMove:: ds 1 wEnemyUsedMove:: ds 1 wccf3:: ds 1 -wccf4:: ds 1 +wMoveDidntMiss:: ds 1 wPartyFoughtCurrentEnemyFlags:: ; flags that indicate which party members have fought the current enemy mon @@ -783,7 +784,9 @@ wcf30:: ds 7 wcf37:: ds 20 wcf4b:: ds 1 wcf4c:: ds 1 -wcf4d:: ds 18 +wGainBoostedExp:: ; cf4d + ds 1 + ds 17 wGymCityName:: ; cf5f wStringBuffer1:: ; cf5f @@ -967,7 +970,14 @@ W_BATTLETYPE:: ; d05a ; in safari battle, this is 2 ds 1 -wd05b:: ds 1 +wDamageMultipliers:: ; d05b +; bits 0-6: Effectiveness + ; $0 = immune + ; $5 = not very effective + ; $a = neutral + ; $14 = super-effective +; bit 7: STAB + ds 1 W_LONEATTACKNO:: ; d05c ; which entry in LoneAttacks to use |