mirror of
https://github.com/pret/pokecrystal.git
synced 2024-11-27 07:10:29 +00:00
Move AI data tables into data/battle/ai (mirroring engine/battle/ai) so they're more discoverable.
This commit is contained in:
parent
7d3ad2136a
commit
d504fb8852
@ -10,6 +10,7 @@
|
||||
NUM_TRAINER_ATTRIBUTES EQU const_value
|
||||
|
||||
; TRNATTR_AI_MOVE_WEIGHTS bit flags (wEnemyTrainerAIFlags)
|
||||
; AIScoringPointers indexes (see engine/battle/ai/move.asm)
|
||||
const_def
|
||||
const NO_AI
|
||||
const_value = 0
|
||||
|
11
data/battle/ai/constant_damage_effects.asm
Normal file
11
data/battle/ai/constant_damage_effects.asm
Normal file
@ -0,0 +1,11 @@
|
||||
; AIDamageCalc uses BattleCommand_ConstantDamage
|
||||
; to calculate damage for these instead of
|
||||
; BattleCommand_DamageCalc and BattleCommand_Stab.
|
||||
|
||||
ConstantDamageEffects: ; 39413
|
||||
db EFFECT_SUPER_FANG
|
||||
db EFFECT_STATIC_DAMAGE
|
||||
db EFFECT_LEVEL_DAMAGE
|
||||
db EFFECT_PSYWAVE
|
||||
db -1 ; end
|
||||
; 39418
|
35
data/battle/ai/encore_moves.asm
Normal file
35
data/battle/ai/encore_moves.asm
Normal file
@ -0,0 +1,35 @@
|
||||
; AI_SMART encourages these moves with Encore.
|
||||
|
||||
EncoreMoves: ; 38c85
|
||||
db SWORDS_DANCE
|
||||
db WHIRLWIND
|
||||
db LEER
|
||||
db ROAR
|
||||
db DISABLE
|
||||
db MIST
|
||||
db LEECH_SEED
|
||||
db GROWTH
|
||||
db POISONPOWDER
|
||||
db STRING_SHOT
|
||||
db MEDITATE
|
||||
db AGILITY
|
||||
db TELEPORT
|
||||
db SCREECH
|
||||
db HAZE
|
||||
db FOCUS_ENERGY
|
||||
db DREAM_EATER
|
||||
db POISON_GAS
|
||||
db SPLASH
|
||||
db SHARPEN
|
||||
db CONVERSION
|
||||
db SUPER_FANG
|
||||
db SUBSTITUTE
|
||||
db TRIPLE_KICK
|
||||
db SPIDER_WEB
|
||||
db MIND_READER
|
||||
db FLAME_WHEEL
|
||||
db AEROBLAST
|
||||
db COTTON_SPORE
|
||||
db POWDER_SNOW
|
||||
db -1 ; end
|
||||
; 38ca4
|
16
data/battle/ai/rain_dance_moves.asm
Normal file
16
data/battle/ai/rain_dance_moves.asm
Normal file
@ -0,0 +1,16 @@
|
||||
; AI_SMART prefers these moves during rain.
|
||||
|
||||
RainDanceMoves: ; 390e7
|
||||
db WATER_GUN
|
||||
db HYDRO_PUMP
|
||||
db SURF
|
||||
db BUBBLEBEAM
|
||||
db THUNDER
|
||||
db WATERFALL
|
||||
db CLAMP
|
||||
db BUBBLE
|
||||
db CRABHAMMER
|
||||
db OCTAZOOKA
|
||||
db WHIRLPOOL
|
||||
db -1 ; end
|
||||
; 390f3
|
10
data/battle/ai/reckless_moves.asm
Normal file
10
data/battle/ai/reckless_moves.asm
Normal file
@ -0,0 +1,10 @@
|
||||
; AI_AGGRESSIVE does not discourage these moves
|
||||
; even if a stronger one is available.
|
||||
|
||||
RecklessMoves: ; 393e2
|
||||
db EFFECT_SELFDESTRUCT
|
||||
db EFFECT_RAMPAGE
|
||||
db EFFECT_MULTI_HIT
|
||||
db EFFECT_DOUBLE_HIT
|
||||
db -1 ; end
|
||||
; 393e7
|
17
data/battle/ai/residual_moves.asm
Normal file
17
data/battle/ai/residual_moves.asm
Normal file
@ -0,0 +1,17 @@
|
||||
; AI_CAUTIOUS discourages these moves after the first turn.
|
||||
|
||||
ResidualMoves:
|
||||
db MIST
|
||||
db LEECH_SEED
|
||||
db POISONPOWDER
|
||||
db STUN_SPORE
|
||||
db THUNDER_WAVE
|
||||
db FOCUS_ENERGY
|
||||
db BIDE
|
||||
db POISON_GAS
|
||||
db TRANSFORM
|
||||
db CONVERSION
|
||||
db SUBSTITUTE
|
||||
db SPIKES
|
||||
db -1 ; end
|
||||
; 39453
|
8
data/battle/ai/risky_effects.asm
Normal file
8
data/battle/ai/risky_effects.asm
Normal file
@ -0,0 +1,8 @@
|
||||
; AI_RISKY will not use these effects at max HP
|
||||
; even if they would KO the player.
|
||||
|
||||
RiskyEffects: ; 394ff
|
||||
db EFFECT_SELFDESTRUCT
|
||||
db EFFECT_OHKO
|
||||
db -1 ; end
|
||||
; 39502
|
38
data/battle/ai/stall_moves.asm
Normal file
38
data/battle/ai/stall_moves.asm
Normal file
@ -0,0 +1,38 @@
|
||||
; AI_OPPORTUNIST discourages these moves
|
||||
; when the player's HP is low.
|
||||
|
||||
StallMoves: ; 39348
|
||||
db SWORDS_DANCE
|
||||
db TAIL_WHIP
|
||||
db LEER
|
||||
db GROWL
|
||||
db DISABLE
|
||||
db MIST
|
||||
db COUNTER
|
||||
db LEECH_SEED
|
||||
db GROWTH
|
||||
db STRING_SHOT
|
||||
db MEDITATE
|
||||
db AGILITY
|
||||
db RAGE
|
||||
db MIMIC
|
||||
db SCREECH
|
||||
db HARDEN
|
||||
db WITHDRAW
|
||||
db DEFENSE_CURL
|
||||
db BARRIER
|
||||
db LIGHT_SCREEN
|
||||
db HAZE
|
||||
db REFLECT
|
||||
db FOCUS_ENERGY
|
||||
db BIDE
|
||||
db AMNESIA
|
||||
db TRANSFORM
|
||||
db SPLASH
|
||||
db ACID_ARMOR
|
||||
db SHARPEN
|
||||
db CONVERSION
|
||||
db SUBSTITUTE
|
||||
db FLAME_WHEEL
|
||||
db -1 ; end
|
||||
; 39369
|
10
data/battle/ai/status_only_effects.asm
Normal file
10
data/battle/ai/status_only_effects.asm
Normal file
@ -0,0 +1,10 @@
|
||||
; AI_BASIC discourages these effects if the player
|
||||
; already has a status condition.
|
||||
|
||||
StatusOnlyEffects: ; 385db
|
||||
db EFFECT_SLEEP
|
||||
db EFFECT_TOXIC
|
||||
db EFFECT_POISON
|
||||
db EFFECT_PARALYZE
|
||||
db -1 ; end
|
||||
; 385e0
|
13
data/battle/ai/sunny_day_moves.asm
Normal file
13
data/battle/ai/sunny_day_moves.asm
Normal file
@ -0,0 +1,13 @@
|
||||
; AI_SMART prefers these moves during harsh sunlight.
|
||||
|
||||
SunnyDayMoves: ; 39134
|
||||
db FIRE_PUNCH
|
||||
db EMBER
|
||||
db FLAMETHROWER
|
||||
db FIRE_SPIN
|
||||
db FIRE_BLAST
|
||||
db SACRED_FIRE
|
||||
db MORNING_SUN
|
||||
db SYNTHESIS
|
||||
db -1 ; end
|
||||
; 3913d
|
24
data/battle/ai/useful_moves.asm
Normal file
24
data/battle/ai/useful_moves.asm
Normal file
@ -0,0 +1,24 @@
|
||||
; AI_SMART knows these moves are usable all-around.
|
||||
|
||||
UsefulMoves: ; 39301
|
||||
db DOUBLE_EDGE
|
||||
db SING
|
||||
db FLAMETHROWER
|
||||
db HYDRO_PUMP
|
||||
db SURF
|
||||
db ICE_BEAM
|
||||
db BLIZZARD
|
||||
db HYPER_BEAM
|
||||
db SLEEP_POWDER
|
||||
db THUNDERBOLT
|
||||
db THUNDER
|
||||
db EARTHQUAKE
|
||||
db TOXIC
|
||||
db PSYCHIC_M
|
||||
db HYPNOSIS
|
||||
db RECOVER
|
||||
db FIRE_BLAST
|
||||
db SOFTBOILED
|
||||
db SUPER_FANG
|
||||
db -1 ; end
|
||||
; 39315
|
@ -202,6 +202,7 @@ AIChooseMove: ; 440ce
|
||||
|
||||
|
||||
AIScoringPointers: ; 441af
|
||||
; entries correspond to AI_* constants
|
||||
dw AI_Basic
|
||||
dw AI_Setup
|
||||
dw AI_Types
|
||||
|
@ -40,7 +40,7 @@ AI_Basic: ; 38591
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld hl, .statusonlyeffects
|
||||
ld hl, StatusOnlyEffects
|
||||
ld de, 1
|
||||
call IsInArray
|
||||
|
||||
@ -63,13 +63,7 @@ AI_Basic: ; 38591
|
||||
jr .checkmove
|
||||
; 385db
|
||||
|
||||
.statusonlyeffects
|
||||
db EFFECT_SLEEP
|
||||
db EFFECT_TOXIC
|
||||
db EFFECT_POISON
|
||||
db EFFECT_PARALYZE
|
||||
db -1 ; end
|
||||
; 385e0
|
||||
INCLUDE "data/battle/ai/status_only_effects.asm"
|
||||
|
||||
|
||||
|
||||
@ -1502,7 +1496,7 @@ AI_Smart_Encore: ; 38c3b
|
||||
.asm_38c68
|
||||
push hl
|
||||
ld a, [LastPlayerCounterMove]
|
||||
ld hl, .EncoreMoves
|
||||
ld hl, EncoreMoves
|
||||
ld de, 1
|
||||
call IsInArray
|
||||
pop hl
|
||||
@ -1522,39 +1516,7 @@ AI_Smart_Encore: ; 38c3b
|
||||
inc [hl]
|
||||
ret
|
||||
|
||||
.EncoreMoves:
|
||||
db SWORDS_DANCE
|
||||
db WHIRLWIND
|
||||
db LEER
|
||||
db ROAR
|
||||
db DISABLE
|
||||
db MIST
|
||||
db LEECH_SEED
|
||||
db GROWTH
|
||||
db POISONPOWDER
|
||||
db STRING_SHOT
|
||||
db MEDITATE
|
||||
db AGILITY
|
||||
db TELEPORT
|
||||
db SCREECH
|
||||
db HAZE
|
||||
db FOCUS_ENERGY
|
||||
db DREAM_EATER
|
||||
db POISON_GAS
|
||||
db SPLASH
|
||||
db SHARPEN
|
||||
db CONVERSION
|
||||
db SUPER_FANG
|
||||
db SUBSTITUTE
|
||||
db TRIPLE_KICK
|
||||
db SPIDER_WEB
|
||||
db MIND_READER
|
||||
db FLAME_WHEEL
|
||||
db AEROBLAST
|
||||
db COTTON_SPORE
|
||||
db POWDER_SNOW
|
||||
db -1 ; end
|
||||
; 38ca4
|
||||
INCLUDE "data/battle/ai/encore_moves.asm"
|
||||
|
||||
|
||||
AI_Smart_PainSplit: ; 38ca4
|
||||
@ -2521,20 +2483,7 @@ AI_Smart_RainDance: ; 390cb
|
||||
jr AI_Smart_WeatherMove
|
||||
; 390e7
|
||||
|
||||
RainDanceMoves: ; 390e7
|
||||
db WATER_GUN
|
||||
db HYDRO_PUMP
|
||||
db SURF
|
||||
db BUBBLEBEAM
|
||||
db THUNDER
|
||||
db WATERFALL
|
||||
db CLAMP
|
||||
db BUBBLE
|
||||
db CRABHAMMER
|
||||
db OCTAZOOKA
|
||||
db WHIRLPOOL
|
||||
db -1 ; end
|
||||
; 390f3
|
||||
INCLUDE "data/battle/ai/rain_dance_moves.asm"
|
||||
|
||||
|
||||
AI_Smart_SunnyDay: ; 390f3
|
||||
@ -2613,17 +2562,7 @@ AIGoodWeatherType: ; 39122
|
||||
; 39134
|
||||
|
||||
|
||||
SunnyDayMoves: ; 39134
|
||||
db FIRE_PUNCH
|
||||
db EMBER
|
||||
db FLAMETHROWER
|
||||
db FIRE_SPIN
|
||||
db FIRE_BLAST
|
||||
db SACRED_FIRE
|
||||
db MORNING_SUN
|
||||
db SYNTHESIS
|
||||
db -1 ; end
|
||||
; 3913d
|
||||
INCLUDE "data/battle/ai/sunny_day_moves.asm"
|
||||
|
||||
|
||||
AI_Smart_BellyDrum: ; 3913d
|
||||
@ -3104,29 +3043,7 @@ AIHasMoveInArray: ; 392e6
|
||||
; 39301
|
||||
|
||||
|
||||
UsefulMoves: ; 39301
|
||||
; Moves that are usable all-around.
|
||||
db DOUBLE_EDGE
|
||||
db SING
|
||||
db FLAMETHROWER
|
||||
db HYDRO_PUMP
|
||||
db SURF
|
||||
db ICE_BEAM
|
||||
db BLIZZARD
|
||||
db HYPER_BEAM
|
||||
db SLEEP_POWDER
|
||||
db THUNDERBOLT
|
||||
db THUNDER
|
||||
db EARTHQUAKE
|
||||
db TOXIC
|
||||
db PSYCHIC_M
|
||||
db HYPNOSIS
|
||||
db RECOVER
|
||||
db FIRE_BLAST
|
||||
db SOFTBOILED
|
||||
db SUPER_FANG
|
||||
db -1 ; end
|
||||
; 39315
|
||||
INCLUDE "data/battle/ai/useful_moves.asm"
|
||||
|
||||
|
||||
AI_Opportunist: ; 39315
|
||||
@ -3161,7 +3078,7 @@ AI_Opportunist: ; 39315
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld hl, .stallmoves
|
||||
ld hl, StallMoves
|
||||
ld de, 1
|
||||
call IsInArray
|
||||
|
||||
@ -3176,41 +3093,7 @@ AI_Opportunist: ; 39315
|
||||
.asm_39347
|
||||
ret
|
||||
|
||||
.stallmoves
|
||||
db SWORDS_DANCE
|
||||
db TAIL_WHIP
|
||||
db LEER
|
||||
db GROWL
|
||||
db DISABLE
|
||||
db MIST
|
||||
db COUNTER
|
||||
db LEECH_SEED
|
||||
db GROWTH
|
||||
db STRING_SHOT
|
||||
db MEDITATE
|
||||
db AGILITY
|
||||
db RAGE
|
||||
db MIMIC
|
||||
db SCREECH
|
||||
db HARDEN
|
||||
db WITHDRAW
|
||||
db DEFENSE_CURL
|
||||
db BARRIER
|
||||
db LIGHT_SCREEN
|
||||
db HAZE
|
||||
db REFLECT
|
||||
db FOCUS_ENERGY
|
||||
db BIDE
|
||||
db AMNESIA
|
||||
db TRANSFORM
|
||||
db SPLASH
|
||||
db ACID_ARMOR
|
||||
db SHARPEN
|
||||
db CONVERSION
|
||||
db SUBSTITUTE
|
||||
db FLAME_WHEEL
|
||||
db -1 ; end
|
||||
; 39369
|
||||
INCLUDE "data/battle/ai/stall_moves.asm"
|
||||
|
||||
|
||||
|
||||
@ -3304,7 +3187,7 @@ AI_Aggressive: ; 39369
|
||||
push de
|
||||
push bc
|
||||
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
|
||||
ld hl, .RecklessMoves
|
||||
ld hl, RecklessMoves
|
||||
ld de, 1
|
||||
call IsInArray
|
||||
pop bc
|
||||
@ -3319,13 +3202,7 @@ AI_Aggressive: ; 39369
|
||||
.done
|
||||
ret
|
||||
|
||||
.RecklessMoves:
|
||||
db EFFECT_SELFDESTRUCT
|
||||
db EFFECT_RAMPAGE
|
||||
db EFFECT_MULTI_HIT
|
||||
db EFFECT_DOUBLE_HIT
|
||||
db -1 ; end
|
||||
; 393e7
|
||||
INCLUDE "data/battle/ai/reckless_moves.asm"
|
||||
|
||||
|
||||
AIDamageCalc: ; 393e7
|
||||
@ -3333,7 +3210,7 @@ AIDamageCalc: ; 393e7
|
||||
ld [hBattleTurn], a
|
||||
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
|
||||
ld de, 1
|
||||
ld hl, .ConstantDamageEffects
|
||||
ld hl, ConstantDamageEffects
|
||||
call IsInArray
|
||||
jr nc, .asm_39400
|
||||
callfar BattleCommand_ConstantDamage
|
||||
@ -3345,13 +3222,7 @@ AIDamageCalc: ; 393e7
|
||||
callfar BattleCommand_Stab
|
||||
ret
|
||||
|
||||
.ConstantDamageEffects:
|
||||
db EFFECT_SUPER_FANG
|
||||
db EFFECT_STATIC_DAMAGE
|
||||
db EFFECT_LEVEL_DAMAGE
|
||||
db EFFECT_PSYWAVE
|
||||
db -1 ; end
|
||||
; 39418
|
||||
INCLUDE "data/battle/ai/constant_damage_effects.asm"
|
||||
|
||||
|
||||
AI_Cautious: ; 39418
|
||||
@ -3377,7 +3248,7 @@ AI_Cautious: ; 39418
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld hl, .residualmoves
|
||||
ld hl, ResidualMoves
|
||||
ld de, 1
|
||||
call IsInArray
|
||||
|
||||
@ -3393,21 +3264,7 @@ AI_Cautious: ; 39418
|
||||
inc [hl]
|
||||
jr .asm_39425
|
||||
|
||||
.residualmoves
|
||||
db MIST
|
||||
db LEECH_SEED
|
||||
db POISONPOWDER
|
||||
db STUN_SPORE
|
||||
db THUNDER_WAVE
|
||||
db FOCUS_ENERGY
|
||||
db BIDE
|
||||
db POISON_GAS
|
||||
db TRANSFORM
|
||||
db CONVERSION
|
||||
db SUBSTITUTE
|
||||
db SPIKES
|
||||
db -1 ; end
|
||||
; 39453
|
||||
INCLUDE "data/battle/ai/residual_moves.asm"
|
||||
|
||||
|
||||
|
||||
@ -3504,7 +3361,7 @@ AI_Risky: ; 394a9
|
||||
; Don't use risky moves at max hp.
|
||||
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
|
||||
ld de, 1
|
||||
ld hl, .RiskyMoves
|
||||
ld hl, RiskyEffects
|
||||
call IsInArray
|
||||
jr nc, .checkko
|
||||
|
||||
@ -3541,11 +3398,7 @@ endr
|
||||
pop de
|
||||
jr .checkmove
|
||||
|
||||
.RiskyMoves:
|
||||
db EFFECT_SELFDESTRUCT
|
||||
db EFFECT_OHKO
|
||||
db -1 ; end
|
||||
; 39502
|
||||
INCLUDE "data/battle/ai/risky_effects.asm"
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user