From 1f182a075370da644b61c8e450dcb9c49706f7d6 Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Thu, 26 Mar 2020 23:47:26 -0700 Subject: [PATCH] pass special NGP parameters in ngpParams global --- js/003-data/gameVariableData.js | 2 +- src/data/newGamePlus.js | 10 +++++----- src/uncategorized/newGamePlus.tw | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index cf9839acb3d..db845b3033f 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -89,7 +89,7 @@ App.Data.defaultGameStateVariables = { profiler: 0, realRoyalties: 0, retainCareer: 1, - ngpNationality: 0, + ngpParams: {}, rulesAssistantAuto: 0, rulesAssistantMain: 1, seeAge: 1, diff --git a/src/data/newGamePlus.js b/src/data/newGamePlus.js index acb9908f3be..5b48f41c687 100644 --- a/src/data/newGamePlus.js +++ b/src/data/newGamePlus.js @@ -10,6 +10,7 @@ App.Data.NewGamePlus = (function() { } else if (id < minID) { id -= NGPOffset; } + return id; } function slaveOrZero(id) { @@ -21,8 +22,7 @@ App.Data.NewGamePlus = (function() { function PCInit() { if (V.freshPC === 0) { - const prosperity = (arcologies && arcologies[0] && arcologies[0].prosperity) ? (250 * $arcologies[0].prosperity * $arcologies[0].ownership) : 0; - cashX(prosperity, "personalBusiness"); + cashX(V.ngpParams.prosperity, "personalBusiness"); const oldCash = V.cash; V.cash = 0; V.cashLastWeek = 0; @@ -113,8 +113,8 @@ App.Data.NewGamePlus = (function() { slave.father = ngpSlaveID(slave.father); slave.canRecruit = 0; slave.breedingMark = 0; - if (typeof V.ngpNationality === 'string') { - slave.nationality = V.ngpNationality; + if (typeof V.ngpParams.nationality === 'string') { + slave.nationality = V.ngpParams.nationality; } slave.relationTarget = ngpSlaveID(slave.relationTarget); slave.relationshipTarget = ngpSlaveID(slave.relationshipTarget); @@ -199,7 +199,7 @@ App.Data.NewGamePlus = (function() { slaveLoopInit(); PCInit(); resetFamilyCounters(); - V.ngpSlaveNationality = 0; + V.ngpParams = {}; } return doNGPSetup; diff --git a/src/uncategorized/newGamePlus.tw b/src/uncategorized/newGamePlus.tw index ec0a9d7a7fd..32041f40d4c 100644 --- a/src/uncategorized/newGamePlus.tw +++ b/src/uncategorized/newGamePlus.tw @@ -23,7 +23,7 @@ You <<if $cash >= _fee>>have<<else>>lack<</if>> the funds to bring more than $sl <br> -<<set $ngpNationality = getRevivalistNationality()>> +<<set $ngpParams = { nationality: getRevivalistNationality(), prosperity: (250 * $arcologies[0].prosperity * $arcologies[0].ownership) }>> <<if $freshPC == 0>> <<if $retainCareer == 1 && $PC.career != "arcology owner">> <<if $week > 52 || ($PC.skill.slaving >= 100 && $PC.skill.trading >= 100 && $PC.skill.warfare >= 100 && $PC.skill.engineering >= 100 && $PC.skill.medicine >= 100 && $PC.skill.hacking >= 100)>> -- GitLab