Skip to content

Commit 651b90f

Browse files
committed
Option to display grouped trigger spikes behind move blocks
1 parent 7dd06b2 commit 651b90f

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

Ahorn/entities/groupedTriggerSpikes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module SpringCollab2020GroupedTriggerSpikes
22

33
using ..Ahorn, Maple
44

5-
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesUp" GroupedTriggerSpikesUp(x::Integer, y::Integer, width::Integer=Maple.defaultSpikeWidth, type::String="default")
6-
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesDown" GroupedTriggerSpikesDown(x::Integer, y::Integer, width::Integer=Maple.defaultSpikeWidth, type::String="default")
7-
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesLeft" GroupedTriggerSpikesLeft(x::Integer, y::Integer, height::Integer=Maple.defaultSpikeHeight, type::String="default")
8-
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesRight" GroupedTriggerSpikesRight(x::Integer, y::Integer, height::Integer=Maple.defaultSpikeHeight, type::String="default")
5+
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesUp" GroupedTriggerSpikesUp(x::Integer, y::Integer, width::Integer=Maple.defaultSpikeWidth, type::String="default", behindMoveBlocks::Bool=false)
6+
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesDown" GroupedTriggerSpikesDown(x::Integer, y::Integer, width::Integer=Maple.defaultSpikeWidth, type::String="default", behindMoveBlocks::Bool=false)
7+
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesLeft" GroupedTriggerSpikesLeft(x::Integer, y::Integer, height::Integer=Maple.defaultSpikeHeight, type::String="default", behindMoveBlocks::Bool=false)
8+
@mapdef Entity "SpringCollab2020/GroupedTriggerSpikesRight" GroupedTriggerSpikesRight(x::Integer, y::Integer, height::Integer=Maple.defaultSpikeHeight, type::String="default", behindMoveBlocks::Bool=false)
99

1010
const placements = Ahorn.PlacementDict()
1111

Ahorn/lang/en_gb.lang

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ placements.entities.SpringCollab2020/GroupedTriggerSpikesUp.tooltips.type=Change
155155
placements.entities.SpringCollab2020/GroupedTriggerSpikesDown.tooltips.type=Changes the visual appearance of the spikes.
156156
placements.entities.SpringCollab2020/GroupedTriggerSpikesLeft.tooltips.type=Changes the visual appearance of the spikes.
157157
placements.entities.SpringCollab2020/GroupedTriggerSpikesRight.tooltips.type=Changes the visual appearance of the spikes.
158+
placements.entities.SpringCollab2020/GroupedTriggerSpikesUp.tooltips.behindMoveBlocks=Whether the spikes should be deeper than normal in order to appear behind move blocks.
159+
placements.entities.SpringCollab2020/GroupedTriggerSpikesDown.tooltips.behindMoveBlocks=Whether the spikes should be deeper than normal in order to appear behind move blocks.
160+
placements.entities.SpringCollab2020/GroupedTriggerSpikesLeft.tooltips.behindMoveBlocks=Whether the spikes should be deeper than normal in order to appear behind move blocks.
161+
placements.entities.SpringCollab2020/GroupedTriggerSpikesRight.tooltips.behindMoveBlocks=Whether the spikes should be deeper than normal in order to appear behind move blocks.
158162

159163
# Move Block with Customizable Speed
160164
placements.entities.SpringCollab2020/MoveBlockCustomSpeed.tooltips.canSteer=Determines whether the move block can be moved by the player.

Entities/GroupedTriggerSpikes.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public static Entity LoadRight(Level level, LevelData levelData, Vector2 offset,
4747
private bool blockingLedge = false;
4848

4949
public GroupedTriggerSpikes(EntityData data, Vector2 offset, Directions dir)
50-
: this(data.Position + offset, GetSize(data, dir), dir, data.Attr("type", "default")) {
50+
: this(data.Position + offset, GetSize(data, dir), dir, data.Attr("type", "default"), data.Bool("behindMoveBlocks", false)) {
5151
}
5252

53-
public GroupedTriggerSpikes(Vector2 position, int size, Directions direction, string overrideType)
53+
public GroupedTriggerSpikes(Vector2 position, int size, Directions direction, string overrideType, bool behindMoveBlocks)
5454
: base(position) {
5555

5656
this.size = size;
@@ -95,7 +95,11 @@ public GroupedTriggerSpikes(Vector2 position, int size, Directions direction, st
9595
JumpThruChecker = IsRiding
9696
});
9797

98-
Depth = -50;
98+
if (behindMoveBlocks) {
99+
Depth = 0; // move blocks have Depth = -1.
100+
} else {
101+
Depth = -50;
102+
}
99103
}
100104

101105
public override void Added(Scene scene) {

0 commit comments

Comments
 (0)