You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Create level scoped event flags for trainers and talkers, and integrate trainer battles in the board engine (#30)
This commit is contained in:
@@ -8,6 +8,7 @@ TalkToTrainerScript::
|
||||
|
||||
SeenByTrainerScript::
|
||||
loadtemptrainer
|
||||
waitsfx ; wait for any pending space-related sfx
|
||||
encountermusic
|
||||
showemote EMOTE_SHOCK, LAST_TALKED, 30
|
||||
callasm TrainerWalkToPlayer
|
||||
|
@@ -82,9 +82,6 @@ LoadMapObjects:
|
||||
farcall InitializeVisibleSprites
|
||||
ret
|
||||
|
||||
MapSetup_DummyFunction: ; unreferenced
|
||||
ret
|
||||
|
||||
ResetPlayerObjectAction:
|
||||
ld hl, wPlayerSpriteSetupFlags
|
||||
set PLAYERSPRITESETUP_RESET_ACTION_F, [hl]
|
||||
@@ -194,3 +191,14 @@ ForceMapMusic:
|
||||
.notbiking
|
||||
call TryRestartMapMusic
|
||||
ret
|
||||
|
||||
ResetLevelScopedEventFlags:
|
||||
ld hl, wEventFlags + EVENT_LEVEL_SCOPED_FLAGS_START / 8
|
||||
ld c, (EVENT_LEVEL_SCOPED_FLAGS_END / 8) - (EVENT_LEVEL_SCOPED_FLAGS_START / 8)
|
||||
xor a
|
||||
.loop
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
|
@@ -1160,6 +1160,8 @@ Script_startbattle:
|
||||
call DisableOverworldHUD
|
||||
ld a, FALSE
|
||||
ld [wText2bpp], a
|
||||
ld hl, wDisplaySecondarySprites
|
||||
res SECONDARYSPRITES_SPACES_LEFT_F, [hl]
|
||||
call BufferScreen
|
||||
predef StartBattle
|
||||
ld a, [wBattleResult]
|
||||
@@ -1192,15 +1194,23 @@ Script_reloadmapafterbattle:
|
||||
bit 0, d
|
||||
jr z, .was_wild
|
||||
farcall MomTriesToBuySomething
|
||||
jr .done
|
||||
jr .next
|
||||
|
||||
.was_wild
|
||||
ld a, [wBattleResult]
|
||||
bit BATTLERESULT_BOX_FULL, a
|
||||
jr z, .done
|
||||
jr z, .next
|
||||
ld b, BANK(Script_SpecialBillCall)
|
||||
ld de, Script_SpecialBillCall
|
||||
farcall LoadMemScript
|
||||
|
||||
.next
|
||||
ld a, [wSpacesLeft]
|
||||
and a
|
||||
jr z, .done
|
||||
farcall LoadBoardMenuDieNumbersGFX
|
||||
ld hl, wDisplaySecondarySprites
|
||||
set SECONDARYSPRITES_SPACES_LEFT_F, [hl]
|
||||
.done
|
||||
jp Script_reloadmap
|
||||
|
||||
|
Reference in New Issue
Block a user