From 73b326f2a2c6163e719600ebf3b18331a5ca3199 Mon Sep 17 00:00:00 2001 From: hexall90 <hexall90@gmail.com> Date: Mon, 6 Nov 2017 13:40:47 +0100 Subject: [PATCH] small fixes --- src/SecExp/SecExpBackwardCompatibility.tw | 35 +++++++++++++++++++++-- src/SecExp/riotControlCenter.tw | 2 ++ src/js/economyJS.tw | 23 +++++++++------ src/uncategorized/costs.tw | 3 ++ src/uncategorized/costsReport.tw | 3 ++ src/uncategorized/nextWeek.tw | 8 +++--- 6 files changed, 60 insertions(+), 14 deletions(-) diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw index efa8b055192..01a3109e398 100644 --- a/src/SecExp/SecExpBackwardCompatibility.tw +++ b/src/SecExp/SecExpBackwardCompatibility.tw @@ -282,7 +282,7 @@ <<set $fort = { reactor: 0, waterway: 0, - assistant:0}>> + assistant: 0}>> <</if>> <<if ndef $sentUnitCooldown>> <<set $sentUnitCooldown = 0>> @@ -387,8 +387,39 @@ reactorTime: 0, assistantTime: 0, waterwayTime: 0 }>> +<<else>> + <<if ndef $garrison.penthouse>> + <<set $garrison.penthouse = 0>> + <</if>> + <<if ndef $garrison.reactor>> + <<set $garrison.reactor = 0>> + <</if>> + <<if ndef $garrison.assistant>> + <<set $garrison.assistant = 0>> + <</if>> + <<if ndef $garrison.waterway>> + <<set $garrison.waterway = 0>> + <</if>> + <<if ndef $garrison.reactorTime>> + <<set $garrison.reactorTime = 0>> + <</if>> + <<if ndef $garrison.assistantTime>> + <<set $garrison.assistantTime = 0>> + <</if>> + <<if ndef $garrison.waterwayTime>> + <<set $garrison.waterwayTime = 0>> + <</if>> +<</if>> +<<if ndef $rebellionsCount>> +<<set $rebellionsCount = 0>> +<</if>> +<<if ndef $PCrebWon>> +<<set $PCrebWon = 0>> <</if>> - +<<if ndef $PCrebLoss>> +<<set $PCrebLoss = 0>> +<</if>> + /* armed forces stats */ <<if ndef $targetUnit>> <<set $targetUnit = 0>> diff --git a/src/SecExp/riotControlCenter.tw b/src/SecExp/riotControlCenter.tw index 0de5bc3e7e0..90cd80c80ef 100644 --- a/src/SecExp/riotControlCenter.tw +++ b/src/SecExp/riotControlCenter.tw @@ -1,5 +1,7 @@ :: riotControlCenter [nobr] +<<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">> + Riot Control Center <hr> diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 1d73db88db3..e885e74feb6 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -26,6 +26,7 @@ window.getCost = function(array) { + (State.variables.club * facilityCost) + (State.variables.dairy * facilityCost) + (State.variables.incubator * facilityCost * 10); + var secExpCost = 0; //facility expenses costs += (0.1 * State.variables.brothelUpgradeDrugs * brothel * facilityCost) @@ -64,41 +65,47 @@ window.getCost = function(array) { //security expansion if(State.variables.secExp == 1) { if(State.variables.edictsUpkeep > 0) { - costs += State.variables.edictsUpkeep; + secExpCost += State.variables.edictsUpkeep; } if(State.variables.SFSupportUpkeep > 0) { - costs += State.variables.SFSupportUpkeep; + secExpCost += State.variables.SFSupportUpkeep; } if(State.variables.propHub > 0) { - costs += State.variables.propHubUpkeep; + secExpCost += State.variables.propHubUpkeep; } if(State.variables.secHQ > 0) { - costs += State.variables.secHQUpkeep + 20 * state.variables.secHelots; + secExpCost += State.variables.secHQUpkeep + 20 * state.variables.secHelots; } if(State.variables.secBarracks > 0) { - costs += State.variables.secBarracksUpkeep; + secExpCost += State.variables.secBarracksUpkeep; + } + if(State.variables.riotCenter > 0) { + secExpCost += State.variables.riotUpkeep; } if (State.variables.militiaUnits != null) { for (var i = 0; i < State.variables.militiaUnits.length; i++) { if( !(State.variables.militiaUnits[i] === null) ){ - costs += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep; + secExpCost += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep; } } } if (State.variables.slaveUnits != null) { for (var i = 0; i < State.variables.slaveUnits.length; i++) { if( !( State.variables.slaveUnits[i] === null) ){ - costs += State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5; + secExpCost += State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5; } } } if (State.variables.mercUnits != null) { for (var i = 0; i < State.variables.mercUnits.length; i++) { if( !(State.variables.mercUnits[i] === null) ){ - costs += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5; + secExpCost += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5; } } } + if(Number.isInteger(secExpCost)) { + costs += secExpCost; + } } //general arcology costs diff --git a/src/uncategorized/costs.tw b/src/uncategorized/costs.tw index 8f2cb21e8a0..b8b70553e6b 100644 --- a/src/uncategorized/costs.tw +++ b/src/uncategorized/costs.tw @@ -45,6 +45,9 @@ <<if $secBarracks != 0>> <<set $costs += $secBarracksUpkeep>> <</if>> + <<if $riotCenter != 0>> + <<set $costs += $riotUpkeep>> + <</if>> <<set _mL = $militiaUnits.length>> <<for _i = 0; _i < _mL; _i++>> diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw index 2fc5ad69d62..61228d76779 100644 --- a/src/uncategorized/costsReport.tw +++ b/src/uncategorized/costsReport.tw @@ -109,6 +109,9 @@ <<if $secBarracks != 0>> <br>__Barracks__ maintenance: ¤<<print $secBarracksUpkeep>> <</if>> + <<if $riotCenter != 0>> + <br>__Riot Control Center__ maintenance: ¤<<print $riotUpkeep>> + <</if>> <<for _i = 0; _i < $militiaUnits.length; _i++>> <br>__<<print $militiaUnits[_i].platoonName>>__ upkeep: ¤<<print $militiaUnits[_i].troops*$soldierUpkeep>> diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index cdf77a5e3c3..1ea48d808c1 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -128,10 +128,6 @@ <</if>> <</if>> -<<if $sentUnitCooldown > 0>> - <<set $sentUnitCooldown-->> -<</if>> - <<if $week == $oldWeek>> <<set $week += 1, $day += 7>> <<switch $month>> @@ -194,6 +190,10 @@ <<set $foughtThisWeek = 0>> <</if>> +<<if $sentUnitCooldown > 0>> + <<set $sentUnitCooldown-->> +<</if>> + <<set _seed = random(1,10)>> <<if $week < 25>> <<if _seed > 4>> -- GitLab