Skip to content

Commit 328c747

Browse files
committed
Merge branch 'master' into flag_touch_switches
2 parents 878e7ea + 501b2ff commit 328c747

18 files changed

+1090
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module SpringCollab2020CustomSandwichLava
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/CustomSandwichLava" CustomSandwichLava(x::Integer, y::Integer,
6+
direction::String="CoreModeBased", speed::Number=20, sandwichGap::Number=160)
7+
8+
const directions = String["AlwaysUp", "AlwaysDown", "CoreModeBased"]
9+
10+
const placements = Ahorn.PlacementDict(
11+
"Custom Sandwich Lava (Spring Collab 2020)" => Ahorn.EntityPlacement(
12+
CustomSandwichLava
13+
)
14+
)
15+
16+
Ahorn.editingOptions(entity::CustomSandwichLava) = Dict{String, Any}(
17+
"direction" => directions
18+
)
19+
20+
function Ahorn.selection(entity::CustomSandwichLava)
21+
x, y = Ahorn.position(entity)
22+
23+
return Ahorn.Rectangle(x - 12, y - 12, 24, 24)
24+
end
25+
26+
function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::CustomSandwichLava, room::Maple.Room)
27+
direction = get(entity.data, "direction", "CoreModeBased")
28+
29+
if direction == "AlwaysUp"
30+
Ahorn.drawSprite(ctx, "ahorn/SpringCollab2020/lava_sandwich_up", 0, 0)
31+
elseif direction == "AlwaysDown"
32+
Ahorn.drawSprite(ctx, "ahorn/SpringCollab2020/lava_sandwich_down", 0, 0)
33+
else
34+
Ahorn.drawImage(ctx, Ahorn.Assets.lavaSanwitch, -12, -12)
35+
end
36+
end
37+
38+
end

Ahorn/entities/sidewaysLava.jl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module SpringCollab2020SidewaysLava
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/SidewaysLava" SidewaysLava(x::Integer, y::Integer, intro::Bool=false, lavaMode::String="LeftToRight", speedMultiplier::Number=1)
6+
7+
const lavaModes = String["LeftToRight", "RightToLeft", "Sandwich"]
8+
9+
const placements = Ahorn.PlacementDict(
10+
"Sideways Lava (Spring Collab 2020)" => Ahorn.EntityPlacement(
11+
SidewaysLava
12+
)
13+
)
14+
15+
Ahorn.editingOptions(entity::SidewaysLava) = Dict{String, Any}(
16+
"lavaMode" => lavaModes
17+
)
18+
19+
function Ahorn.selection(entity::SidewaysLava)
20+
x, y = Ahorn.position(entity)
21+
22+
return Ahorn.Rectangle(x - 12, y - 12, 24, 24)
23+
end
24+
25+
function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::SidewaysLava, room::Maple.Room)
26+
Ahorn.Cairo.save(ctx)
27+
28+
lavaMode = get(entity.data, "lavaMode", "LeftToRight")
29+
30+
Ahorn.rotate(ctx, (lavaMode == "RightToLeft" ? -1 : 1) * pi / 2)
31+
Ahorn.drawImage(ctx, (lavaMode == "Sandwich" ? Ahorn.Assets.lavaSanwitch : Ahorn.Assets.risingLava), -12, -12)
32+
33+
Ahorn.Cairo.restore(ctx);
34+
end
35+
36+
end

Ahorn/lang/en_gb.lang

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ placements.entities.SpringCollab2020/UpsideDownJumpThru.tooltips.texture=Changes
5555
placements.entities.SpringCollab2020/SidewaysJumpThru.tooltips.texture=Changes the appearance of the platform.
5656
placements.entities.SpringCollab2020/SidewaysJumpThru.tooltips.left=Whether the solid side of the jumpthru is the left side.
5757

58+
# Custom Sandwich Lava
59+
placements.entities.SpringCollab2020/CustomSandwichLava.tooltips.direction=Changes the sandwich lava direction. CoreModeBased is the same behaviour as vanilla, depending on core mode.
60+
placements.entities.SpringCollab2020/CustomSandwichLava.tooltips.speed=Changes the speed the lava is moving at, in pixels per second. Vanilla value is 20.
61+
placements.entities.SpringCollab2020/CustomSandwichLava.tooltips.sandwichGap=The gap in pixels between both sides of the lava. Vanilla value is 160.
62+
63+
# Custom Sandwich Lava Settings Trigger
64+
placements.triggers.SpringCollab2020/CustomSandwichLavaSettingsTrigger.tooltips.onlyOnce=If enabled, the settings will change only on the first time the player enters the trigger.
65+
placements.triggers.SpringCollab2020/CustomSandwichLavaSettingsTrigger.tooltips.direction=Changes the sandwich lava direction. CoreModeBased is the same behaviour as vanilla, depending on core mode.
66+
placements.triggers.SpringCollab2020/CustomSandwichLavaSettingsTrigger.tooltips.speed=Changes the speed the lava is moving at, in pixels per second. Vanilla value is 20.
67+
68+
# Sideways Lava
69+
placements.entities.SpringCollab2020/SidewaysLava.tooltips.intro=Determines whether the lava moves into the screen or starts already present on the screen. Not suitable for sandwich lava.
70+
placements.entities.SpringCollab2020/SidewaysLava.tooltips.lavaMode=Determines which side(s) of the screen the lava comes from.
71+
placements.entities.SpringCollab2020/SidewaysLava.tooltips.speedMultiplier=Modifies the lava speed. 1 is vanilla lava speed, 2 is twice as fast.
72+
5873
# Flag Touch Switch
5974
placements.entities.SpringCollab2020/FlagTouchSwitch.tooltips.flag=The session flag this touch switch sets. Give the same to multiple touch switches and switch gates to group them.
6075
placements.entities.SpringCollab2020/FlagTouchSwitch.tooltips.icon=The name of the icon for the touch switch (relative to objects/SpringCollab2020/flagTouchSwitch), or "vanilla" for the default one.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module SpringCollab2020CustomSandwichLavaSettingsTrigger
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Trigger "SpringCollab2020/CustomSandwichLavaSettingsTrigger" CustomSandwichLavaSettingsTrigger(x::Integer, y::Integer, width::Integer=Maple.defaultTriggerWidth, height::Integer=Maple.defaultTriggerHeight,
6+
onlyOnce::Bool=false, direction::String="CoreModeBased", speed::Number=20)
7+
8+
const directions = String["AlwaysUp", "AlwaysDown", "CoreModeBased"]
9+
10+
const placements = Ahorn.PlacementDict(
11+
"Custom Sandwich Lava Settings (Spring Collab 2020)" => Ahorn.EntityPlacement(
12+
CustomSandwichLavaSettingsTrigger,
13+
"rectangle",
14+
),
15+
)
16+
17+
Ahorn.editingOptions(entity::CustomSandwichLavaSettingsTrigger) = Dict{String, Any}(
18+
"direction" => directions
19+
)
20+
21+
end

0 commit comments

Comments
 (0)