Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
58665448
Commit
58665448
authored
7 years ago
by
hexall90
Browse files
Options
Downloads
Patches
Plain Diff
Adding stuff
parent
38544e94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!1155
Pregmod master
,
!1039
Hexall90's security expansion mod
,
!871
Security expansion
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/SecExp/attackGenerator.tw
+360
-0
360 additions, 0 deletions
src/SecExp/attackGenerator.tw
src/SecExp/attackHandler.tw
+1
-3
1 addition, 3 deletions
src/SecExp/attackHandler.tw
src/SecExp/secInit.tw
+1
-1
1 addition, 1 deletion
src/SecExp/secInit.tw
with
362 additions
and
4 deletions
src/SecExp/attackGenerator.tw
+
360
−
0
View file @
58665448
:: attackGenerator [nobr]
:: attackGenerator [nobr]
/* attack progress */
<<set _raider = 0>>
<<if $week < 40>>
<<set _raider += 3>>
<<elseif $week < 60>>
<<set _raider += 5>>
<<elseif $week < 110>>
<<set _raider += 7>>
<<elseif $week < 150>>
<<set _raider +=9>>
<<else>>
<<set _raider +=15>>
<</if>>
<<if $arcologies[0].prosperity <= 50>>
<<set _raider += 3>>
<<elseif $arcologies[0].prosperity <= 70>>
<<set _raider += 5>>
<<elseif $arcologies[0].prosperity <= 90>>
<<set _raider += 7>>
<<elseif $arcologies[0].prosperity <= 110>>
<<set _raider += 9>>
<<elseif $arcologies[0].prosperity <= 130>>
<<set _raider += 15>>
<<else>>
<<set _raider += 18>>
<</if>>
<<set _oldWorld = 0>>
<<if $arcologies[0].prosperity <= 50>>
<<set _oldWorld += 2>>
<<elseif $arcologies[0].prosperity <= 70>>
<<set _oldWorld += 4>>
<<elseif $arcologies[0].prosperity <= 90>>
<<set _oldWorld += 6>>
<<elseif $arcologies[0].prosperity <= 110>>
<<set _oldWorld += 8>>
<<elseif $arcologies[0].prosperity <= 130>>
<<set _oldWorld += 12>>
<<else>>
<<set _oldWorld += 16>>
<</if>>
<<if $arcologies[0].FSRepopulationFocus != "unset">>
<<set _oldWorld += 8>>
<<elseif $arcologies[0].FSGenderRadicalist != "unset">>
<<set _oldWorld += 8>>
<<elseif $arcologies[0].FSPastoralist != "unset">>
<<set _oldWorld += 8>>
<<elseif $arcologies[0].FSChattelReligionist != "unset">>
<<set _oldWorld += 8>>
<<elseif $arcologies[0].FSRomanRevivalist != "unset" || $arcologies[0].FSEdoRevivalist != "unset" || $arcologies[0].FSArabianRevivalist != "unset" ||
$arcologies[0].FSChineseRevivalist != "unset" || $arcologies[0].FSEgyptianRevivalist != "unset" || $arcologies[0].FSAztecRevivalist != "unset">>
<<set _oldWorld += 8>>
<</if>>
<<set _freeCity = 0>>
<<if $week < 40>>
<<set _freeCity += 2>>
<<elseif $week < 60>>
<<set _freeCity += 4>>
<<elseif $week < 110>>
<<set _freeCity += 6>>
<<elseif $week < 150>>
<<set _freeCity +=8>>
<<else>>
<<set _freeCity +=12>>
<</if>>
<<if $arcologies[0].prosperity <= 50>>
<<set _freeCity += 2>>
<<elseif $arcologies[0].prosperity <= 70>>
<<set _freeCity += 4>>
<<elseif $arcologies[0].prosperity <= 90>>
<<set _freeCity += 6>>
<<elseif $arcologies[0].prosperity <= 110>>
<<set _freeCity += 8>>
<<elseif $arcologies[0].prosperity <= 130>>
<<set _freeCity += 12>>
<<else>>
<<set _freeCity += 16>>
<</if>>
<<set _free = 0>>
<<set _slaveRev = 0>>
<<set _citRev = 0>>
<<set _mercRev = 0>>
<<set _arc = 0>>
<<for>> /* cycle through the arcologies and calculate for each */
/* Makes one proceed */
<<set _randThrow =random(0,7)>>
<<if _randThrow == 0>>
<<if $week < 60>>
<<set _raider = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _raider = Math.clamp(0,15)>>
<<else>>
<<set _raider = Math.clamp(0,20)>>
<</if>>
<<set $raidersProgress += _raider>>
<<elseif _randThrow == 1>>
<<if $week < 60>>
<<set _freeCity = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _freeCity = Math.clamp(0,15)>>
<<else>>
<<set _freeCity = Math.clamp(0,20)>>
<</if>>
<<set $freeCityProgress += _freeCity>>
<<elseif _randThrow == 2>>
<<if $week < 60>>
<<set _oldWorld = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _oldWorld = Math.clamp(0,15)>>
<<else>>
<<set _oldWorld = Math.clamp(0,20)>>
<</if>>
<<set $oldWorldProgress += _oldWorld>>
<<elseif _randThrow == 3>>
<<if $week < 60>>
<<set _free = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _free = Math.clamp(0,15)>>
<<else>>
<<set _free = Math.clamp(0,20)>>
<</if>>
<<set $freedomProgress += _free>>
<<elseif _randThrow == 4>>
<<if $week < 60>>
<<set _slaveRev = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _slaveRev = Math.clamp(0,15)>>
<<else>>
<<set _slaveRev = Math.clamp(0,20)>>
<</if>>
<<set $slaveProgress += _slaveRev>>
<<elseif _randThrow == 5>>
<<if $week < 60>>
<<set _mercRev = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _mercRev = Math.clamp(0,15)>>
<<else>>
<<set _mercRev = Math.clamp(0,20)>>
<</if>>
<<set $mercProgress += _mercRev>>
<<elseif _randThrow == 6>>
<<if $week < 60>>
<<set _arc = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _arc = Math.clamp(0,15)>>
<<else>>
<<set _arc = Math.clamp(0,20)>>
<</if>>
<<set $arcologyProgress += _arc>>
<<elseif _randThrow == 7>>
<<if $week < 60>>
<<set _citRev = Math.clamp(0,10)>>
<<elseif $week < 120>>
<<set _citRev = Math.clamp(0,15)>>
<<else>>
<<set _citRev = Math.clamp(0,20)>>
<</if>>
<<set $citizenProgress += _citRev>>
<</if>>
/* if an attack happens */
<<if $raidersProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "raiders">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random(50,150)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<else>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,2)>>
<<else>>
<<set $attackEquip = random(1,4)>>
<</if>>
<<set $raidersProgress = 0>>
<<elseif $slaveProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "slave">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random($ASlaves * 0.05, $ASlaves * 0.1)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<elseif $week < 90>>
<<set $attackTroops *= random(2,3)>>
<<else>>
<<set $attackTroops *= random(3,4)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<else>>
<<set $attackEquip = random(1,2)>>
<</if>>
<<set $slaveProgress = 0>>
<<elseif $citizenProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "citizen">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random($ACitizens * 0.05, $ACitizens * 0.1)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<else>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<else>>
<<set $attackEquip = random(1,2)>>
<</if>>
<<set $citizenProgress = 0>>
<<elseif $arcologyProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "arcology">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random(60,180)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<else>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<else>>
<<set $attackEquip = random(1,2)>>
<</if>>
<<if $attackingArcology.prosperity > 100>>
<<set $attackEquip++>>
<</if>>
<<set $arcologyProgress = 0>>
<<elseif $freeCityProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "free city">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random(60,180)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<else>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<elseif $week < 90>>
<<set $attackEquip = random(1,3)>>
<<else>>
<<set $attackEquip = random(1,4)>>
<</if>>
<<set $freeCityProgress = 0>>
<<elseif $oldWorldProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "old world">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random(100,200)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<else>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<elseif $week < 90>>
<<set $attackEquip = random(1,3)>>
<<else>>
<<set $attackEquip = random(1,4)>>
<</if>>
<<set $oldWorldProgress = 0>>
<<elseif $freedomProgress == 100>>
<<set $attackThisWeek = 1>>
<<set $attackType = "freedom fighters">>
<<if $terrain == "urban">>
<<set $battleTerrain = either("outskirts", "urban", "wasteland")>>
<<elseif $terrain == "rural">>
<<set $battleTerrain = either("hills", "outskirts", "rural", "wasteland")>>
<<elseif $terrain == "ravine">>
<<set $battleTerrain = either("mountains", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "marine">>
<<set $battleTerrain = either("coast", "outskirts", "hills", "wasteland")>>
<<elseif $terrain == "oceanic">>
<<set $battleTerrain = "sea")>>
<</if>>
<<set $attackTroops = random(70,170)>>
<<if $week < 60>>
<<set $attackTroops *= random(1,2)>>
<<elseif>>
<<set $attackTroops *= random(2,3)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = random(0,1)>>
<<else>>
<<set $attackEquip = random(1,3)>>
<</if>>
<<set $freedomProgress = 0>>
<</if>>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/SecExp/attackHandler.tw
+
1
−
3
View file @
58665448
...
@@ -80,13 +80,11 @@ The ominous message dominates the screens of your office. <<print $assistantName
...
@@ -80,13 +80,11 @@ The ominous message dominates the screens of your office. <<print $assistantName
<hr>
<hr>
It seems your troops and your adversary will fight
It seems your troops and your adversary will fight
<<if $battleTerrain == "urban">>
<<if $battleTerrain == "urban">>
in <strong>the streets of
the arcology
.</strong>
in <strong>the streets of
<<if $terrain == "urban">>the old world city surroinding the arcology<<else>>of the free city<</if>>
.</strong>
<<elseif $battleTerrain == "rural">>
<<elseif $battleTerrain == "rural">>
in <strong>the rural land</strong> surrounding the free city.
in <strong>the rural land</strong> surrounding the free city.
<<elseif $battleTerrain == "hills">>
<<elseif $battleTerrain == "hills">>
on <strong>the hills</strong> around the free city.
on <strong>the hills</strong> around the free city.
<<elseif $battleTerrain == "sea">>
in <strong>the sea</strong> surrounding the city.
<<elseif $battleTerrain == "coast">>
<<elseif $battleTerrain == "coast">>
along <strong>the coast</strong> just outside the free city.
along <strong>the coast</strong> just outside the free city.
<<elseif $battleterrain == "outskirts">>
<<elseif $battleterrain == "outskirts">>
...
...
This diff is collapsed.
Click to expand it.
src/SecExp/secInit.tw
+
1
−
1
View file @
58665448
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<<set $raidersProgress = 0>>
<<set $raidersProgress = 0>>
<<set $slaveProgress = 0>>
<<set $slaveProgress = 0>>
<<set $citizenProgress = 0>>
<<set $citizenProgress = 0>>
<<set $mercProgress = 0>>
<<set $arcologyProgress = 0>>
<<set $arcologyProgress = 0>>
<<set $freeCityProgress = 0>>
<<set $freeCityProgress = 0>>
<<set $oldWorldProgress = 0>>
<<set $oldWorldProgress = 0>>
...
@@ -35,7 +36,6 @@
...
@@ -35,7 +36,6 @@
/* battle relevant variables */
/* battle relevant variables */
<<set $attackTroops = 0>>
<<set $attackTroops = 0>>
<<set $attackEquip = 0>>
<<set $attackEquip = 0>>
<<set $attackTraining = 0>>
<<set $deployableUnits = 0>>
<<set $deployableUnits = 0>>
<<set $deployedUnits = 0>>
<<set $deployedUnits = 0>>
<<set $battleTerrain = "none">>
<<set $battleTerrain = "none">>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment