Skip to content

Commit af8cc7b

Browse files
committed
Instant Falling Block
1 parent 004c60a commit af8cc7b

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module SpringCollab2020InstantFallingBlock
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/InstantFallingBlock" InstantFallingBlock(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight,
6+
tiletype::String="3", climbFall::Bool=true, behind::Bool=false)
7+
8+
const placements = Ahorn.PlacementDict(
9+
"Instant Falling Block (Spring Collab 2020)" => Ahorn.EntityPlacement(
10+
InstantFallingBlock,
11+
"rectangle",
12+
Dict{String, Any}(),
13+
Ahorn.tileEntityFinalizer
14+
),
15+
)
16+
17+
Ahorn.editingOptions(entity::InstantFallingBlock) = Dict{String, Any}(
18+
"tiletype" => Ahorn.tiletypeEditingOptions()
19+
)
20+
21+
Ahorn.minimumSize(entity::InstantFallingBlock) = 8, 8
22+
Ahorn.resizable(entity::InstantFallingBlock) = true, true
23+
24+
Ahorn.selection(entity::InstantFallingBlock) = Ahorn.getEntityRectangle(entity)
25+
26+
Ahorn.renderAbs(ctx::Ahorn.Cairo.CairoContext, entity::InstantFallingBlock, room::Maple.Room) = Ahorn.drawTileEntity(ctx, room, entity)
27+
28+
end

Ahorn/lang/en_gb.lang

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,9 @@ placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.persistent=If enabl
8989
placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.inactiveColor=The gate icon colour when not triggered yet.
9090
placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.activeColor=The gate icon colour when triggered, but the group is not complete yet.
9191
placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.finishColor=The gate icon colour when the group is complete.
92-
placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.sprite=The texture for the gate block.
92+
placements.entities.SpringCollab2020/FlagSwitchGate.tooltips.sprite=The texture for the gate block.
93+
94+
# Instant Falling Block
95+
placements.entities.SpringCollab2020/InstantFallingBlock.tooltips.climbFall=After a delay, the block will physically fall down until it comes into contact with another block.
96+
placements.entities.SpringCollab2020/InstantFallingBlock.tooltips.tiletype=Changes the visual appearance of the falling block.
97+
placements.entities.SpringCollab2020/InstantFallingBlock.tooltips.behind=Whether the block should visually be further behind in the scene or not.

Entities/InstantFallingBlock.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Celeste.Mod.Entities;
2+
using Microsoft.Xna.Framework;
3+
4+
namespace Celeste.Mod.SpringCollab2020.Entities {
5+
[CustomEntity("SpringCollab2020/InstantFallingBlock")]
6+
class InstantFallingBlock : FallingBlock {
7+
public InstantFallingBlock(EntityData data, Vector2 offset) : base(data, offset) {
8+
// this block starts triggered right away. that's about it.
9+
Triggered = true;
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)