Skip to content

Commit

Permalink
Assert the relations between some move effect constants (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 authored Nov 25, 2024
1 parent a891fc1 commit f801d67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions constants/move_effect_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const POISON_SIDE_EFFECT1 ; $02
const DRAIN_HP_EFFECT ; $03
const BURN_SIDE_EFFECT1 ; $04
const FREEZE_SIDE_EFFECT ; $05
const FREEZE_SIDE_EFFECT1 ; $05
const PARALYZE_SIDE_EFFECT1 ; $06
const EXPLODE_EFFECT ; $07 Explosion, Self Destruct
const DREAM_EATER_EFFECT ; $08
Expand Down Expand Up @@ -39,7 +39,7 @@
const SLEEP_EFFECT ; $20
const POISON_SIDE_EFFECT2 ; $21
const BURN_SIDE_EFFECT2 ; $22
const_skip ; $23
const FREEZE_SIDE_EFFECT2 ; $23 unused (Blizzard in JP Red/Green)
const PARALYZE_SIDE_EFFECT2 ; $24
const FLINCH_SIDE_EFFECT2 ; $25
const OHKO_EFFECT ; $26 moves like Horn Drill
Expand Down
4 changes: 2 additions & 2 deletions data/moves/effects_pointers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MoveEffectPointerTable:
dw PoisonEffect ; POISON_SIDE_EFFECT1
dw DrainHPEffect ; DRAIN_HP_EFFECT
dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT1
dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT
dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT1
dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT1
dw ExplodeEffect ; EXPLODE_EFFECT
dw DrainHPEffect ; DREAM_EATER_EFFECT
Expand Down Expand Up @@ -35,7 +35,7 @@ MoveEffectPointerTable:
dw SleepEffect ; SLEEP_EFFECT
dw PoisonEffect ; POISON_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; unused effect
dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT2
dw FlinchSideEffect ; FLINCH_SIDE_EFFECT2
dw OneHitKOEffect ; OHKO_EFFECT
Expand Down
6 changes: 3 additions & 3 deletions data/moves/moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Moves:
move MEGA_PUNCH, NO_ADDITIONAL_EFFECT, 80, NORMAL, 85, 20
move PAY_DAY, PAY_DAY_EFFECT, 40, NORMAL, 100, 20
move FIRE_PUNCH, BURN_SIDE_EFFECT1, 75, FIRE, 100, 15
move ICE_PUNCH, FREEZE_SIDE_EFFECT, 75, ICE, 100, 15
move ICE_PUNCH, FREEZE_SIDE_EFFECT1, 75, ICE, 100, 15
move THUNDERPUNCH, PARALYZE_SIDE_EFFECT1, 75, ELECTRIC, 100, 15
move SCRATCH, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35
move VICEGRIP, NO_ADDITIONAL_EFFECT, 55, NORMAL, 100, 30
Expand Down Expand Up @@ -68,8 +68,8 @@ Moves:
move WATER_GUN, NO_ADDITIONAL_EFFECT, 40, WATER, 100, 25
move HYDRO_PUMP, NO_ADDITIONAL_EFFECT, 120, WATER, 80, 5
move SURF, NO_ADDITIONAL_EFFECT, 95, WATER, 100, 15
move ICE_BEAM, FREEZE_SIDE_EFFECT, 95, ICE, 100, 10
move BLIZZARD, FREEZE_SIDE_EFFECT, 120, ICE, 90, 5
move ICE_BEAM, FREEZE_SIDE_EFFECT1, 95, ICE, 100, 10
move BLIZZARD, FREEZE_SIDE_EFFECT1, 120, ICE, 90, 5
move PSYBEAM, CONFUSION_SIDE_EFFECT, 65, PSYCHIC_TYPE, 100, 20
move BUBBLEBEAM, SPEED_DOWN_SIDE_EFFECT, 65, WATER, 100, 20
move AURORA_BEAM, ATTACK_DOWN_SIDE_EFFECT, 65, ICE, 100, 20
Expand Down
8 changes: 5 additions & 3 deletions engine/battle/effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ FreezeBurnParalyzeEffect:
jr c, .regular_effectiveness
; extra effectiveness
ld b, 30 percent + 1
sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on
assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on
.regular_effectiveness
push af
call BattleRandom ; get random 8bit value for probability test
Expand All @@ -226,7 +228,7 @@ FreezeBurnParalyzeEffect:
ld a, b ; what type of effect is this?
cp BURN_SIDE_EFFECT1
jr z, .burn1
cp FREEZE_SIDE_EFFECT
cp FREEZE_SIDE_EFFECT1
jr z, .freeze1
; .paralyze1
ld a, 1 << PAR
Expand Down Expand Up @@ -279,7 +281,7 @@ FreezeBurnParalyzeEffect:
ld a, b
cp BURN_SIDE_EFFECT1
jr z, .burn2
cp FREEZE_SIDE_EFFECT
cp FREEZE_SIDE_EFFECT1
jr z, .freeze2
; .paralyze2
ld a, 1 << PAR
Expand Down

0 comments on commit f801d67

Please sign in to comment.