Skip to content

Commit

Permalink
Merge pull request #72 from CommunalHelper/coyote-bounce-trigger
Browse files Browse the repository at this point in the history
refill dashes/stamina options
  • Loading branch information
vitellaryjr authored Sep 24, 2024
2 parents bb1baaf + 2f446c9 commit 12e2429
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Code/CoyoteBounceTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ private static void HookDashCollision(DashCollisionResults result, Player player

if (CoyoteBounceTrigger.MatchDirection(direction, bouncer.refill))
{
player.RefillDash();
player.RefillStamina();
if (bouncer.dashes)
{
player.RefillDash();
}
if (bouncer.stamina)
{
player.RefillStamina();
}
}
}

Expand All @@ -93,6 +99,8 @@ public static void Unload() {
public float time;
public BounceDirections refill;
public bool setGrounded;
public bool dashes;
public bool stamina;

public static CoyoteBounceTrigger CoyoteTriggerInside;
public static bool GroundedOverride;
Expand All @@ -107,6 +115,8 @@ public CoyoteBounceTrigger(EntityData data, Vector2 offset) : base(data, offset)
refill = data.Enum("refillDirections", BounceDirections.Top);
}
setGrounded = data.Bool("setGrounded", false);
dashes = data.Bool("refillDashes", true);
stamina = data.Bool("refillStamina", true);
}

public override void OnEnter(Player player) {
Expand Down
2 changes: 2 additions & 0 deletions Loenn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ triggers.vitellary/coyotebounce.attributes.description.directions=The sides of t
triggers.vitellary/coyotebounce.attributes.description.refillDirections=The directions that you can regain dashes and stamina from upon collision.\n"Match Coyote" means it will match the behavior of the "Directions" field.
triggers.vitellary/coyotebounce.attributes.description.dashTypes=What type of collision should grant the coyote frames.\nPreviously, this defaulted to "All", which was unintended behavior.
triggers.vitellary/coyotebounce.attributes.description.setGrounded=Whether the player should be considered grounded during the coyote frame period.\nThis is NOT the vanilla behavior, and may be jank.
triggers.vitellary/coyotebounce.attributes.description.refillDashes=Whether the 'Refill Directions' property should refill dashes or not.
triggers.vitellary/coyotebounce.attributes.description.refillStamina=Whether the 'Refill Directions' property should refill stamina or not.

# Flag Inside Trigger
triggers.vitellary/flaginsidetrigger.attributes.description.flag=The flag to set while the player is inside the trigger.
Expand Down
2 changes: 2 additions & 0 deletions Loenn/triggers/coyote_bounce_trigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ coyoteBounceTrigger.placements = {
refillDirections = "MatchCoyote",
dashTypes = "Rebound",
setGrounded = false,
refillDashes = true,
refillStamina = true,
}
}
}
Expand Down

0 comments on commit 12e2429

Please sign in to comment.