named wram variables

This commit is contained in:
YamaArashi 2015-08-07 05:20:37 -07:00
parent 525f1b96f3
commit f658aff538
6 changed files with 55 additions and 45 deletions

View file

@ -2956,7 +2956,7 @@ TossBallAnimation: ; 79e16 (1e:5e16)
ld a,[W_ISINBATTLE]
cp a,2
jr z,.BlockBall ; if in trainer battle, play different animation
ld a,[wd11e]
ld a,[wPokeBallAnimData]
ld b,a
; upper nybble: how many animations (from PokeBallAnimations) to play

View file

@ -2962,7 +2962,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
lb bc, 1, 2
call PrintNumber
coord hl, 8, 11
ld de, wd11e
ld de, wMaxPP
lb bc, 1, 2
call PrintNumber
call GetCurrentMove
@ -5287,7 +5287,7 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5)
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
ld a,[W_PLAYERMOVETYPE]
ld [wd11e],a
ld [wMoveType],a
ld a,[H_WHOSETURN]
and a
jr z,.next
@ -5301,9 +5301,9 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5)
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
ld a,[W_ENEMYMOVETYPE]
ld [wd11e],a
ld [wMoveType],a
.next
ld a,[wd11e] ; move type
ld a,[wMoveType]
cp b ; does the move type match type 1 of the attacker?
jr z,.sameTypeAttackBonus
cp c ; does the move type match type 2 of the attacker?
@ -5328,8 +5328,8 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5)
ld hl,wDamageMultipliers
set 7,[hl]
.skipSameTypeAttackBonus
ld a,[wd11e]
ld b,a ; b = move type
ld a,[wMoveType]
ld b,a
ld hl,TypeEffects
.loop
ld a,[hli] ; a = "attacking type" of the current type pair
@ -5392,29 +5392,29 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5)
; function to tell how effective the type of an enemy attack is on the player's current pokemon
; this doesn't take into account the effects that dual types can have
; (e.g. 4x weakness / resistance, weaknesses and resistances canceling)
; the result is stored in [wd11e]
; the result is stored in [wTypeEffectiveness]
; ($05 is not very effective, $10 is neutral, $14 is super effective)
; as far is can tell, this is only used once in some AI code to help decide which move to use
AIGetTypeEffectiveness: ; 3e449 (f:6449)
ld a,[W_ENEMYMOVETYPE]
ld d,a ; d = type of enemy move
ld d,a ; d = type of enemy move
ld hl,wBattleMonType
ld b,[hl] ; b = type 1 of player's pokemon
ld b,[hl] ; b = type 1 of player's pokemon
inc hl
ld c,[hl] ; c = type 2 of player's pokemon
ld c,[hl] ; c = type 2 of player's pokemon
ld a,$10
ld [wd11e],a ; initialize [wd11e] to neutral effectiveness
ld [wTypeEffectiveness],a ; initialize to neutral effectiveness
ld hl,TypeEffects
.loop
ld a,[hli]
cp a,$ff
ret z
cp d ; match the type of the move
cp d ; match the type of the move
jr nz,.nextTypePair1
ld a,[hli]
cp b ; match with type 1 of pokemon
cp b ; match with type 1 of pokemon
jr z,.done
cp c ; or match with type 2 of pokemon
cp c ; or match with type 2 of pokemon
jr z,.done
jr .nextTypePair2
.nextTypePair1
@ -5424,7 +5424,7 @@ AIGetTypeEffectiveness: ; 3e449 (f:6449)
jr .loop
.done
ld a,[hl]
ld [wd11e],a ; store damage multiplier
ld [wTypeEffectiveness],a ; store damage multiplier
ret
INCLUDE "data/type_effects.asm"
@ -6577,12 +6577,12 @@ CalculateModifiedStats: ; 3ed99 (f:6d99)
CalculateModifiedStat: ; 3eda5 (f:6da5)
push bc
push bc
ld a, [wd11e]
ld a, [wCalculateWhoseStats]
and a
ld a, c
ld hl, wBattleMonAttack
ld de, wPlayerMonUnmodifiedAttack
ld bc, wPlayerMonAttackMod
ld bc, wPlayerMonStatMods
jr z, .next
ld hl, wEnemyMonAttack
ld de, wEnemyMonUnmodifiedAttack

View file

@ -231,8 +231,8 @@ GainExperience: ; 5524f (15:524f)
ld bc, 1 + NUM_STATS * 2
call CopyData
.recalcStatChanges
xor a
ld [wd11e], a
xor a ; battle mon
ld [wCalculateWhoseStats], a
callab CalculateModifiedStats
callab ApplyBurnAndParalysisPenaltiesToPlayer
callab ApplyBadgeStatBoosts