Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tangibility toggle option for the custom puffer #76

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Ahorn/entities/customPuffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module FlushelineCustomPuffer

using ..Ahorn, Maple

@mapdef Entity "vitellary/custompuffer" CustomPuffer(x::Integer, y::Integer, right::Bool=false, static::Bool=false, alwaysShowOutline::Bool=true, pushAnyDir::Bool=false, oneUse::Bool=false, angle::Number=0.0, radius::Integer=32, launchSpeed::Number=280.0, respawnTime::Number=2.5, sprite::String="pufferFish", deathFlag::String="", holdable::Bool=false, outlineColor::String="FFFFFF", returnToStart::Bool=true, holdFlip::Bool=false, boostMode::String="SetSpeed")
@mapdef Entity "vitellary/custompuffer" CustomPuffer(x::Integer, y::Integer, right::Bool=false, static::Bool=false, alwaysShowOutline::Bool=true, pushAnyDir::Bool=false, oneUse::Bool=false, angle::Number=0.0, radius::Integer=32, launchSpeed::Number=280.0, respawnTime::Number=2.5, sprite::String="pufferFish", deathFlag::String="", holdable::Bool=false, outlineColor::String="FFFFFF", returnToStart::Bool=true, holdFlip::Bool=false, boostMode::String="SetSpeed", tangible::Bool=true)

const placements = Ahorn.PlacementDict(
"Custom Puffer (Right) (Crystalline)" => Ahorn.EntityPlacement(
Expand Down Expand Up @@ -54,4 +54,4 @@ function Ahorn.flipped(entity::CustomPuffer, horizontal::Bool)
end
end

end
end
1 change: 1 addition & 0 deletions Ahorn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ placements.entities.vitellary/custompuffer.tooltips.outlineColor=The color of th
placements.entities.vitellary/custompuffer.tooltips.returnToStart=Whether the puffer will respawn at its starting position.
placements.entities.vitellary/custompuffer.tooltips.holdFlip=Whether the puffer will flip with the player when held.
placements.entities.vitellary/custompuffer.tooltips.boostMode=The way the puffer's explosion should affect the player.\nSet Speed: Default puffer behavior, sets the player's speed to the launch speed in the angle specified.\nRedirect Speed: If the player has a greater speed than the launch speed specified, apply that speed to the new angle instead.\nRedirect + Add Speed: Takes the player's current speed and redirects it, then adds the puffer's launch speed as well.
placements.entities.vitellary/custompuffer.tooltips.tangible=Controls if the puffer can be hit by the player.

# Energy Booster
placements.entities.vitellary/energybooster.tooltips.behaveLikeDash=Whether the speed resets after the initial boost unless dashing down diagonal.
Expand Down
4 changes: 3 additions & 1 deletion Code/FLCC/CustomPuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public enum BoostModes
private bool legacyBoost = true;
private bool absoluteVector = false;
private bool launchState = true;
private bool tangible = true;

public CustomPuffer(Vector2 position, bool faceRight, float angle = 0f, float radius = 32f, float launchSpeed = 280f, string spriteName = "pufferFish")
: base(position)
Expand Down Expand Up @@ -136,6 +137,7 @@ public CustomPuffer(EntityData data, Vector2 offset, EntityID id)
legacyBoost = data.Bool("legacyBoost", true);
absoluteVector = data.Bool("absoluteVector", false);
launchState = data.Bool("setLaunchState", true);
tangible=data.Bool("tangible", true);

if (data.Bool("holdable"))
{
Expand Down Expand Up @@ -729,7 +731,7 @@ private void Alert(bool restart, bool playSfx)

private void OnPlayer(Player player)
{
if (State == States.Gone || State == States.Held || !(cantExplodeTimer <= 0f))
if (State == States.Gone || State == States.Held || !(cantExplodeTimer <= 0f) || !tangible)
{
return;
}
Expand Down
4 changes: 3 additions & 1 deletion Loenn/entities/custom_puffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ customPuffer.placements = {
boostMode = "SetSpeed",
legacyBoost = false,
absoluteVector = false,
tangible = true,
}
},
{
Expand All @@ -46,6 +47,7 @@ customPuffer.placements = {
boostMode = "SetSpeed",
legacyBoost = false,
absoluteVector = false,
tangible = true,
}
}
}
Expand Down Expand Up @@ -75,4 +77,4 @@ function customPuffer.scale(room, entity)
return right and 1 or -1, 1
end

return customPuffer
return customPuffer
1 change: 1 addition & 0 deletions Loenn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ entities.vitellary/custompuffer.attributes.description.holdFlip=Whether the puff
entities.vitellary/custompuffer.attributes.description.boostMode=The way the puffer's explosion should affect the player.\nSet Speed: Default puffer behavior, sets the player's speed to the launch speed in the angle specified.\nRedirect Speed: If the player has a greater speed than the launch speed specified, apply that speed to the new angle instead.\nRedirect + Add Speed: Takes the player's current speed and redirects it, then adds the puffer's launch speed as well.
entities.vitellary/custompuffer.attributes.description.legacyBoost=Whether the puffer boost should use the older, less lenient method of checking player input (only accepting input before the freeze frames, rather than after).
entities.vitellary/custompuffer.attributes.description.absoluteVector=If true, the redirect modes for launch will use the player's full speed, including vertical and horizontal, rather than only horizontal speed.
entities.vitellary/custompuffer.attributes.description.tangible=Controls if the puffer can be hit by the player.

# Energy Booster
entities.vitellary/energybooster.attributes.description.behaveLikeDash=Whether the speed resets after the initial boost unless dashing down diagonal.
Expand Down