mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-03-21 17:45:52 -05:00
* Split bank $0f into engine/battle/core.asm and engine/overworld/wildmons.asm * Split wildmon probabilities into separate data/wild/probabilities.inc file for consistency
This commit is contained in:
parent
7f3e77acbe
commit
452a322140
|
|
@ -234,13 +234,19 @@ DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP
|
|||
const BATTLEACTION_SWITCH4
|
||||
const BATTLEACTION_SWITCH5
|
||||
const BATTLEACTION_SWITCH6
|
||||
const BATTLEACTION_A
|
||||
const BATTLEACTION_B
|
||||
const BATTLEACTION_C
|
||||
const BATTLEACTION_D
|
||||
const_skip
|
||||
const_skip
|
||||
const_skip
|
||||
const BATTLEACTION_SKIPTURN
|
||||
const BATTLEACTION_STRUGGLE
|
||||
const BATTLEACTION_FORFEIT
|
||||
|
||||
; wBattlePlayerAction
|
||||
const_def
|
||||
const BATTLEPLAYERACTION_USEMOVE
|
||||
const BATTLEPLAYERACTION_USEITEM
|
||||
const BATTLEPLAYERACTION_SWITCH
|
||||
|
||||
; wBattleEnded
|
||||
const_def
|
||||
const WIN
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
; 6 - ??? E - unused
|
||||
; 7 - Warps F - unused
|
||||
|
||||
; TODO: Replace all instances of COLLISION with COLL for consistency with pokegold.
|
||||
|
||||
DEF COLLISION_TYPE_MASK EQU $f0
|
||||
DEF COLLISION_SUBTYPE_MASK EQU $07
|
||||
DEF COLLISION_WATER_SUBTYPE_MASK EQU $03
|
||||
|
|
@ -42,7 +44,7 @@ DEF OLD_COLLISION_WATER2_S EQU $40
|
|||
|
||||
DEF OLD_COLLISION_ROCK EQU $51
|
||||
|
||||
DEF OLD_COLLISION_CARPED EQU $60
|
||||
DEF OLD_COLLISION_CARPET EQU $60
|
||||
DEF OLD_COLLISION_DOOR EQU $61
|
||||
|
||||
DEF OLD_COLLISION_SIGNPOST EQU $70
|
||||
|
|
@ -57,14 +59,17 @@ DEF OLD_COLLISION_GRASS EQU $82
|
|||
|
||||
DEF COLLISION_WALKABLE EQU $00
|
||||
DEF COLLISION_SOLID EQU $07
|
||||
DEF COLLISION_08 EQU $08 ; triggers wild encounters
|
||||
DEF COLLISION_CUT_TREE EQU $12
|
||||
DEF COLLISION_GRASS EQU $18
|
||||
|
||||
; water collisions
|
||||
|
||||
DEF COLLISION_WATER EQU $21
|
||||
DEF COLLISION_WATER_21 EQU $21
|
||||
DEF COLLISION_WATERFALL EQU $22
|
||||
DEF COLLISION_WATER_SOLID EQU $27
|
||||
DEF COLLISION_WATER_28 EQU $28 ; triggers wild encounters
|
||||
DEF COLLISION_WATER EQU $29
|
||||
|
||||
; water collisions 2
|
||||
DEF COLLISION_WATER2_E EQU $30
|
||||
|
|
@ -81,6 +86,13 @@ DEF COLLISION_LAND_N EQU $43
|
|||
DEF COLLISION_LAND_S EQU $44
|
||||
; $45..$47 will behave like COLLISION_LAND_E
|
||||
|
||||
; All of these are listed in CheckGrassCollision. That's about all we know.
|
||||
DEF COLLISION_48 EQU $48
|
||||
DEF COLLISION_49 EQU $49
|
||||
DEF COLLISION_4A EQU $4A
|
||||
DEF COLLISION_4B EQU $4B
|
||||
DEF COLLISION_4C EQU $4C
|
||||
|
||||
; land collisions 2
|
||||
DEF COLLISION_LAND2_E EQU $50
|
||||
DEF COLLISION_LAND2_W EQU $51
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ DEF ITEM_X_ATTACK_RED EQU $41
|
|||
DEF ITEM_X_DEFEND_RED EQU $42
|
||||
DEF ITEM_X_SPEED_RED EQU $43
|
||||
DEF ITEM_X_SPECIAL_RED EQU $44
|
||||
DEF ITEM_EXP_ALL_RED EQU $4b
|
||||
DEF ITEM_ETHER_RED EQU $50
|
||||
DEF ITEM_MAX_ETHER_RED EQU $51
|
||||
DEF ITEM_ELIXER_RED EQU $52
|
||||
|
|
|
|||
|
|
@ -120,11 +120,13 @@ DEF NUM_HOF_TEAMS EQU 30
|
|||
|
||||
; wild data
|
||||
|
||||
DEF NUM_GRASSMON EQU 6 ; data/wild/*_grass.asm table size
|
||||
DEF NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size
|
||||
DEF NUM_GRASSMON EQU 18 ; data/wild/*_grass.asm table size
|
||||
|
||||
DEF GRASS_WILDDATA_DAYBLOCK_START EQU 3 ;
|
||||
DEF GRASS_WILDDATA_NITEBLOCK_START EQU 7 ; the slot in GrassMonProbTable to start at
|
||||
|
||||
DEF GRASS_WILDDATA_LENGTH EQU (NUM_GRASSMON * 2) + 3 + 2
|
||||
|
||||
DEF GRASS_WILDDATA_LENGTH EQU (NUM_GRASSMON * 2 + 1) * 3 + 2
|
||||
DEF WATER_WILDDATA_LENGTH EQU (NUM_WATERMON * 2 + 1) * 1 + 2
|
||||
|
||||
DEF BASE_HAPPINESS EQU 70
|
||||
|
||||
|
|
|
|||
|
|
@ -146,3 +146,5 @@ ENDM
|
|||
trainerclass TRAINER_ELITE_FOUR_F ; 40
|
||||
|
||||
DEF NUM_TRAINER_CLASSES EQU __trainer_class__
|
||||
|
||||
DEF TRAINER_OPP_RIVAL3_RED EQU $2b
|
||||
|
|
|
|||
9
data/battle/held_stat_up.inc
Normal file
9
data/battle/held_stat_up.inc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
HeldStatUpItems:
|
||||
db HELD_ATTACK_UP, EFFECT_ATTACK_UP
|
||||
db HELD_DEFENSE_UP, EFFECT_DEFENSE_UP
|
||||
db HELD_SPEED_UP, EFFECT_SPEED_UP
|
||||
db HELD_SP_ATTACK_UP, EFFECT_SP_ATK_UP
|
||||
db HELD_SP_DEFENSE_UP, EFFECT_SP_DEF_UP
|
||||
db HELD_ACCURACY_UP, EFFECT_ACCURACY_UP
|
||||
db HELD_EVASION_UP, EFFECT_EVASION_UP
|
||||
db -1 ; end
|
||||
|
|
@ -44,12 +44,12 @@ GiveItemPredef::
|
|||
add_predef PrintMoveDescription
|
||||
add_predef UpdatePlayerHUD
|
||||
add_predef PlaceGraphic
|
||||
add_predef Function3f068 ; 20
|
||||
add_predef Old_ScaleSpriteByTwo ; 20
|
||||
add_predef LoadMonBackPic
|
||||
add_predef AnyPartyAlive
|
||||
add_predef CheckPlayerPartyForFitMon
|
||||
add_predef UpdateEnemyHUD
|
||||
add_predef DoubleOrHalveSelectedStats_Old
|
||||
add_predef Function3ef19
|
||||
add_predef StartBattle
|
||||
add_predef CalcAndPlaceExpBar
|
||||
add_predef GetBattleMonBackpic
|
||||
add_predef GetEnemyMonFrontpic ; 28
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
INCLUDE "constants.asm"
|
||||
|
||||
SECTION "data/wild.asm", ROMX
|
||||
; TODO: These aren't bespoke morning/day/night chunks. Find a way to indicate this.
|
||||
|
||||
GrassWildMons::
|
||||
|
||||
24
data/wild/probabilities.inc
Normal file
24
data/wild/probabilities.inc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
MACRO mon_prob
|
||||
; percent, index
|
||||
db \1, \2 * 2
|
||||
ENDM
|
||||
|
||||
GrassMonProbTable:
|
||||
mon_prob 1, 0 ; start of morning block (#1)
|
||||
mon_prob 4, 1 ;
|
||||
mon_prob 5, 2 ;
|
||||
mon_prob 1, 3 ; start of day block (#4)
|
||||
mon_prob 4, 4 ;
|
||||
mon_prob 15, 5 ;
|
||||
mon_prob 20, 6 ;
|
||||
mon_prob 5, 7 ; start of night block (#8)
|
||||
mon_prob 10, 8 ;
|
||||
mon_prob 20, 9 ;
|
||||
mon_prob 15, 10 ; end of morning block (#11)
|
||||
mon_prob 5, 11 ;
|
||||
mon_prob 5, 12 ; end of day block (#13)
|
||||
mon_prob 20, 13 ;
|
||||
mon_prob 10, 14 ;
|
||||
mon_prob 5, 15 ;
|
||||
mon_prob 4, 16 ;
|
||||
mon_prob 1, 17 ; end of night block (#18)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -238,9 +238,9 @@ BattleCommand_CheckTurn:
|
|||
; Repurposed as hardcoded turn handling. Useless as a command.
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
jr z, .go
|
||||
ld a, [wCurEnemySelectedMove]
|
||||
ld a, [wCurEnemyMove]
|
||||
|
||||
.go
|
||||
inc a
|
||||
|
|
@ -289,14 +289,14 @@ BattleCommand_CheckTurn:
|
|||
call PrintText
|
||||
|
||||
; Snore and Sleep Talk bypass sleep.
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
cp MOVE_SNORE
|
||||
jr z, .not_asleep
|
||||
cp MOVE_SLEEP_TALK
|
||||
jr z, .not_asleep
|
||||
|
||||
xor a
|
||||
ld [wCurPlayerMove], a
|
||||
ld [wLastPlayerCounterMove], a
|
||||
jp EndTurn
|
||||
|
||||
.not_asleep
|
||||
|
|
@ -305,7 +305,7 @@ BattleCommand_CheckTurn:
|
|||
jr z, .not_frozen
|
||||
|
||||
; Flame Wheel and Sacred Fire thaw the user.
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
cp MOVE_FLAME_WHEEL
|
||||
jr z, .not_frozen
|
||||
cp MOVE_SACRED_FIRE
|
||||
|
|
@ -314,7 +314,7 @@ BattleCommand_CheckTurn:
|
|||
ld hl, FrozenSolidText
|
||||
call PrintText
|
||||
xor a
|
||||
ld [wCurPlayerMove], a
|
||||
ld [wLastPlayerCounterMove], a
|
||||
jp EndTurn
|
||||
|
||||
.not_frozen
|
||||
|
|
@ -323,7 +323,7 @@ BattleCommand_CheckTurn:
|
|||
jp z, .not_trapped
|
||||
|
||||
; Rapid Spin breaks the player free of trapping moves
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
cp MOVE_RAPID_SPIN
|
||||
jp z, .not_trapped
|
||||
ld hl, CantMoveText
|
||||
|
|
@ -428,7 +428,7 @@ BattleCommand_CheckTurn:
|
|||
and a
|
||||
jr z, .no_disabled_move
|
||||
|
||||
ld hl, wCurPlayerSelectedMove
|
||||
ld hl, wCurPlayerMove
|
||||
cp [hl]
|
||||
jr nz, .no_disabled_move
|
||||
|
||||
|
|
@ -504,14 +504,14 @@ CheckEnemyTurn:
|
|||
|
||||
.fast_asleep
|
||||
; Snore and Sleep Talk bypass sleep.
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
cp MOVE_SNORE
|
||||
jr z, .not_asleep
|
||||
cp MOVE_SLEEP_TALK
|
||||
jr z, .not_asleep
|
||||
|
||||
xor a
|
||||
ld [wCurEnemyMove], a
|
||||
ld [wLastEnemyCounterMove], a
|
||||
jp EndTurn
|
||||
|
||||
.not_asleep
|
||||
|
|
@ -520,7 +520,7 @@ CheckEnemyTurn:
|
|||
jr z, .not_frozen
|
||||
|
||||
; Flame Wheel and Sacred Fire thaw the user.
|
||||
ld a, [wCurEnemySelectedMove]
|
||||
ld a, [wCurEnemyMove]
|
||||
cp MOVE_FLAME_WHEEL
|
||||
jr z, .not_frozen
|
||||
cp MOVE_SACRED_FIRE
|
||||
|
|
@ -529,7 +529,7 @@ CheckEnemyTurn:
|
|||
ld hl, FrozenSolidText
|
||||
call PrintText
|
||||
xor a
|
||||
ld [wCurEnemyMove], a
|
||||
ld [wLastEnemyCounterMove], a
|
||||
jp EndTurn
|
||||
|
||||
.not_frozen
|
||||
|
|
@ -538,7 +538,7 @@ CheckEnemyTurn:
|
|||
jp z, .not_trapped
|
||||
|
||||
; Rapid Spin breaks the player free of trapping moves
|
||||
ld a, [wCurEnemySelectedMove]
|
||||
ld a, [wCurEnemyMove]
|
||||
cp MOVE_RAPID_SPIN
|
||||
jp z, .not_trapped
|
||||
ld hl, CantMoveText
|
||||
|
|
@ -657,7 +657,7 @@ CheckEnemyTurn:
|
|||
and a
|
||||
jr z, .no_disabled_move
|
||||
|
||||
ld hl, wCurEnemySelectedMove
|
||||
ld hl, wCurEnemyMove
|
||||
cp [hl]
|
||||
jr nz, .no_disabled_move
|
||||
|
||||
|
|
@ -800,12 +800,12 @@ InfatuationText:
|
|||
prompt
|
||||
|
||||
MoveDisabled:
|
||||
ld hl, wCurPlayerSelectedMove
|
||||
ld hl, wCurPlayerMove
|
||||
ld de, wPlayerSubStatus3
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .ok
|
||||
inc hl ; wCurEnemySelectedMove
|
||||
inc hl ; wCurEnemyMove
|
||||
ld de, wEnemySubStatus3
|
||||
|
||||
.ok
|
||||
|
|
@ -1084,7 +1084,7 @@ BattleCommand_CheckObedience:
|
|||
ld hl, wBattleMonMoves
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wCurPlayerSelectedMove], a
|
||||
ld [wCurPlayerMove], a
|
||||
call UpdateMoveData
|
||||
|
||||
.EndDisobedience
|
||||
|
|
@ -1125,10 +1125,10 @@ UsedMoveText:
|
|||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld a, [wPlayerMoveStruct]
|
||||
ld hl, wCurPlayerMove
|
||||
ld hl, wLastPlayerCounterMove
|
||||
jr z, .playerTurn
|
||||
ld a, [wEnemyMoveStruct]
|
||||
ld hl, wCurEnemyMove
|
||||
ld hl, wLastEnemyCounterMove
|
||||
|
||||
.playerTurn:
|
||||
ld [hl], a
|
||||
|
|
@ -1343,12 +1343,12 @@ MoveGrammar:
|
|||
BattleCommand_DoTurn:
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
ld hl, wBattleMonPP
|
||||
ld de, wPlayerSubStatus3
|
||||
jr z, .proceed
|
||||
|
||||
ld a, [wCurEnemySelectedMove]
|
||||
ld a, [wCurEnemyMove]
|
||||
ld hl, wEnemyMonPP
|
||||
ld de, wEnemySubStatus3
|
||||
|
||||
|
|
@ -2003,12 +2003,12 @@ BattleCommand_CheckHit:
|
|||
bit SUBSTATUS_INVULNERABLE, [hl]
|
||||
jp z, .EnemyMonMist
|
||||
|
||||
ld hl, wCurEnemyMove
|
||||
ld hl, wLastEnemyCounterMove
|
||||
ld de, wPlayerMoveStruct
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .fly_moves
|
||||
ld hl, wCurPlayerMove
|
||||
ld hl, wLastPlayerCounterMove
|
||||
ld de, wEnemyMoveStruct
|
||||
|
||||
.fly_moves:
|
||||
|
|
@ -2553,7 +2553,7 @@ Unreferenced_Gen1HealEffect:
|
|||
.updateHPBar:
|
||||
ld [wWhichHPBar], a
|
||||
predef UpdateHPBar
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
ld hl, Unused_RegainedHealthText
|
||||
jp PrintText
|
||||
|
|
@ -3146,7 +3146,7 @@ GetEnemyMonStat:
|
|||
push de
|
||||
push bc
|
||||
ld a, [wLinkMode]
|
||||
cp 3 ; LINK_COLOSSEUM
|
||||
cp LINK_COLOSSEUM
|
||||
jr nz, .notLinkBattle
|
||||
|
||||
ld hl, wOTPartyMon1MaxHP
|
||||
|
|
@ -3563,10 +3563,10 @@ INCLUDE "data/moves/flail_reversal_power.inc"
|
|||
BattleCommand_Counter:
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld hl, wCurEnemySelectedMove
|
||||
ld hl, wCurEnemyMove
|
||||
ld de, wEnemyMoveStructPower
|
||||
jr z, .got_enemy_move
|
||||
ld hl, wCurPlayerSelectedMove
|
||||
ld hl, wCurPlayerMove
|
||||
ld de, wPlayerMoveStructPower
|
||||
|
||||
.got_enemy_move
|
||||
|
|
@ -3611,11 +3611,11 @@ BattleCommand_Encore:
|
|||
and a
|
||||
ld hl, wEnemySubStatus5
|
||||
ld de, wEnemyEncoreCount
|
||||
ld a, [wCurEnemyMove]
|
||||
ld a, [wLastEnemyCounterMove]
|
||||
jr z, .ok
|
||||
ld hl, wPlayerSubStatus5
|
||||
ld de, wPlayerEncoreCount
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
|
||||
.ok
|
||||
; Struggle, Mirror Move, and Encore itself can be encored, unlike the final game.
|
||||
|
|
@ -3857,7 +3857,7 @@ TookAimText:
|
|||
|
||||
BattleCommand_Sketch:
|
||||
ld a, [wLinkMode]
|
||||
cp 3 ; LINK_COLOSSEUM
|
||||
cp LINK_COLOSSEUM
|
||||
jr z, .failed
|
||||
|
||||
call CheckSubstituteOpp
|
||||
|
|
@ -3870,7 +3870,7 @@ BattleCommand_Sketch:
|
|||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [wCurEnemyMove]
|
||||
ld a, [wLastEnemyCounterMove]
|
||||
ld [hl], a
|
||||
|
||||
ld hl, wPartyMon1Moves
|
||||
|
|
@ -3928,12 +3928,12 @@ BattleCommand_SleepTalk:
|
|||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld hl, wBattleMonMoves + 1
|
||||
ld de, wCurPlayerSelectedMove
|
||||
ld de, wCurPlayerMove
|
||||
ld bc, wPlayerMoveStruct
|
||||
ld a, [wBattleMonStatus]
|
||||
jr z, .go
|
||||
ld hl, wEnemyMonMoves + 1
|
||||
ld de, wCurEnemySelectedMove
|
||||
ld de, wCurEnemyMove
|
||||
ld bc, wEnemyMoveStruct
|
||||
ld a, [wEnemyMonStatus]
|
||||
|
||||
|
|
@ -4019,11 +4019,11 @@ BattleCommand_Spite:
|
|||
and a
|
||||
ld hl, wEnemyMonMoves
|
||||
ld de, wOTPartyMon1PP
|
||||
ld a, [wCurEnemyMove]
|
||||
ld a, [wLastEnemyCounterMove]
|
||||
jr z, .got_moves
|
||||
ld hl, wBattleMonMoves
|
||||
ld de, wPartyMon1PP
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
|
||||
.got_moves
|
||||
and a
|
||||
|
|
@ -4241,7 +4241,7 @@ DoEnemyDamage:
|
|||
ld [wWhichHPBar], a
|
||||
predef UpdateHPBar
|
||||
.did_no_damage:
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
DoPlayerDamage:
|
||||
|
|
@ -4296,7 +4296,7 @@ DoPlayerDamage:
|
|||
predef UpdateHPBar
|
||||
|
||||
.did_no_damage:
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
DoSubstituteDamage:
|
||||
|
|
@ -4352,7 +4352,7 @@ DoSubstituteDamage:
|
|||
.got_move_effect:
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
SubTookDamageText:
|
||||
|
|
@ -4372,18 +4372,18 @@ UpdateMoveData:
|
|||
|
||||
ld hl, wEnemySubStatus5
|
||||
ld de, wEnemyMoveStruct
|
||||
ld bc, wCurEnemyMove
|
||||
ld bc, wLastEnemyCounterMove
|
||||
push bc
|
||||
ld a, [wCurEnemySelectedMove]
|
||||
ld a, [wCurEnemyMove]
|
||||
ld b, a
|
||||
jr .get_move_data
|
||||
|
||||
.player:
|
||||
ld hl, wPlayerSubStatus5
|
||||
ld de, wPlayerMoveStruct
|
||||
ld bc, wCurPlayerMove
|
||||
ld bc, wLastPlayerCounterMove
|
||||
push bc
|
||||
ld a, [wCurPlayerSelectedMove]
|
||||
ld a, [wCurPlayerMove]
|
||||
ld b, a
|
||||
ld a, [wPlayerDebugSelectedMove]
|
||||
and a
|
||||
|
|
@ -4463,7 +4463,7 @@ Unreferenced_OldSleepTarget:
|
|||
ld [de], a
|
||||
call PlayDamageAnim
|
||||
push de
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
|
||||
ld hl, FellAsleepText
|
||||
|
|
@ -4487,9 +4487,9 @@ Unreferenced_OldSleepTarget:
|
|||
and ~SLP
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
FellAsleepText:
|
||||
|
|
@ -4558,7 +4558,7 @@ BattleCommand_SleepTarget:
|
|||
ld [de], a
|
||||
call PlayDamageAnim
|
||||
push de
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
|
||||
ld hl, FellAsleepText
|
||||
|
|
@ -4580,9 +4580,9 @@ BattleCommand_SleepTarget:
|
|||
and ~SLP
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
.fail:
|
||||
|
|
@ -4630,7 +4630,7 @@ BattleCommand_PoisonTarget:
|
|||
push de
|
||||
ld de, ANIM_PSN
|
||||
call PlayOpponentBattleAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
ld hl, WasPoisonedText
|
||||
call PrintText
|
||||
|
|
@ -4651,9 +4651,9 @@ BattleCommand_PoisonTarget:
|
|||
res PSN, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
WasPoisonedText:
|
||||
|
|
@ -4724,7 +4724,7 @@ BattleCommand_Poison:
|
|||
xor a
|
||||
ld [de], a
|
||||
call PlayDamageAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
|
||||
ld hl, BadlyPoisonedText
|
||||
|
|
@ -4747,9 +4747,9 @@ BattleCommand_Poison:
|
|||
res PSN, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
call .check_toxic
|
||||
ret nz
|
||||
|
|
@ -4937,7 +4937,7 @@ BattleCommand_BurnTarget:
|
|||
call CallFromBank0F
|
||||
ld de, ANIM_BRN
|
||||
call PlayOpponentBattleAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
ld hl, WasBurnedText
|
||||
call PrintText
|
||||
|
|
@ -4958,9 +4958,9 @@ BattleCommand_BurnTarget:
|
|||
res BRN, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
WasBurnedText:
|
||||
|
|
@ -5032,7 +5032,7 @@ BattleCommand_FreezeTarget:
|
|||
|
||||
ld de, ANIM_FRZ
|
||||
call PlayOpponentBattleAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
ld hl, WasFrozenText
|
||||
call PrintText
|
||||
|
|
@ -5053,9 +5053,9 @@ BattleCommand_FreezeTarget:
|
|||
res FRZ, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
WasFrozenText:
|
||||
|
|
@ -5100,7 +5100,7 @@ BattleCommand_ParalyzeTarget:
|
|||
call CallFromBank0F
|
||||
ld de, ANIM_PAR
|
||||
call PlayOpponentBattleAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
call PrintParalyze
|
||||
|
||||
|
|
@ -5120,9 +5120,9 @@ BattleCommand_ParalyzeTarget:
|
|||
res PAR, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
BattleCommand_StatUp:
|
||||
|
|
@ -5347,7 +5347,7 @@ BattleCommand_StatDown:
|
|||
ld hl, wPlayerStatLevels
|
||||
ld de, wEnemyMoveStructEffect
|
||||
ld a, [wLinkMode]
|
||||
cp 3 ; LINK_COLOSSEUM
|
||||
cp LINK_COLOSSEUM
|
||||
jr z, .got_stat_levels
|
||||
; 25% chance for enemy monsters' stat-lowering moves to fail
|
||||
call BattleRandom
|
||||
|
|
@ -6557,7 +6557,7 @@ BattleCommand_Paralyze:
|
|||
ld c, 30
|
||||
call DelayFrames
|
||||
call LoadMoveAnim
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
call PrintParalyze
|
||||
|
||||
|
|
@ -6577,9 +6577,9 @@ BattleCommand_Paralyze:
|
|||
res PAR, a
|
||||
ld [de], a
|
||||
ld a, [hl]
|
||||
call PrintRecoveredUsingItem
|
||||
call PrintUsersItemActivated
|
||||
call ConsumeHeldItem
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
.paralyzed
|
||||
|
|
@ -6650,7 +6650,7 @@ BattleCommand_Substitute:
|
|||
.played_anim
|
||||
ld hl, MadeSubstituteText
|
||||
call PrintText
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
jp CallFromBank0F
|
||||
|
||||
.already_has_sub
|
||||
|
|
@ -6719,12 +6719,12 @@ BattleCommand_Mimic:
|
|||
jr nz, .fail
|
||||
|
||||
ld hl, wBattleMonMoves
|
||||
ld de, wCurEnemyMove
|
||||
ld de, wLastEnemyCounterMove
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .player_turn
|
||||
ld hl, wEnemyMonMoves
|
||||
ld de, wCurPlayerMove
|
||||
ld de, wLastPlayerCounterMove
|
||||
|
||||
.player_turn
|
||||
; BUG: No checks for Struggle, so it can be mimicked.
|
||||
|
|
@ -6814,13 +6814,13 @@ BattleCommand_Disable:
|
|||
|
||||
ld de, wEnemyDisableCount
|
||||
ld hl, wEnemyMonMoves
|
||||
ld bc, wCurEnemyMove
|
||||
ld bc, wLastEnemyCounterMove
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .got_moves
|
||||
ld de, wPlayerDisableCount
|
||||
ld hl, wBattleMonMoves
|
||||
ld bc, wCurPlayerMove
|
||||
ld bc, wLastPlayerCounterMove
|
||||
|
||||
.got_moves
|
||||
ld a, [de]
|
||||
|
|
@ -6965,7 +6965,7 @@ BattleCommand_ResetStats:
|
|||
call .CopyStats
|
||||
|
||||
ld hl, wEnemyMonStatus
|
||||
ld de, wCurEnemySelectedMove
|
||||
ld de, wCurEnemyMove
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .cure_status
|
||||
|
|
@ -7110,7 +7110,7 @@ BattleCommand_Heal:
|
|||
callfar RestoreHP
|
||||
pop af
|
||||
ldh [hBattleTurn], a
|
||||
ld hl, DrawHUDsAndHPBars
|
||||
ld hl, UpdateBattleHuds
|
||||
call CallFromBank0F
|
||||
ld hl, RegainedHealthText
|
||||
jp PrintText
|
||||
|
|
@ -7456,13 +7456,13 @@ BattleCommand_Selfdestruct:
|
|||
BattleCommand_MirrorMove:
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ld a, [wCurEnemyMove]
|
||||
ld hl, wCurPlayerSelectedMove
|
||||
ld a, [wLastEnemyCounterMove]
|
||||
ld hl, wCurPlayerMove
|
||||
ld de, wPlayerMoveStruct
|
||||
jr z, .got_moves
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
ld de, wEnemyMoveStruct
|
||||
ld hl, wCurEnemySelectedMove
|
||||
ld hl, wCurEnemyMove
|
||||
|
||||
.got_moves
|
||||
cp MOVE_MIRROR_MOVE
|
||||
|
|
@ -7508,12 +7508,12 @@ MirrorMoveFailedText:
|
|||
BattleCommand_Metronome:
|
||||
call LoadMoveAnim
|
||||
ld de, wPlayerMoveStructEffect
|
||||
ld hl, wCurPlayerSelectedMove
|
||||
ld hl, wCurPlayerMove
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .GetMove
|
||||
ld de, wEnemyMoveStructEffect
|
||||
ld hl, wCurEnemySelectedMove
|
||||
ld hl, wCurEnemyMove
|
||||
|
||||
.GetMove
|
||||
call BattleRandom
|
||||
|
|
@ -8450,7 +8450,7 @@ BattleCommand_BatonPass:
|
|||
cp [hl]
|
||||
jr nz, .picked_mon
|
||||
|
||||
ld hl, BattleText_MonIsAlreadyOut
|
||||
ld hl, BattleText_MonIsAlreadyOut_0d
|
||||
call PrintText
|
||||
|
||||
.pressed_b
|
||||
|
|
@ -8458,7 +8458,7 @@ BattleCommand_BatonPass:
|
|||
jr .player_loop
|
||||
|
||||
.picked_mon
|
||||
callfar HasMonFainted
|
||||
callfar CheckIfCurPartyMonIsFitToFight
|
||||
jr z, .pressed_b
|
||||
|
||||
call ClearPalettes
|
||||
|
|
@ -8543,7 +8543,7 @@ BattleCommand_BatonPass:
|
|||
call BattleCommand_MoveDelay
|
||||
jp PrintButItFailed
|
||||
|
||||
BattleText_MonIsAlreadyOut:
|
||||
BattleText_MonIsAlreadyOut_0d:
|
||||
text_from_ram wBattleMonNickname
|
||||
text "はもうでています"
|
||||
prompt
|
||||
|
|
@ -8943,20 +8943,20 @@ ConsumeHeldItem:
|
|||
|
||||
INCLUDE "data/battle/held_consumables.inc"
|
||||
|
||||
PrintRecoveredUsingItem:
|
||||
PrintUsersItemActivated:
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ld [wNamedObjectIndexBuffer], a
|
||||
call GetItemName
|
||||
ld hl, RecoveredUsingText
|
||||
ld hl, BattleText_UsersStringBuffer1Activated
|
||||
call PrintText
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
RecoveredUsingText:
|
||||
BattleText_UsersStringBuffer1Activated:
|
||||
text "そうびしていた"
|
||||
line "@"
|
||||
text_from_ram wStringBuffer1
|
||||
|
|
|
|||
|
|
@ -906,7 +906,7 @@ AIChooseMove::
|
|||
and a
|
||||
jr z, .ChooseMove
|
||||
|
||||
ld [wCurEnemySelectedMove], a
|
||||
ld [wCurEnemyMove], a
|
||||
ld a, c
|
||||
ld [wCurEnemyMoveNum], a
|
||||
ret
|
||||
|
|
@ -1278,7 +1278,7 @@ AI_Smart_DreamEater:
|
|||
|
||||
AI_Smart_MirrorMove:
|
||||
; If the player did not use any move last turn...
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
and a
|
||||
jr nz, .usedmove
|
||||
|
||||
|
|
@ -1466,7 +1466,7 @@ AI_Smart_Substitute:
|
|||
; that would not be effective against itself.
|
||||
; Consequently, the Smart AI might still use Mimic even if no move has actually been used yet.
|
||||
AI_Smart_Mimic:
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
and a
|
||||
ret z
|
||||
|
||||
|
|
@ -1485,7 +1485,7 @@ AI_Smart_Mimic:
|
|||
|
||||
dec [hl]
|
||||
.skip_encourage
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
and a
|
||||
ret z ; Pointless repeat of an earlier check...
|
||||
|
||||
|
|
@ -1551,7 +1551,7 @@ AI_Smart_Counter:
|
|||
cp 3
|
||||
jr nc, .encourage
|
||||
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
and a
|
||||
jr z, .done
|
||||
|
||||
|
|
@ -1584,7 +1584,7 @@ AI_Smart_Encore:
|
|||
jr nz, .discourage
|
||||
|
||||
push hl
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
ld hl, EncoreMoves
|
||||
ld de, 1
|
||||
call FindItemInTable
|
||||
|
|
@ -1664,7 +1664,7 @@ AI_Smart_DefrostOpponent:
|
|||
; less than four moves encourages the AI to use Spite against them.
|
||||
AI_Smart_Spite:
|
||||
push hl
|
||||
ld a, [wCurPlayerMove]
|
||||
ld a, [wLastPlayerCounterMove]
|
||||
ld b, a
|
||||
ld c, NUM_MOVES
|
||||
ld hl, wBattleMonMoves
|
||||
|
|
@ -2590,7 +2590,7 @@ ReadTrainerParty::
|
|||
|
||||
.skip_name
|
||||
ld a, [hli]
|
||||
cp "@"
|
||||
cp '@'
|
||||
jr nz, .skip_name
|
||||
|
||||
ld a, [hli]
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1074,12 +1074,12 @@ OpenPartyMenu::
|
|||
ld [w2DMenuNumRows], a
|
||||
|
||||
ld b, a
|
||||
ld a, [wce38]
|
||||
ld a, [wFailedToFlee]
|
||||
and a
|
||||
ld a, $03
|
||||
jr z, .asm_507b4
|
||||
xor a
|
||||
ld [wce38], a
|
||||
xor a ; FALSE
|
||||
ld [wFailedToFlee], a
|
||||
ld a, $01
|
||||
.asm_507b4
|
||||
ld [wMenuJoypadFilter], a
|
||||
|
|
|
|||
264
engine/overworld/wildmons.asm
Normal file
264
engine/overworld/wildmons.asm
Normal file
|
|
@ -0,0 +1,264 @@
|
|||
INCLUDE "constants.asm"
|
||||
|
||||
SECTION "engine/overworld/wildmons.asm", ROMX
|
||||
|
||||
_LoadWildMonData::
|
||||
xor a
|
||||
ld hl, wWildMonData
|
||||
ld bc, GRASS_WILDDATA_LENGTH
|
||||
call ByteFill
|
||||
ld a, [wMapGroup]
|
||||
ld d, a
|
||||
ld a, [wMapId]
|
||||
ld e, a
|
||||
ld bc, GRASS_WILDDATA_LENGTH
|
||||
ld hl, GrassWildMons
|
||||
.find
|
||||
ld a, [hl]
|
||||
cp -1
|
||||
ret z
|
||||
cp d
|
||||
jr nz, .got_map_group
|
||||
inc hl
|
||||
ld a, [hl]
|
||||
dec hl
|
||||
cp e
|
||||
jr z, .got_map
|
||||
.got_map_group
|
||||
add hl, bc
|
||||
jr .find
|
||||
.got_map
|
||||
inc hl
|
||||
inc hl
|
||||
ld de, wWildMonData
|
||||
ld bc, GRASS_WILDDATA_LENGTH - 2
|
||||
jp CopyBytes
|
||||
|
||||
; Load nest landmarks into wTilemap[0,0]
|
||||
FindNest:
|
||||
hlcoord 0, 0
|
||||
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
xor a
|
||||
call ByteFill
|
||||
ld hl, GrassWildMons
|
||||
decoord 0, 0
|
||||
|
||||
.FindGrass:
|
||||
ld a, [hl]
|
||||
cp -1
|
||||
jr z, .done
|
||||
|
||||
push hl
|
||||
ld b, a
|
||||
inc hl
|
||||
ld c, [hl]
|
||||
call .SearchMapForMon
|
||||
jr nc, .next_grass
|
||||
|
||||
push de
|
||||
call GetWorldMapLocation
|
||||
call .AppendNest
|
||||
pop de
|
||||
jr c, .next_grass
|
||||
ld [de], a
|
||||
inc de
|
||||
|
||||
.next_grass
|
||||
pop hl
|
||||
ld bc, GRASS_WILDDATA_LENGTH
|
||||
add hl, bc
|
||||
jr .FindGrass
|
||||
|
||||
.done:
|
||||
ret
|
||||
|
||||
.SearchMapForMon:
|
||||
rept 5
|
||||
inc hl
|
||||
endr
|
||||
ld a, NUM_GRASSMON
|
||||
|
||||
.ScanMapLoop:
|
||||
push af
|
||||
ld a, [wNamedObjectIndexBuffer]
|
||||
cp [hl]
|
||||
jr z, .found
|
||||
inc hl
|
||||
inc hl
|
||||
pop af
|
||||
dec a
|
||||
jr nz, .ScanMapLoop
|
||||
and a
|
||||
ret
|
||||
|
||||
.found
|
||||
pop af
|
||||
scf
|
||||
ret
|
||||
|
||||
.AppendNest:
|
||||
ld c, a
|
||||
ld hl, wTileMap
|
||||
ld de, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
.AppendNestLoop:
|
||||
ld a, [hli]
|
||||
cp c
|
||||
jr z, .found_nest
|
||||
|
||||
dec de
|
||||
ld a, e
|
||||
or d
|
||||
jr nz, .AppendNestLoop
|
||||
|
||||
ld a, c
|
||||
and a
|
||||
ret
|
||||
|
||||
.found_nest
|
||||
scf
|
||||
ret
|
||||
|
||||
INCLUDE "data/wild/grassmons.inc"
|
||||
|
||||
TryWildBattle::
|
||||
; If there is no active Repel, there's no need to be here.
|
||||
ld a, [wRepelEffect]
|
||||
and a
|
||||
jr z, .encounter
|
||||
|
||||
dec a
|
||||
jp z, .repel_wore_off
|
||||
ld [wRepelEffect], a
|
||||
|
||||
.encounter
|
||||
call .CheckGrassCollision
|
||||
jr nc, .no_battle
|
||||
|
||||
; Get encounter rate for the time of day.
|
||||
call WildMon_GetTimeOfDay
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, wWildMonData
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld b, a
|
||||
|
||||
call Random
|
||||
ldh a, [hRandomAdd]
|
||||
cp b
|
||||
jr nc, .no_battle
|
||||
|
||||
call Random
|
||||
ld b, a
|
||||
ld hl, GrassMonProbTable
|
||||
|
||||
call WildMon_GetTimeOfDay
|
||||
cp NITE_F
|
||||
ld bc, 0
|
||||
jr c, .got_time
|
||||
ld bc, GRASS_WILDDATA_DAYBLOCK_START * 2
|
||||
jr z, .got_time
|
||||
ld bc, GRASS_WILDDATA_NITEBLOCK_START * 2
|
||||
|
||||
.got_time
|
||||
add hl, bc
|
||||
|
||||
.random_loop
|
||||
call Random
|
||||
cp 100
|
||||
jr nc, .random_loop
|
||||
ld b, a
|
||||
ld c, 0
|
||||
|
||||
.prob_bracket_loop
|
||||
ld a, [hli]
|
||||
add c
|
||||
ld c, a
|
||||
cp b
|
||||
jr nc, .got_it
|
||||
inc hl
|
||||
jr .prob_bracket_loop
|
||||
|
||||
.got_it
|
||||
ld c, [hl]
|
||||
ld b, 0
|
||||
ld hl, wWildMons
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld [wCurPartyLevel], a
|
||||
ld a, [hl]
|
||||
call ValidateTempWildMonSpecies
|
||||
jr c, .no_battle
|
||||
|
||||
ld [wCurPartySpecies], a
|
||||
ld [wTempEnemyMonSpecies], a
|
||||
ld a, [wRepelEffect]
|
||||
and a
|
||||
jr z, .ok
|
||||
|
||||
ld a, [wPartyMon1Level]
|
||||
ld b, a
|
||||
ld a, [wCurPartyLevel]
|
||||
cp b
|
||||
jr c, .no_battle
|
||||
|
||||
jr .ok
|
||||
|
||||
.repel_wore_off
|
||||
ld [wRepelEffect], a
|
||||
|
||||
.no_battle
|
||||
ld a, 1
|
||||
and a
|
||||
ret
|
||||
|
||||
.ok
|
||||
ld a, WILD_BATTLE
|
||||
ld [wBattleMode], a
|
||||
xor a
|
||||
ret
|
||||
|
||||
.CheckGrassCollision:
|
||||
ld a, [wPlayerTile]
|
||||
ld hl, .blocks
|
||||
ld de, 1
|
||||
call FindItemInTable
|
||||
ret
|
||||
|
||||
.blocks
|
||||
db COLLISION_08
|
||||
db COLLISION_GRASS
|
||||
db COLLISION_WATER_28
|
||||
db COLLISION_WATER
|
||||
db COLLISION_48
|
||||
db COLLISION_49
|
||||
db COLLISION_4A
|
||||
db COLLISION_4B
|
||||
db COLLISION_4C
|
||||
db -1
|
||||
|
||||
INCLUDE "data/wild/probabilities.inc"
|
||||
|
||||
; This actually works as intended in the proto!
|
||||
; In the final game, due to a development oversight,
|
||||
; this function is called with the wild Pokemon's level, not its species, in a.
|
||||
ValidateTempWildMonSpecies:
|
||||
and a
|
||||
jr z, .nowildmon ; = 0
|
||||
cp NUM_POKEMON + 1 ; 252
|
||||
jr nc, .nowildmon ; >= 252
|
||||
and a ; 1 <= Species <= 251
|
||||
ret
|
||||
|
||||
.nowildmon
|
||||
scf
|
||||
ret
|
||||
|
||||
WildMon_GetTimeOfDay:
|
||||
ld a, [wTimeOfDay]
|
||||
inc a
|
||||
maskbits NUM_DAYTIMES
|
||||
cp MORN_F
|
||||
ret nz
|
||||
dec a
|
||||
ret
|
||||
|
|
@ -78,12 +78,14 @@ UncompressSpriteFromDE::
|
|||
ld [hl], d
|
||||
jp UncompressSpriteData
|
||||
|
||||
; TODO: Rename to LoadTilemapToTempTilemap
|
||||
BackUpTilesToBuffer::
|
||||
hlcoord 0, 0
|
||||
decoord 0, 0, wTileMapBackup
|
||||
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
|
||||
jp CopyBytes
|
||||
|
||||
; TODO: Rename to SafeLoadTempTilemapToTilemap
|
||||
ReloadTilesFromBuffer::
|
||||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
|
|
|
|||
12
home/map.asm
12
home/map.asm
|
|
@ -299,7 +299,7 @@ MapSetup_Reload::
|
|||
ld [wMusicFade], a
|
||||
ld b, 9 ; TODO: constantify this
|
||||
call GetSGBLayout
|
||||
call LoadWildMons
|
||||
call LoadWildMonData
|
||||
call FadeIn
|
||||
ret
|
||||
|
||||
|
|
@ -345,7 +345,7 @@ MapSetup_Continue::
|
|||
ld [wMusicFade], a
|
||||
ld b, 9 ; TODO: constantify this
|
||||
call GetSGBLayout
|
||||
call LoadWildMons
|
||||
call LoadWildMonData
|
||||
call Function242c ; TODO
|
||||
call FadeIn
|
||||
ret
|
||||
|
|
@ -373,7 +373,7 @@ MapSetup_Warp::
|
|||
call PlayMapMusic
|
||||
ld b, 9 ; TODO: constantify this
|
||||
call GetSGBLayout
|
||||
call LoadWildMons
|
||||
call LoadWildMonData
|
||||
call FadeIn
|
||||
call Function2407 ; TODO
|
||||
ret
|
||||
|
|
@ -419,8 +419,8 @@ LoadMapTimeOfDay::
|
|||
jr nz, .row
|
||||
ret
|
||||
|
||||
LoadWildMons::
|
||||
callfar _LoadWildMons
|
||||
LoadWildMonData::
|
||||
callfar _LoadWildMonData
|
||||
ret
|
||||
|
||||
LoadGraphics::
|
||||
|
|
@ -484,7 +484,7 @@ MapSetup_Connection::
|
|||
call FadeToMapMusic
|
||||
ld b, 9 ; TODO: constantify this
|
||||
call GetSGBLayout
|
||||
call LoadWildMons
|
||||
call LoadWildMonData
|
||||
scf
|
||||
ret
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ INCLUDE "constants.asm"
|
|||
|
||||
SECTION "home/misc_32c8.asm@Unknown 32c8", ROM0
|
||||
|
||||
Function32c8::
|
||||
Call_GetItemAmount::
|
||||
predef GetItemAmount
|
||||
ld a, b
|
||||
and a
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ WaitBGMap::
|
|||
call DelayFrames
|
||||
ret
|
||||
|
||||
; TODO: Change to SetDefaultBGPAndOBP
|
||||
SetPalettes::
|
||||
ld a, %11100100
|
||||
ldh [rBGP], a
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ TestWildBattleStart::
|
|||
ret z ; if no directions are down, don't try and trigger a wild encounter
|
||||
call CheckBPressedDebug
|
||||
jp nz, xor_a ; if b button is down, clear acc
|
||||
callfar Function3ee3e
|
||||
callfar TryWildBattle
|
||||
ld a, [wBattleMode]
|
||||
and a
|
||||
ret z ; if no battle, return
|
||||
|
|
@ -60,7 +60,7 @@ TestWildBattleStart::
|
|||
ret
|
||||
|
||||
OverworldLoop_StartBattle::
|
||||
predef Function3ef19
|
||||
predef StartBattle
|
||||
ld a, $f3
|
||||
ldh [hMapEntryMethod], a
|
||||
ld hl, wd4a9
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ AddNTimes::
|
|||
jr nz, .loop
|
||||
ret
|
||||
|
||||
memcmp:: ; TODO: rename
|
||||
CompareBytes::
|
||||
; Compare c bytes at hl and de
|
||||
; Returns z if all equal, nz otherwise.
|
||||
.loop:
|
||||
|
|
|
|||
|
|
@ -280,11 +280,9 @@ ROMX $0e
|
|||
|
||||
ROMX $0f
|
||||
org $4000
|
||||
"engine/dumps/bank0f.asm@StartBattle"
|
||||
"engine/battle/core.asm"
|
||||
"engine/dumps/bank0f.asm@PlayMoveAnimation"
|
||||
"data/wild.asm"
|
||||
"engine/dumps/bank0f.asm@Function3ee3e"
|
||||
"engine/battle/core.asm@DoBattle"
|
||||
"engine/overworld/wildmons.asm"
|
||||
"engine/battle/core.asm@StartBattle"
|
||||
|
||||
ROMX $10
|
||||
org $4000
|
||||
|
|
|
|||
79
ram/wram.asm
79
ram/wram.asm
|
|
@ -626,8 +626,7 @@ wEnemyEvaLevel:: db
|
|||
|
||||
wForceEvolution:: db
|
||||
|
||||
wAILayer2Encouragement::
|
||||
wEnemyTurnsTaken:: ds 1
|
||||
wEnemyTurnsTaken:: db
|
||||
|
||||
ds 1
|
||||
|
||||
|
|
@ -639,10 +638,8 @@ wPlayerDebugSelectedMove:: ds 1
|
|||
|
||||
wMoveSelectionMenuType:: ds 1
|
||||
|
||||
; TODO: Replace these with just wCurPlayer/EnemyMove
|
||||
; and replace the original wCurPlayerMove/wCurEnemyMove with wLastPlayer/EnemyCounterMove
|
||||
wCurPlayerSelectedMove:: db
|
||||
wCurEnemySelectedMove:: db
|
||||
wCurPlayerMove:: db
|
||||
wCurEnemyMove:: db
|
||||
|
||||
wLinkBattleRNCount:: db
|
||||
|
||||
|
|
@ -661,27 +658,21 @@ wcacb:: ds 1
|
|||
wcacc:: ds 1
|
||||
ENDU
|
||||
|
||||
wcacd:: ds 1
|
||||
wcace:: ds 1
|
||||
wUnused_SafariEscapeFactor:: db
|
||||
wUnused_SafariBaitFactor:: db
|
||||
|
||||
ds 1
|
||||
|
||||
wEnemyBackupDVs:: dw
|
||||
|
||||
wAlreadyDisobeyed::
|
||||
wcad2:: ds 1
|
||||
wAlreadyDisobeyed:: db
|
||||
|
||||
wDisabledMove:: ds 1
|
||||
wEnemyDisabledMove:: ds 1
|
||||
wcad5:: ds 1
|
||||
wDisabledMove:: db
|
||||
wEnemyDisabledMove:: db
|
||||
wWhichMonFaintedFirst:: db
|
||||
|
||||
UNION
|
||||
wCurPlayerMove:: ds 1
|
||||
wCurEnemyMove:: ds 1
|
||||
NEXTU
|
||||
wcad6:: ds 1
|
||||
wcad7:: ds 1
|
||||
ENDU
|
||||
wLastPlayerCounterMove:: db
|
||||
wLastEnemyCounterMove:: db
|
||||
|
||||
wEnemyMinimized:: db
|
||||
wAlreadyFailed:: db
|
||||
|
|
@ -690,11 +681,8 @@ wBattleParticipantsIncludingFainted:: db
|
|||
wBattleLowHealthAlarm:: db
|
||||
wPlayerMinimized:: db
|
||||
|
||||
wPlayerScreens::
|
||||
wcadd:: db
|
||||
|
||||
wEnemyScreens::
|
||||
wcade:: db
|
||||
wPlayerScreens:: db
|
||||
wEnemyScreens:: db
|
||||
|
||||
wPlayerSafeguardCount:: db
|
||||
wEnemySafeguardCount:: db
|
||||
|
|
@ -710,6 +698,7 @@ ENDU
|
|||
|
||||
|
||||
SECTION "CB14", WRAM0[$CB14]
|
||||
wBattleEnd::
|
||||
|
||||
UNION
|
||||
wRedrawRowOrColumnSrcTiles::
|
||||
|
|
@ -730,7 +719,8 @@ ENDU
|
|||
SECTION "CB56", WRAM0[$CB4C]
|
||||
UNION
|
||||
wOtherPlayerLinkMode:: db
|
||||
wOtherPlayerLinkAction:: db
|
||||
wOtherPlayerLinkAction::
|
||||
wBattleAction:: db
|
||||
ds 3 ; TODO
|
||||
|
||||
wPlayerLinkAction:: db
|
||||
|
|
@ -1064,6 +1054,11 @@ wHPBarTempHP:: dw
|
|||
NEXTU
|
||||
wStringBuffer2:: ds STRING_BUFFER_LENGTH
|
||||
|
||||
NEXTU
|
||||
|
||||
ds 2
|
||||
wGainBoostedExp:: db
|
||||
|
||||
NEXTU
|
||||
|
||||
wcd31:: db
|
||||
|
|
@ -1074,7 +1069,6 @@ ENDU
|
|||
|
||||
SECTION "CD3C", WRAM0[$CD3C]
|
||||
|
||||
wcd3c::
|
||||
wPartyMenuCursor::
|
||||
wBillsPCCursor:: db
|
||||
wRegularItemsCursor:: db
|
||||
|
|
@ -1087,8 +1081,7 @@ wCurMoveNum:: db
|
|||
wCurBattleMon:: db
|
||||
|
||||
wTMHolderCursor:: db
|
||||
wFieldDebugMenuCursorBuffer::
|
||||
wcd43:: db
|
||||
wFieldDebugMenuCursorBuffer:: db
|
||||
wRegularItemsScrollPosition:: db
|
||||
wBackpackAndKeyItemsScrollPosition:: db
|
||||
wBillsPCScrollPosition:: db
|
||||
|
|
@ -1198,6 +1191,7 @@ wPrevWarp:: db
|
|||
wEvolvableFlags:: db
|
||||
|
||||
UNION
|
||||
wBoostExpByExpAll::
|
||||
wSkipMovesBeforeLevelUp::
|
||||
wListMovesLineSpacing::
|
||||
wFieldMoveScriptID:: db
|
||||
|
|
@ -1278,14 +1272,15 @@ wTempBattleMonSpecies:: ds 1
|
|||
|
||||
wEnemyMon:: battle_struct wEnemyMon
|
||||
wEnemyMonBaseStats:: ds NUM_EXP_STATS
|
||||
|
||||
wEnemyMonCatchRate:: db
|
||||
wcdff:: ds 1
|
||||
wEnemyMonBaseExp:: db
|
||||
wEnemyMonEnd::
|
||||
|
||||
wBattleMode:: db
|
||||
wTempWildMonSpecies:: ds 1
|
||||
wOtherTrainerClass:: ds 1
|
||||
wBattleType:: db
|
||||
wce04:: ds 1
|
||||
wUnused_GymLeaderNo:: ds 1 ; Unused
|
||||
wOtherTrainerID:: ds 1
|
||||
wBattleEnded:: ds 1
|
||||
|
||||
|
|
@ -1354,7 +1349,7 @@ wMonHLearnset::
|
|||
wMonHeaderEnd::
|
||||
|
||||
|
||||
wce26:: ds 1
|
||||
wMapAnimsBackup:: db
|
||||
|
||||
ds 2
|
||||
|
||||
|
|
@ -1388,10 +1383,8 @@ wApplyStatLevelMultipliersToEnemy::
|
|||
wce37::
|
||||
db
|
||||
|
||||
wce38:: ds 1
|
||||
|
||||
wNumFleeAttempts::
|
||||
wce39:: ds 1
|
||||
wFailedToFlee:: db
|
||||
wNumFleeAttempts:: db
|
||||
|
||||
wMonTriedToEvolve:: db
|
||||
|
||||
|
|
@ -1840,8 +1833,16 @@ wOTPartySpeciesEnd:: db
|
|||
SECTION "Wild mon buffer", WRAM0[$D91B]
|
||||
|
||||
UNION
|
||||
wWildMons::
|
||||
ds 41
|
||||
wWildMonData::
|
||||
|
||||
wMornEncounterRate:: db
|
||||
wDayEncounterRate:: db
|
||||
wNiteEncounterRate:: db
|
||||
|
||||
wWildMons:: ds NUM_GRASSMON * 2
|
||||
|
||||
ds 2
|
||||
|
||||
NEXTU
|
||||
wOTPartyMons::
|
||||
; wOTPartyMon1 - wOTPartyMon6
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user