Skip to content

Commit b949c7b

Browse files
committed
Merge branch 'dev' of https://github.com/CommunalHelper/VortexHelper into dev
2 parents cd316cb + e2e7f20 commit b949c7b

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

Code/Entities/VortexBumper.cs

+24-6
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ public class VortexBumper : Entity
3535
private readonly bool notCoreMode, wobble;
3636

3737
public VortexBumper(EntityData data, Vector2 offset)
38-
: this(data.Position + offset, data.FirstNodeNullable(offset), data.Attr("style", "Green"), data.Bool("notCoreMore"), data.Bool("wobble", true), data.Attr("sprite").Trim().TrimEnd('/')) { }
38+
: this(data.Position + offset, data.FirstNodeNullable(offset), data.Attr("style", "Green"), data.Bool("notCoreMore"),
39+
data.Bool("wobble", true), data.Attr("sprite").Trim().TrimEnd('/'),
40+
data.Bool("useCustomParticleColors"), data.HexColor("particleColor1"), data.HexColor("particleColor2")) { }
3941

40-
public VortexBumper(Vector2 position, Vector2? node, string style, bool notCoreMode, bool wobble, string customSpritePath)
42+
public VortexBumper(Vector2 position, Vector2? node, string style, bool notCoreMode, bool wobble, string customSpritePath,
43+
bool useCustomParticleColors, Color particleColor, Color particleColor2)
4144
: base(position)
4245
{
4346
this.Collider = new Circle(12f);
@@ -49,21 +52,36 @@ public VortexBumper(Vector2 position, Vector2? node, string style, bool notCoreM
4952
if (!string.IsNullOrEmpty(customSpritePath))
5053
this.sprite = BuildCustomSprite(customSpritePath, style.ToLower());
5154

55+
// Custom particle colours support
56+
if (useCustomParticleColors)
57+
{
58+
p_ambiance = new(Bumper.P_Ambience)
59+
{
60+
Color = particleColor,
61+
Color2 = particleColor2
62+
};
63+
p_launch = new(Bumper.P_Launch)
64+
{
65+
Color = p_ambiance.Color,
66+
Color2 = p_ambiance.Color2
67+
};
68+
}
69+
5270
switch (style)
5371
{
5472
default:
5573
case "Green":
5674
this.sprite ??= VortexHelperModule.VortexBumperSpriteBank.Create("greenBumper");
5775
this.twoDashes = true;
58-
this.p_ambiance = P_GreenAmbience;
59-
this.p_launch = P_GreenLaunch;
76+
this.p_ambiance ??= P_GreenAmbience;
77+
this.p_launch ??= P_GreenLaunch;
6078
break;
6179

6280
case "Orange":
6381
this.sprite ??= VortexHelperModule.VortexBumperSpriteBank.Create("orangeBumper");
6482
this.oneUse = true;
65-
this.p_ambiance = P_OrangeAmbience;
66-
this.p_launch = P_OrangeLaunch;
83+
this.p_ambiance ??= P_OrangeAmbience;
84+
this.p_launch ??= P_OrangeLaunch;
6785
break;
6886
}
6987
this.notCoreMode = notCoreMode;

Loenn/entities/vortex_custom_bumper.lua

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ vortexCustomBumper.fieldInformation = {
1717
style = {
1818
options = styles,
1919
editable = false
20+
},
21+
particleColor1 = {
22+
fieldType = "color"
23+
},
24+
particleColor2 = {
25+
fieldType = "color"
2026
}
2127
}
2228

@@ -28,7 +34,10 @@ for _, style in ipairs(styles) do
2834
style = style,
2935
notCoreMode = false,
3036
wobble = true,
31-
sprite = ""
37+
sprite = "",
38+
useCustomParticleColors = false,
39+
particleColor1 = (style == "Orange" and "cc9747") or "5dcc47",
40+
particleColor2 = (style == "Orange" and "ffdfc4") or "c4ffc9"
3241
}
3342
}
3443
table.insert(vortexCustomBumper.placements, placement)

Loenn/lang/en_gb.lang

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ entities.VortexHelper/VortexCustomBumper.attributes.description.style=Alters the
8787
entities.VortexHelper/VortexCustomBumper.attributes.description.notCoreMode=Whether this bumper's style should remain the same, independently of the current Core Mode.
8888
entities.VortexHelper/VortexCustomBumper.attributes.description.wobble=Allows this bumper to wobble around and react to the player bouncing on it.
8989
entities.VortexHelper/VortexCustomBumper.attributes.description.sprite=Custom sprite path for this bumper that leads to custom frames.\nThe frame count must match the one from the original skin, and the files need to have this bumper's style as their name (all lowercase), + the frame index.\nFor instance: green00.png, green01.png, green02.png, etc... given that this bumper uses the green style.\nThe sprites must be located somewhere in the Gameplay atlas (somewhere in Graphics/Atlases/Gameplay/).\n\nExemple: objects/myMap/myCustomBumper\n..should be valid if there exists files whose paths are Graphics/Atlases/Gameplay/objects/myMap/myCustomBumper/<style>00.png, etc... (<style> is this bumper's style).
90+
entities.VortexHelper/VortexCustomBumper.attributes.description.useCustomParticleColors=Allows this bumper to use custom colors for its particle effects.
91+
entities.VortexHelper/VortexCustomBumper.attributes.description.particleColor1=Custom primary color for particle effects.\nOnly used when "Use Custom Particle Colors" is checked.
92+
entities.VortexHelper/VortexCustomBumper.attributes.description.particleColor2=Custom secondary color for particle effects.\nOnly used when "Use Custom Particle Colors" is checked.
9093

9194
# Color Switch Trigger
9295
triggers.VortexHelper/ColorSwitchTrigger.placements.name.color_switch_trigger=Color Switch Trigger

everest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- Name: VortexHelper
2-
Version: 1.2.14
2+
Version: 1.2.15
33
DLL: Code/bin/VortexHelper.dll
44
Dependencies:
55
- Name: EverestCore

0 commit comments

Comments
 (0)