named wram variables

This commit is contained in:
YamaArashi 2015-07-14 23:16:06 -07:00
parent 07dd705637
commit 994c2cbf28
21 changed files with 246 additions and 204 deletions

View file

@ -1,6 +1,6 @@
UseItem_: ; d5c7 (3:55c7)
ld a,1
ld [wcd6a],a
ld [wActionResultOrTookBattleTurn],a ; initialise to success value
ld a,[wcf91] ;contains item_ID
cp a,HM_01
jp nc,ItemUseTMHM
@ -661,7 +661,7 @@ ItemUseEvoStone: ; da5b (3:5a5b)
call ItemUseNoEffect
.canceledItemUse
xor a
ld [wcd6a],a
ld [wActionResultOrTookBattleTurn],a ; item not used
pop af
ret
@ -691,7 +691,7 @@ ItemUseMedicine: ; dabb (3:5abb)
.emptyParty
ld hl,.emptyPartyText
xor a
ld [wcd6a],a ; item use failed
ld [wActionResultOrTookBattleTurn],a ; item use failed
jp PrintText
.emptyPartyText
text "You don't have"
@ -706,7 +706,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,[wWhichPokemon]
call AddNTimes
ld a,[wWhichPokemon]
ld [wcf06],a
ld [wUsedItemOnWhichPokemon],a
ld d,a
ld a,[wcf91]
ld e,a
@ -803,7 +803,7 @@ ItemUseMedicine: ; dabb (3:5abb)
push hl
push de
push bc
ld a,[wcf06]
ld a,[wUsedItemOnWhichPokemon]
ld c,a
ld hl,wPartyFoughtCurrentEnemyFlags
ld b,$02
@ -811,7 +811,7 @@ ItemUseMedicine: ; dabb (3:5abb)
ld a,c
and a
jr z,.next
ld a,[wcf06]
ld a,[wUsedItemOnWhichPokemon]
ld c,a
ld hl,wPartyGainExpFlags
ld b,$01
@ -1106,7 +1106,7 @@ ItemUseMedicine: ; dabb (3:5abb)
jr .done
.canceledItemUse
xor a
ld [wcd6a],a ; item use failed
ld [wActionResultOrTookBattleTurn],a ; item use failed
pop af
pop af
.done
@ -1384,7 +1384,7 @@ ItemUseEscapeRope: ; dfaf (3:5faf)
ld [W_SAFARIZONEENTRANCECURSCRIPT],a
inc a
ld [wEscapedFromBattle],a
ld [wcd6a],a ; item used
ld [wActionResultOrTookBattleTurn],a ; item used
ld a,[wd152]
and a ; using Dig?
ret nz ; if so, return
@ -1550,7 +1550,7 @@ ItemUseXStat: ; e104 (3:6104)
jr nz,.inBattle
call ItemUseNotTime
ld a,2
ld [wcd6a],a ; item not used
ld [wActionResultOrTookBattleTurn],a ; item not used
ret
.inBattle
ld hl,W_PLAYERMOVENUM
@ -2043,7 +2043,7 @@ ItemUsePPRestore: ; e31e (3:631e)
call GoPAL_SET_CF1C
pop af
xor a
ld [wcd6a],a ; item use failed
ld [wActionResultOrTookBattleTurn],a ; item use failed
ret
RaisePPWhichTechniqueText: ; e45d (3:645d)
@ -2104,7 +2104,7 @@ ItemUseTMHM: ; e479 (3:6479)
and a
jr z,.useMachine
ld a,2
ld [wcd6a],a ; item not used
ld [wActionResultOrTookBattleTurn],a ; item not used
ret
.useMachine
ld a,[wWhichPokemon]
@ -2234,7 +2234,7 @@ SurfingAttemptFailed: ; e5b6 (3:65b6)
ItemUseFailed: ; e5b9 (3:65b9)
xor a
ld [wcd6a],a ; item use failed
ld [wActionResultOrTookBattleTurn],a ; item use failed
jp PrintText
ItemUseNotTimeText: ; e5c0 (3:65c0)
@ -2301,13 +2301,13 @@ RestoreBonusPP: ; e606 (3:6606)
ld a,[wWhichPokemon]
call AddNTimes
push hl
ld de,wcd78 - 1
predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wcd78
ld de,wNormalMaxPPList - 1
predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wNormalMaxPPList
pop hl
ld c,21
ld b,0
add hl,bc ; hl now points to move 1 PP
ld de,wcd78
ld de,wNormalMaxPPList
ld b,0 ; initialize move counter to zero
; loop through the pokemon's moves
.loop
@ -2420,7 +2420,7 @@ GetMaxPP: ; e677 (3:6677)
ld de,wcd6d
ld a,BANK(Moves)
call FarCopyData
ld de,wcd72
ld de,wcd6d + 5 ; PP is byte 5 of move data
ld a,[de]
ld b,a ; b = normal max PP
pop hl