pokeemerald/data/scripts
Martin Griffin bb781f21a1
Arbitrary trainer scripts + map script/trigger softlock prevention (#5033)
Script_RunImmediatelyUntilEffect runs a script until either a specified
effect may occur or it reaches an end.

All existing script commands and natives, and some specials, call
Script_RequestEffects which allows us to analyze them.

Any downstream script commands/natives/specials will be statically known
not to call Script_RequestEffects and treated as if they have all
effects. Manually tagging them with requests_effects=1 and calling
Script_RequestEffects will make them analyzable.

Using these, we're able to execute scripts until they either exit with
no effect, or would possibly have an effect. This allows us to:
1. Not run on frame map scripts or triggers if they would have no
   effect.
2. Immediately run triggers if they only affect flags/vars. This removes
   the lag frames when biking into the Cycling Road, for example.
3. Migrate on load/on transition/on resume/on return to field/on dive
   warp scripts onto the global script context if they would block
   (approximated via SCREFF_HARDWARE).
4. Support arbitrary control flow in trainer scripts. The trainer does
   not see the player if the script has no effect, and the trainer will
   use whichever trainerbattle command is branched to.
5. Support arbitrary scripts in trainer scripts. cant_see and
   cant_see_if_* commands have been introduced so that scripts are able
   to do something when the player interacts with the trainer even if
   that trainer wouldn't see them.
2025-01-08 10:27:00 +00:00
..
abnormal_weather.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
apprentice.inc Use STR_VAR names for apprentice_buff and frontier_gettrainername 2021-11-18 23:20:05 -05:00
battle_pike.inc Whitespace, documentation and style 2024-01-22 19:12:52 -03:00
berry_blender.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
berry_tree.inc (Default Off) Item Description Headers (#4767) 2024-09-03 20:22:01 +02:00
cable_club.inc Add OW_UNION_DISABLE_CHECK and OW_FLAG_MOVE_UNION_ROOM_CHECK (#5448) 2024-10-07 17:07:23 +02:00
cave_hole.inc Remove address comments 2021-07-20 15:18:31 -04:00
cave_of_origin.inc Add CRY_MODE constants 2021-11-07 13:33:05 -05:00
check_furniture.inc Remove address comments 2021-07-20 15:18:31 -04:00
config.inc [Rebase of #4286] Reordered Debug_EventScript_InflictStatus1 (#4372) 2024-04-14 17:31:39 -04:00
contest_hall.inc Add extra key item bag space checks (#4066) 2024-01-26 21:11:04 +01:00
day_care.inc Whitespace, documentation and style 2024-01-22 19:12:52 -03:00
debug.inc Narrower font tweaks and font fitting fixes (#5782) 2024-12-07 18:12:09 -03:00
dexnav.inc some more fixes 2024-11-03 10:11:05 -05:00
elite_four.inc More updating event macro comments 2021-11-16 17:46:34 -05:00
field_move_scripts.inc Merge branch 'followers-expanded-id' of https://github.com/aarant/pokeemerald into merrpmerge1210 2024-10-12 18:41:33 +02:00
field_poison.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
flash.inc Whitespace, documentation and style 2024-01-22 19:12:52 -03:00
follower.inc Metatile + commas 2024-05-30 13:56:14 -04:00
gabby_and_ty.inc Add temp flag aliases 2023-08-03 15:55:06 -04:00
gift_altering_cave.inc Fix inconsistent static s/g names 2022-05-17 14:00:02 -04:00
gift_aurora_ticket.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
gift_battle_card.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
gift_mystic_ticket.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
gift_old_sea_map.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
gift_pichu.inc Updated term to modernFatefulEncounter 2023-02-11 22:36:42 -03:00
gift_stamp_card.inc Add STR_VAR_# ids to string buffer macros 2021-11-17 22:00:44 -05:00
gift_trainer.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
hall_of_fame.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
interview.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
item_ball_scripts.inc Item Ball refactor / Pluralize item names for giveitem and finditem (#3942) 2024-01-14 21:35:45 +01:00
kecleon.inc Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
lilycove_lady.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
mauville_man.inc Document the trendy saying word group 2023-03-13 15:58:40 -04:00
move_tutors.inc Removed tutor move distinction, combined llists 2022-08-25 19:56:47 -04:00
movement.inc fix: Made Common_Movement_* 'safe' for followers 2024-04-27 22:47:41 -04:00
new_game.inc Cleaned trailing whitespace 2022-09-11 14:14:49 -04:00
obtain_item.inc (Default Off) Item Description Headers (#4767) 2024-09-03 20:22:01 +02:00
pc_transfer.inc Add temp var aliases 2023-08-04 14:17:28 -04:00
pc.inc Implement Pokemon Box Link functionality (#3837) 2023-12-28 11:47:00 +01:00
pkmn_center_nurse.inc Add OW_UNION_DISABLE_CHECK and OW_FLAG_MOVE_UNION_ROOM_CHECK (#5448) 2024-10-07 17:07:23 +02:00
players_house.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
prof_birch.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
profile_man.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
questionnaire.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
record_mix.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
repel.inc Improved Repel / Lure Menu (#3594) 2023-11-23 21:31:33 +01:00
rival_graphics.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
roulette.inc Cleaned trailing whitespace 2022-09-11 14:14:49 -04:00
safari_zone.inc Fix Pokeblock script missing a releaseall 2024-05-19 12:52:04 +02:00
secret_base.inc Whitespace, documentation and style 2024-01-22 19:12:52 -03:00
secret_power_tm.inc Reference TMs and HMs by move instead of number (#1732) 2023-08-09 10:51:01 -04:00
set_gym_trainers.inc Remove address comments 2021-07-20 15:18:31 -04:00
shared_secret_base.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
std_msgbox.inc Continue updating event macro comments 2021-11-16 13:10:23 -05:00
surf.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00
test_signpost.inc Remove address comments 2021-07-20 15:18:31 -04:00
trainer_battle.inc Whitespace, documentation and style 2024-01-22 19:12:52 -03:00
trainer_hill.inc Incorporated upstream fixes 2023-10-27 11:04:10 -03:00
trainer_script.inc Arbitrary trainer scripts + map script/trigger softlock prevention (#5033) 2025-01-08 10:27:00 +00:00
tv.inc Reformat compare + goto_if/call_if to single statements 2021-11-18 23:06:51 -05:00