diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 96c74c650b51b1197f6b7eea42fc6b051306beb9..7f149a3f279530888f05fb0dc56349e55b637ce7 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -377,9 +377,6 @@ App.Data.resetOnNGPlus = { attackThisWeek: 0, lastAttackWeeks: 0, lastRebellionWeeks: 0, - hasFoughtOnce: 0, - hasFoughtMajorBattleOnce: 0, - hasRebelledOnce: 0, majorBattle: 0, PCvictoryStreak: 0, PClossStreak: 0, diff --git a/src/Mods/SecExp/SecExpBackwardCompatibility.tw b/src/Mods/SecExp/SecExpBackwardCompatibility.tw index 7c59d88428e9d5076e5759de504de261ec8faaa3..53c1c2916d1bba146d3b7706df9d559db663f165 100644 --- a/src/Mods/SecExp/SecExpBackwardCompatibility.tw +++ b/src/Mods/SecExp/SecExpBackwardCompatibility.tw @@ -14,15 +14,6 @@ <<set $lastAttackWeeks = 0>> <</if>> <<set $lastRebellionWeeks = Number($lastRebellionWeeks) || 0>> -<<if ndef $hasFoughtOnce>> - <<set $hasFoughtOnce = 0>> -<</if>> -<<if ndef $hasFoughtMajorBattleOnce>> - <<set $hasFoughtMajorBattleOnce = 0>> -<</if>> -<<if ndef $hasRebelledOnce>> - <<set $hasRebelledOnce = 0>> -<</if>> <<if ndef $majorBattle>> <<set $majorBattle = 0>> <</if>> @@ -596,6 +587,17 @@ <</if>> <</if>> +/* if we had the old one-time battle flags, make sure the counters are set to at least one */ +<<if $battlesCount == 0 && $hasFoughtOnce == 1>> + <<set $battlesCount = 1>> +<</if>> +<<if $majorBattlesCount == 0 && $hasFoughtMajorBattleOnce == 1>> + <<set $majorBattlesCount = 1>> +<</if>> +<<if $rebellionsCount == 0 && $hasRebelledOnce == 1>> + <<set $rebellionsCount = 1>> +<</if>> + /* recalculation widgets */ <<fixBrokenUnits>> <<fixBrokenStats>> diff --git a/src/Mods/SecExp/attackGenerator.tw b/src/Mods/SecExp/attackGenerator.tw index 9c9e19961b4a23ef23de86c3dd159cc95354e8bf..5a5736aba9c0f02229820b02da2034bbf72738aa 100644 --- a/src/Mods/SecExp/attackGenerator.tw +++ b/src/Mods/SecExp/attackGenerator.tw @@ -16,7 +16,7 @@ <<else>> <<set _attackChance = 20>> <</if>> - <<if $hasFoughtOnce == 1>> + <<if $battlesCount > 0>> <<set _attackChance = 25>> <</if>> <<if $lastAttackWeeks >= 10>> diff --git a/src/Mods/SecExp/attackOptions.tw b/src/Mods/SecExp/attackOptions.tw index a406c100041c1a96cb91d959141d4caafc8a272f..747dc74f7dbb43fff01f2c86ebb2872dfb9666d8 100644 --- a/src/Mods/SecExp/attackOptions.tw +++ b/src/Mods/SecExp/attackOptions.tw @@ -19,8 +19,8 @@ <</if>> <hr> <<if $majorBattle == 0>> - <<if $hasFoughtOnce == 1>> - The ominous message dominates the screens of your office, <<print $assistant.name>> quickly gathers all information available to prepare for battle. + <<if $battlesCount > 0>> + The ominous message dominates the screens of your office, and <<print $assistant.name>> quickly gathers all information available to prepare for battle. <<if $attackType == "raiders">> <<if App.SecExp.battle.recon() >= 1>> A disorganized horde of raiders is coming to your city. To such jackals your arcology surely looks like an appetizing morsel. @@ -63,86 +63,49 @@ Due to their great wealth, Free Cities inevitably become tasty morsels for anyone able to field armed men. Considering the particular needs of arcologies their supply lines tend to be delicate lifelines, often preyed upon by those who stand to gain from the free city downfall. <</if>> <<else>> - <<if $hasFoughtMajorBattleOnce == 1>> - The ominous message dominates the screens of your office, <<print $assistant.name>> quickly gathers all information available to prepare for battle. - <<if $attackType == "raiders">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, disorganized horde of raiders is coming to your city. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, disorganized horde of raiders coming towards the city and quickly reported it. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. - <</if>> - <br> - Raiders are roaming gangs of bandits, preying on the vulnerable supply lines of Free Cities and old world nations. They are rarely equipped with decent armaments and even more rarely have any formal military training, but they make up for that with high mobility and numbers. - <<elseif $attackType == "free city">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, menacing column of slavers and hired mercenaries is coming to your city. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, menacing column of slavers and hired mercenaries and rushed to your office to bring the grim news. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. - <</if>> - <br> - Free City expeditions are usually composed of mercenaries hired to take down sensible supplies or infrastructure in order to damage the enemies of their contractor. They have, on average, good equipment and training, together with decent mobility, making them a formidable force. Their biggest weakness, however, is their low numbers. - <<elseif $attackType == "freedom fighters">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. - <</if>> - <br> - Freedom Fighters are groups of individuals fighting to rid the planet of "evils" such as the Free Cities and their way of life. Lacking the strength to assault one directly, they fight guerrilla style, slowly starving to death their enemies. They are rarely well equipped, but with good training and mobility they are not a threat that can be taken lightly. - <<elseif $attackType == "old world">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. - <</if>> - <br> - Old world expeditions are usually sent to secure resources and trade routes for their nation or, more often, to provide their citizens with a bogeyman to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. However, they often lack in mobility. - <</if>> + <<if $majorBattlesCount > 0>> + The ominous message dominates the screens of your office, and <<print $assistant.name>> quickly gathers all information available to prepare for the major battle ahead. <<else>> Your assistant interrupted your rest to bring the grim news. You quickly rush to your console, where you can see the satellite images coming in of the force about to crash against your arcology. It's not the first time your armies fought for the survival of your empire, but this time it seems it will be a fight for life or death. <br> <br> - <<if $attackType == "raiders">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, disorganized horde of raiders is coming to your city. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, disorganized horde of raiders coming towards the city and quickly reported it. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. - <</if>> - <br> - Raiders are roaming gangs of bandits, preying on the vulnerable supply lines of Free Cities and old world nations. They are rarely equipped with decent armaments and even more rarely have any formal military training, but they make up for that with high mobility and numbers. - <<elseif $attackType == "free city">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, menacing column of slavers and hired mercenaries is coming to your city. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, menacing column of slavers and hired mercenaries and rushed to your office to bring the grim news. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. - <</if>> - <br> - Free City expeditions are usually composed of mercenaries hired to take down sensible supplies or infrastructure in order to damage the enemies of their contractor. They have, on average, good equipment and training, together with decent mobility, making them a formidable force. Their biggest weakness, however, is their relatively low numbers. - <<elseif $attackType == "freedom fighters">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. - <</if>> - <br> - Freedom Fighters are groups of individuals fighting to rid the planet of "evils" such as the Free Cities and their way of life. Lacking the strength to assault one directly, they fight guerrilla style, slowly starving to death their enemies. They are rarely well equipped, but with good training and mobility they are not a threat that can be taken lightly. - <<elseif $attackType == "old world">> - <<if App.SecExp.battle.recon() >= 1>> - A massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. - Fortunately you knew of their coming, thanks to your recon systems. - <<else>> - Some of your citizens saw the massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. - <</if>> - <br> - Old world expeditions are usually sent to secure resources and trade routes for their nation or, more often, to provide their citizens with a bogeyman to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. However, they often lack in mobility. + <</if>> + <<if $attackType == "raiders">> + <<if App.SecExp.battle.recon() >= 1>> + A massive, disorganized horde of raiders is coming to your city. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the massive, disorganized horde of raiders coming towards the city and quickly reported it. It seems a warlord of the wastelands amassed enough men to try and obtain a slice of territory of his own; if he's not defeated there won't be a tomorrow for the arcology. + <</if>> + <br> + Raiders are roaming gangs of bandits, preying on the vulnerable supply lines of Free Cities and old world nations. They are rarely equipped with decent armaments and even more rarely have any formal military training, but they make up for that with high mobility and numbers. + <<elseif $attackType == "free city">> + <<if App.SecExp.battle.recon() >= 1>> + A massive, menacing column of slavers and hired mercenaries is coming to your city. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the massive, menacing column of slavers and hired mercenaries and rushed to your office to bring the grim news. The quantity of money invested in this assault is staggering; it seems you made some very powerful enemies. If they're not defeated your story will end this day. <</if>> + <br> + Free City expeditions are usually composed of mercenaries hired to take down sensible supplies or infrastructure in order to damage the enemies of their contractor. They have, on average, good equipment and training, together with decent mobility, making them a formidable force. Their biggest weakness, however, is their relatively low numbers. + <<elseif $attackType == "freedom fighters">> + <<if App.SecExp.battle.recon() >= 1>> + A massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the massive, dangerous army of guerrillas is gathering just outside the arcology. A huge ocean of fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire once and for all. And this time they won't stop until your body is burnt to a crisp. + <</if>> + <br> + Freedom Fighters are groups of individuals fighting to rid the planet of "evils" such as the Free Cities and their way of life. Lacking the strength to assault one directly, they fight guerrilla style, slowly starving to death their enemies. They are rarely well equipped, but with good training and mobility they are not a threat that can be taken lightly. + <<elseif $attackType == "old world">> + <<if App.SecExp.battle.recon() >= 1>> + A massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the massive, disciplined old world army is approaching the confines of your arcology. It seems one of the nations of the old world is determined to put your arcology to rest once and for all or die trying. + <</if>> + <br> + Old world expeditions are usually sent to secure resources and trade routes for their nation or, more often, to provide their citizens with a bogeyman to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. However, they often lack in mobility. <</if>> <</if>> <br><br> @@ -562,9 +525,6 @@ For this battle you choose to follow <span id="tactic"><strong><<print $chosenTa <<if App.SecExp.conflict.deployedUnits() > 0>> <<link "Send your orders" "attackHandler">> <<set $battleResult = 4>> /* sets $battleResult value outside accepted range to avoid evaluation problems */ - <<if $hasFoughtOnce == 0>> - <<set $hasFoughtOnce = 1>> - <</if>> <<set $foughtThisWeek = 1>> <</link>> <<else>> @@ -573,9 +533,6 @@ For this battle you choose to follow <span id="tactic"><strong><<print $chosenTa <br> <<link "Surrender" "attackReport">> <<set $battleResult = -1>> - <<if $hasFoughtOnce == 0>> - <<set $hasFoughtOnce = 1>> - <</if>> <<set $foughtThisWeek = 1>> <</link>> <br> @@ -585,9 +542,6 @@ For this battle you choose to follow <span id="tactic"><strong><<print $chosenTa /* calculates bribe cost */ <<link "Attempt to bribe" "attackHandler">> <<set $battleResult = 1>> - <<if $hasFoughtOnce == 0>> - <<set $hasFoughtOnce = 1>> - <</if>> <<set $foughtThisWeek = 1>> <</link>> <br> //Will cost around <<print cashFormat(Math.round($bribeCost * (1 + either(-1,1) * random(2) * 0.1)))>> (estimate).// diff --git a/src/Mods/SecExp/edicts.tw b/src/Mods/SecExp/edicts.tw index 90b55e3985ccceb09f7bd0870ac54ae400c9088e..efeebcc527bdeaa05c20c6e5440b99f232f58745 100644 --- a/src/Mods/SecExp/edicts.tw +++ b/src/Mods/SecExp/edicts.tw @@ -94,7 +94,7 @@ <br>''All weapons allowed:'' residents are allowed to buy, sell and keep all kind of weapons in the arcology. <</if>> -<<if $hasFoughtOnce == 1>> +<<if $battlesCount > 0 || $rebellionsCount > 0>> <br><br>__Defense Force:__ <<if $soldierWages == 0>> <br>''Low wages for soldiers:'' wages for soldiers are set to a low level compared to market standards. @@ -427,7 +427,7 @@ <br> //Will cost some authority each week, but rebellions will be poorly armed.// <</if>> -<<if $hasFoughtOnce == 1 || $mercenaries > 0>> +<<if $battlesCount > 0 || $rebellionsCount > 0 || $mercenaries > 0>> <br><br>__Defense Force__: <<if $soldierWages == 0>> diff --git a/src/Mods/SecExp/rebellionGenerator.tw b/src/Mods/SecExp/rebellionGenerator.tw index 2f52477998af4229265376c60d9230666de7485c..9fce42c4b92fd5fca715e3f9301994541c381da8 100644 --- a/src/Mods/SecExp/rebellionGenerator.tw +++ b/src/Mods/SecExp/rebellionGenerator.tw @@ -295,9 +295,6 @@ <<set $engageRule = 0>> <<set $lastRebellionWeeks = 0>> <<set $leadingTroops = "assistant">> - <<if $hasRebelledOnce == 0>> - <<set $hasRebelledOnce = 1>> - <</if>> /* calc how many slaves and citizens participate */ <<set _authFactor = Math.clamp(1 - ($SecExp.core.authority / 20000),0.4,0.6)>> <<set _repFactor = Math.clamp($rep / 20000,0.4,0.6)>> @@ -355,9 +352,6 @@ <<elseif $citizenRebellion == 1>> <<set $engageRule = 0>> <<set $lastRebellionWeeks = 0>> - <<if $hasRebelledOnce == 0>> - <<set $hasRebelledOnce = 1>> - <</if>> <<set $leadingTroops = "assistant">> /* calc how many citizens participate */ <<set _authFactor = Math.clamp(1 - ($SecExp.core.authority / 20000),0.4,0.6)>> diff --git a/src/Mods/SecExp/rebellionOptions.tw b/src/Mods/SecExp/rebellionOptions.tw index 217ea1b5c755c6f90bc6dffe2c5423d84f0bc3c3..834b91f0092fa0900d5fd2d34cbff62192e1183f 100644 --- a/src/Mods/SecExp/rebellionOptions.tw +++ b/src/Mods/SecExp/rebellionOptions.tw @@ -291,16 +291,10 @@ We can dedicate some of our forces to the protection of the vital parts of the a <br> <<link "Proceed" "rebellionHandler">> <<set $battleResult = 4>> /* sets $battleResult value outside accepted range to avoid evaluation problems */ - <<if $hasFoughtOnce == 0>> - <<set $hasFoughtOnce = 1>> - <</if>> <<set $foughtThisWeek = 1>> <</link>> <br> <<link "Surrender" "rebellionHandler">> <<set $battleResult = -1>> - <<if $hasFoughtOnce == 0>> - <<set $hasFoughtOnce = 1>> - <</if>> <<set $foughtThisWeek = 1>> <</link>> diff --git a/src/Mods/SecExp/securityReport.tw b/src/Mods/SecExp/securityReport.tw index 5fcf0c0e6b0061b23194f0dd79b07d53444a342b..3b81c9965501d4983a2b362f1ffe6fa47de16084 100644 --- a/src/Mods/SecExp/securityReport.tw +++ b/src/Mods/SecExp/securityReport.tw @@ -150,13 +150,13 @@ Your military is the size of a small army. Security is easier to maintain with such forces at your disposal. <<set _secGrowth += 0.5>> <</if>> -<<if $lastAttackWeeks < 3 && $hasFoughtOnce == 1>> +<<if $lastAttackWeeks < 3 && $battlesCount > 0>> The recent attack has a negative effect on the security of the arcology. <<set _secGrowth -= 1>> -<<elseif $lastAttackWeeks < 5 && $hasFoughtOnce == 1>> +<<elseif $lastAttackWeeks < 5 && $battlesCount > 0>> While some time has passed, the last attack still has a negative effect on the security of the arcology. <<set _secGrowth -= 0.5>> -<<elseif $hasFoughtOnce == 1>> +<<elseif $battlesCount > 0>> The arcology has not been attacked in a while, which has a positive effect on security. <<set _secGrowth += 0.5>> <</if>> diff --git a/src/Mods/SecExp/tradeReport.tw b/src/Mods/SecExp/tradeReport.tw index d27deed58f3ad89f9816723319a9dd079ac1730a..c27ede3daa09ae66db50ebf184ff50794148325f 100644 --- a/src/Mods/SecExp/tradeReport.tw +++ b/src/Mods/SecExp/tradeReport.tw @@ -17,17 +17,17 @@ <</if>> <<set _tradeChange = 0>> -<<if $lastAttackWeeks < 2 && $hasFoughtOnce == 1>> +<<if $lastAttackWeeks < 2 && $battlesCount > 0>> The recent attack has a negative effect on the trade of the arcology. <<set _tradeChange -= 1>> -<<elseif $lastAttackWeeks < 4 && $hasFoughtOnce == 1>> +<<elseif $lastAttackWeeks < 4 && $battlesCount > 0>> While some time has passed, the last attack still has a negative effect on the commercial activity of the arcology. <<set _tradeChange -= 0.5>> <</if>> -<<if $lastRebellionWeeks < 2 && $hasRebelledOnce == 1>> +<<if $lastRebellionWeeks < 2 && $rebellionsCount > 0>> The recent rebellion has a negative effect on the trade of the arcology. <<set _tradeChange -= 1>> -<<elseif $lastRebellionWeeks < 4 && $hasRebelledOnce == 1>> +<<elseif $lastRebellionWeeks < 4 && $rebellionsCount > 0>> While some time has passed, the last rebellion still has a negative effect on the commercial activity of the arcology. <<set _tradeChange -= 0.5>> <</if>> diff --git a/src/Mods/SecExp/widgets/miscSecExpWidgets.tw b/src/Mods/SecExp/widgets/miscSecExpWidgets.tw index 77e99c5102c43d78eabfc7a00e534ff7145c178d..868c0d95573227608e32957f8c686ff7a994426d 100644 --- a/src/Mods/SecExp/widgets/miscSecExpWidgets.tw +++ b/src/Mods/SecExp/widgets/miscSecExpWidgets.tw @@ -127,9 +127,6 @@ <<if !Number.isInteger($militiaFreeManpower)>> <<set $militiaFreeManpower = 0>> <</if>> - <<if !Number.isInteger($battlesCount)>> - <<set $battlesCount = 0>> - <</if>> <</widget>> <<widget "replenishAllUnits">> diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index 0229238230ddfe704103747f803dd22d64db975c..c27d239ff46364b1dc9bcdc4a2ae909ac9e108c4 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -538,7 +538,7 @@ <<elseif $SF.Toggle && $SF.Active >= 1>> Your army counts <<print num(App.SecExp.Manpower.employedOverall + $SF.ArmySize)>> total soldiers of which <<print num($SF.ArmySize)>> under the special force command and the rest under your direct control. <</if>> - <<if $hasFoughtOnce == 1>> + <<if $battlesCount > 0>> Your troops were involved in <<print num($battlesCount)>> battles of which <<print num($majorBattlesCount)>> were major engagements. You won <<if $battlesCount == $PCvictories>> all of them.