From 7f200815d40dc992e91a3a3edefbe8fe65e3f241 Mon Sep 17 00:00:00 2001 From: AZiggurat Date: Thu, 24 Aug 2023 19:16:49 +0300 Subject: [PATCH 01/63] small siphoning ui fixes, siphoning description change and adding totalPerDayDelta for alicorns --- game.js | 26 ++++++++++++++++++++------ res/i18n/en.json | 3 ++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/game.js b/game.js index 72080d224b..33735b5b44 100644 --- a/game.js +++ b/game.js @@ -3573,11 +3573,21 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, { //console.error("Unable to fetch resource stack for resName '" + resName + "'"); return; } - stack.push({ - name: $I("res.stack.buildings"), - type: "perDay", - value: this.getEffect(res.name + "PerDay") - }); + if (resName == "necrocorn"){ + console.error(this.getEffect("necrocornPerDay") + this.religion.pactsManager.getSiphonedCorruption(1)); + console.error("ncr"); + stack.push({ + name: $I("res.stack.buildings"), + type: "perDay", + value: this.getEffect("necrocornPerDay") + this.religion.pactsManager.getSiphonedCorruption(1) + }); + }else{ + stack.push({ + name: $I("res.stack.buildings"), + type: "perDay", + value: this.getEffect(res.name + "PerDay") + }); + } if(resName == "necrocorn"){ var corruptionStack = []; corruptionStack.push({ @@ -3963,9 +3973,13 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, { resStringDay = this.processResourcePerTickStack(resStackDay, res, 0), //processResourcePerTickStack can work with perDay stack resPerDay = this.getResourcePerDay(res.name); if (this.opts.usePercentageResourceValues){ + resStringDay = "
" + resStringDay; resStringDay += "
" + $I("res.netGain") + ": " + this.getDisplayValueExt(resPerDay, true, true); } - return resString + resStringDay; + var totalPerDayDelta = "
" + $I("res.netGainPerDay") + ": " + + this.getDisplayValueExt(resPerTick * this.calendar.ticksPerDay + this.getEffect("alicornPerDay")) + ; + return resString + resStringDay + totalPerDayDelta; } return resString; }, diff --git a/res/i18n/en.json b/res/i18n/en.json index 3b6a1910d1..67598c2071 100644 --- a/res/i18n/en.json +++ b/res/i18n/en.json @@ -773,7 +773,7 @@ "policy.republic.label" : "Republic", "policy.republic.desc" : "Best for large societies. Highly promoted leaders will provide a small bonus to the production of all kittens.", "policy.siphoning.label" : "Siphoning", - "policy.siphoning.desc" : "Pacts consume alicorns and slow down production instead of consuming necrocorns. If there is not enough of either pacts also consume necrocorns.", + "policy.siphoning.desc" : "Pacts consume alicorns and slow down corruption instead of consuming necrocorns. Lack of either is compensated by consuming necrocorns.", "policy.socialism.label" : "Socialism", "policy.socialism.desc" : "Has no effect", "policy.spaceBasedTerraforming.label" : "Space-based terraforming", @@ -1030,6 +1030,7 @@ "res.effect": "Effect", "res.effects": "Effects", "res.netGain": "Net gain", + "res.netGainPerDay": "Net delta per day", "res.notify.msg": "You will be notified when {0} will be available.", "res.notify.ready.title": "Enough resource to buy", "res.notify.ready": "The {0} is ready", From 33f10f47625aaf3a8a65a6e7211e6645184059e8 Mon Sep 17 00:00:00 2001 From: AZiggurat Date: Thu, 24 Aug 2023 19:20:46 +0300 Subject: [PATCH 02/63] get rid of debug things --- game.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/game.js b/game.js index 33735b5b44..a8a8ae7640 100644 --- a/game.js +++ b/game.js @@ -3574,8 +3574,6 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, { return; } if (resName == "necrocorn"){ - console.error(this.getEffect("necrocornPerDay") + this.religion.pactsManager.getSiphonedCorruption(1)); - console.error("ncr"); stack.push({ name: $I("res.stack.buildings"), type: "perDay", From 72ba86539518761019137e824157bec3930f76b6 Mon Sep 17 00:00:00 2001 From: AZiggurat Date: Fri, 25 Aug 2023 15:51:00 +0300 Subject: [PATCH 03/63] improve description --- res/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/i18n/en.json b/res/i18n/en.json index 67598c2071..830f5b91d1 100644 --- a/res/i18n/en.json +++ b/res/i18n/en.json @@ -773,7 +773,7 @@ "policy.republic.label" : "Republic", "policy.republic.desc" : "Best for large societies. Highly promoted leaders will provide a small bonus to the production of all kittens.", "policy.siphoning.label" : "Siphoning", - "policy.siphoning.desc" : "Pacts consume alicorns and slow down corruption instead of consuming necrocorns. Lack of either is compensated by consuming necrocorns.", + "policy.siphoning.desc" : "Pacts consume alicorns and slow down corruption instead of consuming necrocorns. Lack of alicorns or corruption is compensated by consuming necrocorns.", "policy.socialism.label" : "Socialism", "policy.socialism.desc" : "Has no effect", "policy.spaceBasedTerraforming.label" : "Space-based terraforming", From 49d31e39145843d657c3ea0379931d88da53da4c Mon Sep 17 00:00:00 2001 From: Arima B Date: Mon, 4 Sep 2023 02:53:27 +0000 Subject: [PATCH 04/63] Merged in feature/spaceport-cherrypick (pull request #1227) Spaceport cherrypick * mobile feature flags * remove map.jsx from the code * cherry pick of the spaceport PR * version bump --- changelog.txt | 4 + core.js | 83 +++++++------ game.js | 15 ++- index.html | 3 +- js/buildings.js | 139 +++++++++++++++------- js/jsx/map.jsx.js | 297 ---------------------------------------------- js/science.js | 3 +- res/i18n/en.json | 7 +- test/game.test.js | 39 ++++++ test/setup.js | 1 - 10 files changed, 207 insertions(+), 384 deletions(-) delete mode 100644 js/jsx/map.jsx.js diff --git a/changelog.txt b/changelog.txt index 7083dc4bd3..841a3536f2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +v 1.4.9.3 +Major: +* Spaceport + v 1.4.9.2 Major: * Queue diff --git a/core.js b/core.js index 117d666720..34c9a078b4 100644 --- a/core.js +++ b/core.js @@ -1978,6 +1978,12 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingStackableBtnController", com.nu } }, + /** + * Ultimate entry point to building construction + * @param {*} model + * @param {*} maxBld + * + */ build: function(model, maxBld){ var meta = model.metadata; var counter = 0; @@ -1985,48 +1991,55 @@ dojo.declare("com.nuclearunicorn.game.ui.BuildingStackableBtnController", com.nu maxBld = meta.limitBuild - meta.val; } - if (model.enabled && this.hasResources(model) || this.game.devMode ){ - while (this.hasResources(model) && maxBld > 0){ - this.incrementValue(model); - this.payPrice(model); + + if (!model.enabled && !this.game.devMode){ + return 0; + } + + while ((this.game.devMode || this.hasResources(model)) && maxBld > 0){ + this.incrementValue(model); + this.payPrice(model); - counter++; - maxBld--; - } + counter++; + maxBld--; + } + + if (!counter){ + return 0; + } - if (counter > 1) { - this.game.msg($I("construct.all.msg", [meta.label, counter]), "notice"); - } + if (counter > 1) { + this.game.msg($I("construct.all.msg", [meta.label, counter]), "notice"); + } - if (meta.breakIronWill) { - this.game.ironWill = false; - var liberty = this.game.science.getPolicy("liberty"); - liberty.calculateEffects(liberty, this.game); - var zebraOutpostMeta = this.game.bld.getBuildingExt("zebraOutpost").meta; - zebraOutpostMeta.calculateEffects(zebraOutpostMeta, this.game); - zebraOutpostMeta.jammed = false; - this.game.diplomacy.onLeavingIW(); - } + if (meta.breakIronWill) { + this.game.ironWill = false; + var liberty = this.game.science.getPolicy("liberty"); + liberty.calculateEffects(liberty, this.game); + var zebraOutpostMeta = this.game.bld.getBuildingExt("zebraOutpost").meta; + zebraOutpostMeta.calculateEffects(zebraOutpostMeta, this.game); + zebraOutpostMeta.jammed = false; + this.game.diplomacy.onLeavingIW(); + } - if (meta.unlocks) { - this.game.unlock(meta.unlocks); - } + if (meta.unlocks) { + this.game.unlock(meta.unlocks); + } - if (meta.calculateEffects){ - meta.calculateEffects(meta, this.game); - this.game.calendar.cycleEffectsBasics(meta.effects, meta.name); //(Only relevant for space buildings) - } - if (meta.unlockScheme && meta.val >= meta.unlockScheme.threshold) { - this.game.ui.unlockScheme(meta.unlockScheme.name); - } + if (meta.calculateEffects){ + meta.calculateEffects(meta, this.game); + this.game.calendar.cycleEffectsBasics(meta.effects, meta.name); //(Only relevant for space buildings) + } + if (meta.unlockScheme && meta.val >= meta.unlockScheme.threshold) { + this.game.ui.unlockScheme(meta.unlockScheme.name); + } - if (meta.upgrades) { - if (meta.updateEffects) { - meta.updateEffects(meta, this.game); - } - this.game.upgrade(meta.upgrades); + if (meta.upgrades) { + if (meta.updateEffects) { + meta.updateEffects(meta, this.game); } - } + this.game.upgrade(meta.upgrades); + } return counter; }, diff --git a/game.js b/game.js index 4d00c82127..0c0a63479f 100644 --- a/game.js +++ b/game.js @@ -1795,23 +1795,28 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, { featureFlags: { VILLAGE_MAP: { beta: true, - main: false + main: false, + mobile: false }, SPACE_EXPL: { beta: true, - main: false + main: false, + mobile: false }, MAUSOLEUM_PACTS:{ beta: true, - main: true + main: true, + mobile: true }, QUEUE:{ beta: true, - main: true + main: true, + mobile: true }, QUEUE_REDSHIFT: { beta: true, - main: false + main: false, + mobile: true } }, diff --git a/index.html b/index.html index e325c976a3..1ddee3832a 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,7 @@