generated from lwelyk/pokecrystal
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the event initialization system
- Loading branch information
Showing
6 changed files
with
202 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
InitialEvents: | ||
dw EVENT_EARLS_ACADEMY_EARL | ||
dw EVENT_RADIO_TOWER_ROCKET_TAKEOVER | ||
dw EVENT_GOLDENROD_CITY_ROCKET_TAKEOVER | ||
dw EVENT_RADIO_TOWER_CIVILIANS_AFTER | ||
dw EVENT_ILEX_FOREST_APPRENTICE | ||
dw EVENT_ILEX_FOREST_FARFETCHD | ||
dw EVENT_ILEX_FOREST_CHARCOAL_MASTER | ||
dw EVENT_MAHOGANY_MART_LANCE_AND_DRAGONITE | ||
dw EVENT_TEAM_ROCKET_BASE_B2F_GRUNT_WITH_EXECUTIVE | ||
dw EVENT_TEAM_ROCKET_BASE_B2F_EXECUTIVE | ||
dw EVENT_TEAM_ROCKET_BASE_B2F_DRAGONITE | ||
dw EVENT_RIVAL_TEAM_ROCKET_BASE | ||
dw EVENT_BLACKTHORN_CITY_SUPER_NERD_DOES_NOT_BLOCK_GYM | ||
dw EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER | ||
dw EVENT_RIVAL_CHERRYGROVE_CITY | ||
dw EVENT_RIVAL_AZALEA_TOWN | ||
dw EVENT_RIVAL_GOLDENROD_UNDERGROUND | ||
dw EVENT_AZALEA_TOWN_SLOWPOKES | ||
dw EVENT_KURTS_HOUSE_SLOWPOKE | ||
dw EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE | ||
dw EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER | ||
dw EVENT_COP_IN_ELMS_LAB | ||
dw EVENT_RUINS_OF_ALPH_OUTSIDE_SCIENTIST | ||
dw EVENT_RUINS_OF_ALPH_RESEARCH_CENTER_SCIENTIST | ||
dw EVENT_BOULDER_IN_ICE_PATH_1A | ||
dw EVENT_BOULDER_IN_ICE_PATH_2A | ||
dw EVENT_BOULDER_IN_ICE_PATH_3A | ||
dw EVENT_BOULDER_IN_ICE_PATH_4A | ||
dw EVENT_ROUTE_30_YOUNGSTER_JOEY | ||
dw EVENT_BUG_CATCHING_CONTESTANT_1A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_2A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_3A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_4A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_5A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_6A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_7A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_8A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_9A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_10A | ||
dw EVENT_BUG_CATCHING_CONTESTANT_1B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_2B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_3B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_4B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_5B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_6B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_7B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_8B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_9B | ||
dw EVENT_BUG_CATCHING_CONTESTANT_10B | ||
dw EVENT_FAST_SHIP_1F_GENTLEMAN | ||
dw EVENT_FAST_SHIP_B1F_SAILOR_RIGHT | ||
dw EVENT_FAST_SHIP_CABINS_NNW_NNE_NE_SAILOR | ||
dw EVENT_LAKE_OF_RAGE_CIVILIANS | ||
dw EVENT_MAHOGANY_MART_OWNERS | ||
dw EVENT_TIN_TOWER_ROOF_HO_OH | ||
dw EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA | ||
dw EVENT_PLAYERS_HOUSE_2F_CONSOLE | ||
dw EVENT_PLAYERS_HOUSE_2F_DOLL_1 | ||
dw EVENT_PLAYERS_HOUSE_2F_DOLL_2 | ||
dw EVENT_PLAYERS_HOUSE_2F_BIG_DOLL | ||
dw EVENT_DECO_BED_1 | ||
dw EVENT_DECO_POSTER_1 | ||
dw EVENT_GOLDENROD_TRAIN_STATION_GENTLEMAN | ||
dw EVENT_OLIVINE_GYM_JASMINE | ||
dw EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN | ||
dw EVENT_MET_BILL | ||
dw EVENT_ECRUTEAK_POKE_CENTER_BILL | ||
dw EVENT_MYSTERY_GIFT_DELIVERY_GUY | ||
dw EVENT_LAKE_OF_RAGE_LANCE | ||
dw EVENT_GOLDENROD_DEPT_STORE_B1F_LAYOUT_1 | ||
dw EVENT_GOLDENROD_UNDERGROUND_WAREHOUSE_BLOCKED_OFF | ||
dw EVENT_DRAGONS_DEN_CLAIR | ||
dw EVENT_RIVAL_OLIVINE_CITY | ||
dw EVENT_RIVAL_VICTORY_ROAD | ||
dw EVENT_RIVAL_DRAGONS_DEN | ||
dw EVENT_LANCES_ROOM_OAK_AND_MARY | ||
dw EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_1 | ||
dw EVENT_BURNED_TOWER_B1F_BEASTS_1 | ||
dw EVENT_RED_IN_MT_SILVER | ||
dw EVENT_OLIVINE_PORT_SPRITES_AFTER_HALL_OF_FAME | ||
dw EVENT_FAST_SHIP_PASSENGERS_EASTBOUND | ||
dw EVENT_FAST_SHIP_PASSENGERS_WESTBOUND | ||
dw EVENT_OLIVINE_PORT_PASSAGE_POKEFAN_M | ||
dw EVENT_KURTS_HOUSE_KURT_2 | ||
dw EVENT_KURTS_HOUSE_GRANDDAUGHTER_2 | ||
dw EVENT_RANG_CLEAR_BELL_1 | ||
dw EVENT_FLORIA_AT_FLOWER_SHOP | ||
dw EVENT_FLORIA_AT_SUDOWOODO | ||
dw EVENT_GOLDENROD_CITY_MOVE_TUTOR | ||
dw EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_FISHER | ||
dw EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS | ||
dw EVENT_DRAGON_SHRINE_CLAIR | ||
dw EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER | ||
dw EVENT_PLAYERS_NEIGHBORS_HOUSE_NEIGHBOR | ||
dw EVENT_AZALEA_TOWN_KURT | ||
dw EVENT_AZALEA_TOWN_KURT | ||
dw EVENT_ILEX_FOREST_KURT | ||
dw EVENT_ROUTE_34_ILEX_FOREST_GATE_TEACHER_IN_WALKWAY | ||
dw EVENT_ILEX_FOREST_LASS | ||
dw EVENT_GOLDENROD_SALE_OFF | ||
dw EVENT_ECRUTEAK_CITY_GRAMPS | ||
dw EVENT_EUSINE_IN_BURNED_TOWER | ||
dw EVENT_PLAYERS_HOUSE_MOM_2 | ||
dw EVENT_WISE_TRIOS_ROOM_WISE_TRIO_2 | ||
dw EVENT_CIANWOOD_CITY_EUSINE | ||
dw EVENT_TIN_TOWER_1F_EUSINE | ||
dw EVENT_TIN_TOWER_1F_WISE_TRIO_1 | ||
dw EVENT_TIN_TOWER_1F_WISE_TRIO_2 | ||
dw EVENT_SET_WHEN_FOUGHT_HO_OH | ||
dw EVENT_SAW_SUICUNE_ON_ROUTE_36 | ||
dw EVENT_SAW_SUICUNE_ON_ROUTE_42 | ||
dw EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY | ||
dw EVENT_BATTLE_TOWER_OPEN_CIVILIANS | ||
dw EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM | ||
dw EVENT_CERULEAN_GYM_ROCKET | ||
dw EVENT_ROUTE_24_ROCKET | ||
dw EVENT_ROUTE_25_MISTY_BOYFRIEND | ||
dw EVENT_TRAINERS_IN_CERULEAN_GYM | ||
dw EVENT_COPYCATS_HOUSE_2F_DOLL | ||
dw EVENT_VIRIDIAN_GYM_BLUE | ||
dw EVENT_SEAFOAM_GYM_GYM_GUIDE | ||
dw EVENT_MT_MOON_SQUARE_CLEFAIRY | ||
dw EVENT_SAFFRON_TRAIN_STATION_POPULATION | ||
dw EVENT_INDIGO_PLATEAU_POKECENTER_RIVAL | ||
dw EVENT_INITIALIZED_EVENTS | ||
dw -1 ; end | ||
|
||
InitialEngineFlags: | ||
dw ENGINE_ROCKET_SIGNAL_ON_CH20 | ||
dw ENGINE_ROCKETS_IN_MAHOGANY | ||
dw -1 ; end | ||
|
||
InitialVariableSprites: | ||
MACRO initvarsprite | ||
; variable sprite, appearance sprite | ||
db \1 - SPRITE_VARS, \2 | ||
ENDM | ||
initvarsprite SPRITE_WEIRD_TREE, SPRITE_SUDOWOODO | ||
initvarsprite SPRITE_OLIVINE_RIVAL, SPRITE_RIVAL | ||
initvarsprite SPRITE_AZALEA_ROCKET, SPRITE_ROCKET | ||
initvarsprite SPRITE_FUCHSIA_GYM_1, SPRITE_JANINE | ||
initvarsprite SPRITE_FUCHSIA_GYM_2, SPRITE_JANINE | ||
initvarsprite SPRITE_FUCHSIA_GYM_3, SPRITE_JANINE | ||
initvarsprite SPRITE_FUCHSIA_GYM_4, SPRITE_JANINE | ||
initvarsprite SPRITE_COPYCAT, SPRITE_LASS | ||
initvarsprite SPRITE_JANINE_IMPERSONATOR, SPRITE_LASS | ||
db -1 ; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
InitializeEvents: | ||
; initialize events | ||
ld hl, InitialEvents | ||
.events_loop | ||
ld a, [hli] | ||
ld e, a | ||
ld a, [hli] | ||
ld d, a | ||
and e | ||
cp -1 | ||
jr z, .events_done | ||
ld b, SET_FLAG | ||
push hl | ||
call EventFlagAction | ||
pop hl | ||
jr .events_loop | ||
|
||
.events_done | ||
; initialize engine flags | ||
ld hl, InitialEngineFlags | ||
.flags_loop | ||
ld a, [hli] | ||
ld e, a | ||
ld a, [hli] | ||
ld d, a | ||
and e | ||
cp -1 | ||
jr z, .flags_done | ||
ld b, SET_FLAG | ||
push hl | ||
farcall EngineFlagAction | ||
pop hl | ||
jr .flags_loop | ||
|
||
.flags_done | ||
; initialize variable sprites | ||
ld hl, InitialVariableSprites | ||
.sprites_loop | ||
ld a, [hli] | ||
ld e, a | ||
ld d, 0 | ||
cp -1 | ||
ret z | ||
ld a, [hli] | ||
push hl | ||
ld hl, wVariableSprites | ||
add hl, de | ||
ld [hl], a | ||
pop hl | ||
jr .sprites_loop | ||
|
||
INCLUDE "data/events/init_events.asm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters