aboutsummaryrefslogtreecommitdiffstats
path: root/engine/events
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-11-27 19:39:25 +0100
committerGitHub <noreply@github.com>2025-11-27 13:39:25 -0500
commit3a4382c6055e21da72357dd18638947a2acbbda9 (patch)
treecb383fbd6a0dc57e3b0f9e9483c2a3f898f42f96 /engine/events
parentAvoid magic numbers for most `CopyData` calls (#542) (diff)
downloadpokeyellow-3a4382c6055e21da72357dd18638947a2acbbda9.tar.gz
pokeyellow-3a4382c6055e21da72357dd18638947a2acbbda9.tar.xz
pokeyellow-3a4382c6055e21da72357dd18638947a2acbbda9.zip
Use more Pokemon data constants, create MOVE_NAME_LENGTH (#543)
Diffstat (limited to 'engine/events')
-rw-r--r--engine/events/heal_party.asm10
-rw-r--r--engine/events/in_game_trades.asm6
-rw-r--r--engine/events/poison.asm4
3 files changed, 10 insertions, 10 deletions
diff --git a/engine/events/heal_party.asm b/engine/events/heal_party.asm
index e6551bcd..5532fd92 100644
--- a/engine/events/heal_party.asm
+++ b/engine/events/heal_party.asm
@@ -11,7 +11,7 @@ HealParty:
push hl
push de
- ld hl, wPartyMon1Status - wPartyMon1HP
+ ld hl, MON_STATUS - MON_HP
add hl, de
xor a
ld [hl], a
@@ -19,7 +19,7 @@ HealParty:
push de
ld b, NUM_MOVES ; A Pokémon has 4 moves
.pp
- ld hl, wPartyMon1Moves - wPartyMon1HP
+ ld hl, MON_MOVES - MON_HP
add hl, de
ld a, [hl]
@@ -27,7 +27,7 @@ HealParty:
jr z, .nextmove
dec a
- ld hl, wPartyMon1PP - wPartyMon1HP
+ ld hl, MON_PP - MON_HP
add hl, de
push hl
@@ -60,7 +60,7 @@ HealParty:
jr nz, .pp
pop de
- ld hl, wPartyMon1MaxHP - wPartyMon1HP
+ ld hl, MON_MAXHP - MON_HP
add hl, de
ld a, [hli]
ld [de], a
@@ -72,7 +72,7 @@ HealParty:
pop hl
push hl
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
ld h, d
ld l, e
add hl, bc
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index 5cc251f4..3107550f 100644
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -115,7 +115,7 @@ InGameTrade_DoTrade:
jr nz, .tradeFailed ; jump if the selected mon's species is not the required one
ld a, [wWhichPokemon]
ld hl, wPartyMon1Level
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
ld [wCurEnemyLevel], a
@@ -190,7 +190,7 @@ InGameTrade_PrepareTradeData:
ld de, wLinkEnemyTrainerName
call InGameTrade_CopyData
ld hl, wPartyMon1OTID
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
ld de, wTradedPlayerMonOTID
@@ -223,7 +223,7 @@ InGameTrade_CopyDataToReceivedMon:
ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMon1OTID
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
call InGameTrade_GetReceivedMonPointer
ld hl, wTradedEnemyMonOTID
ld bc, 2
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index beb1a312..8c3dc8b3 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -65,7 +65,7 @@ ApplyOutOfBattlePoisonDamage:
ld a, [de]
inc a
jr z, .applyDamageLoopDone
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
push hl
ld hl, wWhichPokemon
@@ -82,7 +82,7 @@ ApplyOutOfBattlePoisonDamage:
and 1 << PSN
or e
ld e, a
- ld bc, wPartyMon2 - wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
dec d
jr nz, .countPoisonedLoop