diff --git a/src/shapes/Gem.hx b/src/shapes/Gem.hx index 619d0794..23a652d7 100644 --- a/src/shapes/Gem.hx +++ b/src/shapes/Gem.hx @@ -1,12 +1,13 @@ package shapes; +import mis.MissionElement.MissionElementItem; import src.TimeState; import src.DtsObject; class Gem extends DtsObject { public var pickedUp:Bool; - public function new() { + public function new(element:MissionElementItem) { super(); dtsPath = "data/shapes/items/gem.dts"; ambientRotate = true; @@ -15,7 +16,9 @@ class Gem extends DtsObject { showSequences = false; // Gems actually have an animation for the little shiny thing, but the actual game ignores that. I get it, it was annoying as hell. var GEM_COLORS = ["blue", "red", "yellow", "purple", "green", "turquoise", "orange", "black"]; - var color = GEM_COLORS[Math.floor(Math.random() * GEM_COLORS.length)]; + var color = element.datablock.substring("GemItem".length); + if (color.length == 0) + GEM_COLORS[Math.floor(Math.random() * GEM_COLORS.length)]; this.identifier = "Gem" + color; this.matNameOverride.set('base.gem', color + ".gem"); } diff --git a/src/shapes/SignCaution.hx b/src/shapes/SignCaution.hx new file mode 100644 index 00000000..e9e26945 --- /dev/null +++ b/src/shapes/SignCaution.hx @@ -0,0 +1,20 @@ +package shapes; + +import mis.MissionElement.MissionElementStaticShape; +import src.DtsObject; + +class SignCaution extends DtsObject { + public function new(element:MissionElementStaticShape) { + super(); + this.dtsPath = "data/shapes/signs/cautionsign.dts"; + this.isCollideable = true; + + var type = element.datablock.substring("SignCaution".length); + switch (type) { + case "Caution": + this.matNameOverride.set("base.cautionsign", "caution.cautionsign"); + case "Danger": + this.matNameOverride.set("base.cautionsign", "danger.cautionsign"); + } + } +} diff --git a/src/shapes/SignPlain.hx b/src/shapes/SignPlain.hx new file mode 100644 index 00000000..045dff63 --- /dev/null +++ b/src/shapes/SignPlain.hx @@ -0,0 +1,26 @@ +package shapes; + +import mis.MissionElement.MissionElementStaticShape; +import src.DtsObject; + +class SignPlain extends DtsObject { + public function new(element:MissionElementStaticShape) { + super(); + + this.dtsPath = "data/shapes/signs/plainsign.dts"; + this.isCollideable = true; + + // Determine the direction to show + var direction = element.datablock.substring("SignPlain".length); + switch (direction) { + case "Right": + this.matNameOverride.set("base.plainsign", "right.plainsign"); + case "Left": + this.matNameOverride.set("base.plainsign", "left.plainsign"); + case "Up": + this.matNameOverride.set("base.plainsign", "uo.plainsign"); + case "Down": + this.matNameOverride.set("base.plainsign", "down.plainsign"); + } + } +} diff --git a/src/shapes/TimeTravel.hx b/src/shapes/TimeTravel.hx index f29720c4..ccc17070 100644 --- a/src/shapes/TimeTravel.hx +++ b/src/shapes/TimeTravel.hx @@ -1,16 +1,23 @@ package shapes; +import mis.MissionElement.MissionElementItem; import src.TimeState; +import mis.MisParser; class TimeTravel extends PowerUp { var timeBonus:Float = 5; - public function new() { + public function new(element:MissionElementItem) { super(); this.dtsPath = "data/shapes/items/timetravel.dts"; this.isCollideable = false; this.isTSStatic = false; this.identifier = "TimeTravel"; + + if (element.timebonus != null) { + this.timeBonus = MisParser.parseNumber(element.timebonus) / 1000; + } + this.pickUpName = '${this.timeBonus} second Time Travel bonus'; this.cooldownDuration = 1e8; this.useInstancing = true;