Skip to content

Commit

Permalink
[Community PR] Integrate merrp's followers branch (#4022)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Jun 2, 2024
2 parents 4eda5f6 + ee1d147 commit f11826b
Show file tree
Hide file tree
Showing 3,424 changed files with 74,964 additions and 1,333 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
42 changes: 40 additions & 2 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@
@ The specified id can be used to refer to the sprite again later with turnvobject.
.macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH
.byte 0xaa
.byte \graphicsId
.2byte \graphicsId
.byte \id
.2byte \x
.2byte \y
Expand Down Expand Up @@ -1813,7 +1813,6 @@
_dynmultichoice \left, \top, \ignoreBPress, \maxBeforeScroll, \shouldSort, \initialSelected, \callbacks, NULL
.endm


@ Supplementary

.macro goto_if_unset flag:req, dest:req
Expand Down Expand Up @@ -2185,3 +2184,42 @@
.byte \type
.2byte \slot
.endm

@ Saves species and forms of Daycare Pokémon to specific vars. Saves the amount of Daycare mon to VAR_RESULT.
.macro getdaycaregfx varSpecies1:req varSpecies2:req varForm1:req varForm2:req
callnative GetDaycareGraphics
.2byte \varSpecies1
.2byte \varSpecies2
.2byte \varForm1
.2byte \varForm2
.endm

@ Plays the cry of the first alive party member.
.macro playfirstmoncry
callnative PlayFirstMonCry
.endm

@ Buffers the nickname of the first alive party member.
.macro bufferlivemonnickname out:req
callnative BufferFirstLiveMonNickname
.byte \out
.endm

@ Executes Follower actions
.macro getfolloweraction
callnative GetFollowerAction
.endm

@ Checks if Field move is being used by the current follower.
.macro isfollowerfieldmoveuser var:req
callnative IsFollowerFieldMoveUser
.2byte \var
.endm

@ Saves the direction from where source object event would need to turn to to face the target into the specified var.
.macro getdirectiontoface var:req, sourceId:req, targetId:req
callnative GetDirectionToFaceScript
.2byte \var
.byte \sourceId
.byte \targetId
.endm
3 changes: 1 addition & 2 deletions asm/macros/map.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
@ Defines an object event template for map data, to be used by a normal object. Mirrors the struct layout of ObjectEventTemplate in include/global.fieldmap.h
.macro object_event index:req, gfx:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
.byte \index
.byte \gfx
.2byte \gfx
.byte OBJ_KIND_NORMAL
.space 1 @ Padding
.2byte \x, \y
.byte \elevation
.byte \movement_type
Expand Down
2 changes: 2 additions & 0 deletions asm/macros/movement.inc
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,6 @@
create_movement_action emote_double_exclamation_mark, MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK
create_movement_action emote_x, MOVEMENT_ACTION_EMOTE_X

create_movement_action exit_pokeball, MOVEMENT_ACTION_EXIT_POKEBALL
create_movement_action enter_pokeball, MOVEMENT_ACTION_ENTER_POKEBALL
create_movement_action step_end, MOVEMENT_ACTION_STEP_END
2 changes: 2 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ Common_EventScript_OutOfCenterPartyHeal::
playfanfare MUS_HEAL
waitfanfare
special HealPlayerParty
callnative UpdateFollowingPokemon
fadescreen FADE_FROM_BLACK
return

Expand Down Expand Up @@ -1069,6 +1070,7 @@ EventScript_VsSeekerChargingDone::
.include "data/scripts/move_tutors.inc"
.include "data/scripts/trainer_hill.inc"
.include "data/scripts/test_signpost.inc"
.include "data/scripts/follower.inc"
.include "data/text/frontier_brain.inc"
.include "data/text/save.inc"
.include "data/text/birch_speech.inc"
15 changes: 15 additions & 0 deletions data/field_effect_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ gFieldEffectScriptPointers::
.4byte gFldEffScript_UseVsSeeker @ FLDEFF_USE_VS_SEEKER
.4byte gFldEffScript_XIcon @ FLDEFF_X_ICON
.4byte gFldEffScript_DoubleExclMarkIcon @ FLDEFF_DOUBLE_EXCL_MARK_ICON
.4byte gFieldEffectScript_TracksSlither @ FLDEFF_TRACKS_SLITHER
.4byte gFieldEffectScript_TracksBug @ FLDEFF_TRACKS_BUG
.4byte gFieldEffectScript_TracksSpot @ FLDEFF_TRACKS_SPOT

gFieldEffectScript_ExclamationMarkIcon1::
field_eff_callnative FldEff_ExclamationMarkIcon
Expand Down Expand Up @@ -359,3 +362,15 @@ gFldEffScript_XIcon::
gFldEffScript_DoubleExclMarkIcon::
field_eff_callnative FldEff_DoubleExclMarkIcon
field_eff_end

gFieldEffectScript_TracksBug::
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksBug
field_eff_end

gFieldEffectScript_TracksSpot::
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksSpot
field_eff_end

gFieldEffectScript_TracksSlither::
field_eff_loadfadedpal_callnative gSpritePalette_GeneralFieldEffect0, FldEff_TracksSlither
field_eff_end
2 changes: 1 addition & 1 deletion data/map_events.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include "constants/trainer_hill.h"
#include "constants/trainer_types.h"
#include "constants/berry.h"
#include "constants/species.h"
.include "asm/macros.inc"
.include "constants/constants.inc"

.section .rodata

.include "data/maps/events.inc"

3 changes: 3 additions & 0 deletions data/maps/BattleFrontier_BattleArenaLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ BattleFrontier_BattleArenaLobby_EventScript_SaveAfterChallenge::
frontier_checkairshow
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
arena_save 0
playse SE_SAVE
waitse
Expand Down Expand Up @@ -133,6 +134,7 @@ BattleFrontier_BattleArenaLobby_EventScript_TryEnterChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleArenaLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -194,6 +196,7 @@ BattleFrontier_BattleArenaLobby_EventScript_CancelChallengeSaveFailed::

BattleFrontier_BattleArenaLobby_EventScript_LoadPartyAndCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattleArenaLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattleArenaLobby_Text_AwaitAnotherChallenge, MSGBOX_DEFAULT
BattleFrontier_BattleArenaLobby_EventScript_EndCancelChallenge::
Expand Down
1 change: 1 addition & 0 deletions data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BattleFrontier_BattleDomeBattleRoom_MapScripts::
.byte 0

BattleFrontier_BattleDomeBattleRoom_OnTransition:
setflag FLAG_TEMP_HIDE_FOLLOWER
dome_setopponentgfx
frontier_get FRONTIER_DATA_BATTLE_NUM
copyvar VAR_TEMP_F, VAR_RESULT
Expand Down
4 changes: 4 additions & 0 deletions data/maps/BattleFrontier_BattleDomeLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ BattleFrontier_BattleDomeLobby_EventScript_GiveBattlePoints::
dome_set DOME_DATA_WIN_STREAK_ACTIVE, TRUE
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
goto BattleFrontier_BattleDomeLobby_EventScript_AskRecordBattle

BattleFrontier_BattleDomeLobby_EventScript_LostChallenge::
Expand All @@ -82,6 +83,7 @@ BattleFrontier_BattleDomeLobby_EventScript_LostChallenge::
dome_set DOME_DATA_ATTEMPTED_CHALLENGE, TRUE
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattleDomeLobby_EventScript_AskRecordBattle::
dome_save 0
playse SE_SAVE
Expand Down Expand Up @@ -160,6 +162,7 @@ BattleFrontier_BattleDomeLobby_EventScript_TryEnterChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleDomeLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -222,6 +225,7 @@ BattleFrontier_BattleDomeLobby_EventScript_CancelChallengeSaveFailed::

BattleFrontier_BattleDomeLobby_EventScript_LoadPartyCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattleDomeLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattleDomeLobby_Text_HopeToSeeYouAgain, MSGBOX_DEFAULT
BattleFrontier_BattleDomeLobby_EventScript_EndCancelChallenge::
Expand Down
3 changes: 3 additions & 0 deletions data/maps/BattleFrontier_BattleFactoryLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_GiveBattlePoints::
waitmessage
frontier_checkairshow
special LoadPlayerParty
callnative UpdateFollowingPokemon
factory_save 0
playse SE_SAVE
waitse
Expand All @@ -71,6 +72,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_LostChallenge::
waitmessage
frontier_checkairshow
special LoadPlayerParty
callnative UpdateFollowingPokemon
factory_set FACTORY_DATA_WIN_STREAK_ACTIVE, FALSE
factory_save 0
playse SE_SAVE
Expand Down Expand Up @@ -196,6 +198,7 @@ BattleFrontier_BattleFactoryLobby_EventScript_CancelChallengeSaveFailed::

BattleFrontier_BattleFactoryLobby_EventScript_LoadPartyAndCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattleFactoryLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattleFactoryLobby_Text_LookForwardToNextVisit, MSGBOX_DEFAULT
release
Expand Down
3 changes: 3 additions & 0 deletions data/maps/BattleFrontier_BattlePalaceLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_SaveAfterChallenge::
frontier_checkairshow
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
palace_save 0
playse SE_SAVE
waitse
Expand Down Expand Up @@ -151,6 +152,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_TryEnterChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattlePalaceLobby_Text_NowSelectThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -215,6 +217,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_CancelChallengeSaveFailed::

BattleFrontier_BattlePalaceLobby_EventScript_LoadPartyAndCancelChallenge::
special LoadPlayerParty
callnative LoadPlayerParty
BattleFrontier_BattlePalaceLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattlePalaceLobby_Text_ReturnWhenFortified, MSGBOX_DEFAULT
BattleFrontier_BattlePalaceLobby_EventScript_EndCancelChallenge::
Expand Down
4 changes: 4 additions & 0 deletions data/maps/BattleFrontier_BattlePikeLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ BattleFrontier_BattlePikeLobby_EventScript_GiveBattlePoints::
pike_set PIKE_DATA_TOTAL_STREAKS, VAR_RESULT
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
pike_resethelditems
message BattleFrontier_BattlePikeLobby_Text_ShallRecordResults
waitmessage
Expand All @@ -80,6 +81,7 @@ BattleFrontier_BattlePikeLobby_EventScript_LostChallenge::
pike_set PIKE_DATA_WIN_STREAK_ACTIVE, FALSE
special LoadPlayerParty
special HealPlayerParty
callnative UpdateFollowingPokemon
pike_resethelditems
pike_save 0
playse SE_SAVE
Expand Down Expand Up @@ -119,6 +121,7 @@ BattleFrontier_BattlePikeLobby_EventScript_TryEnterChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattlePikeLobby_Text_PleaseChooseThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -183,6 +186,7 @@ BattleFrontier_BattlePikeLobby_EventScript_CancelChallengeSaveFailed::

BattleFrontier_BattlePikeLobby_EventScript_LoadPartyAndCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattlePikeLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattlePikeLobby_Text_LookForwardToSeeingYou, MSGBOX_DEFAULT
BattleFrontier_BattlePikeLobby_EventScript_EndCancelChallenge::
Expand Down
4 changes: 4 additions & 0 deletions data/maps/BattleFrontier_BattlePyramidLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_GiveBattlePoints::
special LoadPlayerParty
pyramid_clearhelditems
special HealPlayerParty
callnative UpdateFollowingPokemon
message BattleFrontier_BattlePyramidLobby_Text_UsedBattleBagWillBeKept
waitmessage
playse SE_EXP_MAX
Expand All @@ -83,6 +84,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_LostChallenge::
special LoadPlayerParty
pyramid_clearhelditems
special HealPlayerParty
callnative UpdateFollowingPokemon
lockall
message BattleFrontier_BattlePyramidLobby_Text_DisappointingHereIsBag
waitmessage
Expand Down Expand Up @@ -132,6 +134,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_TryEnterChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattlePyramidLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -196,6 +199,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_CancelChallengeSaveFailed::
BattleFrontier_BattlePyramidLobby_EventScript_LoadPartyAndCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattlePyramidLobby_EventScript_CancelChallenge::
msgbox BattleFrontier_BattlePyramidLobby_Text_AwaitFutureChallenge, MSGBOX_DEFAULT
BattleFrontier_BattlePyramidLobby_EventScript_EndCancelChallenge::
Expand Down
7 changes: 7 additions & 0 deletions data/maps/BattleFrontier_BattleTowerLobby/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ BattleFrontier_BattleTowerLobby_EventScript_LookForwardToChallenge::
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
closemessage
setvar VAR_TEMP_CHALLENGE_STATUS, 255
callnative UpdateFollowingPokemon
release
end
Expand All @@ -114,6 +115,7 @@ BattleFrontier_BattleTowerLobby_EventScript_LostThanksForPlaying::
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
closemessage
setvar VAR_TEMP_CHALLENGE_STATUS, 255
callnative UpdateFollowingPokemon
release
end
Expand Down Expand Up @@ -200,6 +202,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterSinglesChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleTowerLobby_Text_SelectThreeMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_PARTY_SIZE
Expand Down Expand Up @@ -263,6 +266,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterDoublesChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectFourMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_DOUBLES_PARTY_SIZE
Expand Down Expand Up @@ -327,6 +331,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterMultisChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE
Expand Down Expand Up @@ -390,6 +395,7 @@ BattleFrontier_BattleTowerLobby_EventScript_TryEnterLinkMultisChallenge::
frontier_set FRONTIER_DATA_LVL_MODE, VAR_RESULT
msgbox BattleFrontier_BattleTowerLobby_Text_PleaseSelectTwoMons2, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
callnative RemoveFollowingPokemon
call BattleFrontier_EventScript_GetLvlMode
copyvar VAR_0x8004, VAR_RESULT
setvar VAR_0x8005, FRONTIER_MULTI_PARTY_SIZE
Expand Down Expand Up @@ -582,6 +588,7 @@ BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed::
BattleFrontier_BattleTowerLobby_EventScript_LoadPartyCancelChallenge::
special LoadPlayerParty
callnative UpdateFollowingPokemon
BattleFrontier_BattleTowerLobby_EventScript_CancelChallenge::
special CloseLink
msgbox BattleFrontier_BattleTowerLobby_Text_LookForwardToAnotherChallenge, MSGBOX_DEFAULT
Expand Down
1 change: 1 addition & 0 deletions data/maps/FortreeCity_Gym/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FortreeCity_Gym_MapScripts::

FortreeCity_Gym_OnTransition:
special RotatingGate_InitPuzzle
setflag FLAG_TEMP_HIDE_FOLLOWER @ Hide follower bc of rotating gates
end

FortreeCity_Gym_OnWarp:
Expand Down
5 changes: 5 additions & 0 deletions data/maps/MossdeepCity_Gym/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
MossdeepCity_Gym_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, MossdeepCity_Gym_OnTransition
map_script MAP_SCRIPT_ON_LOAD, MossdeepCity_Gym_OnLoad
.byte 0

@ NOTE: Mossdeep Gym was redesigned between R/S and E. Leftover (and now functionally unused) scripts are commented below

MossdeepCity_Gym_OnTransition:
setflag FLAG_TEMP_HIDE_FOLLOWER @ Hide follower since it can collide with moving statues
end

@ All the below checks are leftover from RS. FLAG_MOSSDEEP_GYM_SWITCH_X is never set
MossdeepCity_Gym_OnLoad:
goto_if_set FLAG_MOSSDEEP_GYM_SWITCH_1, MossdeepCity_Gym_EventScript_SetSwitch1Metatiles
Expand Down
Loading

0 comments on commit f11826b

Please sign in to comment.