Skip to content

Commit 15177cb

Browse files
authored
Merge pull request #93 from earthwise01/energy-booster-set-lastbooster
Add set last booster option to energy boosters
2 parents 1ef9ba7 + 332c48b commit 15177cb

6 files changed

Lines changed: 15 additions & 2 deletions

File tree

Ahorn/entities/energyBooster.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module FlushelineEnergyBooster
22

33
using ..Ahorn, Maple
44

5-
@mapdef Entity "vitellary/energybooster" EnergyBooster(x::Integer, y::Integer, behaveLikeDash::Bool=false, redirectSpeed::Bool=false, oneUse::Bool=false)
5+
@mapdef Entity "vitellary/energybooster" EnergyBooster(x::Integer, y::Integer, behaveLikeDash::Bool=false, redirectSpeed::Bool=false, oneUse::Bool=false, setLastBooster::Bool=true)
66

77
const placements = Ahorn.PlacementDict(
88
"Energy Booster (Crystalline)" => Ahorn.EntityPlacement(

Ahorn/lang/en_gb.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ placements.entities.vitellary/custompuffer.tooltips.tangible=Controls if the puf
9393
placements.entities.vitellary/energybooster.tooltips.behaveLikeDash=Whether the speed resets after the initial boost unless dashing down diagonal.
9494
placements.entities.vitellary/energybooster.tooltips.redirectSpeed=Stores your total speed regardless of direction and sends you out exactly that fast in the direction you boost.
9595
placements.entities.vitellary/energybooster.tooltips.oneUse=Whether the booster can only be used once.
96+
placements.entities.vitellary/energybooster.tooltips.setLastBooster=Whether to correctly update the internal variable that keeps track of the last booster touched by the player.\nDisabling this can result in unintended behavior when used alongside other custom booster entities.
9697

9798
# Paired Dash Switch
9899
placements.entities.vitellary/paireddashswitch.tooltips.flag=If specified, this flag will be set to true when the switch is pressed.

Code/FLCC/EnergyBooster.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class EnergyBooster : Entity
3030
private bool dashBehavior;
3131
private bool redirectSpeed;
3232
private bool oneUse;
33+
private bool setLastBooster;
3334

3435
public Vector2 PlayerSpeed;
3536

@@ -44,6 +45,7 @@ public EnergyBooster(EntityData data, Vector2 offset) : base(data.Position + off
4445
dashBehavior = data.Bool("behaveLikeDash");
4546
redirectSpeed = data.Bool("redirectSpeed");
4647
oneUse = data.Bool("oneUse");
48+
setLastBooster = data.Bool("setLastBooster", false);
4749

4850
Depth = -8500;
4951
Collider = new Circle(10f, 0f, 2f);
@@ -102,6 +104,8 @@ private void OnPlayer(Player player)
102104
{
103105
cannotUseTimer = 0.45f;
104106
player.boostRed = false;
107+
if (setLastBooster)
108+
player.LastBooster = player.CurrentBooster = null;
105109
player.StateMachine.State = 4;
106110
PlayerSpeed = player.Speed;
107111
if (player.LiftSpeed != Vector2.Zero)

Loenn/entities/energy_booster.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ energyBooster.placements = {
1111
behaveLikeDash = false,
1212
redirectSpeed = false,
1313
oneUse = false,
14+
setLastBooster = true,
1415
},
1516
},
1617
{
@@ -19,10 +20,16 @@ energyBooster.placements = {
1920
behaveLikeDash = false,
2021
redirectSpeed = true,
2122
oneUse = false,
23+
setLastBooster = true,
2224
},
2325
},
2426
}
2527

28+
energyBooster.fieldOrder = {
29+
"x", "y",
30+
"redirectSpeed", "behaveLikeDash", "oneUse", "setLastBooster",
31+
}
32+
2633
function energyBooster.sprite(room, entity)
2734
return drawableSprite.fromTexture(entity.redirectSpeed and "objects/CrystallineHelper/FLCC/energyBoosterRedirect/booster00" or "objects/CrystallineHelper/FLCC/energyBooster/booster00", entity)
2835
end

Loenn/lang/en_gb.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ entities.vitellary/custompuffer.attributes.description.tangible=Controls if the
213213
entities.vitellary/energybooster.attributes.description.behaveLikeDash=Whether the speed resets after the initial boost unless dashing down diagonal.
214214
entities.vitellary/energybooster.attributes.description.redirectSpeed=Stores your total speed regardless of direction and sends you out exactly that fast in the direction you boost.
215215
entities.vitellary/energybooster.attributes.description.oneUse=Whether the booster can only be used once.
216+
entities.vitellary/energybooster.attributes.description.setLastBooster=Whether to correctly update the internal variable that keeps track of the last booster touched by the player.\nDisabling this can result in unintended behavior when used alongside other custom booster entities.
216217

217218
# Paired Dash Switch
218219
entities.vitellary/paireddashswitch.attributes.description.flag=If specified, this flag will be set to true when the switch is pressed.

everest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DLL: Code/bin/vitmod.dll
44
Dependencies:
55
- Name: EverestCore
6-
Version: 1.5184.0
6+
Version: 1.5577.0
77
OptionalDependencies:
88
- Name: FrostHelper
99
Version: 1.21.2

0 commit comments

Comments
 (0)