Commit Graph

24 Commits (274d308d9a0f2dddcd1e2b9469bc8f707f7c54c0)

Author SHA1 Message Date
TheGag96 591c0b58d5 Fix issues Extended Moveset mod (+ extras) (#146)
* Allow Lua action hooks to specify custom functions for more behavior

...like gravity, and update all current mods to match.

Spin jump and wall slide from the Extended Moveset mod now have gravity
code basically matching the original mod.

Currently, any place you'd want to use one of these new action hooks
still requires an O(n) check through all action hook per call. This
should probably be changed.

* Fix some remaining issues with Extended Moveset Lua port

- Remove divergent spin jump code
- Remove divergent roll code
- Remap roll button to Y
- Reimplement dive slide to make dive hop work like the original
- Allow spin from double jump, backflip, side flip

* Fix more issues with Extended Moveset Lua port

- Reimplement all users of update_walking_speed to incorporate the Tight
  Controls edits and modified speed caps
- Fix instances of angle arithmetic to wrap properly across the mod

* Don't chop off group bits of custom action flags; assign missing groups in mods

This fixes the Extended Moveset's underwater actions. Chopping off those
bits was making the game consider the underwater actions to be a part of
the Stationary group, which caused `check_common_stationary_cancels`,
which upwarps Mario to the surface.

* Tweak roll sliding angle tendency

Rolling will now gradually (but fairly quckly) try to tend Mario's
facing angle down the slope.

This is cleaner than my old method that tries to flip Mario's angle
(wrongly) when he begins moving downward, having that logic coexist with
the logic for normal sliding actions that can also tend Mario to face
backward down the slope. Just looks ugly now by comparison.

* Disallow spin jump on slides in Extended Moveset port

This matches the original mod

* Extended Moveset: Crazy Box Bounce check

* Extended Moveset: Fix hugging the wall when spin jumping after wall kick

* Extended Moveset: Fix ledge drop snapping up to ground

Just reimplement `act_air_hit_wall` ourselves.

* Extended Moveset: Add Kaze's walking speed fix

* smlua_hooks.c: Restore option to use old API for hook_mario_action

The intent is to allow mods outside of this repo to continue working.

Co-authored-by: djoslin0 <djoslin0@users.noreply.github.com>
2022-08-07 15:25:00 -07:00
MysterD d3ed4f3362 Add HOOK_USE_ACT_SELECT ; increase MAX_AUDIO_OVERRIDE to 128 2022-08-04 01:12:16 -07:00
PeachyPeach 5ddf093c26 HOOK_ALLOW_INTERACT; new HUD functions (#73)
Added new hook: HOOK_ALLOW_INTERACT:
        Called before Mario interacts with an object. Return true to allow the interaction.
        The hook signature is bool function(MarioState, Object, InteractionType)

    Added new HUD constants:
        enum HudDisplayValue:
            HUD_DISPLAY_LIVES
            HUD_DISPLAY_COINS
            HUD_DISPLAY_STARS
            HUD_DISPLAY_WEDGES
            HUD_DISPLAY_KEYS
            HUD_DISPLAY_FLAGS
            HUD_DISPLAY_TIMER
        enum HudDisplayFlags:
            HUD_DISPLAY_FLAGS_NONE
            HUD_DISPLAY_FLAGS_LIVES
            HUD_DISPLAY_FLAGS_COIN_COUNT
            HUD_DISPLAY_FLAGS_STAR_COUNT
            HUD_DISPLAY_FLAGS_CAMERA_AND_POWER
            HUD_DISPLAY_FLAGS_KEYS
            HUD_DISPLAY_FLAGS_UNKNOWN_0020
            HUD_DISPLAY_FLAGS_TIMER
            HUD_DISPLAY_FLAGS_EMPHASIZE_POWER

    Added new HUD functions:
        s32 hud_get_value(enum HudDisplayValue type)
        void hud_set_value(enum HudDisplayValue type, s32 value)
        void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height)
2022-04-30 17:33:38 -07:00
MysterD 2552d22cf9 Added custom mod packets 2022-04-22 00:13:58 -07:00
MysterD 77ca167564 Added HOOK_ON_DEATH 2022-04-21 18:34:12 -07:00
MysterD 1b291b0941 Added HOOK_ON_OBJECT_RENDER 2022-04-19 22:36:47 -07:00
MysterD dc4310a152 Improve rom hack camera's collisions in tight spaces and focus underwater. Add HOOK_ON_SET_CAMERA_MODE 2022-04-13 00:10:50 -07:00
MysterD 0e4ab8ec64 Added HOOK_GET_STAR_COLLECTION_DIALOG 2022-04-10 02:44:11 -07:00
MysterD 377fcefd86 Allow Lua mods to prevent exit to castle/exit course 2022-03-30 20:03:22 -07:00
MysterD f8d52343b5 Add HOOK_ON_PAUSE_EXIT 2022-03-25 23:06:14 -07:00
MysterD d5f225018f Added HOOK_ON_OBJECT_UNLOAD, HOOK_ON_SYNC_OBJECT_UNLOAD 2022-03-17 01:43:08 -07:00
MysterD 55ff99cfe2 Added hooks: HOOK_ON_LEVEL_INIT, HOOK_ON_WARP, HOOK_ON_SYNC_VALID 2022-03-16 23:53:01 -07:00
MysterD bdd939f24e Added hook: HOOK_ALLOW_PVP_ATTACK, disabled friendly fire in football 2022-03-12 23:43:47 -08:00
MysterD 4405164667 Made adding to behaviors possible in Lua 2022-03-05 01:29:24 -08:00
MysterD b6004d7358 Update Lua documentation autogeneration 2022-03-04 22:22:31 -08:00
MysterD 6e74c21b0f Fixed how constants.md autogen'd links 2022-03-04 22:11:10 -08:00
MysterD e4f9df99d1 Document hook_behavior() 2022-03-04 21:58:51 -08:00
MysterD e7e94a5155 Add ON_HUD_RENDER to Lua hook docs 2022-02-18 19:48:05 -08:00
MysterD a1ec9ad628 Added HOOK_ON_INTERACT to Lua API 2022-02-15 22:21:31 -08:00
MysterD e53c3d5f71 Add Wario's moveset based on steven's mod 2022-02-14 18:26:44 -08:00
MysterD 3dca09851e Added hook_on_sync_table_change() to Lua API 2022-02-04 00:15:14 -08:00
MysterD ecb6956203 Rewrite of how lua hooks chat commands 2022-02-03 19:50:27 -08:00
MysterD 3677a1ac7f Added support for returning structs from C to Lua 2022-02-03 00:43:08 -08:00
MysterD 96310b7c87 Added hooks to Lua documentation 2022-01-30 00:07:50 -08:00