diff --git a/images/items/fertilizer.png b/images/items/fertilizer.png new file mode 100644 index 0000000..1f92079 Binary files /dev/null and b/images/items/fertilizer.png differ diff --git a/images/items/glass.png b/images/items/glass.png new file mode 100644 index 0000000..29789c8 Binary files /dev/null and b/images/items/glass.png differ diff --git a/images/tiles/fertilizermixer10.png b/images/tiles/fertilizermixer10.png new file mode 100644 index 0000000..69706d2 Binary files /dev/null and b/images/tiles/fertilizermixer10.png differ diff --git a/images/tiles/fertilizermixer11.png b/images/tiles/fertilizermixer11.png new file mode 100644 index 0000000..a9aee45 Binary files /dev/null and b/images/tiles/fertilizermixer11.png differ diff --git a/images/tiles/fertilizermixer12.png b/images/tiles/fertilizermixer12.png new file mode 100644 index 0000000..c33072c Binary files /dev/null and b/images/tiles/fertilizermixer12.png differ diff --git a/images/tiles/fertilizermixer13.png b/images/tiles/fertilizermixer13.png new file mode 100644 index 0000000..b6bab70 Binary files /dev/null and b/images/tiles/fertilizermixer13.png differ diff --git a/images/tiles/fertilizermixer14.png b/images/tiles/fertilizermixer14.png new file mode 100644 index 0000000..e174603 Binary files /dev/null and b/images/tiles/fertilizermixer14.png differ diff --git a/images/tiles/fertilizermixer15.png b/images/tiles/fertilizermixer15.png new file mode 100644 index 0000000..9c58091 Binary files /dev/null and b/images/tiles/fertilizermixer15.png differ diff --git a/images/tiles/fertilizermixer16.png b/images/tiles/fertilizermixer16.png new file mode 100644 index 0000000..4b83475 Binary files /dev/null and b/images/tiles/fertilizermixer16.png differ diff --git a/images/tiles/fertilizermixer17.png b/images/tiles/fertilizermixer17.png new file mode 100644 index 0000000..0afe462 Binary files /dev/null and b/images/tiles/fertilizermixer17.png differ diff --git a/images/tiles/glassmelt110.pdn b/images/tiles/glassmelt110.pdn deleted file mode 100644 index 37296c7..0000000 Binary files a/images/tiles/glassmelt110.pdn and /dev/null differ diff --git a/images/tiles/precisionspliterleft10.png b/images/tiles/precisionspliterleft10.png new file mode 100644 index 0000000..7d18a71 Binary files /dev/null and b/images/tiles/precisionspliterleft10.png differ diff --git a/images/tiles/precisionspliterright10.png b/images/tiles/precisionspliterright10.png new file mode 100644 index 0000000..89e7123 Binary files /dev/null and b/images/tiles/precisionspliterright10.png differ diff --git a/images/tiles/siev10.png b/images/tiles/siev10.png new file mode 100644 index 0000000..1c3722e Binary files /dev/null and b/images/tiles/siev10.png differ diff --git a/images/tiles/teleporter02.pdn b/images/tiles/teleporter02.pdn deleted file mode 100644 index b31e28d..0000000 Binary files a/images/tiles/teleporter02.pdn and /dev/null differ diff --git a/images/tiles/teleporterout01.png b/images/tiles/teleporterout01.png new file mode 100644 index 0000000..1d06a5d Binary files /dev/null and b/images/tiles/teleporterout01.png differ diff --git a/images/tiles/teleporterout02.png b/images/tiles/teleporterout02.png new file mode 100644 index 0000000..9b17101 Binary files /dev/null and b/images/tiles/teleporterout02.png differ diff --git a/images/tiles/teleporterout03.png b/images/tiles/teleporterout03.png new file mode 100644 index 0000000..a4cf6b0 Binary files /dev/null and b/images/tiles/teleporterout03.png differ diff --git a/images/tiles/teleporterout04.png b/images/tiles/teleporterout04.png new file mode 100644 index 0000000..93f2bc5 Binary files /dev/null and b/images/tiles/teleporterout04.png differ diff --git a/images/tiles/teleporterout05.png b/images/tiles/teleporterout05.png new file mode 100644 index 0000000..55a40a5 Binary files /dev/null and b/images/tiles/teleporterout05.png differ diff --git a/images/tiles/teleporterout06.png b/images/tiles/teleporterout06.png new file mode 100644 index 0000000..1e183df Binary files /dev/null and b/images/tiles/teleporterout06.png differ diff --git a/images/tiles/teleporterout07.png b/images/tiles/teleporterout07.png new file mode 100644 index 0000000..f23214f Binary files /dev/null and b/images/tiles/teleporterout07.png differ diff --git a/images/tiles/teleporterout08.png b/images/tiles/teleporterout08.png new file mode 100644 index 0000000..6256cf1 Binary files /dev/null and b/images/tiles/teleporterout08.png differ diff --git a/images/tiles/teleporterout09.png b/images/tiles/teleporterout09.png new file mode 100644 index 0000000..3128db5 Binary files /dev/null and b/images/tiles/teleporterout09.png differ diff --git a/js/items.json b/js/items.json index d628758..ca8114d 100644 --- a/js/items.json +++ b/js/items.json @@ -167,6 +167,10 @@ "id": 41, "name": "dirt", "value": 100 + }, { + "id": 42, + "name": "glass", + "value": 100 }], "minerals": { "nameFromId": ["bauxite", diff --git a/js/tiles.js b/js/tiles.js index 56213ee..eb24bde 100644 --- a/js/tiles.js +++ b/js/tiles.js @@ -1031,8 +1031,8 @@ class TeleporterOutput extends Tile { "count": 50 }] this.texture = { - "0": [], - "1": ["collector13"] + "0": ["teleporterout01","teleporterout02","teleporterout03","teleporterout04","teleporterout05","teleporterout06","teleporterout07","teleporterout08","teleporterout09"], + "1": [] } this.options = [{ "type": "amount", @@ -1117,7 +1117,7 @@ class SoilMiner extends Tile { constructor(x, y, factory) { super(x, y, factory) this.maxwork = 24 * 30 - this.i = 22 + this.i = 23 this.currentwork = 0 this.name = "soilminer" this.hasNoInventory = true @@ -1138,13 +1138,261 @@ class SoilMiner extends Tile { work() { this.currentwork = ((this.currentwork + 1) % this.maxwork) if (this.currentwork == 0) { - var item = new Item(38, this.x * 48, this.y * 48) - this.factory.items.push(item) - item.setDFromDirection(this.direction) + var item = new Item(38, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) } } } +class Siev extends Tile { + constructor(x, y, factory) { + super(x, y, factory) + this.maxwork = 48 + this.currentwork = 0 + this.name = "siev" + this.i = 24 + this.cost = [{ + "id": 0, + "count": 750 + }, + { + "id": 1, + "count": 50 + } + ] + this.texture = { + "0": [], + "1": ["siev10"] + } + this.loadImages() + } + + work() { + //Items für ein Pank + if (this.input.countOf(38) >= 9) { + if (this.currentwork == this.maxwork) { + this.input.take(38, 9, this.factory) + for (var i = 0; i < 3; i++) { + var item = new Item(39, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) + item = new Item(40, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) + item = new Item(41, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) + this.currentwork = 0 + } + } else { + this.currentwork++ + } + } else { + this.currentwork = 0 + } + } +} + +class GlasMelt extends Tile { + constructor(x, y, factory) { + super(x, y, factory) + this.maxwork = 48 * 30 + this.currentwork = 0 + this.name = "glasmelt" + this.i = 25 + this.cost = [{ + "id": 0, + "count": 750 + }, + { + "id": 1, + "count": 50 + } + ] + this.texture = { + "0": [], + "1": ["glassmelt10", "glassmelt11", "glassmelt12", "glassmelt13", "glassmelt14", "glassmelt15", "glassmelt16", "glassmelt17", "glassmelt18", "glassmelt19", "glassmelt110"] + } + this.loadImages() + } + + work() { + //Items für ein Pank + if (this.input.countOf(39) >= 30) { + if (this.currentwork == this.maxwork) { + this.input.take(39, 30, this.factory) + for (var i = 0; i < 10; i++) { + var item = new Item(42, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) + this.currentwork = 0 + } + } else { + this.currentwork++ + } + } else { + this.currentwork = 0 + } + } + getImage(fulltime, layer) { + fulltime = Math.round(fulltime / 6) + if (this.images[layer].length == 0) + return "0" + return this.images[layer][(fulltime % this.images[layer].length)] + } +} + +class FertilizerMixer extends Tile { + constructor(x, y, factory) { + super(x, y, factory) + this.maxwork = 48 * 30 + this.currentwork = 0 + this.name = "fertilizermixer" + this.i = 28 + this.cost = [{ + "id": 0, + "count": 750 + }, + { + "id": 1, + "count": 50 + } + ] + this.texture = { + "0": [], + "1": ["fertilizermixer10", "fertilizermixer11", "fertilizermixer12", "fertilizermixer13", "fertilizermixer14", "fertilizermixer15", "fertilizermixer16", "fertilizermixer17"] + } + this.loadImages() + } + + work() { + //Items für ein Pank + if (this.input.countOf(39) >= 30) { + if (this.currentwork == this.maxwork) { + this.input.take(39, 30, this.factory) + for (var i = 0; i < 10; i++) { + var item = new Item(42, this.x * 48, this.y * 48) + this.factory.items.push(item) + item.setDFromDirection(this.direction) + this.currentwork = 0 + } + } else { + this.currentwork++ + } + } else { + this.currentwork = 0 + } + } + getImage(fulltime, layer) { + fulltime = Math.round(fulltime / 6) + if (this.images[layer].length == 0) + return "0" + return this.images[layer][(fulltime % this.images[layer].length)] + } +} + +class PrecisionSpliterLeft extends Tile { + constructor(x, y, factory) { + super(x, y, factory) + this.name = "precisionspliterleft" + this.hasNoInventory = true + this.i = 26 + this.n = 0 + this.nn = 0 + this.cost = [{ + "id": 0, + "count": 50 + }] + this.texture = { + "0": ["conveyorbelt00", "conveyorbelt01", "conveyorbelt02", "conveyorbelt03", "conveyorbelt04", "conveyorbelt05", "conveyorbelt06"], + "1": ["precisionspliterleft10"] + } + this.options = [{ + "type": "amount", + "var": "n" + }] + this.loadImages() + } + + work() { + while (this.input.items.length > 0) { + var item = this.input.items.pop() + this.nn++; + var d = this.direction + if (this.n == this.nn) { + switch (this.direction) { + case "right": + d = "up" + break; + case "down": + d = "right" + break; + case "left": + d = "down" + break; + case "up": + d = "left" + break; + } + this.nn = 0 + } + item.setDFromDirection(d) + } + } +} + +class PrecisionSpliterRight extends Tile { + constructor(x, y, factory) { + super(x, y, factory) + this.name = "precisionspliterright" + this.hasNoInventory = true + this.i = 27 + this.n = 0 + this.nn = 0 + this.cost = [{ + "id": 0, + "count": 50 + }] + this.texture = { + "0": ["conveyorbelt00", "conveyorbelt01", "conveyorbelt02", "conveyorbelt03", "conveyorbelt04", "conveyorbelt05", "conveyorbelt06"], + "1": ["precisionspliterright10"] + } + this.options = [{ + "type": "amount", + "var": "n" + }] + this.loadImages() + } + + work() { + while (this.input.items.length > 0) { + var item = this.input.items.pop() + this.nn++; + var d = this.direction + if (this.n == this.nn) { + switch (this.direction) { + case "right": + d = "down" + break; + case "down": + d = "left" + break; + case "left": + d = "up" + break; + case "up": + d = "right" + break; + } + this.nn = 0 + } + item.setDFromDirection(d) + } + } +} + + tileClasses.push(Conveyorbelt) //0 tileClasses.push(Treefarm) //1 tileClasses.push(Saw) //2 @@ -1169,3 +1417,8 @@ tileClasses.push(TeleporterInput) //20 tileClasses.push(TeleporterOutput) //21 tileClasses.push(SimpleMiner) //22 tileClasses.push(SoilMiner) //23 +tileClasses.push(Siev) //24 +tileClasses.push(GlasMelt) //25 +tileClasses.push(PrecisionSpliterLeft) //26 +tileClasses.push(PrecisionSpliterRight) //27 +tileClasses.push(FertilizerMixer) //28 diff --git a/lang/en.json b/lang/en.json index 91db03e..6db2484 100644 --- a/lang/en.json +++ b/lang/en.json @@ -32,9 +32,13 @@ "name": "Quarry", "description": "Mines stone slowly but safely." }, - "quarry": { - "name": "Quarry", - "description": "Mines stone slowly but safely." + "glasmelt": { + "name": "Glas Melt", + "description": "Melts 30 Quartz Sand into 10 Glass." + }, + "siev": { + "name": "Siev", + "description": "Sieves 9 Soil into 3 Quartz Sand, 3 Concret and 3 Dirt." }, "charcoalmeiler": { "name": "Charcoal Meiler", @@ -88,6 +92,10 @@ "name": "Soil Miner", "description": "Mines Soil." }, + "fertilizermixer": { + "name": "Fertilizer Mixer", + "description": "Mines Soil." + }, "filterleft": { "name": "Item Filter (left)", "description": "Puts a selected Item to the left and all other straight.", @@ -115,6 +123,20 @@ "options": { "filter": "Filtered Item" } + }, + "precisionspliterleft": { + "name": "Precision Spliter (Left)", + "description": "Pushes every N'th Item to the left.", + "options": { + "n": "N" + } + }, + "precisionspliterright": { + "name": "Precision Spliter (Right)", + "description": "Pushes every N'th Item to the right.", + "options": { + "n": "N" + } } }, "minerals": ["bauxite", @@ -191,7 +213,8 @@ "Soil", "Quartz Sand", "Concret", - "Dirt" + "Dirt", + "Glass" ], "more": "Show Inventory / Sell Items", "inventory": "Inventory",