Skip to content

Commit

Permalink
Otimized event scripts for Mewtwo and Mew
Browse files Browse the repository at this point in the history
  • Loading branch information
SoupPotato committed Feb 8, 2024
1 parent b879d85 commit 504fcd0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
7 changes: 4 additions & 3 deletions constants/event_flags.asm
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@
const EVENT_CERULEAN_CAVE_B1F_MOON_STONE
const EVENT_CERULEAN_CAVE_B1F_MAGNET
const EVENT_CERULEAN_CAVE_B1F_LEFTOVERS
const EVENT_MEWTWO_APPEAR
const EVENT_FOUGHT_MEWTWO
const EVENT_MEWTWO_APPEAR ; ----unused
const EVENT_CERULEAN_CAVE_B1F_MEWTWO
const EVENT_POKEMON_MANSION_B1F_BOULDER_1
const EVENT_POKEMON_MANSION_B1F_BOULDER_2
const EVENT_POKEMON_MANSION_B1F_BOULDER_3
Expand All @@ -760,7 +760,8 @@
const EVENT_POKEMON_MANSION_B1F_RARE_CANDY
const EVENT_POKEMON_MANSION_B1F_HIDDEN_STAR_PIECE
const EVENT_ROUTE_11_SNORLAX_RESPAWN
; Unused: next 103 events
const EVENT_POKEMON_MANSION_B1F_MEW
; Unused: next 104 events

const_next 1000
; Trainer flags
Expand Down
2 changes: 1 addition & 1 deletion data/maps/scenes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MapScenes::
scene_var MOBILE_TRADE_ROOM, wMobileTradeRoomSceneID
scene_var MOBILE_BATTLE_ROOM, wMobileBattleRoomSceneID
scene_var POKEMON_MANSION_1F, wPokemonMansion1FSceneID
scene_var POKEMON_MANSION_B1F, wPokemonMansionB1FSceneID
scene_var POKEMON_MANSION_B1F, wPokemonMansionB1FSceneID ; unused
scene_var SAFARI_ZONE_ENTRANCE, wSafariZoneEntranceSceneID
scene_var PEWTER_MUSEUM_1F, wPewterMuseumSceneID
scene_var ROUTE_42_ECRUTEAK_GATE, wRoute42EcruteakGateSceneID
Expand Down
1 change: 1 addition & 0 deletions engine/events/std_scripts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ InitializeEventsScript:
setevent EVENT_SAFARI_ZONE_ENTRANCE_OFFICER_SAFARI_GAME_ACTIVE
setevent EVENT_OLIVINE_LIGHTHOUSE_AMPHY_SICK
setevent EVENT_ROUTE_11_SNORLAX_RESPAWN
setevent EVENT_POKEMON_MANSION_B1F_MEW
endcallback

AskNumber1MScript:
Expand Down
17 changes: 2 additions & 15 deletions maps/CeruleanCaveB1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,9 @@

CeruleanCaveB1F_MapScripts:
def_scene_scripts
scene_script CeruleanCaveB1FNoop1Scene

def_callbacks

CeruleanCaveB1FNoop1Scene:
checkevent EVENT_FOUGHT_MEWTWO
iftrue .DoNothing
readvar VAR_BADGES
ifequal NUM_BADGES, .MewtwoAppear
.DoNothing
end

.MewtwoAppear
setevent EVENT_MEWTWO_APPEAR
end

CeruleanCaveB1FMewtwo:
opentext
writetext MewtwoText
Expand All @@ -42,7 +29,7 @@ CeruleanCaveB1FMewtwo:
loadwildmon MEWTWO, 70
startbattle
disappear CERULEAN_CAVE_B1F_MEWTWO
setevent EVENT_FOUGHT_MEWTWO
setevent EVENT_CERULEAN_CAVE_B1F_MEWTWO
reloadmapafterbattle
special CheckBattleCaughtResult
iffalse .nocatch
Expand Down Expand Up @@ -109,4 +96,4 @@ CeruleanCaveB1F_MapEvents:
object_event 8, 9, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, CeruleanCaveB1FRock, -1
object_event 25, 12, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, CeruleanCaveB1FRock, -1
object_event 24, 14, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, CeruleanCaveB1FRock, -1
object_event 34, 17, SPRITE_MEWTWO, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_PINK, OBJECTTYPE_SCRIPT, 0, CeruleanCaveB1FMewtwo, EVENT_MEWTWO_APPEAR
object_event 34, 17, SPRITE_MEWTWO, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_PINK, OBJECTTYPE_SCRIPT, 0, CeruleanCaveB1FMewtwo, EVENT_CERULEAN_CAVE_B1F_MEWTWO
9 changes: 1 addition & 8 deletions maps/PokemonMansionB1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@

PokemonMansionB1F_MapScripts:
def_scene_scripts
scene_script .DummyScene

def_callbacks
callback MAPCALLBACK_TILES, .BouldersPokemonMansionB1F
callback MAPCALLBACK_STONETABLE, .SetUpStoneTable

.DummyScene:
checkevent EVENT_FOUGHT_MEW
iftrue .DoNothing
disappear POKEMON_MANSION_B1F_MEW
.DoNothing
end

.BouldersPokemonMansionB1F:
checkevent EVENT_POKEMON_MANSION_B1F_BOULDER_1
Expand Down Expand Up @@ -198,7 +191,7 @@ PokemonMansionB1F_MapEvents:
object_event 22, 23, SPRITE_BOULDER, SPRITEMOVEDATA_STRENGTH_BOULDER, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PokemonMansionB1FBoulder, EVENT_POKEMON_MANSION_B1F_BOULDER_1
object_event 25, 5, SPRITE_BOULDER, SPRITEMOVEDATA_STRENGTH_BOULDER, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PokemonMansionB1FBoulder, EVENT_POKEMON_MANSION_B1F_BOULDER_2
object_event 18, 25, SPRITE_BOULDER, SPRITEMOVEDATA_STRENGTH_BOULDER, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, PokemonMansionB1FBoulder, EVENT_POKEMON_MANSION_B1F_BOULDER_3
object_event 4, 4, SPRITE_MEW, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_PINK, OBJECTTYPE_SCRIPT, 0, ObjectEvent, -1
object_event 4, 4, SPRITE_MEW, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_NPC_PINK, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_POKEMON_MANSION_B1F_MEW
object_event 4, 5, SPRITE_PAPER, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, PAL_NPC_ROCK, OBJECTTYPE_SCRIPT, 0, LabDocument, -1
object_event 14, 11, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, PokemonMansionB1FFullRestore, EVENT_POKEMON_MANSION_B1F_FULL_RESTORE
object_event 4, 18, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, PokemonMansionB1FRareCandy, EVENT_POKEMON_MANSION_B1F_RARE_CANDY

0 comments on commit 504fcd0

Please sign in to comment.