ref: 58f10893707004fe353422e19f3d1f2b89e60a6c
parent: 8c83ebe9663ef317c8bd3b74339047bda29be1a4
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Thu Jul 16 05:40:30 EDT 2020
Define constants for default trainer DVs
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -39,6 +39,10 @@
MAX_STAT_VALUE EQU 999
+; trainer dvs
+ATKDEFDV_TRAINER EQU $98
+SPDSPCDV_TRAINER EQU $88
+
; volatile statuses 1
const_def
const STORING_ENERGY ; 0 ; Bide
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6104,8 +6104,8 @@
ld a, [wIsInBattle]
cp $2 ; is it a trainer battle?
; fixed DVs for trainer mon
- ld a, $98
- ld b, $88
+ ld a, ATKDEFDV_TRAINER
+ ld b, SPDSPCDV_TRAINER
jr z, .storeDVs
; random DVs for wild mon
call BattleRandom
--- a/engine/pokemon/add_mon.asm
+++ b/engine/pokemon/add_mon.asm
@@ -75,8 +75,8 @@
push hl
ld a, [wMonDataLocation]
and $f
- ld a, $98 ; set enemy trainer mon IVs to fixed average values
- ld b, $88
+ ld a, ATKDEFDV_TRAINER ; set enemy trainer mon IVs to fixed average values
+ ld b, SPDSPCDV_TRAINER
jr nz, .next4
; If the mon is being added to the player's party, update the pokedex.