diff --git a/Changelog.txt b/Changelog.txt index 2f18c74c7e9b4c94a7d719ce4a301ae12b32c655..0e64f1a8ede95835fb6b5a4e983f9b4005281a0a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,11 @@ Pregmod +0.10.7.1-3.4.x + + 0 + -arcoglogy layout overhauled + -fixes + 0.10.7.1-3.3.x 3/07/2020 diff --git a/src/arcologyBuilding/base.js b/src/arcologyBuilding/base.js index 160edfda4beb7710c9e754468e22ac2fb51cde17..df7d221c99160c7e1104c12c218bc0bf91347710 100644 --- a/src/arcologyBuilding/base.js +++ b/src/arcologyBuilding/base.js @@ -39,91 +39,12 @@ App.Arcology.updateOwnership = function() { * @returns {App.Arcology.Building} */ App.Arcology.defaultBuilding = function(location = "default") { - const sections = []; - - sections.push(new App.Arcology.Section("penthouse", [[new App.Arcology.Cell.Penthouse()]])); - sections.push(shops()); - sections.push(apartments()); - sections.push(markets()); - sections.push(manufacturing()); - - - function shops() { - const rows = []; - if (location === "marine") { - rows.push([new App.Arcology.Cell.Shop(1), new App.Arcology.Cell.Shop(1), new App.Arcology.Cell.Shop(1), new App.Arcology.Cell.Shop(1)]); - } else { - rows.push([new App.Arcology.Cell.Shop(1), new App.Arcology.Cell.Shop(1), new App.Arcology.Cell.Shop(1)]); - } - return new App.Arcology.Section("shops", rows); - } - - function apartments() { - const rows = []; - if (location === "rural") { - rows.push([new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1)]); - rows.push([new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1)]); - } else { - if (location === "marine") { - rows.push([new App.Arcology.Cell.Apartment(1, 1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1, 1)]); - } else if (location === "oceanic") { - rows.push([new App.Arcology.Cell.Apartment(1, 1), new App.Arcology.Cell.Apartment(1, 1), new App.Arcology.Cell.Apartment(1, 1), new App.Arcology.Cell.Apartment(1, 1)]); - } else { - rows.push([new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1)]); - } - rows.push([new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1)]); - - if (location === "urban") { - rows.push([new App.Arcology.Cell.Apartment(1, 3), new App.Arcology.Cell.Apartment(1, 3), new App.Arcology.Cell.Apartment(1, 3), new App.Arcology.Cell.Apartment(1, 3)]); - } else { - rows.push([new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1), new App.Arcology.Cell.Apartment(1)]); - } - } - return new App.Arcology.Section("apartments", rows); - } - - function markets() { - if (location === "ravine") { - return new App.Arcology.Section("ravine-markets", [[new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1)]], true); - } - const rows = []; - if (location === "urban") { - rows.push([convertableCell(new App.Arcology.Cell.Apartment(1, 3), ["Apartment", "Market"]), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), convertableCell(new App.Arcology.Cell.Apartment(1, 3), ["Apartment", "Market"])]); - rows.push([new App.Arcology.Cell.Market(1), convertableCell(new App.Arcology.Cell.Market(1), ["Market", "Manufacturing"]), convertableCell(new App.Arcology.Cell.Market(1), ["Market", "Manufacturing"]), new App.Arcology.Cell.Market(1)]); - } else if (location === "rural") { - rows.push([new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1)]); - } else if (location === "marine") { - rows.push([new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), convertableCell(new App.Arcology.Cell.Manufacturing(1), ["Market", "Manufacturing"]), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1)]); - } else { - rows.push([new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1), new App.Arcology.Cell.Market(1)]); - } - return new App.Arcology.Section("markets", rows, true); - } - - function manufacturing() { - const rows = []; - if (location === "urban") { - rows.push([new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1)]); - } else if (location === "rural") { - rows.push([new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1)]); - } else if (location === "marine") { - rows.push([convertableCell(new App.Arcology.Cell.Market(1), ["Market", "Manufacturing"]), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), convertableCell(new App.Arcology.Cell.Market(1), ["Market", "Manufacturing"])]); - } else { - rows.push([new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1), new App.Arcology.Cell.Manufacturing(1)]); - } - return new App.Arcology.Section("manufacturing", rows); - } - /** - * @param {App.Arcology.Cell.BaseCell} cell - * @param {Array<string>} conversions must include the initial cell + * @type {arcologyEnvironment} */ - function convertableCell(cell, conversions) { - cell.allowedConversions = conversions; - return cell; - } - - return new App.Arcology.Building(sections); + const env = {location: location, established: false, fs: ""}; + const candidates = App.Arcology.presets.filter(preset => preset.isAllowed(env)); + return candidates.pluck().construct(env); }; /** diff --git a/src/arcologyBuilding/presets.js b/src/arcologyBuilding/presets.js new file mode 100644 index 0000000000000000000000000000000000000000..517507a859e08d2261f7ff6bb453827b62309370 --- /dev/null +++ b/src/arcologyBuilding/presets.js @@ -0,0 +1,194 @@ +/** + * @typedef {object} arcologyEnvironment + * @property {string} location + * @property {boolean} established + * @property {string} fs + */ +/** + * @typedef {object} buildingPreset + * @property {function(arcologyEnvironment):boolean} isAllowed + * @property {function(arcologyEnvironment):App.Arcology.Building} construct + * @property {function():void} apply + */ + +/** + * @type {Array<buildingPreset>} + */ +App.Arcology.presets = (function() { + /** + * @typedef {object} sectionTemplate + * @property {string} id + * @property {Array<string>} rows + * @property {boolean} [ground] + */ + /** + * @typedef {Array<sectionTemplate>} buildingTemplate + */ + + /* NOTE: test new templates, broken templates WILL explode */ + /* t is markets, () is possible values for a sector, first is default */ + const templates = { + default: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["sss"]}, + {id: "apartments", rows: ["aaaa", "aaaa", "aaaa"]}, + {id: "markets", rows: ["ttttt"], ground: true}, + {id: "manufacturing", rows: ["mmmmm"]}], + urban: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["sss"]}, + {id: "apartments", rows: ["aaaa", "aaaa", "dddd"]}, + {id: "markets", rows: ["(dt)tt(dt)", "t(tm)(tm)t"], ground: true}, + {id: "manufacturing", rows: ["mmmm"]}], + rural: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["sss"]}, + {id: "apartments", rows: ["aaaaa", "aaaaa"]}, + {id: "markets", rows: ["tt(mt)(mt)tt"], ground: true}, + {id: "manufacturing", rows: ["mmmmm"]}], + ravine: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["sss"]}, + {id: "ravine-markets", rows: ["ttttt"], ground: true}, + {id: "apartments", rows: ["aaaa", "aaaa", "aaaa"]}, + {id: "manufacturing", rows: ["mmmmm"]}], + marine: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["ssss"]}, + {id: "apartments", rows: ["laal", "aaaa", "aaaa"]}, + {id: "markets", rows: ["tt(mt)tt"], ground: true}, + {id: "manufacturing", rows: ["(tm)mmm(tm)"]}], + oceanic: [{id: "penthouse", rows: ["p"]}, + {id: "shops", rows: ["sss"]}, + {id: "apartments", rows: ["llll", "aaaa", "aaaa"]}, + {id: "markets", rows: ["ttttt"], ground: true}, + {id: "manufacturing", rows: ["mmmmm"]}], + }; + + /** + * @param {buildingTemplate} template + * @returns {App.Arcology.Building} + */ + function templateToBuilding(template) { + const sections = []; + for (let sectionTemplate of template) { + sections.push(getSection(sectionTemplate)); + } + return new App.Arcology.Building(sections); + + /** + * @param {sectionTemplate} section + * @returns {App.Arcology.Section} + */ + function getSection(section) { + const rows = []; + for (const row of section.rows) { + rows.push(getRow(row)); + } + return new App.Arcology.Section(section.id, rows, section.ground === true /* to ensure no undefined gets trough */); + } + + /** + * @param {string} rowTemplate + * @returns {[App.Arcology.Cell.BaseCell]} + */ + function getRow(rowTemplate) { + const cells = []; + const iter = rowTemplate[Symbol.iterator](); + + let next = iter.next(); + while (!next.done) { + if (next.value === "(") { + const cell = charToCell(iter.next().value).cell; + next = iter.next(); + while (next.value !== ")") { + cell.allowedConversions.push(charToCell(next.value).code); + next = iter.next(); + } + cells.push(cell); + } else { + cells.push(charToCell(next.value).cell); + } + next = iter.next(); + } + + return cells; + } + + /** + * @param {string} char + * @returns {{cell: App.Arcology.Cell.BaseCell, code:string}} + */ + function charToCell(char) { + switch (char) { + case "p": + return {cell: new App.Arcology.Cell.Penthouse(), code: "Penthouse"}; + case "s": + return {cell: new App.Arcology.Cell.Shop(1), code: "Shop"}; + case "l": + return {cell: new App.Arcology.Cell.Apartment(1, 1), code: "Apartment"}; + case "a": + return {cell: new App.Arcology.Cell.Apartment(1), code: "Apartment"}; + case "d": + return {cell: new App.Arcology.Cell.Apartment(1, 3), code: "Apartment"}; + case "t": + return {cell: new App.Arcology.Cell.Market(1), code: "Market"}; + case "m": + return {cell: new App.Arcology.Cell.Manufacturing(1), code: "Manufacturing"}; + default: + return {cell: new App.Arcology.Cell.BaseCell(1), code: "BaseCell"}; + } + } + } + + return [ + /* basic types for controlled start */ + { + isAllowed: env => !env.established && env.location === "default", + construct: () => templateToBuilding(templates.default), + apply() {} + }, { + isAllowed: env => !env.established && env.location === "urban", + construct: () => templateToBuilding(templates.urban), + apply() {} + }, { + isAllowed: env => !env.established && env.location === "rural", + construct: () => templateToBuilding(templates.rural), + apply() {} + }, { + isAllowed: env => !env.established && env.location === "ravine", + construct: () => templateToBuilding(templates.ravine), + apply() {} + }, { + isAllowed: env => !env.established && env.location === "marine", + construct: () => templateToBuilding(templates.marine), + apply() {} + }, { + isAllowed: env => !env.established && env.location === "oceanic", + construct: () => templateToBuilding(templates.oceanic), + apply() {} + }, + /* crazy presets for established arcologies TODO */ + { + isAllowed: env => env.established && env.location === "default", + construct() { return templateToBuilding(templates.default); }, + apply() {} + }, { + isAllowed: env => env.established && env.location === "urban", + construct() { return templateToBuilding(templates.urban); }, + apply() {} + }, { + isAllowed: env => env.established && env.location === "rural", + construct() { return templateToBuilding(templates.rural); }, + apply() {} + }, { + isAllowed: env => env.established && env.location === "ravine", + construct() { return templateToBuilding(templates.ravine); }, + apply() {} + }, { + isAllowed: env => env.established && env.location === "marine", + construct() { return templateToBuilding(templates.marine); }, + apply() {} + }, { + isAllowed: env => env.established && env.location === "oceanic", + construct() { return templateToBuilding(templates.oceanic); }, + apply() {} + }, + ]; +}()); + diff --git a/src/endWeek/saDrugs.js b/src/endWeek/saDrugs.js index caa3f0430b4b739f62e64ce8119748aa41290838..f77305fc8d6dd62130ffdd63c428c937fce28a27 100644 --- a/src/endWeek/saDrugs.js +++ b/src/endWeek/saDrugs.js @@ -1391,7 +1391,7 @@ window.saDrugs = (function saDrugs() { case "breast redistributors": r += ` ${He} receives <span class="lime">direct injections of fat redistributors right into ${his}`; if (gigantomastiaMod !== 3) { - r += ` breasts, causing ${his} body to begin moving fatty tissue from them to ${his} core`; + r += ` breasts</span>, causing ${his} body to begin moving fatty tissue from them to ${his} core`; if (slave.geneMods.NCS === 1) { r += `; ${his} <span class="orange">NCS</span> amplifies the effectiveness</span>`; } diff --git a/src/npc/interaction/fDick.tw b/src/npc/interaction/fDick.tw index 7d6dc9430b657ada67451b0dbb627ea753cb794c..092175257cd741b8bafb052344e4923a407c19cf 100644 --- a/src/npc/interaction/fDick.tw +++ b/src/npc/interaction/fDick.tw @@ -141,7 +141,7 @@ <<else>> twist $his dick at an odd angle <</if>> - until $he behaves. $He groans with a mix and disgust and pleasure while you bounce<<if $PC.belly >= 5000>> your gravid bulk<</if>> on $his traitorous cock. $He might not want to bend to your will, but you have $his body wrapped around your little finger, even though it still leaves you doing all the work. $He cries out lewdly, overwhelmed by your orgasmic <<if $PC.vagina != -1>>cunt<<else>>rectal<</if>> spasms, and unloads deep inside you without warning. $He @@.orangered;smirks a little@@ as you glare daggers at $him. + until $he behaves. $He groans with a mix of disgust and pleasure while you bounce<<if $PC.belly >= 5000>> your gravid bulk<</if>> on $his traitorous cock. $He might not want to bend to your will, but you have $his body wrapped around your little finger, even though it still leaves you doing all the work. $He cries out lewdly, overwhelmed by your orgasmic <<if $PC.vagina != -1>>cunt<<else>>rectal<</if>> spasms, and unloads deep inside you without warning. $He @@.orangered;smirks a little@@ as you glare daggers at $him. <<set getSlave($AS).trust++>> <</if>> <</if>>