pokeemerald/data
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
..
layouts refactor: code review for expansion 2024-05-17 20:45:32 -04:00
maps Arbitrary trainer scripts + map script/trigger softlock prevention (#5033) 2025-01-08 10:27:00 +00:00
scripts Arbitrary trainer scripts + map script/trigger softlock prevention (#5033) 2025-01-08 10:27:00 +00:00
text Removed FRONTIER_BRAIN_SPRITES and updated TRAINER_SPRITE, TRAINER_BACK_SPRITE, and TRAINER_CLASS (#5166) 2024-09-22 09:54:01 +02:00
tilesets Revert metatile behavior 2024-07-25 20:23:04 -07:00
battle_anim_scripts.s Merge branch '_RHH/master' into _RHH/upcoming 2024-12-31 18:38:03 -03:00
battle_scripts_1.s Battle Weather Refactor (#5833) 2025-01-04 07:33:25 -05:00
battle_scripts_2.s simultaneous hp reduction 2024-11-23 08:35:01 +01:00
contest_ai_scripts.s Move general config file to the config folder (#4805) 2024-06-19 13:42:01 +02:00
event_scripts.s Adds B_VAR_DIFFICULTY and related functions READ DESC (#5337) 2025-01-04 14:25:03 +01:00
field_effect_scripts.s syntax, alignment fixes 2024-07-08 14:15:41 -04:00
map_events.s Updated existing OW pokemon events with new system. 2023-01-12 21:45:42 -05:00
maps.s Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
mb_berry_fix.gba Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
mb_colosseum.gba Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
mb_ereader.gba Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
multiboot_berry_glitch_fix.s Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
multiboot_ereader.s Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
multiboot_pokemon_colosseum.s Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
mystery_event_script_cmd_table.s Remove address comments 2021-07-20 15:18:31 -04:00
mystery_gift.s Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into HEAD 2022-04-02 18:45:18 -03:00
script_cmd_table.inc Arbitrary trainer scripts + map script/trigger softlock prevention (#5033) 2025-01-08 10:27:00 +00:00
sound_data.s Organized conffig files into their own folder and cleaned up 2022-11-14 11:03:49 -03:00
specials.inc Arbitrary trainer scripts + map script/trigger softlock prevention (#5033) 2025-01-08 10:27:00 +00:00