summaryrefslogtreecommitdiff
path: root/engine/items.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 18:21:53 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 19:42:56 -0500
commit32ed487a476e01759d3d9dbc818d8566ae2c9cb7 (patch)
tree669e90b56d36f17efff5f673235193f5298c0ceb /engine/items.asm
parent6ff2cb20e67db2054486fc5dc48eb9263298d4ad (diff)
parentb35eb72290b964b98844afbe741bb7ede34b9ef3 (diff)
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
Diffstat (limited to 'engine/items.asm')
-rwxr-xr-xengine/items.asm82
1 files changed, 41 insertions, 41 deletions
diff --git a/engine/items.asm b/engine/items.asm
index 120756764..c07042aed 100755
--- a/engine/items.asm
+++ b/engine/items.asm
@@ -28,13 +28,13 @@ _ReceiveItem:: ; d1d5
jp ReceiveKeyItem
.Ball: ; d1fb
- ld hl, NumBalls
+ ld hl, wNumBalls
jp PutItemInPocket
.TMHM: ; d201
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp ReceiveTMHM
@@ -59,13 +59,13 @@ _TossItem:: ; d20d
dw .TMHM
.Ball: ; d228
- ld hl, NumBalls
+ ld hl, wNumBalls
jp RemoveItemFromPocket
.TMHM: ; d22e
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp TossTMHM
@@ -102,13 +102,13 @@ _CheckItem:: ; d244
dw .TMHM
.Ball: ; d25f
- ld hl, NumBalls
+ ld hl, wNumBalls
jp CheckTheItem
.TMHM: ; d265
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp CheckTMHM
@@ -127,28 +127,28 @@ _CheckItem:: ; d244
DoesHLEqualNumItems: ; d27b
ld a, l
- cp LOW(NumItems)
+ cp LOW(wNumItems)
ret nz
ld a, h
- cp HIGH(NumItems)
+ cp HIGH(wNumItems)
ret
GetPocketCapacity: ; d283
ld c, MAX_ITEMS
ld a, e
- cp LOW(NumItems)
+ cp LOW(wNumItems)
jr nz, .not_bag
ld a, d
- cp HIGH(NumItems)
+ cp HIGH(wNumItems)
ret z
.not_bag
ld c, MAX_PC_ITEMS
ld a, e
- cp LOW(PCItems)
+ cp LOW(wPCItems)
jr nz, .not_pc
ld a, d
- cp HIGH(PCItems)
+ cp HIGH(wPCItems)
ret z
.not_pc
@@ -159,7 +159,7 @@ PutItemInPocket: ; d29c
ld d, h
ld e, l
inc hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld b, 0
.loop
@@ -192,7 +192,7 @@ PutItemInPocket: ; d29c
.ok
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld a, [wItemQuantityChangeBuffer]
ld [wItemQuantityBuffer], a
@@ -218,7 +218,7 @@ PutItemInPocket: ; d29c
.terminator2
dec hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hli], a
ld a, [wItemQuantityBuffer]
ld [hli], a
@@ -236,14 +236,14 @@ RemoveItemFromPocket: ; d2ff
ld e, l
ld a, [hli]
ld c, a
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
cp c
jr nc, .ok ; memory
ld c, a
ld b, $0
add hl, bc
add hl, bc
- ld a, [CurItem]
+ ld a, [wCurItem]
cp [hl]
inc hl
jr z, .skip
@@ -252,7 +252,7 @@ RemoveItemFromPocket: ; d2ff
inc hl
.ok
- ld a, [CurItem]
+ ld a, [wCurItem]
ld b, a
.loop
ld a, [hli]
@@ -297,7 +297,7 @@ RemoveItemFromPocket: ; d2ff
ret
CheckTheItem: ; d349
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
.loop
inc hl
@@ -314,17 +314,17 @@ CheckTheItem: ; d349
ret
ReceiveKeyItem: ; d35a
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
ld a, [hli]
cp MAX_KEY_ITEMS
jr nc, .nope
ld c, a
ld b, 0
add hl, bc
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hli], a
ld [hl], -1
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
inc [hl]
scf
ret
@@ -334,10 +334,10 @@ ReceiveKeyItem: ; d35a
ret
TossKeyItem: ; d374
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
ld e, a
ld d, 0
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
ld a, [hl]
cp e
jr nc, .ok
@@ -364,8 +364,8 @@ TossKeyItem: ; d374
ret
.Toss: ; d396
- ld hl, NumKeyItems
- ld a, [CurItem]
+ ld hl, wNumKeyItems
+ ld a, [wCurItem]
ld c, a
.loop3
inc hl
@@ -378,16 +378,16 @@ TossKeyItem: ; d374
ret
.ok3
- ld a, [NumKeyItems]
+ ld a, [wNumKeyItems]
dec a
- ld [NumKeyItems], a
+ ld [wNumKeyItems], a
scf
ret
CheckKeyItems: ; d3b1
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
- ld hl, KeyItems
+ ld hl, wKeyItems
.loop
ld a, [hli]
cp c
@@ -404,7 +404,7 @@ CheckKeyItems: ; d3b1
ReceiveTMHM: ; d3c4
dec c
ld b, 0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [wItemQuantityChangeBuffer]
add [hl]
@@ -421,7 +421,7 @@ ReceiveTMHM: ; d3c4
TossTMHM: ; d3d8
dec c
ld b, 0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [wItemQuantityChangeBuffer]
ld b, a
@@ -448,7 +448,7 @@ TossTMHM: ; d3d8
CheckTMHM: ; d3fb
dec c
ld b, $0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [hl]
and a
@@ -492,7 +492,7 @@ GetNumberedTMHM: ; d417
ret
_CheckTossableItem:: ; d427
-; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be removed from the bag.
+; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be removed from the bag.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit CANT_TOSS_F, a
@@ -501,7 +501,7 @@ _CheckTossableItem:: ; d427
ret
CheckSelectableItem: ; d432
-; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be selected.
+; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be selected.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit CANT_SELECT_F, a
@@ -510,7 +510,7 @@ CheckSelectableItem: ; d432
ret
CheckItemPocket:: ; d43d
-; Return the pocket for CurItem in wItemAttributeParamBuffer.
+; Return the pocket for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_POCKET
call GetItemAttr
and $f
@@ -518,7 +518,7 @@ CheckItemPocket:: ; d43d
ret
CheckItemContext: ; d448
-; Return the context for CurItem in wItemAttributeParamBuffer.
+; Return the context for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
and $f
@@ -526,7 +526,7 @@ CheckItemContext: ; d448
ret
CheckItemMenu: ; d453
-; Return the menu for CurItem in wItemAttributeParamBuffer.
+; Return the menu for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
swap a
@@ -535,7 +535,7 @@ CheckItemMenu: ; d453
ret
GetItemAttr: ; d460
-; Get attribute a of CurItem.
+; Get attribute a of wCurItem.
push hl
push bc
@@ -548,7 +548,7 @@ GetItemAttr: ; d460
xor a
ld [wItemAttributeParamBuffer], a
- ld a, [CurItem]
+ ld a, [wCurItem]
dec a
ld c, a
ld a, ITEMATTR_STRUCT_LENGTH
@@ -567,7 +567,7 @@ ItemAttr_ReturnCarry: ; d47f
ret
GetItemPrice: ; d486
-; Return the price of CurItem in de.
+; Return the price of wCurItem in de.
push hl
push bc
ld a, ITEMATTR_PRICE