shithub: pokered

Download patch

ref: 247b619e9abf12c6790cff72343a8cf8431b0fb9
parent: a8375aaee71e37fb1e6d39c525dbd40fd0df09bb
author: xCrystal <rgr.crystal@gmail.com>
date: Tue Mar 31 16:28:42 EDT 2015

Some wram constants

--- a/engine/battle/15.asm
+++ b/engine/battle/15.asm
@@ -82,7 +82,7 @@
 	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 @@
 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
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -2931,7 +2931,7 @@
 
 Func_79e6a: ; 79e6a (1e:5e6a)
 	call WaitForSoundToFinish
-	ld a, [wd05b]
+	ld a, [wDamageMultipliers]
 	and $7f
 	ret z
 	cp $a
--- 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
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -919,7 +919,7 @@
 ; 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 @@
 ; 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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	db "@"
 
 Func_3fb4e: ; 3fb4e (f:7b4e)
-	ld a, [wccf4]
+	ld a, [wMoveDidntMiss]
 	and a
 	ret nz
 
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -321,7 +321,7 @@
 	xor a
 	ld [$fff3],a
 	ld [wcc5b],a
-	ld [wd05b],a
+	ld [wDamageMultipliers],a
 	ld a,[wWhichPokemon]
 	push af
 	ld a,[wcf91]
--- a/wram.asm
+++ b/wram.asm
@@ -351,6 +351,7 @@
 	ds 2
 
 wHallOfFame:: ; cc5b
+wBoostExpByExpAll:: ; cc5b
 wcc5b:: ds 1
 wcc5c:: ds 1
 wcc5d:: ds 1
@@ -431,7 +432,7 @@
 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 @@
 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 @@
 ; 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