diff --git a/dist/app.js b/dist/app.js index 1703d43..f2a458b 100644 --- a/dist/app.js +++ b/dist/app.js @@ -5084,7 +5084,7 @@ eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argume /***/ ((__unused_webpack_module, exports) => { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Autotile = void 0;\r\nvar Autotile = /** @class */ (function () {\r\n function Autotile() {\r\n }\r\n Autotile.areValidNeighborBiomes = function (neighborBiome, tileBiome) {\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"oceandeep\" && (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"ocean\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"forestgrass\" &&\r\n (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"grassland\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"grassland\" &&\r\n (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"forestgrass\") {\r\n return true;\r\n }\r\n if (neighborBiome == null) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Autotile.shouldAutoTile = function (mapObject, x, y, tileBiome) {\r\n var skipAutoTileTypes = [\"dirt\", \"dirttextured\"];\r\n if (skipAutoTileTypes.includes(tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome)) {\r\n return false;\r\n }\r\n var neighborPositions = [\r\n [x, y - 1],\r\n [x - 1, y],\r\n [x + 1, y],\r\n [x, y + 1],\r\n [x - 1, y - 1],\r\n [x + 1, y - 1],\r\n [x - 1, y + 1],\r\n [x + 1, y + 1], // southeast\r\n ];\r\n for (var _i = 0, neighborPositions_1 = neighborPositions; _i < neighborPositions_1.length; _i++) {\r\n var _a = neighborPositions_1[_i], nx = _a[0], ny = _a[1];\r\n if (!Autotile.areValidNeighborBiomes(tileBiome, mapObject[\"\".concat(nx, \",\").concat(ny)])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Autotile.autotileLookup = function (mapObject, x_boundary, y_boundary, x, y, tileBiome) {\r\n var sum = 0;\r\n var n = false;\r\n var e = false;\r\n var s = false;\r\n var w = false;\r\n if (y > 0 && mapObject[\"\".concat(x, \",\").concat(y - 1)].biome == tileBiome.biome) {\r\n n = true;\r\n sum += Autotile.N;\r\n }\r\n if (x > 0 && mapObject[\"\".concat(x - 1, \",\").concat(y)].biome == tileBiome.biome) {\r\n w = true;\r\n sum += Autotile.W;\r\n }\r\n if (x < x_boundary && mapObject[\"\".concat(x + 1, \",\").concat(y)].biome == tileBiome.biome) {\r\n e = true;\r\n sum += Autotile.E;\r\n }\r\n if (y < y_boundary && mapObject[\"\".concat(x, \",\").concat(y + 1)].biome == tileBiome.biome) {\r\n s = true;\r\n sum += Autotile.S;\r\n }\r\n if (n &&\r\n w &&\r\n y > 0 &&\r\n x > 0 &&\r\n mapObject[\"\".concat(x - 1, \",\").concat(y - 1)].biome == tileBiome.biome)\r\n sum += Autotile.NW;\r\n if (n &&\r\n e &&\r\n y > 0 &&\r\n x < x_boundary &&\r\n mapObject[\"\".concat(x + 1, \",\").concat(y - 1)].biome == tileBiome.biome)\r\n sum += Autotile.NE;\r\n if (s &&\r\n w &&\r\n y < y_boundary &&\r\n x > 0 &&\r\n mapObject[\"\".concat(x - 1, \",\").concat(y + 1)].biome == tileBiome.biome)\r\n sum += Autotile.SW;\r\n if (s &&\r\n e &&\r\n x < x_boundary &&\r\n y < y_boundary &&\r\n mapObject[\"\".concat(x + 1, \",\").concat(y + 1)].biome == tileBiome.biome)\r\n sum += Autotile.SE;\r\n return Autotile.BITMASK[sum];\r\n };\r\n Autotile.autotile = function (mapObject) {\r\n console.log(\"autotile rawMapObj: \", mapObject);\r\n var tiles = {};\r\n var mapKeys = Object.keys(mapObject);\r\n var _a = mapKeys.reduce(function (acc, key) {\r\n var _a = key.split(\",\").map(Number), x = _a[0], y = _a[1];\r\n acc[0] = Math.max(acc[0], x);\r\n acc[1] = Math.max(acc[1], y);\r\n return acc;\r\n }, [0, 0]), maxX = _a[0], maxY = _a[1];\r\n for (var y = 0; y <= maxY; y++) {\r\n for (var x = 0; x <= maxX; x++) {\r\n var key = \"\".concat(x, \",\").concat(y);\r\n var tileValue = mapObject[key];\r\n if (!this.shouldAutoTile(mapObject, x, y, tileValue)) {\r\n tiles[key] = 47;\r\n continue;\r\n }\r\n tiles[key] = Autotile.autotileLookup(mapObject, maxX, maxY, x, y, tileValue);\r\n }\r\n }\r\n console.log(\"autotiled map: \", tiles);\r\n return tiles;\r\n };\r\n Autotile.NW = Math.pow(2, 0);\r\n Autotile.N = Math.pow(2, 1);\r\n Autotile.NE = Math.pow(2, 2);\r\n Autotile.W = Math.pow(2, 3);\r\n Autotile.E = Math.pow(2, 4);\r\n Autotile.SW = Math.pow(2, 5);\r\n Autotile.S = Math.pow(2, 6);\r\n Autotile.SE = Math.pow(2, 7);\r\n Autotile.BITMASK = {\r\n 2: 44,\r\n 8: 45,\r\n 10: 39,\r\n 11: 38,\r\n 16: 43,\r\n 18: 41,\r\n 22: 40,\r\n 24: 33,\r\n 26: 31,\r\n 27: 30,\r\n 30: 29,\r\n 31: 28,\r\n 64: 42,\r\n 66: 32,\r\n 72: 37,\r\n 74: 27,\r\n 75: 25,\r\n 80: 35,\r\n 82: 19,\r\n 86: 18,\r\n 88: 21,\r\n 90: 15,\r\n 91: 14,\r\n 94: 13,\r\n 95: 12,\r\n 104: 36,\r\n 106: 26,\r\n 107: 24,\r\n 120: 21,\r\n 122: 7,\r\n 123: 6,\r\n 126: 5,\r\n 127: 4,\r\n 208: 34,\r\n 210: 17,\r\n 214: 16,\r\n 216: 22,\r\n 218: 11,\r\n 219: 10,\r\n 222: 9,\r\n 223: 8,\r\n 248: 20,\r\n 250: 3,\r\n 251: 2,\r\n 254: 1,\r\n 255: 47,\r\n 0: 46,\r\n };\r\n return Autotile;\r\n}());\r\nexports.Autotile = Autotile;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/autotile.ts?"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Autotile = void 0;\r\nvar Autotile = /** @class */ (function () {\r\n function Autotile() {\r\n }\r\n Autotile.areValidNeighborBiomes = function (neighborBiome, tileBiome) {\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"oceandeep\" && (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"ocean\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"forestgrass\" &&\r\n (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"grassland\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"swampdirt\" &&\r\n (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"grassland\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"hills\" && (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"grassland\") {\r\n return false;\r\n }\r\n if ((tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome) == \"grassland\" &&\r\n (neighborBiome === null || neighborBiome === void 0 ? void 0 : neighborBiome.biome) == \"forestgrass\") {\r\n return true;\r\n }\r\n if (neighborBiome == null) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Autotile.shouldAutoTile = function (mapObject, x, y, tileBiome) {\r\n var skipAutoTileTypes = [\"dirt\", \"dirttextured\"];\r\n if (skipAutoTileTypes.includes(tileBiome === null || tileBiome === void 0 ? void 0 : tileBiome.biome)) {\r\n return false;\r\n }\r\n var neighborPositions = [\r\n [x, y - 1],\r\n [x - 1, y],\r\n [x + 1, y],\r\n [x, y + 1],\r\n [x - 1, y - 1],\r\n [x + 1, y - 1],\r\n [x - 1, y + 1],\r\n [x + 1, y + 1], // southeast\r\n ];\r\n for (var _i = 0, neighborPositions_1 = neighborPositions; _i < neighborPositions_1.length; _i++) {\r\n var _a = neighborPositions_1[_i], nx = _a[0], ny = _a[1];\r\n if (!Autotile.areValidNeighborBiomes(tileBiome, mapObject[\"\".concat(nx, \",\").concat(ny)])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Autotile.autotileLookup = function (mapObject, x_boundary, y_boundary, x, y, tileBiome) {\r\n var sum = 0;\r\n var n = false;\r\n var e = false;\r\n var s = false;\r\n var w = false;\r\n if (y > 0 && mapObject[\"\".concat(x, \",\").concat(y - 1)].biome == tileBiome.biome) {\r\n n = true;\r\n sum += Autotile.N;\r\n }\r\n if (x > 0 && mapObject[\"\".concat(x - 1, \",\").concat(y)].biome == tileBiome.biome) {\r\n w = true;\r\n sum += Autotile.W;\r\n }\r\n if (x < x_boundary && mapObject[\"\".concat(x + 1, \",\").concat(y)].biome == tileBiome.biome) {\r\n e = true;\r\n sum += Autotile.E;\r\n }\r\n if (y < y_boundary && mapObject[\"\".concat(x, \",\").concat(y + 1)].biome == tileBiome.biome) {\r\n s = true;\r\n sum += Autotile.S;\r\n }\r\n if (n &&\r\n w &&\r\n y > 0 &&\r\n x > 0 &&\r\n mapObject[\"\".concat(x - 1, \",\").concat(y - 1)].biome == tileBiome.biome)\r\n sum += Autotile.NW;\r\n if (n &&\r\n e &&\r\n y > 0 &&\r\n x < x_boundary &&\r\n mapObject[\"\".concat(x + 1, \",\").concat(y - 1)].biome == tileBiome.biome)\r\n sum += Autotile.NE;\r\n if (s &&\r\n w &&\r\n y < y_boundary &&\r\n x > 0 &&\r\n mapObject[\"\".concat(x - 1, \",\").concat(y + 1)].biome == tileBiome.biome)\r\n sum += Autotile.SW;\r\n if (s &&\r\n e &&\r\n x < x_boundary &&\r\n y < y_boundary &&\r\n mapObject[\"\".concat(x + 1, \",\").concat(y + 1)].biome == tileBiome.biome)\r\n sum += Autotile.SE;\r\n return Autotile.BITMASK[sum];\r\n };\r\n Autotile.autotile = function (mapObject) {\r\n console.log(\"autotile rawMapObj: \", mapObject);\r\n var tiles = {};\r\n var mapKeys = Object.keys(mapObject);\r\n var _a = mapKeys.reduce(function (acc, key) {\r\n var _a = key.split(\",\").map(Number), x = _a[0], y = _a[1];\r\n acc[0] = Math.max(acc[0], x);\r\n acc[1] = Math.max(acc[1], y);\r\n return acc;\r\n }, [0, 0]), maxX = _a[0], maxY = _a[1];\r\n for (var y = 0; y <= maxY; y++) {\r\n for (var x = 0; x <= maxX; x++) {\r\n var key = \"\".concat(x, \",\").concat(y);\r\n var tileValue = mapObject[key];\r\n if (!this.shouldAutoTile(mapObject, x, y, tileValue)) {\r\n tiles[key] = 47;\r\n continue;\r\n }\r\n tiles[key] = Autotile.autotileLookup(mapObject, maxX, maxY, x, y, tileValue);\r\n }\r\n }\r\n console.log(\"autotiled map: \", tiles);\r\n return tiles;\r\n };\r\n Autotile.NW = Math.pow(2, 0);\r\n Autotile.N = Math.pow(2, 1);\r\n Autotile.NE = Math.pow(2, 2);\r\n Autotile.W = Math.pow(2, 3);\r\n Autotile.E = Math.pow(2, 4);\r\n Autotile.SW = Math.pow(2, 5);\r\n Autotile.S = Math.pow(2, 6);\r\n Autotile.SE = Math.pow(2, 7);\r\n Autotile.BITMASK = {\r\n 2: 44,\r\n 8: 45,\r\n 10: 39,\r\n 11: 38,\r\n 16: 43,\r\n 18: 41,\r\n 22: 40,\r\n 24: 33,\r\n 26: 31,\r\n 27: 30,\r\n 30: 29,\r\n 31: 28,\r\n 64: 42,\r\n 66: 32,\r\n 72: 37,\r\n 74: 27,\r\n 75: 25,\r\n 80: 35,\r\n 82: 19,\r\n 86: 18,\r\n 88: 21,\r\n 90: 15,\r\n 91: 14,\r\n 94: 13,\r\n 95: 12,\r\n 104: 36,\r\n 106: 26,\r\n 107: 24,\r\n 120: 21,\r\n 122: 7,\r\n 123: 6,\r\n 126: 5,\r\n 127: 4,\r\n 208: 34,\r\n 210: 17,\r\n 214: 16,\r\n 216: 22,\r\n 218: 11,\r\n 219: 10,\r\n 222: 9,\r\n 223: 8,\r\n 248: 20,\r\n 250: 3,\r\n 251: 2,\r\n 254: 1,\r\n 255: 47,\r\n 0: 46,\r\n };\r\n return Autotile;\r\n}());\r\nexports.Autotile = Autotile;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/autotile.ts?"); /***/ }), @@ -5161,7 +5161,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Game = void 0;\r\nvar index_1 = __webpack_require__(/*! rot-js/lib/index */ \"./node_modules/rot-js/lib/index.js\");\r\nvar player_1 = __webpack_require__(/*! ./entities/player */ \"./src/entities/player.ts\");\r\nvar shrub_1 = __webpack_require__(/*! ./entities/shrub */ \"./src/entities/shrub.ts\");\r\nvar person_1 = __webpack_require__(/*! ./entities/person */ \"./src/entities/person.ts\");\r\nvar game_state_1 = __webpack_require__(/*! ./game-state */ \"./src/game-state.ts\");\r\nvar input_utility_1 = __webpack_require__(/*! ./input-utility */ \"./src/input-utility.ts\");\r\nvar tile_1 = __webpack_require__(/*! ./tile */ \"./src/tile.ts\");\r\nvar user_interface_1 = __webpack_require__(/*! ./user-interface */ \"./src/user-interface.ts\");\r\nvar animal_1 = __webpack_require__(/*! ./entities/animal */ \"./src/entities/animal.ts\");\r\nvar renderer_1 = __webpack_require__(/*! ./renderer */ \"./src/renderer.ts\");\r\nvar map_world_1 = __webpack_require__(/*! ./map-world */ \"./src/map-world.ts\");\r\nvar Game = /** @class */ (function () {\r\n function Game() {\r\n // RNG.setSeed(1234);\r\n this.entityCount = 5;\r\n this.treeCount = 20;\r\n this.isPaused = false;\r\n this.biome = \"grassland\";\r\n // sensible default\r\n var width = 150;\r\n var height = 150;\r\n var fontSize = 20;\r\n // how/why should this change?\r\n fontSize = 20;\r\n this.gameSize = { width: width, height: height };\r\n this.mapSize = { width: this.gameSize.width, height: this.gameSize.height };\r\n this.userInterface = new user_interface_1.UserInterface(this);\r\n this.gameState = new game_state_1.GameState();\r\n this.map = new map_world_1.MapWorld(this);\r\n this.renderer = new renderer_1.Renderer(this);\r\n }\r\n Game.prototype.Init = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.initializeGame()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n Game.prototype.start = function () {\r\n this.mainLoop();\r\n };\r\n Game.prototype.mapIsPassable = function (x, y) {\r\n return this.map.isPassable(x, y);\r\n };\r\n Game.prototype.occupiedByEntity = function (x, y) {\r\n for (var _i = 0, _a = this.entities; _i < _a.length; _i++) {\r\n var enemy = _a[_i];\r\n if (enemy.position.x == x && enemy.position.y == y) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Game.prototype.getPlayerPosition = function () {\r\n var _a;\r\n return (_a = this.player) === null || _a === void 0 ? void 0 : _a.position;\r\n };\r\n Game.prototype.checkBox = function (x, y) {\r\n switch (this.map.getTileType(x, y)) {\r\n case tile_1.Tile.shrub.type:\r\n this.map.setTile(x, y, tile_1.Tile.cutTree);\r\n this.userInterface.statusLine.boxes += 1;\r\n if (this.treePoint.x == x && this.treePoint.y == y) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Hooray! You found a pineapple.\");\r\n this.gameState.foundPineapple = true;\r\n }\r\n else {\r\n this.userInterface.messageLog.appendText(\"This box is empty.\");\r\n }\r\n break;\r\n case tile_1.Tile.cutTree.type:\r\n this.map.setTile(x, y, tile_1.Tile.treeStump);\r\n this.userInterface.messageLog.appendText(\"You destroy this box!\");\r\n break;\r\n case tile_1.Tile.treeStump.type:\r\n this.userInterface.messageLog.appendText(\"This box is already destroyed.\");\r\n break;\r\n default:\r\n this.userInterface.messageLog.appendText(\"There is no box here!\");\r\n break;\r\n }\r\n };\r\n Game.prototype.destroyBox = function (actor, x, y) {\r\n switch (this.map.getTileType(x, y)) {\r\n case 5 /* Plant */:\r\n case 7 /* CutTree */:\r\n this.map.setTile(x, y, tile_1.Tile.treeStump);\r\n if (this.treePoint.x == x && this.treePoint.y == y) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Game over - \".concat(this.getActorName(actor), \" detroyed the box with the pineapple.\"));\r\n this.gameState.pineappleWasDestroyed = true;\r\n }\r\n else {\r\n this.userInterface.messageLog.appendText(\"\".concat(this.getActorName(actor), \" detroyed a box.\"));\r\n }\r\n break;\r\n case 8 /* TreeStump */:\r\n this.userInterface.messageLog.appendText(\"This box is already destroyed.\");\r\n break;\r\n default:\r\n this.userInterface.messageLog.appendText(\"There is no box here!\");\r\n break;\r\n }\r\n };\r\n Game.prototype.catchPlayer = function (actor) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Game over - you were captured by \".concat(this.getActorName(actor), \"!\"));\r\n this.gameState.playerWasCaught = true;\r\n };\r\n Game.prototype.getTileType = function (x, y) {\r\n return this.map.getTileType(x, y);\r\n };\r\n Game.prototype.getRandomTilePositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n return this.map.getRandomTilePositions(type, quantity);\r\n };\r\n Game.prototype.getRandomPlantPositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.plants) {\r\n if (this.plants[key].type === type) {\r\n buffer.push(this.plants[key].position);\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(index_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n Game.prototype.getRandomEntityPositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.entities) {\r\n if (this.entities[key].type === type) {\r\n buffer.push(this.entities[key].position);\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(index_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n Game.prototype.initializeGame = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _i, _a, entity;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n console.log(\"init game\");\r\n return [4 /*yield*/, this.userInterface.init()];\r\n case 1:\r\n _b.sent();\r\n this.gameState.reset();\r\n this.map.generateMap(this.mapSize.width, this.mapSize.height);\r\n this.generatePlants();\r\n this.generateBeings();\r\n this.scheduler = new index_1.Scheduler.Action();\r\n // this.scheduler.add(this.player, true);\r\n for (_i = 0, _a = this.entities; _i < _a.length; _i++) {\r\n entity = _a[_i];\r\n this.scheduler.add(entity, true);\r\n }\r\n this.userInterface.refreshPanel();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n Game.prototype.mainLoop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var actor;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (false) {}\r\n return [4 /*yield*/, Game.delay(100)];\r\n case 1:\r\n _a.sent();\r\n if (!!this.isPaused) return [3 /*break*/, 4];\r\n actor = this.scheduler.next();\r\n if (!actor) return [3 /*break*/, 3];\r\n actor.plan();\r\n this.scheduler.setDuration(actor.action.durationInTurns);\r\n return [4 /*yield*/, actor.act()];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n this.userInterface.refreshPanel();\r\n _a.label = 4;\r\n case 4:\r\n if (!this.gameState.isGameOver()) return [3 /*break*/, 7];\r\n return [4 /*yield*/, input_utility_1.InputUtility.waitForInput(this.userInterface.HandleInputConfirm.bind(this))];\r\n case 5:\r\n _a.sent();\r\n return [4 /*yield*/, this.initializeGame()];\r\n case 6:\r\n _a.sent();\r\n _a.label = 7;\r\n case 7: return [3 /*break*/, 0];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // private async mainLoop(): Promise {\r\n // let actor: Actor;\r\n // console.log(\"main loop\");\r\n // while (true) {\r\n // await this.userInterface.camera.Act();\r\n // actor = this.scheduler.next();\r\n // // actor = null;\r\n // // if (!actor) {\r\n // // await this.userInterface.camera.Act();\r\n // // }\r\n // if (actor) {\r\n // const actionDuration = Math.ceil(RNG.getUniform() * 20);\r\n // this.scheduler.setDuration(actionDuration);\r\n // await actor.act();\r\n // if (actor.type === TileType.Player) {\r\n // this.userInterface.statusLine.turns += 1;\r\n // }\r\n // if (this.gameState.foundPineapple) {\r\n // this.userInterface.statusLine.pineapples += 1;\r\n // }\r\n // }\r\n // // this.drawUserInterface();\r\n // this.userInterface.refreshPanel();\r\n // // this.map.UpdateFOV(this.player);\r\n // if (this.gameState.isGameOver()) {\r\n // await InputUtility.waitForInput(\r\n // this.userInterface.HandleInputConfirm.bind(this)\r\n // );\r\n // await this.initializeGame();\r\n // }\r\n // }\r\n // }\r\n Game.prototype.getActorName = function (actor) {\r\n switch (actor.type) {\r\n case 6 /* Player */:\r\n return \"Player\";\r\n case 4 /* Entity */:\r\n return \"%c{\".concat(actor.tile.color, \"}Entity%c{}\");\r\n case 5 /* Plant */:\r\n return \"%c{\".concat(actor.tile.color, \"}Plant%c{}\");\r\n default:\r\n return \"unknown actor\";\r\n }\r\n };\r\n Game.prototype.generatePlants = function () {\r\n this.plants = [];\r\n var positions = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, this.treeCount);\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n this.plants.push(new shrub_1.Shrub(this, position));\r\n }\r\n this.treePoint = positions[0];\r\n };\r\n Game.prototype.generatePlayer = function () {\r\n var pos = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, 1)[0];\r\n this.player = new player_1.Player(this, pos);\r\n };\r\n Game.prototype.generateBeings = function () {\r\n this.entities = [];\r\n var positions = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, this.entityCount);\r\n // this.player = new Player(this, positions.splice(0, 1)[0]);\r\n for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {\r\n var position = positions_2[_i];\r\n if (index_1.RNG.getUniform() < 0.5) {\r\n this.entities.push(new person_1.Person(this, position));\r\n }\r\n else {\r\n this.entities.push(new animal_1.Animal(this, position));\r\n }\r\n }\r\n };\r\n Game.delay = function (delayInMs) {\r\n return new Promise(function (resolve) {\r\n return setTimeout(function () {\r\n return resolve(true);\r\n }, delayInMs);\r\n });\r\n };\r\n return Game;\r\n}());\r\nexports.Game = Game;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/game.ts?"); +eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Game = void 0;\r\nvar index_1 = __webpack_require__(/*! rot-js/lib/index */ \"./node_modules/rot-js/lib/index.js\");\r\nvar player_1 = __webpack_require__(/*! ./entities/player */ \"./src/entities/player.ts\");\r\nvar shrub_1 = __webpack_require__(/*! ./entities/shrub */ \"./src/entities/shrub.ts\");\r\nvar person_1 = __webpack_require__(/*! ./entities/person */ \"./src/entities/person.ts\");\r\nvar game_state_1 = __webpack_require__(/*! ./game-state */ \"./src/game-state.ts\");\r\nvar input_utility_1 = __webpack_require__(/*! ./input-utility */ \"./src/input-utility.ts\");\r\nvar tile_1 = __webpack_require__(/*! ./tile */ \"./src/tile.ts\");\r\nvar user_interface_1 = __webpack_require__(/*! ./user-interface */ \"./src/user-interface.ts\");\r\nvar animal_1 = __webpack_require__(/*! ./entities/animal */ \"./src/entities/animal.ts\");\r\nvar renderer_1 = __webpack_require__(/*! ./renderer */ \"./src/renderer.ts\");\r\nvar map_world_1 = __webpack_require__(/*! ./map-world */ \"./src/map-world.ts\");\r\nvar Game = /** @class */ (function () {\r\n function Game() {\r\n // RNG.setSeed(1234);\r\n this.entityCount = 5;\r\n this.treeCount = 20;\r\n this.isPaused = false;\r\n this.biome = \"grassland\";\r\n // sensible default\r\n var width = 350;\r\n var height = 350;\r\n var fontSize = 20;\r\n // how/why should this change?\r\n fontSize = 20;\r\n this.gameSize = { width: width, height: height };\r\n this.mapSize = { width: this.gameSize.width, height: this.gameSize.height };\r\n this.userInterface = new user_interface_1.UserInterface(this);\r\n this.gameState = new game_state_1.GameState();\r\n this.map = new map_world_1.MapWorld(this);\r\n this.renderer = new renderer_1.Renderer(this);\r\n }\r\n Game.prototype.Init = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.initializeGame()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n Game.prototype.start = function () {\r\n this.mainLoop();\r\n };\r\n Game.prototype.mapIsPassable = function (x, y) {\r\n return this.map.isPassable(x, y);\r\n };\r\n Game.prototype.occupiedByEntity = function (x, y) {\r\n for (var _i = 0, _a = this.entities; _i < _a.length; _i++) {\r\n var enemy = _a[_i];\r\n if (enemy.position.x == x && enemy.position.y == y) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Game.prototype.getPlayerPosition = function () {\r\n var _a;\r\n return (_a = this.player) === null || _a === void 0 ? void 0 : _a.position;\r\n };\r\n Game.prototype.checkBox = function (x, y) {\r\n switch (this.map.getTileType(x, y)) {\r\n case tile_1.Tile.shrub.type:\r\n this.map.setTile(x, y, tile_1.Tile.cutTree);\r\n this.userInterface.statusLine.boxes += 1;\r\n if (this.treePoint.x == x && this.treePoint.y == y) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Hooray! You found a pineapple.\");\r\n this.gameState.foundPineapple = true;\r\n }\r\n else {\r\n this.userInterface.messageLog.appendText(\"This box is empty.\");\r\n }\r\n break;\r\n case tile_1.Tile.cutTree.type:\r\n this.map.setTile(x, y, tile_1.Tile.treeStump);\r\n this.userInterface.messageLog.appendText(\"You destroy this box!\");\r\n break;\r\n case tile_1.Tile.treeStump.type:\r\n this.userInterface.messageLog.appendText(\"This box is already destroyed.\");\r\n break;\r\n default:\r\n this.userInterface.messageLog.appendText(\"There is no box here!\");\r\n break;\r\n }\r\n };\r\n Game.prototype.destroyBox = function (actor, x, y) {\r\n switch (this.map.getTileType(x, y)) {\r\n case 5 /* Plant */:\r\n case 7 /* CutTree */:\r\n this.map.setTile(x, y, tile_1.Tile.treeStump);\r\n if (this.treePoint.x == x && this.treePoint.y == y) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Game over - \".concat(this.getActorName(actor), \" detroyed the box with the pineapple.\"));\r\n this.gameState.pineappleWasDestroyed = true;\r\n }\r\n else {\r\n this.userInterface.messageLog.appendText(\"\".concat(this.getActorName(actor), \" detroyed a box.\"));\r\n }\r\n break;\r\n case 8 /* TreeStump */:\r\n this.userInterface.messageLog.appendText(\"This box is already destroyed.\");\r\n break;\r\n default:\r\n this.userInterface.messageLog.appendText(\"There is no box here!\");\r\n break;\r\n }\r\n };\r\n Game.prototype.catchPlayer = function (actor) {\r\n this.userInterface.messageLog.appendText(\"Continue with 'spacebar' or 'return'.\");\r\n this.userInterface.messageLog.appendText(\"Game over - you were captured by \".concat(this.getActorName(actor), \"!\"));\r\n this.gameState.playerWasCaught = true;\r\n };\r\n Game.prototype.getTileType = function (x, y) {\r\n return this.map.getTileType(x, y);\r\n };\r\n Game.prototype.getRandomTilePositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n return this.map.getRandomTilePositions(type, quantity);\r\n };\r\n Game.prototype.getRandomPlantPositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.plants) {\r\n if (this.plants[key].type === type) {\r\n buffer.push(this.plants[key].position);\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(index_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n Game.prototype.getRandomEntityPositions = function (type, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.entities) {\r\n if (this.entities[key].type === type) {\r\n buffer.push(this.entities[key].position);\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(index_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n Game.prototype.initializeGame = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _i, _a, entity;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n console.log(\"init game\");\r\n return [4 /*yield*/, this.userInterface.init()];\r\n case 1:\r\n _b.sent();\r\n this.gameState.reset();\r\n this.map.generateMap(this.mapSize.width, this.mapSize.height);\r\n this.generatePlants();\r\n this.generateBeings();\r\n this.scheduler = new index_1.Scheduler.Action();\r\n // this.scheduler.add(this.player, true);\r\n for (_i = 0, _a = this.entities; _i < _a.length; _i++) {\r\n entity = _a[_i];\r\n this.scheduler.add(entity, true);\r\n }\r\n this.userInterface.refreshPanel();\r\n return [2 /*return*/, true];\r\n }\r\n });\r\n });\r\n };\r\n Game.prototype.mainLoop = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var actor;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (false) {}\r\n return [4 /*yield*/, Game.delay(100)];\r\n case 1:\r\n _a.sent();\r\n if (!!this.isPaused) return [3 /*break*/, 4];\r\n actor = this.scheduler.next();\r\n if (!actor) return [3 /*break*/, 3];\r\n actor.plan();\r\n this.scheduler.setDuration(actor.action.durationInTurns);\r\n return [4 /*yield*/, actor.act()];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n this.userInterface.refreshPanel();\r\n _a.label = 4;\r\n case 4:\r\n if (!this.gameState.isGameOver()) return [3 /*break*/, 7];\r\n return [4 /*yield*/, input_utility_1.InputUtility.waitForInput(this.userInterface.HandleInputConfirm.bind(this))];\r\n case 5:\r\n _a.sent();\r\n return [4 /*yield*/, this.initializeGame()];\r\n case 6:\r\n _a.sent();\r\n _a.label = 7;\r\n case 7: return [3 /*break*/, 0];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // private async mainLoop(): Promise {\r\n // let actor: Actor;\r\n // console.log(\"main loop\");\r\n // while (true) {\r\n // await this.userInterface.camera.Act();\r\n // actor = this.scheduler.next();\r\n // // actor = null;\r\n // // if (!actor) {\r\n // // await this.userInterface.camera.Act();\r\n // // }\r\n // if (actor) {\r\n // const actionDuration = Math.ceil(RNG.getUniform() * 20);\r\n // this.scheduler.setDuration(actionDuration);\r\n // await actor.act();\r\n // if (actor.type === TileType.Player) {\r\n // this.userInterface.statusLine.turns += 1;\r\n // }\r\n // if (this.gameState.foundPineapple) {\r\n // this.userInterface.statusLine.pineapples += 1;\r\n // }\r\n // }\r\n // // this.drawUserInterface();\r\n // this.userInterface.refreshPanel();\r\n // // this.map.UpdateFOV(this.player);\r\n // if (this.gameState.isGameOver()) {\r\n // await InputUtility.waitForInput(\r\n // this.userInterface.HandleInputConfirm.bind(this)\r\n // );\r\n // await this.initializeGame();\r\n // }\r\n // }\r\n // }\r\n Game.prototype.getActorName = function (actor) {\r\n switch (actor.type) {\r\n case 6 /* Player */:\r\n return \"Player\";\r\n case 4 /* Entity */:\r\n return \"%c{\".concat(actor.tile.color, \"}Entity%c{}\");\r\n case 5 /* Plant */:\r\n return \"%c{\".concat(actor.tile.color, \"}Plant%c{}\");\r\n default:\r\n return \"unknown actor\";\r\n }\r\n };\r\n Game.prototype.generatePlants = function () {\r\n this.plants = [];\r\n var positions = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, this.treeCount);\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n this.plants.push(new shrub_1.Shrub(this, position));\r\n }\r\n this.treePoint = positions[0];\r\n };\r\n Game.prototype.generatePlayer = function () {\r\n var pos = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, 1)[0];\r\n this.player = new player_1.Player(this, pos);\r\n };\r\n Game.prototype.generateBeings = function () {\r\n this.entities = [];\r\n var positions = this.map.getRandomTilePositions(tile_1.Tile.Biomes.grassland.biome, this.entityCount);\r\n // this.player = new Player(this, positions.splice(0, 1)[0]);\r\n for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {\r\n var position = positions_2[_i];\r\n if (index_1.RNG.getUniform() < 0.5) {\r\n this.entities.push(new person_1.Person(this, position));\r\n }\r\n else {\r\n this.entities.push(new animal_1.Animal(this, position));\r\n }\r\n }\r\n };\r\n Game.delay = function (delayInMs) {\r\n return new Promise(function (resolve) {\r\n return setTimeout(function () {\r\n return resolve(true);\r\n }, delayInMs);\r\n });\r\n };\r\n return Game;\r\n}());\r\nexports.Game = Game;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/game.ts?"); /***/ }), @@ -5183,7 +5183,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MapWorld = void 0;\r\nvar rot_js_1 = __webpack_require__(/*! rot-js */ \"./node_modules/rot-js/lib/index.js\");\r\nvar index_1 = __webpack_require__(/*! rot-js/lib/index */ \"./node_modules/rot-js/lib/index.js\");\r\nvar tile_1 = __webpack_require__(/*! ./tile */ \"./src/tile.ts\");\r\nvar point_1 = __webpack_require__(/*! ./point */ \"./src/point.ts\");\r\nvar renderer_1 = __webpack_require__(/*! ./renderer */ \"./src/renderer.ts\");\r\nvar autotile_1 = __webpack_require__(/*! ./autotile */ \"./src/autotile.ts\");\r\nvar simplex_1 = __webpack_require__(/*! rot-js/lib/noise/simplex */ \"./node_modules/rot-js/lib/noise/simplex.js\");\r\nvar MapWorld = /** @class */ (function () {\r\n function MapWorld(game) {\r\n this.game = game;\r\n this.tileMap = {};\r\n this.biomeMap = {};\r\n this.heightMap = {};\r\n this.terrainMap = {};\r\n this.adjacencyMap = {};\r\n this.dirtyTiles = [];\r\n this.landHeight = 0.5;\r\n this.valleyScaleFactor = 1.5;\r\n this.edgePadding = 0;\r\n this.islandMask = 0.3;\r\n }\r\n MapWorld.prototype.generateMap = function (width, height) {\r\n this.tileMap = {};\r\n this.biomeMap = {};\r\n this.heightMap = {}; // between 0 and 1\r\n this.terrainMap = {};\r\n this.dirtyTiles = [];\r\n var noise = new simplex_1.default();\r\n for (var x = 0; x < width; x++) {\r\n for (var y = 0; y < height; y++) {\r\n var key = this.coordinatesToKey(x, y);\r\n this.heightMap[key] = this.getHeight(x, y, width, height, noise);\r\n this.terrainMap[key] = this.assignTerrain(x, y);\r\n }\r\n }\r\n for (var x = 0; x < width; x++) {\r\n for (var y = 0; y < height; y++) {\r\n var key = this.coordinatesToKey(x, y);\r\n this.adjacencyMap[key] = this.assignAdjacentTerrain(x, y);\r\n this.biomeMap[key] = this.assignBiome(x, y);\r\n this.dirtyTiles.push(key);\r\n }\r\n }\r\n // console.log(\"adjacencyMap: \", this.adjacencyMap);\r\n this.autotileMap(this.biomeMap);\r\n };\r\n MapWorld.prototype.lerp = function (x, y, a) {\r\n return x * (1 - a) + y * a;\r\n };\r\n MapWorld.prototype.getHeight = function (x, y, mapWidth, mapHeight, noise) {\r\n // randomize the edge padding to prevent a squared-off look\r\n var randomizedEdgePadding = this.edgePadding + rot_js_1.RNG.getUniformInt(0, 2);\r\n // if near the edge of the map, return a lower height\r\n if (x < randomizedEdgePadding ||\r\n x >= mapWidth - randomizedEdgePadding ||\r\n y < randomizedEdgePadding ||\r\n y >= mapHeight - randomizedEdgePadding) {\r\n return this.landHeight / 2;\r\n }\r\n var noiseX = x / mapWidth - 0.5;\r\n var noiseY = y / mapHeight - 0.5;\r\n // add different octaves of frequency\r\n // some small hills, some large, etc\r\n // 1 / octave * this.getScaledNoise(noise, octave * noiseX, octave * noiseY)\r\n var height = 0.333 * this.getScaledNoise(noise, 3 * noiseX, 3 * noiseY);\r\n height += 0.1667 * this.getScaledNoise(noise, 6 * noiseX, 6 * noiseY);\r\n height += 0.06667 * this.getScaledNoise(noise, 15 * noiseX, 15 * noiseY);\r\n height += 0.045 * this.getScaledNoise(noise, 22 * noiseX, 22 * noiseY);\r\n height = height / (0.3 + 0.1667 + 0.067 + 0.045); // scale to between 0 and 1\r\n height = Math.pow(height, this.valleyScaleFactor); // reshape valleys/mountains\r\n // reduce height near edges of map\r\n var dx = (2 * x) / mapWidth - 1;\r\n var dy = (2 * y) / mapHeight - 1;\r\n var d = 1 - (1 - Math.pow(dx, 2)) * (1 - Math.pow(dy, 2));\r\n height = this.lerp(height, 1 - d, this.islandMask);\r\n return height;\r\n };\r\n MapWorld.prototype.getScaledNoise = function (noise, x, y) {\r\n return (noise.get(x, y) + 1) / 2;\r\n };\r\n MapWorld.prototype.assignTerrain = function (x, y) {\r\n // assign the high level terrain types\r\n // features will be placed within these terrain types for tiling transition purposes\r\n var heightVal = this.heightMap[this.coordinatesToKey(x, y)];\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.ocean.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.ocean;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.dirt.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.dirt;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.grassland.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.grassland;\r\n }\r\n };\r\n MapWorld.prototype.assignAdjacentTerrain = function (x, y) {\r\n var adjacencyDistance = 2;\r\n var key = this.coordinatesToKey(x, y);\r\n var heightVal = this.heightMap[key];\r\n var terrain = this.terrainMap[key];\r\n var adjacentTerrain = [];\r\n var pos;\r\n var biome;\r\n for (var xOffset = -adjacencyDistance; xOffset <= adjacencyDistance; xOffset++) {\r\n for (var yOffset = -adjacencyDistance; yOffset <= adjacencyDistance; yOffset++) {\r\n if (xOffset === 0 && yOffset === 0) {\r\n continue;\r\n }\r\n pos = new point_1.Point(x + xOffset, y + yOffset);\r\n biome = this.terrainMap[this.coordinatesToKey(pos.x, pos.y)];\r\n if (biome) {\r\n adjacentTerrain.push(biome);\r\n }\r\n }\r\n }\r\n return adjacentTerrain;\r\n };\r\n MapWorld.prototype.isAdjacentToTerrain = function (x, y, terrain) {\r\n var key = this.coordinatesToKey(x, y);\r\n var adjacentTerrain = this.adjacencyMap[key];\r\n for (var i = 0; i < adjacentTerrain.length; i++) {\r\n if (terrain.includes(adjacentTerrain[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n MapWorld.prototype.assignBiome = function (x, y) {\r\n var key = this.coordinatesToKey(x, y);\r\n var heightVal = this.heightMap[key];\r\n if (this.terrainMap[key] === tile_1.Tile.Biomes.ocean) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.oceandeep.generationOptions.height) &&\r\n !this.isAdjacentToTerrain(x, y, [\r\n tile_1.Tile.Biomes.dirt,\r\n tile_1.Tile.Biomes.grassland,\r\n ])) {\r\n return tile_1.Tile.Biomes.oceandeep;\r\n }\r\n return tile_1.Tile.Biomes.ocean;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.dirt.generationOptions.height)) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.sand.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.sand;\r\n }\r\n return tile_1.Tile.Biomes.dirt;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.grassland.generationOptions.height)) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.forestgrass.generationOptions.height) &&\r\n !this.isAdjacentToTerrain(x, y, [tile_1.Tile.Biomes.dirt, tile_1.Tile.Biomes.ocean])) {\r\n return tile_1.Tile.Biomes.forestgrass;\r\n }\r\n return tile_1.Tile.Biomes.grassland;\r\n }\r\n };\r\n MapWorld.prototype.autotileMap = function (rawMap) {\r\n var _this = this;\r\n // console.log(\"rawMap to start with: \", rawMap);\r\n var autotileMap = autotile_1.Autotile.autotile(rawMap);\r\n var tileIndex;\r\n var biome;\r\n var season;\r\n var tile;\r\n Object.keys(autotileMap).forEach(function (pos) {\r\n tileIndex = autotileMap[pos];\r\n biome = rawMap[pos].biome;\r\n season = rawMap[pos].season;\r\n tile = tile_1.Tile.Tilesets[biome][season][tileIndex];\r\n if (!tile) {\r\n console.log(\"AUTOTILE ERROR: \".concat(biome, \" - \").concat(season, \" - \").concat(tileIndex));\r\n }\r\n _this.tileMap[pos] = tile;\r\n });\r\n };\r\n MapWorld.prototype.setTile = function (x, y, tile) {\r\n this.tileMap[this.coordinatesToKey(x, y)] = tile;\r\n this.dirtyTiles.push(this.coordinatesToKey(x, y));\r\n };\r\n MapWorld.prototype.getRandomTilePositions = function (biomeType, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.tileMap) {\r\n // console.log(\"this.map[key]\", key, this.map[key]);\r\n if (this.tileMap[key].biomeType === biomeType) {\r\n buffer.push(this.keyToPoint(key));\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(rot_js_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n MapWorld.prototype.getTile = function (x, y) {\r\n return this.tileMap[this.coordinatesToKey(x, y)];\r\n };\r\n MapWorld.prototype.getTileType = function (x, y) {\r\n return this.tileMap[this.coordinatesToKey(x, y)].type;\r\n };\r\n MapWorld.prototype.isPassable = function (x, y) {\r\n var _a;\r\n return (this.coordinatesToKey(x, y) in this.tileMap &&\r\n ((_a = this.tileMap[this.coordinatesToKey(x, y)]) === null || _a === void 0 ? void 0 : _a.biomeType) !==\r\n tile_1.Tile.Biomes.ocean.biome);\r\n };\r\n MapWorld.prototype.draw = function () {\r\n for (var _i = 0, _a = this.dirtyTiles; _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n if (key) {\r\n var tile = this.tileMap[key];\r\n this.game.renderer.removeFromScene(this.keyToPoint(key), key, renderer_1.Layer.TERRAIN);\r\n this.game.renderer.addToScene(this.keyToPoint(key), renderer_1.Layer.TERRAIN, tile.sprite);\r\n }\r\n }\r\n // Clear the changed tiles after drawing them\r\n this.dirtyTiles = [];\r\n };\r\n MapWorld.prototype.UpdateFOV = function (actor) {\r\n var _this = this;\r\n var fov = new index_1.FOV.PreciseShadowcasting(this.lightPasses.bind(this));\r\n var bgTile;\r\n var key;\r\n /* output callback */\r\n fov.compute(actor.position.x, actor.position.y, 3, function (xPos, yPos, r, visibility) {\r\n key = xPos + \",\" + yPos;\r\n bgTile = _this.tileMap[key];\r\n if (_this.tileMap[key] == null) {\r\n return;\r\n }\r\n console.log(\"r= \" + r);\r\n console.log(\"visibility: \" + visibility);\r\n // const glyphs =\r\n // r === 0 ? [this.map[key].glyph, actor.glyph] : [this.map[key].glyph];\r\n // const glyphs = r === 0 ? [actor.glyph, this.map[key].glyph] : [this.map[key].glyph];\r\n var brightness = 0.55 * (1 / r) * visibility;\r\n var color = \"rgba(244, 197, 91, \".concat(brightness, \")\");\r\n // var color = (this.map[xPos+\",\"+yPos] ? \"#aa0\": \"#660\");\r\n // comment out while switching from glyphs to tiles\r\n // this.game.userInterface.draw(new Point(xPos, yPos), glyphs, glyphs.map(g => color));\r\n });\r\n };\r\n MapWorld.prototype.lightPasses = function (x, y) {\r\n var key = x + \",\" + y;\r\n if (key in this.tileMap) {\r\n return this.tileMap[key] != tile_1.Tile.water;\r\n }\r\n return false;\r\n };\r\n MapWorld.prototype.coordinatesToKey = function (x, y) {\r\n return x + \",\" + y;\r\n };\r\n MapWorld.prototype.keyToPoint = function (key) {\r\n var parts = key.split(\",\");\r\n return new point_1.Point(parseInt(parts[0]), parseInt(parts[1]));\r\n };\r\n return MapWorld;\r\n}());\r\nexports.MapWorld = MapWorld;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/map-world.ts?"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MapWorld = void 0;\r\nvar rot_js_1 = __webpack_require__(/*! rot-js */ \"./node_modules/rot-js/lib/index.js\");\r\nvar index_1 = __webpack_require__(/*! rot-js/lib/index */ \"./node_modules/rot-js/lib/index.js\");\r\nvar tile_1 = __webpack_require__(/*! ./tile */ \"./src/tile.ts\");\r\nvar point_1 = __webpack_require__(/*! ./point */ \"./src/point.ts\");\r\nvar renderer_1 = __webpack_require__(/*! ./renderer */ \"./src/renderer.ts\");\r\nvar autotile_1 = __webpack_require__(/*! ./autotile */ \"./src/autotile.ts\");\r\nvar simplex_1 = __webpack_require__(/*! rot-js/lib/noise/simplex */ \"./node_modules/rot-js/lib/noise/simplex.js\");\r\nvar MapWorld = /** @class */ (function () {\r\n function MapWorld(game) {\r\n this.game = game;\r\n this.tileMap = {};\r\n this.biomeMap = {};\r\n this.heightMap = {};\r\n this.terrainMap = {};\r\n this.adjacencyMap = {};\r\n this.dirtyTiles = [];\r\n this.landHeight = 0.5;\r\n this.valleyScaleFactor = 2;\r\n this.edgePadding = 0;\r\n this.islandMask = 0.38;\r\n }\r\n MapWorld.prototype.generateMap = function (width, height) {\r\n this.tileMap = {};\r\n this.biomeMap = {};\r\n this.heightMap = {}; // between 0 and 1\r\n this.terrainMap = {};\r\n this.dirtyTiles = [];\r\n var noise = new simplex_1.default();\r\n for (var x = 0; x < width; x++) {\r\n for (var y = 0; y < height; y++) {\r\n var key = this.coordinatesToKey(x, y);\r\n this.heightMap[key] = this.getHeight(x, y, width, height, noise);\r\n this.terrainMap[key] = this.assignTerrain(x, y);\r\n }\r\n }\r\n for (var x = 0; x < width; x++) {\r\n for (var y = 0; y < height; y++) {\r\n var key = this.coordinatesToKey(x, y);\r\n this.adjacencyMap[key] = this.assignAdjacentTerrain(x, y);\r\n this.biomeMap[key] = this.assignBiome(x, y);\r\n this.dirtyTiles.push(key);\r\n }\r\n }\r\n // console.log(\"adjacencyMap: \", this.adjacencyMap);\r\n this.autotileMap(this.biomeMap);\r\n };\r\n MapWorld.prototype.lerp = function (x, y, a) {\r\n return x * (1 - a) + y * a;\r\n };\r\n MapWorld.prototype.getHeight = function (x, y, mapWidth, mapHeight, noise) {\r\n // randomize the edge padding to prevent a squared-off look\r\n var randomizedEdgePadding = this.edgePadding + rot_js_1.RNG.getUniformInt(0, 2);\r\n // if near the edge of the map, return a lower height\r\n if (x < randomizedEdgePadding ||\r\n x >= mapWidth - randomizedEdgePadding ||\r\n y < randomizedEdgePadding ||\r\n y >= mapHeight - randomizedEdgePadding) {\r\n return this.landHeight / 2;\r\n }\r\n var noiseX = x / mapWidth - 0.5;\r\n var noiseY = y / mapHeight - 0.5;\r\n // add different octaves of frequency\r\n // some small hills, some large, etc\r\n // 1 / octave * this.getScaledNoise(noise, octave * noiseX, octave * noiseY)\r\n var height = 0.7 * this.getScaledNoise(noise, 3 * noiseX, 3 * noiseY);\r\n height += 0.5 * this.getScaledNoise(noise, 4 * noiseX, 4 * noiseY);\r\n height += 0.3 * this.getScaledNoise(noise, 8 * noiseX, 8 * noiseY);\r\n height += 0.3 * this.getScaledNoise(noise, 15 * noiseX, 15 * noiseY);\r\n height = height / (0.4 + 0.5 + 0.3 + 0.2); // scale to between 0 and 1\r\n height = Math.pow(height, this.valleyScaleFactor); // reshape valleys/mountains\r\n // reduce height near edges of map\r\n var dx = (2 * x) / mapWidth - 1;\r\n var dy = (2 * y) / mapHeight - 1;\r\n var d = 1 - (1 - Math.pow(dx, 2)) * (1 - Math.pow(dy, 2));\r\n height = this.lerp(height, 1 - d, this.islandMask);\r\n return height;\r\n };\r\n MapWorld.prototype.getScaledNoise = function (noise, x, y) {\r\n return (noise.get(x, y) + 1) / 2;\r\n };\r\n MapWorld.prototype.assignTerrain = function (x, y) {\r\n // assign the high level terrain types\r\n // features will be placed within these terrain types for tiling transition purposes\r\n var heightVal = this.heightMap[this.coordinatesToKey(x, y)];\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.ocean.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.ocean;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.dirt.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.dirt;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.grassland.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.grassland;\r\n }\r\n };\r\n MapWorld.prototype.assignAdjacentTerrain = function (x, y) {\r\n var adjacencyDistance = 2;\r\n var key = this.coordinatesToKey(x, y);\r\n var heightVal = this.heightMap[key];\r\n var terrain = this.terrainMap[key];\r\n var adjacentTerrain = [];\r\n var pos;\r\n var biome;\r\n for (var xOffset = -adjacencyDistance; xOffset <= adjacencyDistance; xOffset++) {\r\n for (var yOffset = -adjacencyDistance; yOffset <= adjacencyDistance; yOffset++) {\r\n if (xOffset === 0 && yOffset === 0) {\r\n continue;\r\n }\r\n pos = new point_1.Point(x + xOffset, y + yOffset);\r\n biome = this.terrainMap[this.coordinatesToKey(pos.x, pos.y)];\r\n if (biome) {\r\n adjacentTerrain.push(biome);\r\n }\r\n }\r\n }\r\n return adjacentTerrain;\r\n };\r\n MapWorld.prototype.isAdjacentToTerrain = function (x, y, terrain) {\r\n var key = this.coordinatesToKey(x, y);\r\n var adjacentTerrain = this.adjacencyMap[key];\r\n for (var i = 0; i < adjacentTerrain.length; i++) {\r\n if (terrain.includes(adjacentTerrain[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n MapWorld.prototype.assignBiome = function (x, y) {\r\n var key = this.coordinatesToKey(x, y);\r\n var heightVal = this.heightMap[key];\r\n if (this.terrainMap[key] === tile_1.Tile.Biomes.ocean) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.oceandeep.generationOptions.height) &&\r\n !this.isAdjacentToTerrain(x, y, [\r\n tile_1.Tile.Biomes.dirt,\r\n tile_1.Tile.Biomes.grassland,\r\n ])) {\r\n return tile_1.Tile.Biomes.oceandeep;\r\n }\r\n return tile_1.Tile.Biomes.ocean;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.dirt.generationOptions.height)) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.sand.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.sand;\r\n }\r\n return tile_1.Tile.Biomes.dirt;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.grassland.generationOptions.height)) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.hills.generationOptions.height)) {\r\n return tile_1.Tile.Biomes.hills;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.swampdirt.generationOptions.height) &&\r\n !this.isAdjacentToTerrain(x, y, [tile_1.Tile.Biomes.dirt, tile_1.Tile.Biomes.ocean])) {\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.swampwater.generationOptions.height) &&\r\n this.isAdjacentToTerrain(x, y, [tile_1.Tile.Biomes.swampdirt])) {\r\n return tile_1.Tile.Biomes.swampwater;\r\n }\r\n return tile_1.Tile.Biomes.swampdirt;\r\n }\r\n if (tile_1.Tile.inRange(heightVal, tile_1.Tile.Biomes.forestgrass.generationOptions.height) &&\r\n !this.isAdjacentToTerrain(x, y, [tile_1.Tile.Biomes.dirt, tile_1.Tile.Biomes.ocean])) {\r\n return tile_1.Tile.Biomes.forestgrass;\r\n }\r\n return tile_1.Tile.Biomes.grassland;\r\n }\r\n };\r\n MapWorld.prototype.autotileMap = function (rawMap) {\r\n var _this = this;\r\n // console.log(\"rawMap to start with: \", rawMap);\r\n var autotileMap = autotile_1.Autotile.autotile(rawMap);\r\n var tileIndex;\r\n var biome;\r\n var season;\r\n var tile;\r\n Object.keys(autotileMap).forEach(function (pos) {\r\n tileIndex = autotileMap[pos];\r\n biome = rawMap[pos].biome;\r\n season = rawMap[pos].season;\r\n tile = tile_1.Tile.Tilesets[biome][season][tileIndex];\r\n if (!tile) {\r\n console.log(\"AUTOTILE ERROR: \".concat(biome, \" - \").concat(season, \" - \").concat(tileIndex));\r\n }\r\n _this.tileMap[pos] = tile;\r\n });\r\n };\r\n MapWorld.prototype.setTile = function (x, y, tile) {\r\n this.tileMap[this.coordinatesToKey(x, y)] = tile;\r\n this.dirtyTiles.push(this.coordinatesToKey(x, y));\r\n };\r\n MapWorld.prototype.getRandomTilePositions = function (biomeType, quantity) {\r\n if (quantity === void 0) { quantity = 1; }\r\n var buffer = [];\r\n var result = [];\r\n for (var key in this.tileMap) {\r\n // console.log(\"this.map[key]\", key, this.map[key]);\r\n if (this.tileMap[key].biomeType === biomeType) {\r\n buffer.push(this.keyToPoint(key));\r\n }\r\n }\r\n var index;\r\n while (buffer.length > 0 && result.length < quantity) {\r\n index = Math.floor(rot_js_1.RNG.getUniform() * buffer.length);\r\n result.push(buffer.splice(index, 1)[0]);\r\n }\r\n return result;\r\n };\r\n MapWorld.prototype.getTile = function (x, y) {\r\n return this.tileMap[this.coordinatesToKey(x, y)];\r\n };\r\n MapWorld.prototype.getTileType = function (x, y) {\r\n return this.tileMap[this.coordinatesToKey(x, y)].type;\r\n };\r\n MapWorld.prototype.isPassable = function (x, y) {\r\n var _a;\r\n return (this.coordinatesToKey(x, y) in this.tileMap &&\r\n ((_a = this.tileMap[this.coordinatesToKey(x, y)]) === null || _a === void 0 ? void 0 : _a.biomeType) !==\r\n tile_1.Tile.Biomes.ocean.biome);\r\n };\r\n MapWorld.prototype.draw = function () {\r\n for (var _i = 0, _a = this.dirtyTiles; _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n if (key) {\r\n var tile = this.tileMap[key];\r\n this.game.renderer.removeFromScene(this.keyToPoint(key), key, renderer_1.Layer.TERRAIN);\r\n this.game.renderer.addToScene(this.keyToPoint(key), renderer_1.Layer.TERRAIN, tile.sprite);\r\n }\r\n }\r\n // Clear the changed tiles after drawing them\r\n this.dirtyTiles = [];\r\n };\r\n MapWorld.prototype.UpdateFOV = function (actor) {\r\n var _this = this;\r\n var fov = new index_1.FOV.PreciseShadowcasting(this.lightPasses.bind(this));\r\n var bgTile;\r\n var key;\r\n /* output callback */\r\n fov.compute(actor.position.x, actor.position.y, 3, function (xPos, yPos, r, visibility) {\r\n key = xPos + \",\" + yPos;\r\n bgTile = _this.tileMap[key];\r\n if (_this.tileMap[key] == null) {\r\n return;\r\n }\r\n console.log(\"r= \" + r);\r\n console.log(\"visibility: \" + visibility);\r\n // const glyphs =\r\n // r === 0 ? [this.map[key].glyph, actor.glyph] : [this.map[key].glyph];\r\n // const glyphs = r === 0 ? [actor.glyph, this.map[key].glyph] : [this.map[key].glyph];\r\n var brightness = 0.55 * (1 / r) * visibility;\r\n var color = \"rgba(244, 197, 91, \".concat(brightness, \")\");\r\n // var color = (this.map[xPos+\",\"+yPos] ? \"#aa0\": \"#660\");\r\n // comment out while switching from glyphs to tiles\r\n // this.game.userInterface.draw(new Point(xPos, yPos), glyphs, glyphs.map(g => color));\r\n });\r\n };\r\n MapWorld.prototype.lightPasses = function (x, y) {\r\n var key = x + \",\" + y;\r\n if (key in this.tileMap) {\r\n return this.tileMap[key] != tile_1.Tile.water;\r\n }\r\n return false;\r\n };\r\n MapWorld.prototype.coordinatesToKey = function (x, y) {\r\n return x + \",\" + y;\r\n };\r\n MapWorld.prototype.keyToPoint = function (key) {\r\n var parts = key.split(\",\");\r\n return new point_1.Point(parseInt(parts[0]), parseInt(parts[1]));\r\n };\r\n return MapWorld;\r\n}());\r\nexports.MapWorld = MapWorld;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/map-world.ts?"); /***/ }), @@ -5249,7 +5249,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n /***/ ((__unused_webpack_module, exports) => { "use strict"; -eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tile = exports.Season = void 0;\r\nvar Season;\r\n(function (Season) {\r\n Season[\"Spring\"] = \"SPRING\";\r\n Season[\"Summer\"] = \"SUMMER\";\r\n Season[\"Fall\"] = \"FALL\";\r\n Season[\"Winter\"] = \"SPRING\";\r\n})(Season = exports.Season || (exports.Season = {}));\r\nvar Tile = /** @class */ (function () {\r\n function Tile(type, sprite, color, biomeType) {\r\n this.type = type;\r\n this.sprite = sprite;\r\n this.color = color;\r\n this.biomeType = biomeType;\r\n }\r\n Tile.inRange = function (value, range) {\r\n if (!range) {\r\n return true;\r\n }\r\n if (range.min && value < range.min) {\r\n return false;\r\n }\r\n if (range.max && value > range.max) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Tile.size = 16;\r\n Tile.player = new Tile(6 /* Player */, \"biomes/grassland/player_01\", \"#D2D2D2\");\r\n Tile.person = new Tile(6 /* Player */, \"biomes/grassland/player_01\", \"#E7E6AC\");\r\n Tile.animal = new Tile(4 /* Entity */, \"biomes/grassland/entity-mushroom\", \"#C1BF69\");\r\n Tile.water = new Tile(0 /* Wall */, \"biomes/grassland/grassland_spring_577\", \"#95C9F6\");\r\n Tile.shrub = new Tile(5 /* Plant */, \"biomes/grassland/grassland_spring_075\", \"#95C577\");\r\n Tile.cutTree = new Tile(7 /* CutTree */, \"TODO cut tree\", \"#FF4AE7\");\r\n Tile.treeStump = new Tile(8 /* TreeStump */, \"TODO tree stump\", \"#FF4AE7\");\r\n Tile.Biomes = {\r\n grassland: {\r\n // key will match BiomeType\r\n biome: \"grassland\",\r\n autotilePrefix: \"biomes/grassland/grassland_spring_ground_\",\r\n color: \"#d3ffd8\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.5,\r\n // max: 0.8,\r\n },\r\n },\r\n },\r\n forestgrass: {\r\n biome: \"forestgrass\",\r\n autotilePrefix: \"biomes/forestgrass/forestgrass_grassland_\",\r\n color: \"#2f9e77\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.7,\r\n max: 0.8,\r\n },\r\n },\r\n },\r\n ocean: {\r\n biome: \"ocean\",\r\n autotilePrefix: \"biomes/ocean/ocean_dirt_\",\r\n color: \"#0080e5\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n max: 0.5,\r\n },\r\n },\r\n },\r\n dirt: {\r\n biome: \"dirt\",\r\n autotilePrefix: \"biomes/dirt/dirt_dirt_\",\r\n color: \"#e5e5a0\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.4,\r\n max: 0.6,\r\n },\r\n },\r\n },\r\n dirttextured: {\r\n biome: \"dirttextured\",\r\n autotilePrefix: \"biomes/dirttextured/dirttextured_dirt_\",\r\n color: \"#ddd29b\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.8,\r\n },\r\n },\r\n },\r\n sand: {\r\n biome: \"sand\",\r\n autotilePrefix: \"biomes/sand/sand_dirt_\",\r\n color: \"#f4f0c3\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.3,\r\n max: 0.54,\r\n },\r\n },\r\n },\r\n oceandeep: {\r\n biome: \"oceandeep\",\r\n autotilePrefix: \"biomes/oceandeep/oceandeep_ocean_\",\r\n color: \"#004db2\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n max: 0.25,\r\n },\r\n },\r\n },\r\n };\r\n Tile.Tilesets = {};\r\n return Tile;\r\n}());\r\nexports.Tile = Tile;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/tile.ts?"); +eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Tile = exports.Season = void 0;\r\nvar Season;\r\n(function (Season) {\r\n Season[\"Spring\"] = \"SPRING\";\r\n Season[\"Summer\"] = \"SUMMER\";\r\n Season[\"Fall\"] = \"FALL\";\r\n Season[\"Winter\"] = \"SPRING\";\r\n})(Season = exports.Season || (exports.Season = {}));\r\nvar Tile = /** @class */ (function () {\r\n function Tile(type, sprite, color, biomeType) {\r\n this.type = type;\r\n this.sprite = sprite;\r\n this.color = color;\r\n this.biomeType = biomeType;\r\n }\r\n Tile.inRange = function (value, range) {\r\n if (!range) {\r\n return true;\r\n }\r\n if (range.min && value < range.min) {\r\n return false;\r\n }\r\n if (range.max && value > range.max) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Tile.size = 16;\r\n Tile.player = new Tile(6 /* Player */, \"biomes/grassland/player_01\", \"#D2D2D2\");\r\n Tile.person = new Tile(6 /* Player */, \"biomes/grassland/player_01\", \"#E7E6AC\");\r\n Tile.animal = new Tile(4 /* Entity */, \"biomes/grassland/entity-mushroom\", \"#C1BF69\");\r\n Tile.water = new Tile(0 /* Wall */, \"biomes/grassland/grassland_spring_577\", \"#95C9F6\");\r\n Tile.shrub = new Tile(5 /* Plant */, \"biomes/grassland/grassland_spring_075\", \"#95C577\");\r\n Tile.cutTree = new Tile(7 /* CutTree */, \"TODO cut tree\", \"#FF4AE7\");\r\n Tile.treeStump = new Tile(8 /* TreeStump */, \"TODO tree stump\", \"#FF4AE7\");\r\n Tile.Biomes = {\r\n grassland: {\r\n // key will match BiomeType\r\n biome: \"grassland\",\r\n autotilePrefix: \"biomes/grassland/grassland_spring_ground_\",\r\n color: \"#d3ffd8\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.5,\r\n // max: 0.8,\r\n },\r\n },\r\n },\r\n hills: {\r\n biome: \"hills\",\r\n autotilePrefix: \"biomes/hills/hills_grassland_\",\r\n color: \"#e48989\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.75,\r\n max: 1,\r\n },\r\n },\r\n },\r\n forestgrass: {\r\n biome: \"forestgrass\",\r\n autotilePrefix: \"biomes/forestgrass/forestgrass_grassland_\",\r\n color: \"#2f9e77\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.7,\r\n max: 0.8,\r\n },\r\n },\r\n },\r\n ocean: {\r\n biome: \"ocean\",\r\n autotilePrefix: \"biomes/ocean/ocean_dirt_\",\r\n color: \"#0080e5\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n max: 0.5,\r\n },\r\n },\r\n },\r\n dirt: {\r\n biome: \"dirt\",\r\n autotilePrefix: \"biomes/dirt/dirt_dirt_\",\r\n color: \"#e5e5a0\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.4,\r\n max: 0.6,\r\n },\r\n },\r\n },\r\n dirttextured: {\r\n biome: \"dirttextured\",\r\n autotilePrefix: \"biomes/dirttextured/dirttextured_dirt_\",\r\n color: \"#ddd29b\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.8,\r\n },\r\n },\r\n },\r\n swampdirt: {\r\n biome: \"swampdirt\",\r\n autotilePrefix: \"biomes/swampdirt/swampdirt_grassland_\",\r\n color: \"#665b47\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.5,\r\n max: 0.7,\r\n },\r\n },\r\n },\r\n swampwater: {\r\n biome: \"swampwater\",\r\n autotilePrefix: \"biomes/swampwater/swampwater_swampdirt_\",\r\n color: \"#39512f\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.57,\r\n max: 0.62,\r\n },\r\n },\r\n },\r\n sand: {\r\n biome: \"sand\",\r\n autotilePrefix: \"biomes/sand/sand_dirt_\",\r\n color: \"#f4f0c3\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n min: 0.3,\r\n max: 0.54,\r\n },\r\n },\r\n },\r\n oceandeep: {\r\n biome: \"oceandeep\",\r\n autotilePrefix: \"biomes/oceandeep/oceandeep_ocean_\",\r\n color: \"#004db2\",\r\n season: Season.Spring,\r\n generationOptions: {\r\n height: {\r\n max: 0.25,\r\n },\r\n },\r\n },\r\n };\r\n Tile.Tilesets = {};\r\n return Tile;\r\n}());\r\nexports.Tile = Tile;\r\n\n\n//# sourceURL=webpack://rotjs-typescript-basics/./src/tile.ts?"); /***/ }), diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_00.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_00.png new file mode 100644 index 0000000..2d61adf Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_00.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_01.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_01.png new file mode 100644 index 0000000..f551acd Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_01.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_02.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_02.png new file mode 100644 index 0000000..1a038a4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_02.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_03.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_03.png new file mode 100644 index 0000000..be82ba4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_03.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_04.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_04.png new file mode 100644 index 0000000..dcf9777 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_04.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_05.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_05.png new file mode 100644 index 0000000..91da7a8 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_05.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_06.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_06.png new file mode 100644 index 0000000..deafe03 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_06.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_07.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_07.png new file mode 100644 index 0000000..e97600e Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_07.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_08.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_08.png new file mode 100644 index 0000000..2075d8a Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_08.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_09.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_09.png new file mode 100644 index 0000000..70cf747 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_09.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_10.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_10.png new file mode 100644 index 0000000..31ae40f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_10.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_11.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_11.png new file mode 100644 index 0000000..26b1f73 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_11.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_12.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_12.png new file mode 100644 index 0000000..087d111 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_12.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_13.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_13.png new file mode 100644 index 0000000..5127bec Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_13.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_14.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_14.png new file mode 100644 index 0000000..4c3649e Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_14.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_15.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_15.png new file mode 100644 index 0000000..0966b5d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_15.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_16.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_16.png new file mode 100644 index 0000000..fe3116b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_16.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_17.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_17.png new file mode 100644 index 0000000..c0d47cd Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_17.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_18.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_18.png new file mode 100644 index 0000000..0bbc9e1 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_18.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_19.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_19.png new file mode 100644 index 0000000..f33604b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_19.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_20.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_20.png new file mode 100644 index 0000000..c4761a6 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_20.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_21.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_21.png new file mode 100644 index 0000000..0768acc Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_21.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_22.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_22.png new file mode 100644 index 0000000..a4e75d5 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_22.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_23.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_23.png new file mode 100644 index 0000000..64b0a34 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_23.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_24.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_24.png new file mode 100644 index 0000000..b127833 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_24.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_25.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_25.png new file mode 100644 index 0000000..f773c0b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_25.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_26.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_26.png new file mode 100644 index 0000000..d690e51 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_26.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_27.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_27.png new file mode 100644 index 0000000..2ef1fed Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_27.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_28.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_28.png new file mode 100644 index 0000000..bd48c48 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_28.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_29.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_29.png new file mode 100644 index 0000000..c2e7456 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_29.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_30.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_30.png new file mode 100644 index 0000000..54c5f24 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_30.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_31.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_31.png new file mode 100644 index 0000000..97b674a Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_31.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_32.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_32.png new file mode 100644 index 0000000..70d7bc4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_32.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_33.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_33.png new file mode 100644 index 0000000..6662cdd Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_33.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_34.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_34.png new file mode 100644 index 0000000..b1eb1e1 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_34.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_35.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_35.png new file mode 100644 index 0000000..077691e Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_35.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_36.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_36.png new file mode 100644 index 0000000..4ba7243 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_36.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_37.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_37.png new file mode 100644 index 0000000..bda4877 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_37.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_38.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_38.png new file mode 100644 index 0000000..2d87cbf Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_38.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_39.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_39.png new file mode 100644 index 0000000..40ac947 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_39.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_40.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_40.png new file mode 100644 index 0000000..e1eda1f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_40.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_41.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_41.png new file mode 100644 index 0000000..4503d75 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_41.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_42.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_42.png new file mode 100644 index 0000000..9a87e87 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_42.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_43.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_43.png new file mode 100644 index 0000000..b9777ef Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_43.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_44.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_44.png new file mode 100644 index 0000000..b403e03 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_44.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_45.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_45.png new file mode 100644 index 0000000..ff58121 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_45.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_46.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_46.png new file mode 100644 index 0000000..8760d28 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_46.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_47.png b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_47.png new file mode 100644 index 0000000..2d61adf Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/hills/hills_grassland_47.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_00.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_00.png new file mode 100644 index 0000000..bf9c37f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_00.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_01.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_01.png new file mode 100644 index 0000000..f155f3b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_01.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_02.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_02.png new file mode 100644 index 0000000..e0f20dd Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_02.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_03.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_03.png new file mode 100644 index 0000000..00aa695 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_03.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_04.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_04.png new file mode 100644 index 0000000..1aae9c6 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_04.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_05.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_05.png new file mode 100644 index 0000000..17759b3 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_05.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_06.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_06.png new file mode 100644 index 0000000..3a73205 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_06.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_07.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_07.png new file mode 100644 index 0000000..342814c Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_07.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_08.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_08.png new file mode 100644 index 0000000..569cc62 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_08.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_09.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_09.png new file mode 100644 index 0000000..76f8d75 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_09.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_10.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_10.png new file mode 100644 index 0000000..8610861 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_10.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_11.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_11.png new file mode 100644 index 0000000..681ad01 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_11.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_12.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_12.png new file mode 100644 index 0000000..ae58e21 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_12.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_13.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_13.png new file mode 100644 index 0000000..78a639b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_13.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_14.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_14.png new file mode 100644 index 0000000..0908e1d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_14.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_15.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_15.png new file mode 100644 index 0000000..417433a Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_15.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_16.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_16.png new file mode 100644 index 0000000..0af0669 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_16.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_17.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_17.png new file mode 100644 index 0000000..eaf04df Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_17.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_18.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_18.png new file mode 100644 index 0000000..ede4646 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_18.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_19.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_19.png new file mode 100644 index 0000000..50b2ce2 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_19.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_20.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_20.png new file mode 100644 index 0000000..2a6f998 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_20.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_21.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_21.png new file mode 100644 index 0000000..4580c33 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_21.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_22.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_22.png new file mode 100644 index 0000000..1a60073 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_22.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_23.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_23.png new file mode 100644 index 0000000..0bc8ec4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_23.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_24.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_24.png new file mode 100644 index 0000000..84b06fc Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_24.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_25.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_25.png new file mode 100644 index 0000000..27d64ee Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_25.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_26.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_26.png new file mode 100644 index 0000000..04e678d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_26.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_27.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_27.png new file mode 100644 index 0000000..57650a4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_27.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_28.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_28.png new file mode 100644 index 0000000..9ade6f9 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_28.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_29.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_29.png new file mode 100644 index 0000000..b7a4353 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_29.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_30.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_30.png new file mode 100644 index 0000000..ec080cf Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_30.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_31.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_31.png new file mode 100644 index 0000000..abd7521 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_31.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_32.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_32.png new file mode 100644 index 0000000..efd874d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_32.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_33.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_33.png new file mode 100644 index 0000000..3b94b77 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_33.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_34.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_34.png new file mode 100644 index 0000000..964e33a Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_34.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_35.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_35.png new file mode 100644 index 0000000..98b39f2 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_35.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_36.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_36.png new file mode 100644 index 0000000..600fa02 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_36.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_37.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_37.png new file mode 100644 index 0000000..323928e Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_37.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_38.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_38.png new file mode 100644 index 0000000..edab4c0 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_38.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_39.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_39.png new file mode 100644 index 0000000..e79b79f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_39.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_40.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_40.png new file mode 100644 index 0000000..f772b53 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_40.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_41.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_41.png new file mode 100644 index 0000000..e10ae38 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_41.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_42.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_42.png new file mode 100644 index 0000000..89b62a6 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_42.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_43.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_43.png new file mode 100644 index 0000000..148c896 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_43.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_44.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_44.png new file mode 100644 index 0000000..7d2484c Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_44.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_45.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_45.png new file mode 100644 index 0000000..0752f9c Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_45.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_46.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_46.png new file mode 100644 index 0000000..7f23808 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_46.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_47.png b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_47.png new file mode 100644 index 0000000..bf9c37f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampdirt/swampdirt_grassland_47.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_00.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_00.png new file mode 100644 index 0000000..8f21e1b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_00.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_01.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_01.png new file mode 100644 index 0000000..21d8ac4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_01.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_02.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_02.png new file mode 100644 index 0000000..71e7e8f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_02.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_03.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_03.png new file mode 100644 index 0000000..236eff8 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_03.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_04.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_04.png new file mode 100644 index 0000000..9bbd78c Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_04.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_05.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_05.png new file mode 100644 index 0000000..e88fae7 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_05.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_06.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_06.png new file mode 100644 index 0000000..7f9be16 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_06.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_07.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_07.png new file mode 100644 index 0000000..835ff07 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_07.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_08.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_08.png new file mode 100644 index 0000000..999d7af Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_08.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_09.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_09.png new file mode 100644 index 0000000..1df5506 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_09.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_10.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_10.png new file mode 100644 index 0000000..cf436de Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_10.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_11.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_11.png new file mode 100644 index 0000000..a280c28 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_11.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_12.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_12.png new file mode 100644 index 0000000..8ccd860 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_12.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_13.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_13.png new file mode 100644 index 0000000..65e4ffa Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_13.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_14.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_14.png new file mode 100644 index 0000000..6c4c874 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_14.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_15.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_15.png new file mode 100644 index 0000000..f7b9451 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_15.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_16.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_16.png new file mode 100644 index 0000000..b63cab4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_16.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_17.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_17.png new file mode 100644 index 0000000..e167109 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_17.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_18.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_18.png new file mode 100644 index 0000000..a423fba Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_18.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_19.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_19.png new file mode 100644 index 0000000..b815c25 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_19.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_20.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_20.png new file mode 100644 index 0000000..1665171 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_20.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_21.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_21.png new file mode 100644 index 0000000..3aa3012 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_21.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_22.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_22.png new file mode 100644 index 0000000..a729005 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_22.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_23.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_23.png new file mode 100644 index 0000000..2fbb935 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_23.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_24.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_24.png new file mode 100644 index 0000000..1a41780 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_24.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_25.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_25.png new file mode 100644 index 0000000..07c3c51 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_25.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_26.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_26.png new file mode 100644 index 0000000..1276bde Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_26.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_27.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_27.png new file mode 100644 index 0000000..c1d2425 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_27.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_28.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_28.png new file mode 100644 index 0000000..474d3d4 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_28.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_29.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_29.png new file mode 100644 index 0000000..f0e5e72 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_29.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_30.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_30.png new file mode 100644 index 0000000..95a2aa3 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_30.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_31.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_31.png new file mode 100644 index 0000000..7a4b606 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_31.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_32.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_32.png new file mode 100644 index 0000000..2281638 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_32.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_33.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_33.png new file mode 100644 index 0000000..bf83eb1 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_33.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_34.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_34.png new file mode 100644 index 0000000..36dc058 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_34.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_35.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_35.png new file mode 100644 index 0000000..84340c7 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_35.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_36.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_36.png new file mode 100644 index 0000000..3fb8042 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_36.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_37.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_37.png new file mode 100644 index 0000000..b0175b9 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_37.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_38.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_38.png new file mode 100644 index 0000000..ef123a5 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_38.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_39.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_39.png new file mode 100644 index 0000000..7295423 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_39.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_40.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_40.png new file mode 100644 index 0000000..21240db Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_40.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_41.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_41.png new file mode 100644 index 0000000..50f3893 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_41.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_42.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_42.png new file mode 100644 index 0000000..7cdd95d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_42.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_43.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_43.png new file mode 100644 index 0000000..b244a69 Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_43.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_44.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_44.png new file mode 100644 index 0000000..ff3e15f Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_44.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_45.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_45.png new file mode 100644 index 0000000..af7f17d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_45.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_46.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_46.png new file mode 100644 index 0000000..b744f4d Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_46.png differ diff --git a/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_47.png b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_47.png new file mode 100644 index 0000000..8f21e1b Binary files /dev/null and b/raw-assets/sprites/season/spring{tps}/biomes/swampwater/swampwater_swampdirt_47.png differ diff --git a/src/autotile.ts b/src/autotile.ts index 29461e0..be33d8e 100644 --- a/src/autotile.ts +++ b/src/autotile.ts @@ -75,6 +75,17 @@ export class Autotile { return false; } + if ( + tileBiome?.biome == "swampdirt" && + neighborBiome?.biome == "grassland" + ) { + return false; + } + + if (tileBiome?.biome == "hills" && neighborBiome?.biome == "grassland") { + return false; + } + if ( tileBiome?.biome == "grassland" && neighborBiome?.biome == "forestgrass" diff --git a/src/game.ts b/src/game.ts index 7d05b68..653a507 100644 --- a/src/game.ts +++ b/src/game.ts @@ -38,8 +38,8 @@ export class Game { // RNG.setSeed(1234); // sensible default - let width = 150; - let height = 150; + let width = 350; + let height = 350; let fontSize = 20; // how/why should this change? diff --git a/src/map-world.ts b/src/map-world.ts index 1e42154..0b04675 100644 --- a/src/map-world.ts +++ b/src/map-world.ts @@ -29,9 +29,9 @@ export class MapWorld { this.adjacencyMap = {}; this.dirtyTiles = []; this.landHeight = 0.5; - this.valleyScaleFactor = 1.5; + this.valleyScaleFactor = 2; this.edgePadding = 0; - this.islandMask = 0.3; + this.islandMask = 0.38; } generateMap(width: number, height: number): void { @@ -93,11 +93,11 @@ export class MapWorld { // add different octaves of frequency // some small hills, some large, etc // 1 / octave * this.getScaledNoise(noise, octave * noiseX, octave * noiseY) - let height = 0.333 * this.getScaledNoise(noise, 3 * noiseX, 3 * noiseY); - height += 0.1667 * this.getScaledNoise(noise, 6 * noiseX, 6 * noiseY); - height += 0.06667 * this.getScaledNoise(noise, 15 * noiseX, 15 * noiseY); - height += 0.045 * this.getScaledNoise(noise, 22 * noiseX, 22 * noiseY); - height = height / (0.3 + 0.1667 + 0.067 + 0.045); // scale to between 0 and 1 + let height = 0.7 * this.getScaledNoise(noise, 3 * noiseX, 3 * noiseY); + height += 0.5 * this.getScaledNoise(noise, 4 * noiseX, 4 * noiseY); + height += 0.3 * this.getScaledNoise(noise, 8 * noiseX, 8 * noiseY); + height += 0.3 * this.getScaledNoise(noise, 15 * noiseX, 15 * noiseY); + height = height / (0.4 + 0.5 + 0.3 + 0.2); // scale to between 0 and 1 height = Math.pow(height, this.valleyScaleFactor); // reshape valleys/mountains @@ -205,6 +205,29 @@ export class MapWorld { if ( Tile.inRange(heightVal, Tile.Biomes.grassland.generationOptions.height) ) { + if (Tile.inRange(heightVal, Tile.Biomes.hills.generationOptions.height)) { + return Tile.Biomes.hills; + } + + if ( + Tile.inRange( + heightVal, + Tile.Biomes.swampdirt.generationOptions.height + ) && + !this.isAdjacentToTerrain(x, y, [Tile.Biomes.dirt, Tile.Biomes.ocean]) + ) { + if ( + Tile.inRange( + heightVal, + Tile.Biomes.swampwater.generationOptions.height + ) && + this.isAdjacentToTerrain(x, y, [Tile.Biomes.swampdirt]) + ) { + return Tile.Biomes.swampwater; + } + return Tile.Biomes.swampdirt; + } + if ( Tile.inRange( heightVal, diff --git a/src/tile.ts b/src/tile.ts index e628ae4..a71c555 100644 --- a/src/tile.ts +++ b/src/tile.ts @@ -24,7 +24,10 @@ export type BiomeType = | "dirttextured" | "sand" | "oceandeep" - | "forestgrass"; + | "forestgrass" + | "hills" + | "swampdirt" + | "swampwater"; export interface Biome { biome: BiomeType; // basic identifier for the tileset @@ -115,6 +118,18 @@ export class Tile { }, }, }, + hills: { + biome: "hills", + autotilePrefix: "biomes/hills/hills_grassland_", + color: "#e48989", + season: Season.Spring, + generationOptions: { + height: { + min: 0.75, + max: 1, + }, + }, + }, forestgrass: { biome: "forestgrass", autotilePrefix: "biomes/forestgrass/forestgrass_grassland_", @@ -161,6 +176,30 @@ export class Tile { }, }, }, + swampdirt: { + biome: "swampdirt", + autotilePrefix: "biomes/swampdirt/swampdirt_grassland_", + color: "#665b47", + season: Season.Spring, + generationOptions: { + height: { + min: 0.5, + max: 0.7, + }, + }, + }, + swampwater: { + biome: "swampwater", + autotilePrefix: "biomes/swampwater/swampwater_swampdirt_", + color: "#39512f", + season: Season.Spring, + generationOptions: { + height: { + min: 0.57, + max: 0.62, + }, + }, + }, sand: { biome: "sand", autotilePrefix: "biomes/sand/sand_dirt_",