Skip to content

Commit

Permalink
Merge pull request #3 from SilverDorian46/dev
Browse files Browse the repository at this point in the history
Addendum: Add option for custom debris
  • Loading branch information
bigkahuna443 authored Sep 12, 2024
2 parents 38eee07 + 8d82fb1 commit 442a75a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Code/PushBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public PushBlock(EntityData data, Vector2 offset) : base(data.Position + offset,
{
breakDebrisTileset = 'f';
}

// Override debris data if enabled.
if (data.Bool("overrideDebris"))
{
breakDebrisTileset = data.Char("customDebrisFromTileset");
}
}

public override void Added(Scene scene)
Expand Down
16 changes: 14 additions & 2 deletions Loenn/entities/pushblock.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
local drawableSprite = require("structs.drawable_sprite")
local fakeTilesHelper = require("helpers.fake_tiles")
local utils = require("utils")

local pushblock = {}

pushblock.name = "canyon/pushblock"
pushblock.depth = -9999
pushblock.fieldInformation = fakeTilesHelper.getFieldInformation("customDebrisFromTileset")
pushblock.fieldOrder = {
"x", "y",
"customBlockTexture", "customGooTexture",
"customDebrisFromTileset", "overrideDebris", "isTemple",
"stickyTop", "stickyBottom", "stickyLeft", "stickyRight",
"legacy"
}
pushblock.placements =
{
name = "PushBlock",
Expand All @@ -14,8 +24,10 @@ pushblock.placements =
["stickyRight"] = false,
["isTemple"] = false,
legacy = false,
customBlockTexture = "",
customGooTexture = ""
customBlockTexture = "objects/canyon/pushblock/idle",
customGooTexture = "objects/canyon/pushblock/stickyGoo",
overrideDebris = false,
customDebrisFromTileset = "5"
}
}

Expand Down
2 changes: 2 additions & 0 deletions Loenn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ entities.canyon/pushblock.attributes.description.isTemple=Whether it uses the te
entities.canyon/pushblock.attributes.description.legacy=Whether this entity should have old functionality.\nThe current entity has received some physics tweaks, including fixing a bug where the block travels further when pushed left versus when pushed right.\nOn by default for every placement before the fix.
entities.canyon/pushblock.attributes.description.customBlockTexture=A custom path relative to Graphics/Atlases/Gameplay/ for the texture of the block.\nIf the "isTemple" attribute is checked, the texture suffixed with "Temple" is used.\nDefault path: "objects/canyon/pushblock/idle"
entities.canyon/pushblock.attributes.description.customGooTexture=A custom path relative to Graphics/Atlases/Gameplay/ for the subtextures of the sticky goo.\nThe subtextures are chosen at random, and each one is suffixed with a number from "00" to "03".\nOnly visible when at least one of the "sticky" attributes is checked.\nDefault path: "objects/canyon/pushblock/stickyGoo"
entities.canyon/pushblock.attributes.description.overrideDebris=Whether to override the debris spawned upon being dashed into, with custom debris data.
entities.canyon/pushblock.attributes.description.customDebrisFromTileset=The debris associated with a tileset, to spawn upon being dashed into.\nFor custom tilesets, this is declared using the "debris" attribute in the XML.\nOnly in effect when the "overrideDebris" attribute is checked.

# Spin Orb
entities.canyon/spinorb.placements.name.SpinOrb=Spin Orb (Canyon)
Expand Down

0 comments on commit 442a75a

Please sign in to comment.