mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Battle data goes in data/battle/
TreeMons, like fish groups, have constants
This commit is contained in:
parent
28d5169a11
commit
c8575823a0
@ -20,8 +20,14 @@ TREEMON_SLEEP_TURNS EQU 7
|
||||
; default move priority
|
||||
BASE_PRIORITY EQU 1
|
||||
|
||||
; PlayerStatLevels and EnemyStatLevels indexes
|
||||
; used for GetStatName
|
||||
; type effectiveness factors, scaled by 10
|
||||
SUPER_EFFECTIVE EQU 20
|
||||
EFFECTIVE EQU 10
|
||||
NOT_VERY_EFFECTIVE EQU 05
|
||||
NO_EFFECT EQU 00
|
||||
|
||||
; PlayerStatLevels and EnemyStatLevels indexes (see wram.asm)
|
||||
; GetStatName arguments (see data/battle/stat_names.asm)
|
||||
const_def
|
||||
const ATTACK
|
||||
const DEFENSE
|
||||
|
@ -290,9 +290,9 @@ NUM_HMS = const_value - HM01
|
||||
add_mt ICE_BEAM
|
||||
NUM_TM_HM_TUTOR = __enum__ +- 1
|
||||
|
||||
ITEM_FROM_MEM EQU $FF
|
||||
ITEM_FROM_MEM EQU $ff
|
||||
|
||||
; leftovers from red
|
||||
SAFARI_BALL EQU $08 ; MOON_STONE
|
||||
MOON_STONE_RED EQU $0A ; BURN_HEAL
|
||||
MOON_STONE_RED EQU $0a ; BURN_HEAL
|
||||
FULL_HEAL_RED EQU $34 ; X_SPEED
|
||||
|
@ -253,6 +253,26 @@ const_value set 1
|
||||
NUM_FRUIT_TREES EQU const_value +- 1
|
||||
|
||||
|
||||
; treemon sets
|
||||
; TreeMons indexes (see data/wild/treemons.asm)
|
||||
const_def
|
||||
const TREEMON_SET_CITY
|
||||
const TREEMON_SET_CANYON
|
||||
const TREEMON_SET_AZALEA
|
||||
const TREEMON_SET_ROUTE
|
||||
const TREEMON_SET_KANTO
|
||||
const TREEMON_SET_LAKE
|
||||
const TREEMON_SET_FOREST
|
||||
const TREEMON_SET_ROCK
|
||||
NUM_TREEMON_SETS EQU const_value
|
||||
|
||||
; treemon scores
|
||||
const_def
|
||||
const TREEMON_SCORE_BAD ; 0
|
||||
const TREEMON_SCORE_GOOD ; 1
|
||||
const TREEMON_SCORE_RARE ; 2
|
||||
|
||||
|
||||
; elevator floors
|
||||
; used by `elevfloor`
|
||||
const_def
|
||||
|
17
data/battle/accuracy_multipliers.asm
Normal file
17
data/battle/accuracy_multipliers.asm
Normal file
@ -0,0 +1,17 @@
|
||||
; Multiplier ratios for accuracy from modifier -6 to +6
|
||||
; (for other stats, see data/battle/stat_multipliers.asm)
|
||||
|
||||
AccuracyLevelMultipliers:
|
||||
db 33, 100 ; -6 = 33%
|
||||
db 36, 100 ; -5 = 36%
|
||||
db 43, 100 ; -4 = 43%
|
||||
db 50, 100 ; -3 = 50%
|
||||
db 60, 100 ; -2 = 60%
|
||||
db 75, 100 ; -1 = 75%
|
||||
db 1, 1 ; 0 = 100%
|
||||
db 133, 100 ; +1 = 133%
|
||||
db 166, 100 ; +2 = 166%
|
||||
db 2, 1 ; +3 = 200%
|
||||
db 233, 100 ; +4 = 233%
|
||||
db 133, 50 ; +5 = 266%
|
||||
db 3, 1 ; +6 = 300%
|
18
data/battle/critical_hits.asm
Normal file
18
data/battle/critical_hits.asm
Normal file
@ -0,0 +1,18 @@
|
||||
CriticalHitMoves:
|
||||
db KARATE_CHOP
|
||||
db RAZOR_WIND
|
||||
db RAZOR_LEAF
|
||||
db CRABHAMMER
|
||||
db SLASH
|
||||
db AEROBLAST
|
||||
db CROSS_CHOP
|
||||
db -1
|
||||
|
||||
CriticalHitChances:
|
||||
db 7 percent ; 0
|
||||
db 12 percent + 2 ; 1
|
||||
db 25 percent + 1 ; 2
|
||||
db 33 percent + 1 ; 3
|
||||
db 50 percent + 1 ; 4
|
||||
db 50 percent + 1 ; 5
|
||||
db 50 percent + 1 ; 6
|
17
data/battle/stat_multipliers.asm
Normal file
17
data/battle/stat_multipliers.asm
Normal file
@ -0,0 +1,17 @@
|
||||
; Multiplier ratios for all stats from modifier -6 to +6
|
||||
; (except accuracy, see data/battle/accuracy_multipliers.asm)
|
||||
|
||||
StatLevelMultipliers:
|
||||
db 25, 100 ; -6 = 25%
|
||||
db 28, 100 ; -5 = 28%
|
||||
db 33, 100 ; -4 = 33%
|
||||
db 40, 100 ; -3 = 40%
|
||||
db 50, 100 ; -2 = 50%
|
||||
db 66, 100 ; -1 = 66%
|
||||
db 1, 1 ; 0 = 100%
|
||||
db 15, 10 ; +1 = 150%
|
||||
db 2, 1 ; +2 = 200%
|
||||
db 25, 10 ; +3 = 250%
|
||||
db 3, 1 ; +4 = 300%
|
||||
db 35, 10 ; +5 = 350%
|
||||
db 4, 1 ; +6 = 400%
|
10
data/battle/stat_names.asm
Normal file
10
data/battle/stat_names.asm
Normal file
@ -0,0 +1,10 @@
|
||||
StatNames:
|
||||
; entries correspond to stat ids
|
||||
db "ATTACK@"
|
||||
db "DEFENSE@"
|
||||
db "SPEED@"
|
||||
db "SPCL.ATK@"
|
||||
db "SPCL.DEF@"
|
||||
db "ACCURACY@"
|
||||
db "EVASION@"
|
||||
db "ABILITY@"
|
20
data/battle/type_boost_items.asm
Normal file
20
data/battle/type_boost_items.asm
Normal file
@ -0,0 +1,20 @@
|
||||
TypeBoostItems: ; 35703
|
||||
db HELD_NORMAL_BOOST, NORMAL ; PINK_BOW/POLKADOT_BOW
|
||||
db HELD_FIGHTING_BOOST, FIGHTING ; BLACKBELT
|
||||
db HELD_FLYING_BOOST, FLYING ; SHARP_BEAK
|
||||
db HELD_POISON_BOOST, POISON ; POISON BARB
|
||||
db HELD_GROUND_BOOST, GROUND ; SOFT_SAND
|
||||
db HELD_ROCK_BOOST, ROCK ; HARD_STONE
|
||||
db HELD_BUG_BOOST, BUG ; SILVERPOWDER
|
||||
db HELD_GHOST_BOOST, GHOST ; SPELL_TAG
|
||||
db HELD_FIRE_BOOST, FIRE ; CHARCOAL
|
||||
db HELD_WATER_BOOST, WATER ; MYSTIC WATER
|
||||
db HELD_GRASS_BOOST, GRASS ; MIRACLE_SEED
|
||||
db HELD_ELECTRIC_BOOST, ELECTRIC ; MAGNET
|
||||
db HELD_PSYCHIC_BOOST, PSYCHIC ; TWISTEDSPOON
|
||||
db HELD_ICE_BOOST, ICE ; NEVERMELTICE
|
||||
db HELD_DRAGON_BOOST, DRAGON ; DRAGON_SCALE
|
||||
db HELD_DARK_BOOST, DARK ; BLACKGLASSES
|
||||
db HELD_STEEL_BOOST, STEEL ; METAL_COAT
|
||||
db -1
|
||||
; 35726
|
@ -1,9 +1,3 @@
|
||||
; The multiplier is divided by 10, so we can use values like 0.5.
|
||||
; All other cases are neutral (1x).
|
||||
SUPER_EFFECTIVE EQU 20
|
||||
NOT_VERY_EFFECTIVE EQU 05
|
||||
NO_EFFECT EQU 00
|
||||
|
||||
TypeMatchups: ; 34bb1
|
||||
; attacker, defender, *=
|
||||
db NORMAL, ROCK, NOT_VERY_EFFECTIVE
|
||||
@ -115,11 +109,11 @@ TypeMatchups: ; 34bb1
|
||||
db STEEL, ROCK, SUPER_EFFECTIVE
|
||||
db STEEL, STEEL, NOT_VERY_EFFECTIVE
|
||||
|
||||
db $fe ; end
|
||||
db -2 ; end
|
||||
|
||||
; Foresight removes Ghost's immunities.
|
||||
db NORMAL, GHOST, NO_EFFECT
|
||||
db FIGHTING, GHOST, NO_EFFECT
|
||||
|
||||
db $ff ; end (with Foresight)
|
||||
db -1 ; end (with Foresight)
|
||||
; 34cfd
|
@ -4,47 +4,47 @@ treemon_map: MACRO
|
||||
ENDM
|
||||
|
||||
TreeMonMaps: ; b825e
|
||||
treemon_map ROUTE_26, 4
|
||||
treemon_map ROUTE_27, 4
|
||||
treemon_map ROUTE_28, 0
|
||||
treemon_map ROUTE_29, 3
|
||||
treemon_map ROUTE_30, 3
|
||||
treemon_map ROUTE_31, 3
|
||||
treemon_map ROUTE_32, 4
|
||||
treemon_map ROUTE_33, 2
|
||||
treemon_map ROUTE_34, 3
|
||||
treemon_map ROUTE_35, 3
|
||||
treemon_map ROUTE_36, 3
|
||||
treemon_map ROUTE_37, 3
|
||||
treemon_map ROUTE_38, 3
|
||||
treemon_map ROUTE_39, 3
|
||||
treemon_map ROUTE_40, 0
|
||||
treemon_map ROUTE_41, 0
|
||||
treemon_map ROUTE_42, 2
|
||||
treemon_map ROUTE_43, 5
|
||||
treemon_map ROUTE_44, 1
|
||||
treemon_map ROUTE_45, 1
|
||||
treemon_map ROUTE_46, 1
|
||||
treemon_map NEW_BARK_TOWN, 0
|
||||
treemon_map CHERRYGROVE_CITY, 0
|
||||
treemon_map VIOLET_CITY, 0
|
||||
treemon_map AZALEA_TOWN, 2
|
||||
treemon_map CIANWOOD_CITY, 0
|
||||
treemon_map GOLDENROD_CITY, 0
|
||||
treemon_map OLIVINE_CITY, 0
|
||||
treemon_map ECRUTEAK_CITY, 0
|
||||
treemon_map MAHOGANY_TOWN, 0
|
||||
treemon_map LAKE_OF_RAGE, 5
|
||||
treemon_map BLACKTHORN_CITY, 0
|
||||
treemon_map SILVER_CAVE_OUTSIDE, 0
|
||||
treemon_map ILEX_FOREST, 6
|
||||
treemon_map ROUTE_26, TREEMON_SET_KANTO
|
||||
treemon_map ROUTE_27, TREEMON_SET_KANTO
|
||||
treemon_map ROUTE_28, TREEMON_SET_CITY
|
||||
treemon_map ROUTE_29, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_30, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_31, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_32, TREEMON_SET_KANTO
|
||||
treemon_map ROUTE_33, TREEMON_SET_AZALEA
|
||||
treemon_map ROUTE_34, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_35, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_36, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_37, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_38, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_39, TREEMON_SET_ROUTE
|
||||
treemon_map ROUTE_40, TREEMON_SET_CITY
|
||||
treemon_map ROUTE_41, TREEMON_SET_CITY
|
||||
treemon_map ROUTE_42, TREEMON_SET_AZALEA
|
||||
treemon_map ROUTE_43, TREEMON_SET_LAKE
|
||||
treemon_map ROUTE_44, TREEMON_SET_CANYON
|
||||
treemon_map ROUTE_45, TREEMON_SET_CANYON
|
||||
treemon_map ROUTE_46, TREEMON_SET_CANYON
|
||||
treemon_map NEW_BARK_TOWN, TREEMON_SET_CITY
|
||||
treemon_map CHERRYGROVE_CITY, TREEMON_SET_CITY
|
||||
treemon_map VIOLET_CITY, TREEMON_SET_CITY
|
||||
treemon_map AZALEA_TOWN, TREEMON_SET_AZALEA
|
||||
treemon_map CIANWOOD_CITY, TREEMON_SET_CITY
|
||||
treemon_map GOLDENROD_CITY, TREEMON_SET_CITY
|
||||
treemon_map OLIVINE_CITY, TREEMON_SET_CITY
|
||||
treemon_map ECRUTEAK_CITY, TREEMON_SET_CITY
|
||||
treemon_map MAHOGANY_TOWN, TREEMON_SET_CITY
|
||||
treemon_map LAKE_OF_RAGE, TREEMON_SET_LAKE
|
||||
treemon_map BLACKTHORN_CITY, TREEMON_SET_CITY
|
||||
treemon_map SILVER_CAVE_OUTSIDE, TREEMON_SET_CITY
|
||||
treemon_map ILEX_FOREST, TREEMON_SET_FOREST
|
||||
db -1
|
||||
; b82c5
|
||||
|
||||
RockMonMaps: ; b82c5
|
||||
treemon_map CIANWOOD_CITY, 7
|
||||
treemon_map ROUTE_40, 7
|
||||
treemon_map DARK_CAVE_VIOLET_ENTRANCE, 7
|
||||
treemon_map SLOWPOKE_WELL_B1F, 7
|
||||
treemon_map CIANWOOD_CITY, TREEMON_SET_ROCK
|
||||
treemon_map ROUTE_40, TREEMON_SET_ROCK
|
||||
treemon_map DARK_CAVE_VIOLET_ENTRANCE, TREEMON_SET_ROCK
|
||||
treemon_map SLOWPOKE_WELL_B1F, TREEMON_SET_ROCK
|
||||
db -1
|
||||
; b82d2
|
||||
|
@ -1,19 +1,21 @@
|
||||
TreeMons: ; b82e8
|
||||
dw TreeMons1
|
||||
dw TreeMons1
|
||||
dw TreeMons2
|
||||
dw TreeMons3
|
||||
dw TreeMons4
|
||||
dw TreeMons5
|
||||
dw TreeMons6
|
||||
dw RockMons
|
||||
dw TreeMons1
|
||||
; entries correspond to TREEMON_SET_* constants
|
||||
dw TreeMonSet_City
|
||||
dw TreeMonSet_Canyon
|
||||
dw TreeMonSet_Azalea
|
||||
dw TreeMonSet_Route
|
||||
dw TreeMonSet_Kanto
|
||||
dw TreeMonSet_Lake
|
||||
dw TreeMonSet_Forest
|
||||
dw TreeMonSet_Rock
|
||||
dw TreeMonSet_City
|
||||
|
||||
; Two tables each (common, rare).
|
||||
; Structure:
|
||||
; db %, species, level
|
||||
|
||||
TreeMons1: ; b82fa
|
||||
TreeMonSet_City:
|
||||
TreeMonSet_Canyon: ; b82fa
|
||||
; common
|
||||
db 50, SPEAROW, 10
|
||||
db 15, SPEAROW, 10
|
||||
@ -31,7 +33,7 @@ TreeMons1: ; b82fa
|
||||
db 5, AIPOM, 10
|
||||
db -1
|
||||
|
||||
TreeMons2: ; b8320
|
||||
TreeMonSet_Azalea: ; b8320
|
||||
; common
|
||||
db 50, SPEAROW, 10
|
||||
db 15, EKANS, 10
|
||||
@ -49,7 +51,7 @@ TreeMons2: ; b8320
|
||||
db 5, AIPOM, 10
|
||||
db -1
|
||||
|
||||
TreeMons3: ; b8346
|
||||
TreeMonSet_Route: ; b8346
|
||||
; common
|
||||
db 50, HOOTHOOT, 10
|
||||
db 15, SPINARAK, 10
|
||||
@ -67,7 +69,7 @@ TreeMons3: ; b8346
|
||||
db 5, EXEGGCUTE, 10
|
||||
db -1
|
||||
|
||||
TreeMons4: ; b836c
|
||||
TreeMonSet_Kanto: ; b836c
|
||||
; common
|
||||
db 50, HOOTHOOT, 10
|
||||
db 15, EKANS, 10
|
||||
@ -85,7 +87,7 @@ TreeMons4: ; b836c
|
||||
db 5, EXEGGCUTE, 10
|
||||
db -1
|
||||
|
||||
TreeMons5: ; b8392
|
||||
TreeMonSet_Lake: ; b8392
|
||||
; common
|
||||
db 50, HOOTHOOT, 10
|
||||
db 15, VENONAT, 10
|
||||
@ -103,7 +105,7 @@ TreeMons5: ; b8392
|
||||
db 5, EXEGGCUTE, 10
|
||||
db -1
|
||||
|
||||
TreeMons6: ; b83b8
|
||||
TreeMonSet_Forest: ; b83b8
|
||||
; common
|
||||
db 50, HOOTHOOT, 10
|
||||
db 15, PINECO, 10
|
||||
@ -121,7 +123,7 @@ TreeMons6: ; b83b8
|
||||
db 5, KAKUNA, 10
|
||||
db -1
|
||||
|
||||
RockMons: ; b83de
|
||||
TreeMonSet_Rock: ; b83de
|
||||
db 90, KRABBY, 15
|
||||
db 10, SHUCKLE, 15
|
||||
db -1
|
||||
|
@ -64,7 +64,7 @@ DoMove: ; 3402c
|
||||
inc hl
|
||||
ld [de], a
|
||||
inc de
|
||||
cp $ff
|
||||
cp -1
|
||||
jr nz, .GetMoveEffect
|
||||
|
||||
; Start at the first command.
|
||||
@ -138,7 +138,7 @@ BattleCommand_CheckTurn: ; 34084
|
||||
ld [AlreadyFailed], a
|
||||
ld [wSomeoneIsRampaging], a
|
||||
|
||||
ld a, 10 ; 1.0
|
||||
ld a, EFFECTIVE
|
||||
ld [TypeModifier], a
|
||||
|
||||
ld a, [hBattleTurn]
|
||||
@ -282,7 +282,7 @@ CheckPlayerTurn:
|
||||
|
||||
; 50% chance of hitting itself
|
||||
call BattleRandom
|
||||
cp $80
|
||||
cp 50 percent + 1
|
||||
jr nc, .not_confused
|
||||
|
||||
; clear confusion-dependent substatus
|
||||
@ -311,7 +311,7 @@ CheckPlayerTurn:
|
||||
|
||||
; 50% chance of infatuation
|
||||
call BattleRandom
|
||||
cp $80
|
||||
cp 50 percent + 1
|
||||
jr c, .not_infatuated
|
||||
|
||||
ld hl, InfatuationText
|
||||
@ -345,7 +345,7 @@ CheckPlayerTurn:
|
||||
|
||||
; 25% chance to be fully paralyzed
|
||||
call BattleRandom
|
||||
cp $3f
|
||||
cp 25 percent
|
||||
ret nc
|
||||
|
||||
ld hl, FullyParalyzedText
|
||||
@ -457,6 +457,8 @@ CheckEnemyTurn: ; 3421f
|
||||
ld hl, EnemyMonStatus
|
||||
bit FRZ, [hl]
|
||||
jr z, .not_frozen
|
||||
|
||||
; Flame Wheel and Sacred Fire thaw the user.
|
||||
ld a, [CurEnemyMove]
|
||||
cp FLAME_WHEEL
|
||||
jr z, .not_frozen
|
||||
@ -611,7 +613,7 @@ CheckEnemyTurn: ; 3421f
|
||||
|
||||
; 25% chance to be fully paralyzed
|
||||
call BattleRandom
|
||||
cp $3f
|
||||
cp 25 percent
|
||||
ret nc
|
||||
|
||||
ld hl, FullyParalyzedText
|
||||
@ -989,6 +991,7 @@ IgnoreSleepOnly: ; 3451f
|
||||
ld a, BATTLE_VARS_MOVE_ANIM
|
||||
call GetBattleVar
|
||||
|
||||
; Snore and Sleep Talk bypass sleep.
|
||||
cp SNORE
|
||||
jr z, .CheckSleep
|
||||
cp SLEEP_TALK
|
||||
@ -1172,7 +1175,7 @@ BattleCommand_DoTurn: ; 34555
|
||||
db EFFECT_ROLLOUT
|
||||
db EFFECT_BIDE
|
||||
db EFFECT_RAMPAGE
|
||||
db $ff
|
||||
db -1
|
||||
; 3460b
|
||||
|
||||
CheckMimicUsed: ; 3460b
|
||||
@ -1266,7 +1269,7 @@ BattleCommand_Critical: ; 34631
|
||||
ld a, BATTLE_VARS_MOVE_ANIM
|
||||
call GetBattleVar
|
||||
ld de, 1
|
||||
ld hl, .Criticals
|
||||
ld hl, CriticalHitMoves
|
||||
push bc
|
||||
call IsInArray
|
||||
pop bc
|
||||
@ -1288,7 +1291,7 @@ BattleCommand_Critical: ; 34631
|
||||
inc c
|
||||
|
||||
.Tally:
|
||||
ld hl, .Chances
|
||||
ld hl, CriticalHitChances
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
call BattleRandom
|
||||
@ -1298,12 +1301,7 @@ BattleCommand_Critical: ; 34631
|
||||
ld [CriticalHit], a
|
||||
ret
|
||||
|
||||
.Criticals:
|
||||
db KARATE_CHOP, RAZOR_WIND, RAZOR_LEAF, CRABHAMMER, SLASH, AEROBLAST, CROSS_CHOP, $ff
|
||||
.Chances:
|
||||
; 6.25% 12.1% 24.6% 33.2% 49.6% 49.6% 49.6%
|
||||
db $11, $20, $40, $55, $80, $80, $80
|
||||
; 0 1 2 3 4 5 6
|
||||
INCLUDE "data/battle/critical_hits.asm"
|
||||
; 346b2
|
||||
|
||||
|
||||
@ -1433,11 +1431,11 @@ BattleCommand_Stab: ; 346d2
|
||||
.TypesLoop:
|
||||
ld a, [hli]
|
||||
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, .end
|
||||
|
||||
; foresight
|
||||
cp $fe
|
||||
cp -2
|
||||
jr nz, .SkipForesightCheck
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call GetBattleVar
|
||||
@ -1562,9 +1560,9 @@ CheckTypeMatchup: ; 347d3
|
||||
ld hl, TypeMatchups
|
||||
.TypesLoop:
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, .End
|
||||
cp $fe
|
||||
cp -2
|
||||
jr nz, .Next
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call GetBattleVar
|
||||
@ -1640,7 +1638,7 @@ BattleCommand_ResetTypeMatchup: ; 34833
|
||||
|
||||
INCLUDE "engine/battle/ai/switch.asm"
|
||||
|
||||
INCLUDE "data/type_matchups.asm"
|
||||
INCLUDE "data/battle/type_matchups.asm"
|
||||
|
||||
BattleCommand_DamageVariation: ; 34cfd
|
||||
; damagevariation
|
||||
@ -1675,7 +1673,7 @@ BattleCommand_DamageVariation: ; 34cfd
|
||||
.loop
|
||||
call BattleRandom
|
||||
rrca
|
||||
cp $d9 ; 85%
|
||||
cp 85 percent + 1
|
||||
jr c, .loop
|
||||
|
||||
ld [hMultiplier], a
|
||||
@ -1756,7 +1754,7 @@ BattleCommand_CheckHit: ; 34d32
|
||||
|
||||
.skip_brightpowder
|
||||
ld a, b
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, .Hit
|
||||
|
||||
call BattleRandom
|
||||
@ -1954,7 +1952,7 @@ BattleCommand_CheckHit: ; 34d32
|
||||
|
||||
.skip_foresight_check
|
||||
; subtract evasion from 14
|
||||
ld a, 14
|
||||
ld a, MAX_STAT_LEVEL + 1
|
||||
sub c
|
||||
ld c, a
|
||||
; store the base move accuracy for math ops
|
||||
@ -1969,7 +1967,7 @@ BattleCommand_CheckHit: ; 34d32
|
||||
.accuracy_loop
|
||||
; look up the multiplier from the table
|
||||
push bc
|
||||
ld hl, .AccProb
|
||||
ld hl, AccuracyLevelMultipliers
|
||||
dec b
|
||||
sla b
|
||||
ld c, b
|
||||
@ -2013,21 +2011,7 @@ BattleCommand_CheckHit: ; 34d32
|
||||
ld [hl], a
|
||||
ret
|
||||
|
||||
.AccProb:
|
||||
db 33, 100 ; 33% -6
|
||||
db 36, 100 ; 36% -5
|
||||
db 43, 100 ; 43% -4
|
||||
db 50, 100 ; 50% -3
|
||||
db 60, 100 ; 60% -2
|
||||
db 75, 100 ; 75% -1
|
||||
db 1, 1 ; 100% 0
|
||||
db 133, 100 ; 133% +1
|
||||
db 166, 100 ; 166% +2
|
||||
db 2, 1 ; 200% +3
|
||||
db 233, 100 ; 233% +4
|
||||
db 133, 50 ; 266% +5
|
||||
db 3, 1 ; 300% +6
|
||||
|
||||
INCLUDE "data/battle/accuracy_multipliers.asm"
|
||||
; 34ecc
|
||||
|
||||
|
||||
@ -2199,7 +2183,7 @@ BattleCommand_HitTargetNoSub: ; 34f60
|
||||
xor 1
|
||||
ld [wKickCounter], a
|
||||
ld a, [de]
|
||||
cp $1
|
||||
cp 1
|
||||
push af
|
||||
ld a, BATTLE_VARS_MOVE_ANIM
|
||||
call GetBattleVar
|
||||
@ -2438,7 +2422,7 @@ GetFailureResultText: ; 350e4
|
||||
ld hl, AttackMissedText
|
||||
ld de, AttackMissed2Text
|
||||
ld a, [CriticalHit]
|
||||
cp $ff
|
||||
cp -1
|
||||
jr nz, .got_text
|
||||
ld hl, UnaffectedText
|
||||
.got_text
|
||||
@ -3519,7 +3503,7 @@ BattleCommand_DamageCalc: ; 35612
|
||||
|
||||
.NextItem:
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, .DoneItem
|
||||
|
||||
; Item effect
|
||||
@ -3657,26 +3641,7 @@ BattleCommand_DamageCalc: ; 35612
|
||||
; 35703
|
||||
|
||||
|
||||
TypeBoostItems: ; 35703
|
||||
db HELD_NORMAL_BOOST, NORMAL ; Pink/Polkadot Bow
|
||||
db HELD_FIGHTING_BOOST, FIGHTING ; Blackbelt
|
||||
db HELD_FLYING_BOOST, FLYING ; Sharp Beak
|
||||
db HELD_POISON_BOOST, POISON ; Poison Barb
|
||||
db HELD_GROUND_BOOST, GROUND ; Soft Sand
|
||||
db HELD_ROCK_BOOST, ROCK ; Hard Stone
|
||||
db HELD_BUG_BOOST, BUG ; Silverpowder
|
||||
db HELD_GHOST_BOOST, GHOST ; Spell Tag
|
||||
db HELD_FIRE_BOOST, FIRE ; Charcoal
|
||||
db HELD_WATER_BOOST, WATER ; Mystic Water
|
||||
db HELD_GRASS_BOOST, GRASS ; Miracle Seed
|
||||
db HELD_ELECTRIC_BOOST, ELECTRIC ; Magnet
|
||||
db HELD_PSYCHIC_BOOST, PSYCHIC ; Twistedspoon
|
||||
db HELD_ICE_BOOST, ICE ; Nevermeltice
|
||||
db HELD_DRAGON_BOOST, DRAGON ; Dragon Scale
|
||||
db HELD_DARK_BOOST, DARK ; Blackglasses
|
||||
db HELD_STEEL_BOOST, STEEL ; Metal Coat
|
||||
db $ff
|
||||
; 35726
|
||||
INCLUDE "data/battle/type_boost_items.asm"
|
||||
|
||||
|
||||
BattleCommand_ConstantDamage: ; 35726
|
||||
@ -4671,7 +4636,7 @@ BattleCommand_FalseSwipe: ; 35c94
|
||||
ld [de], a
|
||||
.okay
|
||||
ld a, [CriticalHit]
|
||||
cp $2
|
||||
cp 2
|
||||
jr nz, .carry
|
||||
xor a
|
||||
ld [CriticalHit], a
|
||||
@ -5049,7 +5014,7 @@ BattleCommand_SleepTarget: ; 35e5c
|
||||
jr nz, .dont_fail
|
||||
|
||||
call BattleRandom
|
||||
cp $40 ; 25%
|
||||
cp 25 percent + 1 ; 25% chance AI fails
|
||||
ret c
|
||||
|
||||
.dont_fail
|
||||
@ -5149,7 +5114,7 @@ BattleCommand_Poison: ; 35f2c
|
||||
jr nz, .mimic_random
|
||||
|
||||
call BattleRandom
|
||||
cp $40 ; 25% chance AI fails
|
||||
cp 25 percent + 1 ; 25% chance AI fails
|
||||
jr c, .failed
|
||||
|
||||
.mimic_random
|
||||
@ -5827,7 +5792,7 @@ BattleCommand_StatDown: ; 362e3
|
||||
inc b
|
||||
|
||||
.ComputerMiss:
|
||||
; Computer opponents have a 1/4 chance of failing.
|
||||
; Computer opponents have a 25% chance of failing.
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .DidntMiss
|
||||
@ -5852,7 +5817,7 @@ BattleCommand_StatDown: ; 362e3
|
||||
jr z, .DidntMiss
|
||||
|
||||
call BattleRandom
|
||||
cp $40
|
||||
cp 25 percent + 1 ; 25% chance AI fails
|
||||
jr c, .Failed
|
||||
|
||||
.DidntMiss:
|
||||
@ -6104,7 +6069,7 @@ BattleCommand_StatDownFailText: ; 3646a
|
||||
|
||||
|
||||
GetStatName: ; 3648f
|
||||
ld hl, .names
|
||||
ld hl, StatNames
|
||||
ld c, "@"
|
||||
.CheckName:
|
||||
dec b
|
||||
@ -6120,33 +6085,10 @@ GetStatName: ; 3648f
|
||||
ld bc, StringBuffer3 - StringBuffer2
|
||||
jp CopyBytes
|
||||
|
||||
.names
|
||||
db "ATTACK@"
|
||||
db "DEFENSE@"
|
||||
db "SPEED@"
|
||||
db "SPCL.ATK@"
|
||||
db "SPCL.DEF@"
|
||||
db "ACCURACY@"
|
||||
db "EVASION@"
|
||||
db "ABILITY@"
|
||||
; 364e6
|
||||
INCLUDE "data/battle/stat_names.asm"
|
||||
|
||||
|
||||
StatLevelMultipliers: ; 364e6
|
||||
db 25, 100 ; 0.25x
|
||||
db 28, 100 ; 0.28x
|
||||
db 33, 100 ; 0.33x
|
||||
db 40, 100 ; 0.40x
|
||||
db 50, 100 ; 0.50x
|
||||
db 66, 100 ; 0.66x
|
||||
db 1, 1 ; 1.00x
|
||||
db 15, 10 ; 1.50x
|
||||
db 2, 1 ; 2.00x
|
||||
db 25, 10 ; 2.50x
|
||||
db 3, 1 ; 3.00x
|
||||
db 35, 10 ; 3.50x
|
||||
db 4, 1 ; 4.00x
|
||||
; 36500
|
||||
INCLUDE "data/battle/stat_multipliers.asm"
|
||||
|
||||
|
||||
BattleCommand_AllStatsUp: ; 36500
|
||||
|
@ -1,13 +1,11 @@
|
||||
ReturnFromMapSetupScript:: ; b8000
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
; For some reson, GameFreak chose to use a farcall here instead of just falling through.
|
||||
; No other function in the game references the function at 2E:400A, here labeled
|
||||
; ReturnFromMapSetupScript.inefficient_farcall.
|
||||
farcall .inefficient_farcall ; this is a waste of 6 ROM bytes and 6 stack bytes
|
||||
ret
|
||||
; b800a
|
||||
|
||||
; should have just been a fallthrough
|
||||
.inefficient_farcall ; b800a
|
||||
ld a, [MapGroup]
|
||||
ld b, a
|
||||
@ -70,6 +68,7 @@ ReturnFromMapSetupScript:: ; b8000
|
||||
; b8070
|
||||
|
||||
.CheckSpecialMap: ; b8070
|
||||
; These landmarks do not get pop-up signs.
|
||||
cp -1
|
||||
ret z
|
||||
cp SPECIAL_MAP
|
||||
@ -401,6 +400,7 @@ RockMonEncounter: ; b8219
|
||||
call GetTreeMons
|
||||
jr nc, .no_battle
|
||||
|
||||
; 40% chance of an encounter
|
||||
ld a, 10
|
||||
call RandomRange
|
||||
cp 4
|
||||
@ -461,7 +461,7 @@ GetTreeMons: ; b82d2
|
||||
; Return the address of TreeMon table a in hl.
|
||||
; Return nc if table a doesn't exist.
|
||||
|
||||
cp 8
|
||||
cp NUM_TREEMON_SETS
|
||||
jr nc, .quit
|
||||
|
||||
and a
|
||||
@ -491,15 +491,16 @@ GetTreeMon: ; b83e5
|
||||
push hl
|
||||
call GetTreeScore
|
||||
pop hl
|
||||
and a
|
||||
and a ; TREEMON_SCORE_BAD
|
||||
jr z, .bad
|
||||
cp 1
|
||||
cp TREEMON_SCORE_GOOD
|
||||
jr z, .good
|
||||
cp 2
|
||||
cp TREEMON_SCORE_RARE
|
||||
jr z, .rare
|
||||
ret
|
||||
|
||||
.bad
|
||||
; 10% chance of an encounter
|
||||
ld a, 10
|
||||
call RandomRange
|
||||
and a
|
||||
@ -507,6 +508,7 @@ GetTreeMon: ; b83e5
|
||||
jr SelectTreeMon
|
||||
|
||||
.good
|
||||
; 50% chance of an encounter
|
||||
ld a, 10
|
||||
call RandomRange
|
||||
cp 5
|
||||
@ -514,6 +516,7 @@ GetTreeMon: ; b83e5
|
||||
jr SelectTreeMon
|
||||
|
||||
.rare
|
||||
; 80% chance of an encounter
|
||||
ld a, 10
|
||||
call RandomRange
|
||||
cp 8
|
||||
@ -542,7 +545,7 @@ SelectTreeMon: ; b841f
|
||||
|
||||
.ok
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, NoTreeMon
|
||||
|
||||
ld a, [hli]
|
||||
@ -575,15 +578,15 @@ GetTreeScore: ; b8443
|
||||
jr c, .good
|
||||
|
||||
.bad
|
||||
xor a
|
||||
xor a ; TREEMON_SCORE_BAD
|
||||
ret
|
||||
|
||||
.good
|
||||
ld a, 1
|
||||
ld a, TREEMON_SCORE_GOOD
|
||||
ret
|
||||
|
||||
.rare
|
||||
ld a, 2
|
||||
ld a, TREEMON_SCORE_RARE
|
||||
ret
|
||||
; b8466
|
||||
|
||||
|
@ -2045,12 +2045,12 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb
|
||||
|
||||
; If any party Pokemon was introduced in the generation 2 games, don't let it in.
|
||||
ld hl, PartySpecies
|
||||
ld b, PARTY_LENGTH ; 6
|
||||
ld b, PARTY_LENGTH
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp -1
|
||||
jr z, .checkitem
|
||||
cp CHIKORITA ; MEW + 1 ; 151 + 1
|
||||
cp MEW + 1
|
||||
jr nc, .mon_too_new
|
||||
dec b
|
||||
jr nz, .loop
|
||||
|
@ -174,8 +174,11 @@ LoadWarpData: ; 1046c6
|
||||
call GetAnyMapEnvironment
|
||||
call CheckIndoorMap
|
||||
ret nz
|
||||
|
||||
; MOUNT_MOON_SQUARE and TIN_TOWER_ROOF are outdoor maps within indoor maps.
|
||||
; Dig and Escape Rope should not take you to them.
|
||||
ld a, [wPrevMapGroup]
|
||||
cp GROUP_MOUNT_MOON_SQUARE
|
||||
cp GROUP_MOUNT_MOON_SQUARE ; GROUP_TIN_TOWER_ROOF
|
||||
jr nz, .not_mt_moon_or_tin_tower
|
||||
ld a, [wPrevMapNumber]
|
||||
cp MAP_MOUNT_MOON_SQUARE
|
||||
@ -183,6 +186,7 @@ LoadWarpData: ; 1046c6
|
||||
cp MAP_TIN_TOWER_ROOF
|
||||
ret z
|
||||
.not_mt_moon_or_tin_tower
|
||||
|
||||
ld a, [wPrevWarp]
|
||||
ld [wDigWarpNumber], a
|
||||
ld a, [wPrevMapGroup]
|
||||
@ -206,6 +210,8 @@ LoadWarpData: ; 1046c6
|
||||
ld b, a
|
||||
ld a, [wNextMapNumber]
|
||||
ld c, a
|
||||
|
||||
; Respawn in Pokémon Centers.
|
||||
call GetAnyMapTileset
|
||||
ld a, c
|
||||
cp TILESET_POKECENTER
|
||||
@ -214,6 +220,7 @@ LoadWarpData: ; 1046c6
|
||||
jr z, .pokecenter_pokecom
|
||||
ret
|
||||
.pokecenter_pokecom
|
||||
|
||||
ld a, [wPrevMapGroup]
|
||||
ld [wLastSpawnMapGroup], a
|
||||
ld a, [wPrevMapNumber]
|
||||
|
@ -1429,6 +1429,7 @@ LoadTilesetGFX:: ; 2821
|
||||
pop af
|
||||
ld [rSVBK], a
|
||||
|
||||
; These tilesets support dynamic per-mapgroup roof tiles.
|
||||
ld a, [wTileset]
|
||||
cp TILESET_JOHTO_1
|
||||
jr z, .load_roof
|
||||
|
Loading…
Reference in New Issue
Block a user