diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000000000000000000000000000000000000..4ffbc51e5bd7ce0778c370dd2c3bfd663b9c017c --- /dev/null +++ b/TODO.txt @@ -0,0 +1,22 @@ +Rebellions: +-citizens mini events + +further development: +-specialized slave schools +-fortifications +-security based careers should have discount on secHQ upgrades +-celebrity on propHub +-more levels for militia edict (further militarize society) +-conquering other arcologies? + +Events: +-famous criminal escapes to the arcology, followed by another arcology police force + +Edicts: +-cyber enhancements for slave units + +Bugs: +-sometimes troop counts breaks +-sometimes rebel numbers have fractionary parts +-growth stimulants can give height with fractionary parts +-weap manufacturing is a mess as always \ No newline at end of file diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw new file mode 100644 index 0000000000000000000000000000000000000000..53c462dc08e8c46b67bc26de62d430c188d06fdd --- /dev/null +++ b/src/SecExp/SecExpBackwardCompatibility.tw @@ -0,0 +1,975 @@ +:: SecExpBackwardCompatibility [nobr] + +<<set $nextButton = "Continue", $nextLink = "Main", $returnTo = "Main">> + +/* base stats */ +<<if ndef $authority>> +<<set $authority = 0>> +<</if>> +<<if ndef $security>> +<<set $security = 30>> +<</if>> +<<if ndef $secRestPoint>> +<<set $secRestPoint = 40>> +<</if>> +<<if ndef $crime>> +<<set $crime = 30>> +<</if>> +<<if ndef $crimeCap>> +<<set $crimeCap = 100>> +<</if>> +<<if ndef $readiness>> +<<set $readiness = 1>> +<</if>> +<<if ndef $recon>> +<<set $recon = 0>> +<</if>> +<<if ndef $maxUnits>> +<<set $maxUnits = 6>> +<</if>> +<<if ndef $trade>> +<<set $trade = 0>> +<<calcInitialTrade>> +<</if>> +<<if ndef $activeUnits>> +<<set $activeUnits = 0>> +<</if>> +<<if ndef $attackType>> +<<set $attackType = "none">> +<</if>> +<<if ndef $attackThisWeek>> +<<set $attackThisWeek = 0>> +<</if>> +<<if ndef $lastAttackWeeks>> +<<set $lastAttackWeeks = 0>> +<</if>> +<<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>> +<<if ndef $PCvictoryStreak>> +<<set $PCvictoryStreak = 0>> +<</if>> +<<if ndef $PClossStreak>> +<<set $PClossStreak = 0>> +<</if>> +<<if ndef $oldFlux>> +<<set $oldFlux = 0>> +<</if>> +<<if ndef $wasToggledBefore>> +<<set $wasToggledBefore = 0>> +<</if>> +<<if ndef $showBattleStatistics>> +<<set $showBattleStatistics = 0>> +<</if>> +<<if ndef $forceBattle>> +<<set $forceBattle = 0>> +<</if>> +<<if ndef $forceMajorBattle>> +<<set $forceMajorBattle = 0>> +<</if>> +<<if ndef $foughtThisWeek>> +<<set $foughtThisWeek = 0>> +<</if>> +<<if ndef $battlesEnabled>> +<<set $battlesEnabled = 1>> +<</if>> +<<if ndef $battlesEnabledOceanic>> +<<set $battlesEnabledOceanic = 0>> +<</if>> +<<if ndef $majorBattlesEnabled>> +<<set $majorBattlesEnabled = 1>> +<</if>> +<<if ndef $majorBattleGameOver>> +<<set $majorBattleGameOver = 1>> +<</if>> +<<if ndef $rebellionsEnabled>> +<<set $rebellionsEnabled = 1>> +<</if>> +<<if ndef $forceRebellion>> +<<set $forceRebellion = 0>> +<</if>> +<<if ndef $rebellionGameOver>> +<<set $rebellionGameOver = 1>> +<</if>> + +/* edicts */ +<<if ndef $edictsUpkeep>> +<<set $edictsUpkeep = 0>> +<</if>> +<<if ndef $edictsAuthUpkeep>> +<<set $edictsAuthUpkeep = 0>> +<</if>> +<<if ndef $alternativeRents>> +<<set $alternativeRents = 0>> +<</if>> +<<if ndef $enslavementRights>> +<<set $enslavementRights = 0>> +<</if>> +<<if ndef $securityExemption>> +<<set $securityExemption = 0>> +<</if>> +<<if ndef $sellData>> +<<set $sellData = 0>> +<</if>> +<<if ndef $propCampaignBoost>> +<<set $propCampaignBoost = 0>> +<</if>> +<<if ndef $slaveWatch>> +<<set $slaveWatch = 0>> +<</if>> +<<if ndef $subsidyChurch>> +<<set $subsidyChurch = 0>> +<</if>> +<<if ndef $limitImmigration>> +<<set $limitImmigration = 0>> +<</if>> +<<if ndef $openBorders>> +<<set $openBorders = 0>> +<</if>> +<<if ndef $limitSubhumans>> +<<set $limitSubhumans = 0>> +<</if>> +<<if ndef $slavesOfficers>> +<<set $slavesOfficers = 0>> +<</if>> +<<if ndef $martialSchool>> +<<set $martialSchool = 0>> +<</if>> +<<if ndef $discountMercenaries>> +<<set $discountMercenaries = 0>> +<</if>> +<<if ndef $militiaFounded>> +<<set $militiaFounded = 0>> +<</if>> +<<if ndef $recruitVolunteers>> +<<set $recruitVolunteers = 0>> +<</if>> +<<if ndef $militaryService>> +<<set $militaryService = 0>> +<</if>> +<<if ndef $militarizedSociety>> +<<set $militarizedSociety = 0>> +<</if>> +<<if ndef $militaryExemption>> +<<set $militaryExemption = 0>> +<</if>> +<<if ndef $lowerRquirements>> +<<set $lowerRquirements = 0>> +<</if>> +<<if ndef $noSubhumansInArmy>> +<<set $noSubhumansInArmy = 0>> +<</if>> +<<if ndef $pregExemption>> +<<set $pregExemption = 0>> +<</if>> +<<if ndef $eliteOfficers>> +<<set $eliteOfficers = 0>> +<</if>> +<<if ndef $liveTargets>> +<<set $liveTargets = 0>> +<</if>> +<<if ndef $legionTradition>> +<<set $legionTradition = 0>> +<</if>> +<<if ndef $eagleWarriors>> +<<set $eagleWarriors = 0>> +<</if>> +<<if ndef $ronin>> +<<set $ronin = 0>> +<</if>> +<<if ndef $sunTzu>> +<<set $sunTzu = 0>> +<</if>> +<<if ndef $weaponsLaw || $wasToggledBefore == 1>> +<<set $weaponsLaw = 3>> +<</if>> +<<if ndef $soldierWages>> +<<set $soldierWages = 1>> +<</if>> +<<if ndef $militiaSoldierPrivilege>> +<<set $militiaSoldierPrivilege = 0>> +<</if>> +<<if ndef $slaveSoldierPrivilege>> +<<set $slaveSoldierPrivilege = 0>> +<</if>> +<<if ndef $mercSoldierPrivilege>> +<<set $mercSoldierPrivilege = 0>> +<</if>> +<<if ndef $tradeLegalAid>> +<<set $tradeLegalAid = 0>> +<</if>> +<<if ndef $taxTrade>> +<<set $taxTrade = 0>> +<</if>> + +/* proclamations */ +<<if ndef $proclamationsCooldown>> +<<set $proclamationsCooldown = 0>> +<</if>> +<<if ndef $proclamationCurrency>> +<<set $proclamationCurrency = "authority">> +<</if>> +<<if ndef $proclamationType>> +<<set $proclamationType = "none">> +<</if>> + +/* buildings */ +<<if ndef $secHQ>> +<<set $secHQ = 0>> +<</if>> +<<if ndef $secBarracks>> +<<set $secBarracks = 0>> +<</if>> +<<if ndef $secBarracksUpgrades>> +<<set $secBarracksUpgrades ={ + size: 0, + luxury: 0, + training: 0, + loyaltyMod:0 }>> +<</if>> +<<if ndef $secBarracksUpgrades.loyaltyMod>> +<<set $secBarracksUpgrades.loyaltyMod = 0>> +<</if>> +<<if ndef $secHelots>> +<<set $secHelots = 0>> +<</if>> +<<if ndef $reqHelots>> +<<set $reqHelots = 20>> +<</if>> +<<if ndef $secUpgrades >> +<<set $secUpgrades = { + nanoCams: 0, + cyberBots: 0, + eyeScan: 0, + cryptoAnalyzer: 0, + coldstorage: 0}>> +<</if>> +<<if ndef $crimeUpgrades>> +<<set $crimeUpgrades = { + autoTrial: 0, + autoArchive: 0, + worldProfiler: 0, + advForensic: 0}>> +<</if>> +<<if ndef $intelUpgrades>> + <<set $intelUpgrades = { + sensors: 0, + radar: 0, + signalIntercept: 0}>> +<</if>> +<<if ndef $readinessUpgrades>> +<<set $readinessUpgrades = { + earlyWarn: 0, + rapidPlatforms: 0, + pathways: 0, + rapidVehicles: 0}>> +<</if>> +<<if ndef $propHub>> + <<set $propHub = 0>> +<</if>> +<<if ndef $propCampaign>> +<<set $propCampaign = 0>> +<</if>> +<<if ndef $propFocus>> +<<set $propFocus = "none">> +<</if>> +<<if ndef $miniTruth>> +<<set $miniTruth = 0>> +<</if>> +<<if ndef $fakeNews>> +<<set $fakeNews = 0>> +<</if>> +<<if ndef $controlLeaks>> +<<set $controlLeaks = 0>> +<</if>> +<<if ndef $secretService>> +<<set $secretService = 0>> +<</if>> +<<if ndef $blackOps>> +<<set $blackOps = 0>> +<</if>> +<<if ndef $marketInfiltration>> +<<set $marketInfiltration = 0>> +<</if>> +<<if ndef $propHubUpkeep>> +<<set $propHubUpkeep = $facilityCost * 5>> +<</if>> +<<if ndef $secHQUpkeep>> +<<set $secHQUpkeep = $facilityCost * 5>> +<</if>> +<<if ndef $secBarracksUpkeep>> +<<set $secBarracksUpkeep = $facilityCost * 5>> +<</if>> +<<if ndef $upgradeUpkeep>> +<<set $upgradeUpkeep = 50>> +<</if>> +<<if ndef $riotCenter>> +<<set $riotCenter = 0>> +<</if>> +<<if ndef $riotUpkeep>> +<<set $riotUpkeep = $facilityCost * 5>> +<</if>> +<<if ndef $riotUpgrades>> +<<set $riotUpgrades = { + freeMedia: 0, + rapidUnit: 0, + rapidUnitSpeed: 0}>> +<</if>> +<<if ndef $fort>> +<<set $fort = { + reactor: 0, + waterway: 0, + assistant: 0}>> +<</if>> +<<if ndef $sentUnitCooldown>> +<<set $sentUnitCooldown = 0>> +<</if>> +<<if ndef $advancedRiotEquip>> +<<set $advancedRiotEquip = 0>> +<</if>> +<<if ndef $brainImplant>> +<<set $brainImplant = -1>> +<</if>> +<<if ndef $brainImplantProject>> +<<set $brainImplantProject = 0>> +<</if>> +<<if ndef $weapHelots>> +<<set $weapHelots = 0>> +<</if>> +<<if ndef $weapManu>> +<<set $weapManu = 0>> +<</if>> +<<if ndef $weapProductivity>> +<<set $weapProductivity = 1>> +<</if>> +<<if ndef $weapLab>> +<<set $weapLab = 1>> +<</if>> +<<if ndef $baseUpgradeTime>> +<<set $baseUpgradeTime = 10>> +<</if>> +<<if ndef $weapUpgrades>> +<<set $weapUpgrades = []>> +<</if>> +<<if ndef $currentUpgrade>> +<<set $currentUpgrade = { + ID: 0, + name: " ", + unit: 0, + type: 0, + time: 0, + value: 0}>> +<<else>> + <<if ndef $currentUpgrade.ID>> + <<if $currentUpgrade.name == "magnetic based ballistic weaponry">> + <<set $currentUpgrade.ID = 0>> + <<elseif $currentUpgrade.name == "ceramo-metallic alloys">> + <<set $currentUpgrade.ID = 1>> + <<elseif $currentUpgrade.name == "rapid action stimulants">> + <<set $currentUpgrade.ID = 2>> + <<elseif $currentUpgrade.name == "fast response neural stimulant">> + <<set $currentUpgrade.ID = 3>> + <<elseif $currentUpgrade.name == "universal cyber enhancements">> + <<set $currentUpgrade.ID = 4>> + <<elseif $currentUpgrade.name == "remote neural links">> + <<set $currentUpgrade.ID = 5>> + <<elseif $currentUpgrade.name == "combined training regimens with the special force">> + <<set $currentUpgrade.ID = 6>> + <<elseif $currentUpgrade.name == "a variant of the stimulant cocktail that the special force created">> + <<set $currentUpgrade.ID = 7>> + <<elseif $currentUpgrade.name == "a mesh network based off the custom network of the special force">> + <<set $currentUpgrade.ID = 8>> + <<elseif $currentUpgrade.name == "dynamic battle aware AI">> + <<set $currentUpgrade.ID = -1>> + <<elseif $currentUpgrade.name == "adaptive armored frames">> + <<set $currentUpgrade.ID = -2>> + <<elseif $currentUpgrade.name == "advanced synthetic alloys">> + <<set $currentUpgrade.ID = -3>> + <</if>> + <</if>> +<</if>> +<<if ndef $droneUpgrades>> + <<set $droneUpgrades = { + attack: 0, + defense: 0, + hp:0}>> +<<elseif $droneUpgrades == null>> + <<set $droneUpgrades = { + attack: 0, + defense: 0, + hp:0}>> +<<else>> + <<if isInt($droneUpgrades)>> + <<unset $droneUpgrades>> + <<set $droneUpgrades = { + attack: 0, + defense: 0, + hp:0}>> + <</if>> + <<if ndef $droneUpgrades.attack || !isInt($droneUpgrades.attack)>> + <<set $droneUpgrades.attack = 0>> + <</if>> + <<if ndef $droneUpgrades.defense || !isInt($droneUpgrades.defense)>> + <<set $droneUpgrades.defense = 0>> + <</if>> + <<if ndef $droneUpgrades.hp || !isInt($droneUpgrades.hp)>> + <<set $droneUpgrades.hp = 0>> + <</if>> +<</if>> +<<if ndef $humanUpgrade>> + <<set $humanUpgrade = { + attack: 0, + defense: 0, + hp:0, + morale: 0}>> +<<elseif $humanUpgrade == null>> + <<set $humanUpgrade = { + attack: 0, + defense: 0, + hp:0, + morale: 0}>> +<<else>> + <<if isInt($humanUpgrade)>> + <<unset $humanUpgrade>> + <<set $humanUpgrade = { + attack: 0, + defense: 0, + hp:0, + morale: 0}>> + <</if>> + <<if ndef $humanUpgrade.attack || !isInt($humanUpgrade.attack)>> + <<set $humanUpgrade.attack = 0>> + <</if>> + <<if ndef $humanUpgrade.defense || !isInt($humanUpgrade.defense)>> + <<set $humanUpgrade.defense = 0>> + <</if>> + <<if ndef $humanUpgrade.hp || !isInt($humanUpgrade.hp)>> + <<set $humanUpgrade.hp = 0>> + <</if>> + <<if ndef $humanUpgrade.morale || !isInt($humanUpgrade.morale)>> + <<set $humanUpgrade.morale = 0>> + <</if>> +<</if>> +<<if ndef $sellTo>> +<<set $sellTo = { + citizen: 1, + raiders: 1, + oldWorld: 1, + FC: 1}>> +<</if>> +<<if ndef $completedUpgrades>> +<<set $completedUpgrades = []>> +<</if>> +<<if ndef $transportHub>> +<<set $transportHub = 0>> +<</if>> +<<if ndef $airport>> +<<set $airport = 1>> +<</if>> +<<if ndef $railway>> +<<set $railway = 1>> +<</if>> +<<if ndef $docks>> +<<set $docks = 1>> +<</if>> +<<if ndef $hubSecurity>> +<<set $hubSecurity = 1>> +<</if>> + +/* events */ +<<if ndef $smilingManProgress>> +<<set $smilingManProgress = 0>> +<</if>> +<<if ndef $investedFunds>> +<<set $investedFunds = 0>> +<</if>> +<<if ndef $relationshipLM>> +<<set $relationshipLM = 0>> +<</if>> +<<if ndef $captureRoute>> +<<set $captureRoute = 0>> +<</if>> +<<if ndef $collaborationRoute>> +<<set $collaborationRoute = 0>> +<</if>> +<<if ndef $hostileRoute>> +<<set $hostileRoute = 0>> +<</if>> +<<if ndef $smilingManWeek>> +<<set $smilingManWeek = 0>> +<</if>> +<<if ndef $globalCrisisWeeks>> +<<set $globalCrisisWeeks = 0>> +<</if>> +<<if ndef $smilingManFate>> +<<set $smilingManFate = 4>> +<</if>> + +/* rebellions */ +<<if ndef $tension>> +<<set $tension = 0>> +<</if>> +<<if ndef $slaveProgress>> +<<set $slaveProgress = 0>> +<</if>> +<<if ndef $citizenProgress>> +<<set $citizenProgress = 0>> +<</if>> +<<if ndef $slaveRebellionEventFires>> +<<set $slaveRebellionEventFires = 0>> +<</if>> +<<if ndef $citizenRebellionEventFires>> +<<set $citizenRebellionEventFires = 0>> +<</if>> +<<if ndef $slaveRebellion>> +<<set $slaveRebellion = 0>> +<</if>> +<<if ndef $citizenRebellion>> +<<set $citizenRebellion = 0>> +<</if>> +<<if ndef $rebellingUnits>> +<<set $rebellingUnits = []>> +<</if>> +<<if ndef $notInvolved>> +<<set $notInvolved = 0>> +<</if>> +<<if ndef $engageRule>> +<<set $engageRule = 0>> +<</if>> +<<if ndef $irregulars>> +<<set $irregulars = 0>> +<</if>> +<<if ndef $rebellingMilitia>> +<<set $rebellingMilitia = 0>> +<</if>> +<<if ndef $rebellingSlaves>> +<<set $rebellingSlaves = 0>> +<</if>> +<<if ndef $rebellingMercs>> +<<set $rebellingMercs = 0>> +<</if>> +<<if ndef $repairTime>> +<<set $repairTime = 3>> +<</if>> +<<if ndef $arcRepairTime>> +<<set $arcRepairTime = 0>> +<</if>> +<<if ndef $rebelDefeatAftermath>> +<<set $rebelDefeatAftermath = 0>> +<</if>> +<<if ndef $garrison>> +<<set $garrison = { + penthouse: 0, + reactor: 0, + assistant: 0, + waterway: 0, + 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 $difficulty>> +<<set $difficulty = 1>> +<</if>> +<<if ndef $targetUnit>> +<<set $targetUnit = 0>> +<</if>> +<<if ndef $targetIndex>> +<<set $targetIndex = 0>> +<</if>> +<<if ndef $secBotsCost>> +<<set $secBotsCost = 500>> +<</if>> +<<if ndef $secBotsUpgradeCost>> +<<set $secBotsUpgradeCost = 250>> +<</if>> +<<if ndef $equipUpgradeCost>> +<<set $equipUpgradeCost = 250>> +<</if>> +<<if ndef $maxTroops>> +<<set $maxTroops = 30>> +<</if>> +<<if ndef $militiaFounded>> +<<set $militiaFounded = 0>> +<</if>> +<<if ndef $militiaRecruitment>> +<<set $militiaRecruitment = 0>> +<</if>> +<<if ndef $militiaTotalManpower>> +<<set $militiaTotalManpower = 0>> +<</if>> +<<if ndef $militiaFreeManpower>> +<<set $militiaFreeManpower = 0>> +<</if>> +<<if ndef $militiaEmployedManpower>> +<<set $militiaEmployedManpower = 0>> +<</if>> +<<if ndef $militiaTotalCasualties>> +<<set $militiaTotalCasualties = 0>> +<</if>> +<<if ndef $slavesOfficers>> +<<set $slavesOfficers = 0>> +<</if>> +<<if ndef $slavesEmployedManpower>> +<<set $slavesEmployedManpower = 0>> +<</if>> +<<if ndef $slavesTotalCasualties>> +<<set $slavesTotalCasualties = 0>> +<</if>> +<<if ndef $slavesMaxTroops>> +<<set $slavesMaxTroops = 30>> +<</if>> +<<if ndef $mercTotalManpower>> +<<set $mercTotalManpower = 0>> +<</if>> +<<if ndef $mercFreeManpower>> +<<set $mercFreeManpower = 0>> +<</if>> +<<if ndef mercEmployedManpower>> +<<set $mercEmployedManpower = 0>> +<</if>> +<<if ndef $mercTotalCasualties>> +<<set $mercTotalCasualties = 0>> +<</if>> +<<if ndef $militiaLoyalty>> +<<set $militiaLoyalty = 0>> +<</if>> +<<if ndef $slaveArmyLoyalty>> +<<set $slaveArmyLoyalty = 0>> +<</if>> +<<if ndef $mercLoyalty>> +<<set $mercLoyalty = 0>> +<</if>> +<<if ndef $soldierUpkeep>> +<<set $soldierUpkeep = 10>> +<</if>> +<<if ndef $createdSlavesUnits>> +<<set $createdSlavesUnits = 0>> +<</if>> +<<if ndef $createdMilitiaUnits>> +<<set $createdMilitiaUnits = 0>> +<</if>> +<<if ndef $createdMercUnits>> +<<set $createdMercUnits = 0>> +<</if>> + +/* battle relevant vars */ +<<if ndef $troopCount>> +<<set $troopCount = 0>> +<</if>> +<<if ndef $totalKills>> +<<set $totalKills = 0>> +<</if>> +<<if ndef $battlesCount>> +<<set $battlesCount = 0>> +<</if>> +<<if ndef $majorBattlesCount>> +<<set $majorBattlesCount = 0>> +<</if>> +<<if ndef $chosenTactic>> + <<set $chosenTactic = "none">> +<</if>> +<<if ndef $leadingTroops>> + <<set $leadingTroops = "none">> +<</if>> +<<if ndef $attackTroops>> + <<set $attackTroops = 0>> +<</if>> +<<if ndef $attackEquip>> + <<set $attackEquip = 0>> +<</if>> +<<if ndef $deployableUnits>> + <<set $deployableUnits = 0>> +<</if>> +<<if ndef $deployedUnits>> + <<set $deployedUnits = 0>> +<</if>> +<<if ndef $deployingBots>> + <<set $deployingBots = 0>> +<</if>> +<<if ndef $deployingMilitia>> + <<set $deployingMilitia = 0>> +<</if>> +<<if ndef $deployingSlaves>> + <<set $deployingSlaves = 0>> +<</if>> +<<if ndef $deployingMercs>> + <<set $deployingMercs = 0>> +<</if>> +<<if ndef $battleTerrain>> + <<set $battleTerrain = "none">> +<</if>> +<<if ndef $maxTurns>> + <<set $maxTurns = 10>> +<</if>> +<<if ndef $battleResult>> + <<set $battleResult = 4>> /* sets $battleResult value outside accepted range (-3,3) to avoid evaluation problems */ +<</if>> +<<if ndef $losses>> + <<set $losses = 0>> +<</if>> +<<if ndef $enemyLosses>> + <<set $enemyLosses = 0>> +<</if>> +<<if ndef $battleTurns>> + <<set $battleTurns = 0>> +<</if>> +<<if ndef $bribeCost>> + <<set $bribeCost = 0>> +<</if>> +<<if ndef $tacticsSuccessful>> + <<set $tacticsSuccessful = 0>> +<</if>> +<<if ndef $leaderWounded>> + <<set $leaderWounded = 0>> /* 0=no wound, 1=mute, 2=blind, 3=amputee, 4=health */ +<</if>> +<<if ndef $gainedCombat>> + <<set $gainedCombat = 0>> +<</if>> +<<if ndef $gainedWarfare>> +<<set $gainedWarfare = 0>> +<</if>> +<<if ndef $PCWounded>> +<<set $PCWounded = 0>> +<</if>> +<<if ndef $PCWoundCooldown>> +<<set $PCWoundCooldown = 0>> +<</if>> +<<if ndef $expectedEquip>> +<<set $expectedEquip = 0>> +<</if>> +<<if ndef $estimatedMen>> +<<set $estimatedMen = 0>> +<</if>> +<<if ndef $SFIntervention>> +<<set $SFIntervention = 0>> +<</if>> +<<if ndef $carriableSoldiers>> +<<set $carriableSoldiers = 0>> +<</if>> +<<if ndef $SFatk>> +<<set $SFatk = 0>> +<</if>> +<<if ndef $SFdef>> +<<set $SFdef = 0>> +<</if>> +<<if ndef $SFhp>> +<<set $SFhp = 0>> +<</if>> +<<if ndef $rebellingID>> +<<set $rebellingID = []>> +<</if>> + +/* statistics */ +<<if ndef $baseBribePerAttacker>> +<<set $baseBribePerAttacker = 5>> +<</if>> +<<if ndef $equipMod>> +<<set $equipMod = 0.15>> +<</if>> +<<if ndef $secBotsBaseAttack>> +<<set $secBotsBaseAttack = 7 + $droneUpgrades.attack>> +<</if>> +<<if ndef $secBotsBaseDefense>> +<<set $secBotsBaseDefense = 3 + $droneUpgrades.defense>> +<</if>> +<<if ndef $secBotsMorale>> +<<set $secBotsMorale = 200>> +<</if>> +<<if ndef $secBotsBaseHp>> +<<set $secBotsBaseHp = 3 + $droneUpgrades.hp>> +<</if>> +<<if ndef $militiaBaseAttack>> +<<set $militiaBaseAttack = 7 + $humanUpgrade.attack>> +<</if>> +<<if ndef $militiaBaseDefense>> +<<set $militiaBaseDefense = 5 + $humanUpgrade.defense>> +<</if>> +<<if ndef $militiaBaseMorale>> +<<set $militiaBaseMorale = 140 + $humanUpgrade.morale>> +<</if>> +<<if ndef $militiaBaseHp>> +<<set $militiaBaseHp = 3 + $humanUpgrade.hp>> +<</if>> +<<if ndef $slaveBaseAttack>> +<<set $slaveBaseAttack = 8 + $humanUpgrade.attack>> +<</if>> +<<if ndef $slaveBaseDefense>> +<<set $slaveBaseDefense = 3 + $humanUpgrade.defense>> +<</if>> +<<if ndef $slaveBaseMorale>> +<<set $slaveBaseMorale = 110 + $humanUpgrade.morale>> +<</if>> +<<if ndef $slaveBaseHp>> +<<set $slaveBaseHp = 3 + $humanUpgrade.hp>> +<</if>> +<<if ndef $mercBaseAttack>> +<<set $mercBaseAttack = 8 + $humanUpgrade.attack>> +<</if>> +<<if ndef $mercBaseDefense>> +<<set $mercBaseDefense = 4 + $humanUpgrade.defense>> +<</if>> +<<if ndef $mercBaseMorale>> +<<set $mercBaseMorale = 125 + $humanUpgrade.morale>> +<</if>> +<<if ndef $mercBaseHp>> +<<set $mercBaseHp = 4 + $humanUpgrade.hp>> +<</if>> +<<if ndef $SFBaseAttack>> +<<set $SFBaseAttack = 8 + $humanUpgrade.attack>> +<</if>> +<<if ndef $SFBaseDefense>> +<<set $SFBaseDefense = 4 + $humanUpgrade.defense>> +<</if>> +<<if ndef $SFBaseMorale>> +<<set $SFBaseMorale = 140 + $humanUpgrade.morale>> +<</if>> +<<if ndef $SFBaseHp>> +<<set $SFBaseHp = 4 + $humanUpgrade.hp>> +<</if>> + +<<if ndef $raBaseAttack>> +<<set $raBaseAttack = 7>> +<</if>> +<<if ndef $raBaseDefense>> +<<set $raBaseDefense = 2>> +<</if>> +<<if ndef $raBaseMorale>> +<<set $raBaseMorale = 100>> +<</if>> +<<if ndef $raBaseHp>> +<<set $raBaseHp = 2>> +<</if>> +<<if ndef $fcBaseAttack>> +<<set $fcBaseAttack = 6>> +<</if>> +<<if ndef $fcBaseDefense>> +<<set $fcBaseDefense = 4>> +<</if>> +<<if ndef $fcBaseMorale>> +<<set $fcBaseMorale = 130>> +<</if>> +<<if ndef $fcBaseHp>> +<<set $fcBaseHp = 3>> +<</if>> +<<if ndef $owBaseAttack>> +<<set $owBaseAttack = 8>> +<</if>> +<<if ndef $owBaseDefense>> +<<set $owBaseDefense = 4>> +<</if>> +<<if ndef $owBaseMorale>> +<<set $owBaseMorale = 110>> +<</if>> +<<if ndef $owBaseHp>> +<<set $owBaseHp = 2>> +<</if>> +<<if ndef $ffBaseAttack>> +<<set $ffBaseAttack = 9>> +<</if>> +<<if ndef $ffBaseDefense>> +<<set $ffBaseDefense = 2>> +<</if>> +<<if ndef $ffBaseMorale>> +<<set $ffBaseMorale = 160>> +<</if>> +<<if ndef $ffBaseHp>> +<<set $ffBaseHp = 2>> +<</if>> + +/* units */ +<<if ndef $secBots>> + <<if $arcologyUpgrade.drones == 0>> + <<set $secBots = { + active: 0, + isDeployed: 0, + troops: 0, + maxTroops: 0, + equip: 0} >> + <<elseif $arcologyUpgrade.drones == 1>> + <<set $secBots = { + active: 1, + isDeployed: 0, + troops: 30, + maxTroops: 30, + equip: 0} >> + <</if>> +<</if>> + +<<if ndef $militiaUnits>> + <<set $militiaUnits = []>> +<</if>> +<<if ndef $slaveUnits>> + <<set $slaveUnits = []>> +<</if>> +<<if ndef $mercUnits>> + <<set $mercUnits = []>> +<</if>> + +/* SFanon additions */ +<<if ndef $SFSupportLevel>> + <<set $SFSupportLevel = 0>> +<</if>> +<<if ndef $SFSupportUpkeep>> +<<set $SFSupportUpkeep = 0>> +<</if>> +<<if ndef $secUpgrades.coldstorage>> + <<set $secUpgrades.coldstorage = 0>> +<</if>> + +/* recalculation widgets */ +<<fixBrokenUnits>> +<<fixBrokenStats>> +<<fixBrokenFS>> +<<recalcSecRestPoint>> +<<recalcCrimeCap>> +<<recalcReqHelots>> +<<recalcManpower>> +<<recalcEdictsUpkeep>> +<<recalcBaseStats>> +<<recalcUnits>> + +<<set $wasToggledBefore = 1>> + +<br>Missing Security Expansion variables set. All done! \ No newline at end of file diff --git a/src/SecExp/attackGenerator.tw b/src/SecExp/attackGenerator.tw new file mode 100644 index 0000000000000000000000000000000000000000..e1ff70090df0406f800fc7cce49e4fbd2bc058b2 --- /dev/null +++ b/src/SecExp/attackGenerator.tw @@ -0,0 +1,249 @@ +:: attackGenerator [nobr] + +/* _attackChance value is the chance out of 100 of an attack happening this week */ +/* attacks are deactivated if battles are not enabled, the arcology is in the middle of the ocean, security drones are not around yet, there is not a rebellion this week or the last attack/rebellion happened within 3 weeks */ +<<if $battlesEnabled == 0 || ($terrain == "oceanic" && $battlesEnabledOceanic == 0) || $arcologyUpgrade.drones != 1 || $lastAttackWeeks <= 3 || $citizenRebellion == 1 || $slaveRebellion == 1 || $lastRebellionWeeks <= 3>> + <<set _attackChance = 0>> +<<else>> + <<if $week < 30>> + <<set _attackChance = 5>> + <<elseif $week < 60>> + <<set _attackChance = 8>> + <<elseif $week < 90>> + <<set _attackChance = 12>> + <<elseif $week < 120>> + <<set _attackChance =16>> + <<else>> + <<set _attackChance =20>> + <</if>> + <<if $lastAttackWeeks >= 15>> + <<set _attackChance += 5>> + <</if>> + <<if $hasFoughtOnce == 1>> + <<set _attackChance = 25>> + <</if>> +<</if>> + +<<if $forceBattle == 1 && $forceRebellion != 1 && $foughtThisWeek == 0>> + <<set _attackChance = 100>> +<</if>> + +/* Rolls to see if attack happens this week */ +/* raiders are attracted by low security */ +/* the old world by "degenerate" future societies */ +/* free Cities by high prosperity */ +/* freedom fighters by high slave/citizen ratio */ +<<if random(1,100) <= _attackChance>> + <<set $attackThisWeek = 1>> + <<set $lastAttackWeeks = 0>> + <<set $leadingTroops = "assistant">> + <<set $deployableUnits = 2 * $readiness>> + <<set $chosenTactic = either("Bait and Bleed", "Guerrilla", "Choke Points", "Interior Lines", "Pincer Manouver", "Defense In Depth", "Blitzkrieg", "Human Wave")>> + /* _type is the chance out of 100 of an attack of that type happening */ + <<set _raider = 25>> + <<set _oldWorld = 25>> + <<set _freeCity = 25>> + <<set _free = 25>> + /* old world */ + <<if $arcologies[0].FSRomanRevivalist != "unset" || $arcologies[0].FSEdoRevivalist != "unset" || $arcologies[0].FSArabianRevivalist != "unset" || $arcologies[0].FSChineseRevivalist != "unset" || $arcologies[0].FSEgyptianRevivalist != "unset" || $arcologies[0].FSAztecRevivalist != "unset" || $arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderRadicalist != "unset" || $arcologies[0].FSPastoralist != "unset" || $arcologies[0].FSChattelReligionist != "unset">> + <<set _oldWorld += 15>> + <<set _raider -= 5>> + <<set _freeCity -= 5>> + <<set _free -= 5>> + <<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") && ($arcologies[0].FSRepopulationFocus != "unset" || $arcologies[0].FSGenderRadicalist != "unset" || $arcologies[0].FSPastoralist != "unset" || $arcologies[0].FSChattelReligionist != "unset")>> + <<set _oldWorld += 24>> + <<set _raider -= 8>> + <<set _freeCity -= 8>> + <<set _free -= 8>> + <</if>> + /* freedom fighter */ + <<if $ASlaves > $ACitizens * 2>> + <<set _oldWorld -= 8>> + <<set _raider -= 8>> + <<set _freeCity -= 8>> + <<set _free += 24>> + <<elseif $ASlaves > $ACitizens * 1.2 || $arcologies[0].FSDegradationist != "unset">> + <<set _oldWorld -= 5>> + <<set _raider -= 5>> + <<set _freeCity -= 5>> + <<set _free += 15>> + <</if>> + /* free cities */ + <<if $arcologies[0].prosperity >= 10 && $arcologies[0].prosperity < 20>> + <<set _oldWorld -= 5>> + <<set _raider -= 5>> + <<set _freeCity += 15>> + <<set _free -= 5>> + <<elseif $arcologies[0].prosperity >= 20>> + <<set _oldWorld -= 8>> + <<set _raider -= 8>> + <<set _freeCity += 24>> + <<set _free -= 8>> + <</if>> + /* raiders */ + <<if $security <= 50>> + <<set _oldWorld -= 5>> + <<set _raider += 15>> + <<set _freeCity -= 5>> + <<set _free -= 5>> + <<elseif $security <= 25>> + <<set _oldWorld -= 8>> + <<set _raider += 24>> + <<set _freeCity -= 8>> + <<set _free -= 8>> + <</if>> + + /* makes the actual roll */ + <<set _roll = random(1,100)>> + <<if _roll <= _raider>> + <<set $attackType = "raiders">> + <<elseif _roll <= _raider + _oldWorld>> + <<set $attackType = "old world">> + <<elseif _roll <= _raider + _oldWorld + _freeCity>> + <<set $attackType = "free city">> + <<elseif _roll <= _raider + _oldWorld + _freeCity + _free>> + <<set $attackType = "freedom fighters">> + <</if>> +<<else>> + <<set $lastAttackWeeks++>> +<</if>> + +/* if an attack happens */ +<<if $attackThisWeek == 1>> + + /* terrain */ + <<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 = either("coast","outskirts","hills","wasteland")>> + <<else>> + <<set $battleTerrain = "error">> + <</if>> + + <<if $attackType == "raiders">> + <<set $attackTroops = random(40,80)>> + <<if $week < 30>> + <<set $attackTroops *= random(1,2)>> + <<elseif $week < 60>> + <<set $attackTroops *= random(1,3)>> + <<elseif $week < 90>> + <<set $attackTroops *= random(2,3)>> + <<elseif $week < 120>> + <<set $attackTroops *= random(2,4)>> + <<else>> + <<set $attackTroops *= random(3,5)>> + <</if>> + <<if $week < 60>> + <<set $attackEquip = random(0,1)>> + <<elseif $week < 90>> + <<set $attackEquip = random(0,2)>> + <<elseif $week < 120>> + <<set $attackEquip = random(0,3)>> + <<else>> + <<set $attackEquip = random(1,3)>> + <</if>> + <<elseif $attackType == "free city">> + <<set $attackTroops = random(20,40)>> + <<if $week < 30>> + <<set $attackTroops *= random(1,2)>> + <<elseif $week < 60>> + <<set $attackTroops *= random(1,3)>> + <<elseif $week < 90>> + <<set $attackTroops *= random(2,3)>> + <<elseif $week < 120>> + <<set $attackTroops *= random(2,4)>> + <<else>> + <<set $attackTroops *= random(3,5)>> + <</if>> + <<if $week < 60>> + <<set $attackEquip = random(0,1)>> + <<elseif $week < 90>> + <<set $attackEquip = random(0,3)>> + <<elseif $week < 120>> + <<set $attackEquip = random(1,3)>> + <<else>> + <<set $attackEquip = random(2,4)>> + <</if>> + <<elseif $attackType == "old world">> + <<set $attackTroops = random(25,50)>> + <<if $week < 30>> + <<set $attackTroops *= random(1,2)>> + <<elseif $week < 60>> + <<set $attackTroops *= random(1,3)>> + <<elseif $week < 90>> + <<set $attackTroops *= random(2,3)>> + <<elseif $week < 120>> + <<set $attackTroops *= random(2,4)>> + <<else>> + <<set $attackTroops *= random(3,5)>> + <</if>> + <<if $week < 60>> + <<set $attackEquip = random(0,1)>> + <<elseif $week < 90>> + <<set $attackEquip = random(0,3)>> + <<elseif $week < 120>> + <<set $attackEquip = random(1,3)>> + <<else>> + <<set $attackEquip = random(2,4)>> + <</if>> + <<elseif $attackType == "freedom fighters">> + <<set $attackTroops = random(30,60)>> + <<if $week < 30>> + <<set $attackTroops *= random(1,2)>> + <<elseif $week < 60>> + <<set $attackTroops *= random(1,3)>> + <<elseif $week < 90>> + <<set $attackTroops *= random(2,3)>> + <<elseif $week < 120>> + <<set $attackTroops *= random(2,4)>> + <<else>> + <<set $attackTroops *= random(3,5)>> + <</if>> + <<if $week < 60>> + <<set $attackEquip = random(0,1)>> + <<elseif $week < 90>> + <<set $attackEquip = random(0,3)>> + <<elseif $week < 120>> + <<set $attackEquip = random(1,3)>> + <<else>> + <<set $attackEquip = random(2,4)>> + <</if>> + <</if>> + <<set $estimatedMen = Math.round($attackTroops * (1 + either(-1,1) * (random(3,4) - $recon) * 0.1))>> + <<if $recon == 3>> + <<set $expectedEquip = $attackEquip + random(-1,1)>> + <<elseif $recon == 2>> + <<set $expectedEquip = $attackEquip + random(-1,2)>> + <<elseif $recon == 1>> + <<set $expectedEquip = $attackEquip + random(-2,2)>> + <<else>> + <<set $expectedEquip = $attackEquip + random(-2,3)>> + <</if>> +<</if>> + +/* major battles have a 50% chance of firing after week 120 */ +<<if $majorBattlesEnabled == 1>> + <<if ($week >= 120 && $attackType != "none") || ($forceMajorBattle == 1 && $foughtThisWeek == 0)>> + <<if random(1,100) >= 50 || $forceMajorBattle == 1>> + <<set $majorBattle = 1>> + <<set $attackTroops *= random(4,6)>> + <<set $attackEquip = either(3,4)>> + <<set $estimatedMen = Math.round($attackTroops * (1 + either(-1,1) * (random(3,4) - $recon) * 0.1))>> + <<if $recon == 3>> + <<set $expectedEquip = $attackEquip + random(-1,1)>> + <<elseif $recon == 2>> + <<set $expectedEquip = $attackEquip + random(-1,2)>> + <<elseif $recon == 1>> + <<set $expectedEquip = $attackEquip + random(-2,2)>> + <<else>> + <<set $expectedEquip = $attackEquip + random(-2,3)>> + <</if>> + <</if>> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/attackHandler.tw b/src/SecExp/attackHandler.tw new file mode 100644 index 0000000000000000000000000000000000000000..b0a8abf0c9cdd32c5730bbaa3500a552c2064ac5 --- /dev/null +++ b/src/SecExp/attackHandler.tw @@ -0,0 +1,1218 @@ +:: attackHandler [nobr] + +<<set $nextButton = " ", $nextLink = "attackReport", $showEncyclopedia = 0>> + +/* updates deployed flags */ +<<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].isDeployed == 1>> + <<set $deployingMilitia = 1>> + <<break>> + <</if>> +<</for>> +<<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].isDeployed == 1>> + <<set $deployingSlaves = 1>> + <<break>> + <</if>> +<</for>> +<<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].isDeployed == 1>> + <<set $deployingMercs = 1>> + <<break>> + <</if>> +<</for>> + +<<if $battleResult == 1>> /* bribery check */ + <<if $showBattleStatistics == 1>>bribery chosen<</if>> + <<if $cash >= $bribeCost>> /* if there's enough cash there's a 10% chance bribery fails. If there isn't there's instead a 50% chance it fails */ + <<if random(1,100) <= 10>> + <<set $battleResult = 0>> + <</if>> + <<else>> + <<if random(1,100) <= 50>> + <<set $battleResult = 0>> + <</if>> + <</if>> + <<if $showBattleStatistics == 1>> + <<if $battleResult == 0>> + <br>Bribery failed! + <<else>> + <br>Bribery Successful! + <</if>> + <br><br> + <<link "proceed">> + <<goto "attackReport">> + <</link>> + <<else>> + <<goto "attackReport">> + <</if>> + +<<else>> + +/*Init*/ +<<if $majorBattle == 0>> + <<set _turns = $maxTurns>> +<</if>> +<<set _turn = 0>> +<<set _attack = 0>> +<<set _defense = 0>> +<<set _morale = 0>> +<<set _hp = 0>> +<<set _baseHp = 0>> +<<set _enemyAttack = 0>> +<<set _enemyDefense = 0>> +<<set _enemyMorale = 0>> +<<set _enemyHp = 0>> +<<set _enemyBaseHp = 0>> +<<set _woundChance = 5>> /* leader has a base chance of 5% to get wounded */ +<<set _tacChance = 0.5>> /* by default tactics have a 50% chance of succeeding */ +<<set _atkMod = 1>> +<<set _defMod = 1>> +<<set _militiaMod = 1>> +<<set _slaveMod = 1>> +<<set _mercMod = 1>> +<<set _enemyMod = 1>> +<<set _SFMod = 1>> +<<set _expBonus = 0>> +<<set _loyaltyBonus = 0>> +<<set _armyMod = 0>> + +/* major battle */ +<<if $majorBattle == 1>> + <<set _militiaMod = 1.5>> + <<set _slaveMod = 1.5>> + <<set _mercMod = 1.5>> + <<set _enemyMod = 1.5>> + <<set _SFMod = 1.5>> + <<set _turns = $maxTurns * 2>> + <<if $securityForceCreate == 1>> + <<if $securityForceArcologyUpgrades >= 7>> + <<set _atkMod += ($securityForceArcologyUpgrades - 6) * 0.05>> + <</if>> + <<if $securityForceFortressZeppelin >= 1>> + <<set _defMod += $securityForceFortressZeppelin * 0.05>> + <</if>> + <<if $securityForceSatalitePower >= 11>> + <<set _atkMod += ($securityForceSatalitePower - 10) * 0.05>> + <</if>> + <<if $securityForceGiantRobot >= 6>> + <<set _defMod += ($securityForceGiantRobot - 5) * 0.05>> + <</if>> + <<if $securityForceMissileSilo >= 1>> + <<set _atkMod += $securityForceMissileSilo * 0.05>> + <<set _defMod += $securityForceMissileSilo * 0.05>> + <</if>> + <</if>> +<</if>> + +/* Leaders */ +<<if $leadingTroops == "PC">> + <<if $authority <= 2500 && $authority > 1000>> + <<set _slaveMod -= 0.10>> + <<elseif $authority <= 1000>> + <<set _slaveMod -= 0.25>> + <<elseif $authority >= 5000 && $authority < 15000>> + <<set _slaveMod += 0.10>> + <<elseif $authority >= 15000>> + <<set _slaveMod += 0.25>> + <</if>> + <<if $PC.career == "escort" || $PC.career == "servant">> + <<set _slaveMod += 0.10>> + <<elseif $PC.career == "slaver">> + <<set _slaveMod -= 0.10>> + <</if>> + <<if $rep <= 2500 && $rep > 1000>> + <<set _militiaMod -= 0.10>> + <<elseif $rep <= 1000>> + <<set _militiaMod -= 0.25>> + <<elseif $rep >= 5000 && $rep < 15000>> + <<set _militiaMod += 0.10>> + <<elseif $rep >= 15000>> + <<set _militiaMod += 0.25>> + <</if>> + <<if $PC.career == "celebrity" || $PC.career == "capitalist">> + <<set _militiaMod += 0.10>> + <<elseif $PC.career == "gang" || $PC.career == "escort">> + <<set _militiaMod -= 0.10>> + <</if>> + <<if $PC.career == "mercenary" || $PC.warfare > 75>> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.10>> + <<elseif $PC.career == "wealth" || $PC.career == "servant">> + <<set _mercMod -= 0.10>> + <<set _SFMod -= 0.10>> + <</if>> + <<if $rep >= 15000>> + <<set _enemyMod -= 0.10>> + <</if>> + <<if $PC.warfare <= 25 && $PC.warfare > 10>> + <<set _atkMod -= 0.15>> + <<set _tacChance -= 0.15>> + <<elseif $PC.warfare <= 10>> + <<set _atkMod -= 0.20>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.30>> + <<elseif $PC.warfare >= 50 && $PC.warfare >= 50>> + <<set _atkMod += 0.15>> + <<set _tacChance += 0.15>> + <<elseif $PC.warfare >= 75>> + <<set _atkMod += 0.20>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.30>> + <</if>> + /* 80% chance of increasing warfare */ + <<if $PC.warfare < 100 && random(1,100) <= 80>> + <<set $gainedWarfare = 1>> + <<set $PC.warfare += 10>> + <<set $PC.warfare = Math.clamp($PC.warfare,-100,100)>> + <</if>> + /* does the PC get wounded? */ + <<if $PC.career == "mercenary" || $PC.career == "gang">> + <<set _woundChance -= 3>> + <</if>> + <<if $PC.physicalAge >= 60>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.belly > 5000>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.boobsBonus >= 2>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.butt >= 2>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.balls == 2>> + <<set _woundChance += 1>> + <</if>> + <<if $PC.ballsImplant >= 2>> + <<set _woundChance += 1>> + <</if>> + <<if random(1,100) <= _woundChance>> + <<set $leaderWounded = 1>> + <<set _militiaMod -= 0.2>> + <<set _slaveMod -= 0.2>> + <<set _mercMod -= 0.2>> + <<set _SFMod -= 0.2>> + <<set _enemyMod += 0.2>> + <<set $PCWounded = 1>> + <</if>> +<<elseif $leadingTroops == "assistant">> + <<if $rep < 10000 && $authority < 10000>> + <<set _militiaMod -= 0.15>> + <<set _slaveMod -= 0.15>> + <<set _mercMod -= 0.15>> + <<set _SFMod -= 0.15>> + <</if>> + <<if $assistantPower == 0>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $assistantPower == 2>> + <<set _atkMod += 0.15>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.30>> + <</if>> +<<elseif $leadingTroops == "bodyguard">> + <<if $Bodyguard.devotion < -20>> + <<set _slaveMod -= 0.15>> + <<elseif $Bodyguard.devotion >= 50>> + <<set _slaveMod += 0.15>> + <</if>> + <<if ($rep < 10000 && $authority < 10000) || $Bodyguard.prestige < 1>> + <<set _militiaMod -= 0.15>> + <<set _mercMod -= 0.15>> + <<set _SFMod -= 0.15>> + <<elseif $Bodyguard.prestige >= 2>> + <<set _militiaMod += 0.10>> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.10>> + <</if>> + <<if (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 3>> + <<set _atkMod += 0.25>> + <<set _defMod += 0.25>> + <<set _tacChance += 0.50>> + <<elseif $Bodyguard.intelligence == 3>> + <<set _atkMod += 0.20>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.35>> + <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 2>> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $Bodyguard.intelligence == 2>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career) && $Bodyguard.intelligence >= 1>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.15>> + <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.30>> + <<elseif $Bodyguard.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.25>> + <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $Bodyguard.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.15>> + <</if>> + /* does she get wounded? */ + <<if $Bodyguard.combatSkill == 1>> + <<set _woundChance -= 2>> + <</if>> + <<if $Bodyguard.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $Bodyguard.health >= 50>> + <<set _woundChance -= 1>> + <</if>> + <<if $Bodyguard.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<if random(1,100) <= _woundChance>> + <<set $leaderWounded = 1>> + <<set _militiaMod -= 0.2>> + <<set _slaveMod -= 0.2>> + <<set _mercMod -= 0.2>> + <<set _SFMod -= 0.2>> + <<set _enemyMod += 0.2>> + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + <<set $Bodyguard.voice = 0>> + <<elseif $woundType == 2>> + <<set $Bodyguard.eyes = -2>> + <<elseif $woundType == 3>> + <<set $Bodyguard.amp = 1>> + <<elseif $woundType >= 4>> + <<if $Bodyguard.health >= -60>> + <<set $Bodyguard.health -= 30>> + <<else>> + <<set $Bodyguard.health -= Math.abs(90 - $Bodyguard.health)>> + <</if>> + <</if>> + <</if>> + /* 60% chance of getting combat skill if not already have it */ + <<if $Bodyguard.combatSkill == 0 && random(1,100) <= 60>> + <<set $gainedCombat = 1>> + <<set $Bodyguard.combatSkill = 1>> + <</if>> +<<elseif $leadingTroops == "headGirl">> + <<if $HeadGirl.devotion < -20>> + <<set _slaveMod -= 0.15>> + <<elseif $HeadGirl.devotion > 51>> + <<set _slaveMod += 0.15>> + <</if>> + <<if ($rep < 10000 && $authority < 10000) || $HeadGirl.prestige < 1>> + <<set _militiaMod -= 0.15>> + <<set _mercMod -= 0.15>> + <<set _SFMod -= 0.15>> + <<elseif $HeadGirl.prestige >= 2>> + <<set _militiaMod += 0.10>> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.10>> + <</if>> + <<if (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 3>> + <<set _atkMod += 0.25>> + <<set _defMod += 0.25>> + <<set _tacChance += 0.50>> + <<elseif $HeadGirl.intelligence == 3>> + <<set _atkMod += 0.20>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.35>> + <<elseif (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 2>> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $HeadGirl.intelligence == 2>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career) && $HeadGirl.intelligence >= 1>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.15>> + <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.30>> + <<elseif $HeadGirl.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.25>> + <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $HeadGirl.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.15>> + <</if>> + /* does she get wounded? */ + <<if $HeadGirl.combatSkill == 1>> + <<set _woundChance -= 3>> + <</if>> + <<if $HeadGirl.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $HeadGirl.health >= 50>> + <<set _woundChance -= 2>> + <</if>> + <<if $HeadGirl.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $HeadGirl.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<if random(1,100) <= _woundChance>> + <<set $leaderWounded = 1>> + <<set _militiaMod -= 0.2>> + <<set _slaveMod -= 0.2>> + <<set _mercMod -= 0.2>> + <<set _SFMod -= 0.2>> + <<set _enemyMod += 0.2>> + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + <<set $HeadGirl.voice = 0>> + <<elseif $woundType == 2>> + <<set $HeadGirl.eyes = -2>> + <<elseif $woundType == 3>> + <<set $HeadGirl.amp = 1>> + <<elseif $woundType >= 4>> + <<set $HeadGirl.health -= 40>> + <</if>> + <</if>> + /* 60% chance of getting combat skill if nto already have it */ + <<if $HeadGirl.combatSkill == 0 && random(1,100) <= 60>> + <<set $gainedCombat = 1>> + <<set $HeadGirl.combatSkill = 1>> + <</if>> +<<elseif $leadingTroops == "citizen">> + <<if $arcologies[0].FSDegradationist == "unset" && $arcologies[0].FSPaternalist == "unset">> + <<set _militiaMod += 0.15>> + <<set _slaveMod -= 0.15>> + <<elseif $arcologies[0].FSPaternalist != "unset">> + <<set _militiaMod += 0.15>> + <<set _slaveMod += 0.10>> + <<elseif $arcologies[0].FSDegradationist != "unset">> + <<set _militiaMod += 0.15>> + <<set _slaveMod -= 0.35>> + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset">> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.10>> + <<else>> + <<set _mercMod -= 0.10>> + <<set _SFMod -= 0.10>> + <</if>> + <<set _atkMod += either(-1,1) * random(10) * 0.1>> + <<set _defMod += either(-1,1) * random(10) * 0.1>> + <<set _tacChance += either(-1,1) * random(20) * 0.1>> +<<elseif $leadingTroops == "mercenary">> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.10>> + <<if $arcologies[0].FSRomanRevivalist != "unset">> + <<set _militiaMod += 0.10>> + <<else>> + <<set _militiaMod -= 0.10>> + <</if>> + <<if $arcologies[0].FSDegradationist != "unset">> + <<set _slaveMod -= 0.35>> + <</if>> + <<set _atkMod += random(15) * 0.1>> + <<set _defMod += random(15) * 0.1>> + <<set _tacChance += random(30) * 0.1>> +<<elseif $leadingTroops == "colonel">> + <<set _mercMod += 0.10>> + <<set _SFMod += 0.15>> + <<if $arcologies[0].FSRomanRevivalist != "unset">> + <<set _militiaMod += 0.10>> + <<else>> + <<set _militiaMod -= 0.10>> + <</if>> + <<if $arcologies[0].FSDegradationist != "unset">> + <<set _slaveMod -= 0.35>> + <</if>> + <<set _atkMod += random(30) * 0.1>> + <<set _defMod += random(30) * 0.1>> + <<set _tacChance += random(40) * 0.1>> +<</if>> +/* Terrain and Tactics */ +<<if $battleTerrain == "urban">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.15>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.10>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.25>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.30>> + <</if>> +<<elseif $battleTerrain == "rural">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.15>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.25>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.30>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod += 0.20>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.25>> + <</if>> +<<elseif $battleTerrain == "hills">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.10>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.10>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.15>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.30>> + <</if>> +<<elseif $battleTerrain == "coast">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.10>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.10>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod -= 0.05>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.10>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod += 0.05>> + <<set _defMod -= 0.05>> + <</if>> +<<elseif $battleTerrain == "outskirts">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.15>> + <<set _tacChance -= 0.25>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance -= 0.15>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod += 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance += 0.05>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod += 0.10>> + <<set _defMod -= 0.10>> + <</if>> +<<elseif $battleTerrain == "mountains">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.20>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod += 0.10>> + <<set _defMod -= 0.05>> + <<set _tacChance += 0.05>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.20>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set _tacChance -= 0.20>> + <</if>> +<<elseif $battleTerrain == "wasteland">> + <<if $chosenTactic == "Bait and Bleed">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.10>> + <<elseif $chosenTactic == "Guerrilla">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Choke Points">> + <<set _atkMod -= 0.10>> + <<set _defMod += 0.05>> + <<set _tacChance -= 0.05>> + <<elseif $chosenTactic == "Interior Lines">> + <<set _atkMod += 0.10>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.25>> + <<elseif $chosenTactic == "Defense In Depth">> + <<set _atkMod += 0.05>> + <<set _defMod += 0.10>> + <<set _tacChance += 0.15>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<set _atkMod += 0.15>> + <<set _defMod += 0.15>> + <<set _tacChance += 0.30>> + <<elseif $chosenTactic == "Human Wave">> + <<set _atkMod += 0.20>> + <<set _defMod += 0.05>> + <<set _tacChance += 0.25>> + <</if>> +<</if>> + +<<if $chosenTactic == "Bait and Bleed">> + <<if $attackType == "raiders">> + <<set _tacChance -= 0.10>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.10>> + <<elseif $attackType == "old world">> + <<set _tacChance += 0.25>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance -= 0.15>> + <</if>> +<<elseif $chosenTactic == "Guerrilla">> + <<if $attackType == "raiders">> + <<set _tacChance -= 0.20>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.15>> + <<elseif $attackType == "old world">> + <<set _tacChance += 0.25>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance -= 0.25>> + <</if>> +<<elseif $chosenTactic == "Choke Points">> + <<if $attackType == "raiders">> + <<set _tacChance += 0.25>> + <<elseif $attackType == "free city">> + <<set _tacChance -= 0.05>> + <<elseif $attackType == "old world">> + <<set _tacChance -= 0.10>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance += 0.05>> + <</if>> +<<elseif $chosenTactic == "Interior Lines">> + <<if $attackType == "raiders">> + <<set _tacChance -= 0.15>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.15>> + <<elseif $attackType == "old world">> + <<set _tacChance += 0.20>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance -= 0.10>> + <</if>> +<<elseif $chosenTactic == "Pincer Manouver">> + <<if $attackType == "raiders">> + <<set _tacChance += 0.15>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.10>> + <<elseif $attackType == "old world">> + <<set _tacChance -= 0.10>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance += 0.15>> + <</if>> +<<elseif $chosenTactic == "Defense In Depth">> + <<if $attackType == "raiders">> + <<set _tacChance -= 0.20>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.10>> + <<elseif $attackType == "old world">> + <<set _tacChance += 0.20>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance -= 0.05>> + <</if>> +<<elseif $chosenTactic == "Blitzkrieg">> + <<if $attackType == "raiders">> + <<set _tacChance += 0.10>> + <<elseif $attackType == "free city">> + <<set _tacChance -= 0.20>> + <<elseif $attackType == "old world">> + <<set _tacChance += 0.25>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance -= 0.10>> + <</if>> +<<elseif $chosenTactic == "Human Wave">> + <<if $attackType == "raiders">> + <<set _tacChance -= 0.10>> + <<elseif $attackType == "free city">> + <<set _tacChance += 0.10>> + <<elseif $attackType == "old world">> + <<set _tacChance -= 0.15>> + <<elseif $attackType == "freedom fighters">> + <<set _tacChance += 0.10>> + <</if>> +<</if>> + +/* Calculates if tactics are successful */ +/* minimum chance is 10% */ +<<if _tacChance <= 0>> + <<set _tacChance = 0.1>> +<</if>> +<<if random(1,100) <= _tacChance * 100>> + <<set _enemyMod -= 0.30>> + <<set _militiaMod += 0.20>> + <<set _slaveMod += 0.20>> + <<set _mercMod += 0.20>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<set $tacticsSuccessful = 1>> +<<else>> + <<set _enemyMod += 0.20>> + <<set _militiaMod -= 0.20>> + <<set _slaveMod -= 0.20>> + <<set _mercMod -= 0.20>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.10>> + <<set $tacticsSuccessful = 0>> +<</if>> + +/* enemy morale mods */ +<<if $week < 30>> + <<set _enemyMod += 0.15>> +<<elseif $week < 60>> + <<set _enemyMod += 0.30>> +<<elseif $week < 90>> + <<set _enemyMod += 0.45>> +<<elseif $week < 120>> + <<set _enemyMod += 0.60>> +<<else>> + <<set _enemyMod += 0.75>> +<</if>> + +/* calculates PC army stats */ +<<if $secBots.isDeployed == 1>> + <<set _attack += ($secBotsBaseAttack + $secBotsBaseAttack * $secBots.equip * $equipMod) * _atkMod>> + <<set _defense += ($secBotsBaseDefense + $secBotsBaseDefense * $secBots.equip * $equipMod) * _defMod>> + <<set _hp += $secBotsBaseHp * $secBots.troops>> +<</if>> +<<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].isDeployed == 1>> + <<if $militiaUnits[_i].training <= 10>> + <<set _expBonus = 0>> + <<elseif $militiaUnits[_i].training <= 33>> + <<set _expBonus = 0.10>> + <<elseif $militiaUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $militiaUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $militiaUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $militiaUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($militiaBaseAttack + $militiaBaseAttack * $militiaUnits[_i].equip * $equipMod + $militiaBaseAttack * _expBonus + $militiaBaseAttack * _loyaltyBonus + $militiaBaseAttack * $militiaUnits[_i].SF * 0.20) * _atkMod>> + <<set _defense += ($militiaBaseDefense + $militiaBaseDefense * $militiaUnits[_i].equip * $equipMod + $militiaBaseDefense * _expBonus + $militiaBaseDefense * _loyaltyBonus + $militiaBaseDefense * $militiaUnits[_i].SF * 0.20) * _defMod>> + <<set _hp += ($militiaBaseHp + $militiaBaseHp * $militiaUnits[_i].medics * $equipMod) * $militiaUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].isDeployed == 1>> + <<if $slaveUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $slaveUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $slaveUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $slaveUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $slaveUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($slaveBaseAttack + $slaveBaseAttack * $slaveUnits[_i].equip * $equipMod + $slaveBaseAttack * _expBonus + $slaveBaseAttack * _loyaltyBonus + $slaveBaseAttack * $slaveUnits[_i].SF * 0.20) * _atkMod>> + <<set _defense += ($slaveBaseDefense + $slaveBaseDefense * $slaveUnits[_i].equip * $equipMod + $slaveBaseDefense * _expBonus + $slaveBaseDefense * _loyaltyBonus + $slaveBaseDefense * $slaveUnits[_i].SF * 0.20) * _defMod>> + <<set _hp += ($slaveBaseHp + $slaveBaseHp * $slaveUnits[_i].medics * 0.25) * $slaveUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].isDeployed == 1>> + <<if $mercUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $mercUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $mercUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $mercUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $mercUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($mercBaseAttack + $mercBaseAttack * $mercUnits[_i].equip * $equipMod + $mercBaseAttack * _expBonus + $mercBaseAttack * _loyaltyBonus + $mercBaseAttack * $mercUnits[_i].SF * 0.20) * _atkMod>> + <<set _defense += ($mercBaseDefense + $mercBaseDefense * $mercUnits[_i].equip * $equipMod + $mercBaseDefense * _expBonus + $mercBaseDefense * _loyaltyBonus + $mercBaseDefense * $mercUnits[_i].SF * 0.20) * _defMod>> + <<set _hp += ($mercBaseHp + $mercBaseHp * $mercUnits[_i].medics * 0.25) * $mercUnits[_i].troops>> + <</if>> +<</for>> + +<<if $SFIntervention == 1>> + <<set $SFatk = 0>> + <<set $SFdef = 0>> + <<set $SFhp = 0>> + <<calcSFStatistics>> + <<set _attack += $SFatk>> + <<set _defense += $SFdef>> + <<set _hp += $SFhp>> +<</if>> + +/* morale and baseHp calculation */ +/* minimum modifier is -50%, maximum is +50% */ +<<if _militiaMod < 0.5>> + <<set _militiaMod = 0.5>> +<<elseif _militiaMod > 1.5>> + <<set _militiaMod = 1.5>> +<</if>> +<<if _slaveMod < 0.5>> + <<set _slaveMod = 0.5>> +<<elseif _slaveMod > 1.5>> + <<set _slaveMod = 1.5>> +<</if>> +<<if _mercMod < 0.5>> + <<set _mercMod = 0.5>> +<<elseif _mercMod > 1.5>> + <<set _mercMod = 1.5>> +<</if>> +<<if _SFMod < 0.5>> + <<set _SFMod = 0.5>> +<<elseif _SFMod > 1.5>> + <<set _SFMod = 1.5>> +<</if>> + +<<set $troopCount = 0>> +<<calcTroopCount>> +<<set _moraleTroopMod = Math.clamp($troopCount / 200,1,10)>> + +<<set _morale = ($secBotsMorale * $deployingBots + $militiaBaseMorale * _militiaMod * $deployingMilitia + $slaveBaseMorale * _slaveMod * $deployingSlaves + $mercBaseMorale * _mercMod * $deployingMercs + $SFBaseMorale * $SFIntervention * _SFMod) / ($deployingBots + $deployingMilitia +$deployingSlaves + $deployingMercs + $SFIntervention)>> +<<set _morale = _morale + _morale * $secBarracksUpgrades.luxury * 0.05>> /* barracks bonus */ +<<set _morale *= _moraleTroopMod>> +<<set _baseHp = ($secBotsBaseHp * $deployingBots + $militiaBaseHp * $deployingMilitia + $slaveBaseHp * $deployingSlaves + $mercBaseHp * $deployingMercs + $SFBaseHp * $SFIntervention) / ($deployingBots + $deployingMilitia +$deployingSlaves + $deployingMercs + $SFIntervention)>> + +/* calculates enemy army stats */ +<<if $week <= 30>> + <<set _armyMod = $attackTroops / 80>> +<<elseif $week <= 60>> + <<set _armyMod = $attackTroops / 75>> +<<elseif $week <= 90>> + <<set _armyMod = $attackTroops / 70>> +<<elseif $week <= 120>> + <<set _armyMod = $attackTroops / 65>> +<<else>> + <<set _armyMod = $attackTroops / 60>> +<</if>> +<<set _armyMod = Math.trunc(_armyMod)>> +<<if $majorBattle == 1>> + <<set _armyMod *= 2>> +<</if>> +<<if _armyMod <= 0>> + <<set _armyMod = 1>> +<</if>> + +<<set _enemyMoraleTroopMod = Math.clamp($attackTroops / 400,1,5)>> + +<<if $attackType == "raiders">> + <<set _enemyAttack = ($raBaseAttack + $weapManu * $sellTo.raiders + $raBaseAttack * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense = ($raBaseDefense + $weapManu * $sellTo.raiders + $raBaseDefense * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyMorale = $raBaseMorale * _enemyMod * _enemyMoraleTroopMod>> + <<set _enemyHp = $raBaseHp * $attackTroops>> + <<set _enemyBaseHp = $raBaseHp>> +<<elseif $attackType == "free city">> + <<set _enemyAttack = ($fcBaseAttack + $weapManu * $sellTo.FC + $fcBaseAttack * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense = ($fcBaseDefense + $weapManu * $sellTo.FC + $fcBaseDefense * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyMorale = $fcBaseMorale * _enemyMod * _enemyMoraleTroopMod>> + <<set _enemyHp = $fcBaseHp * $attackTroops>> + <<set _enemyBaseHp = $fcBaseHp>> +<<elseif $attackType == "old world">> + <<set _enemyAttack = ($owBaseAttack + $weapManu * $sellTo.oldWorld + $owBaseAttack * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense = ($owBaseDefense + $weapManu * $sellTo.oldWorld + $owBaseDefense * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyMorale = $owBaseMorale * _enemyMod * _enemyMoraleTroopMod>> + <<set _enemyHp = $owBaseHp * $attackTroops>> + <<set _enemyBaseHp = $owBaseHp>> +<<elseif $attackType == "freedom fighters">> + <<set _enemyAttack = ($ffBaseAttack + $weapManu * $sellTo.oldWorld + $ffBaseAttack * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense = ($ffBaseDefense + $weapManu * $sellTo.oldWorld + $ffBaseDefense * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyMorale = $ffBaseMorale * _enemyMod * _enemyMoraleTroopMod>> + <<set _enemyHp = $ffBaseHp * $attackTroops>> + <<set _enemyBaseHp = $ffBaseHp>> +<</if>> + +/* difficulty */ +<<set _enemyAttack *= $difficulty>> +<<set _enemyDefense *= $difficulty>> +<<set _enemyMorale *= $difficulty>> +<<set _enemyHp *= $difficulty>> +<<set _enemyBaseHp *= $difficulty>> + +<<if isNaN(_attack)>> + <br>@@.red;Error: attack value reported NaN@@ +<</if>> +<<if isNaN(_defense)>> + <br>@@.red;Error: defense value reported NaN@@ +<</if>> +<<if isNaN(_hp)>> + <br>@@.red;Error: hp value reported NaN@@ +<</if>> +<<if isNaN(_morale)>> + <br>@@.red;Error: morale value reported NaN@@ +<</if>> +<<if isNaN(_enemyAttack)>> + <br>@@.red;Error: enemy attack value reported NaN@@ +<</if>> +<<if isNaN(_enemyDefense)>> + <br>@@.red;Error: enemy defense value reported NaN@@ +<</if>> +<<if isNaN(_enemyHp)>> + <br>@@.red;Error: enemy hp value reported NaN@@ +<</if>> +<<if isNaN(_enemyMorale)>> + <br>@@.red;Error: enemy morale value reported NaN@@ +<</if>> + +<<if $showBattleStatistics == 1>> +<<set _atkMod -= 1, _defMod -= 1, _militiaMod -= 1, _mercMod -= 1, _slaveMod -= 1, _SFMod -= 1, _enemyMod -= 1, _moraleTroopMod -= 1, _enemyMoraleTroopMod -= 1, _difficulty = $difficulty -1>> +<<set _atkMod = Math.round(_atkMod * 100)>> +<<set _defMod = Math.round(_defMod * 100)>> +<<set _militiaMod = Math.round(_militiaMod * 100)>> +<<set _mercMod = Math.round(_mercMod * 100)>> +<<set _slaveMod = Math.round(_slaveMod * 100)>> +<<set _SFMod = Math.round(_SFMod * 100)>> +<<set _enemyMod = Math.round(_enemyMod * 100)>> +<<set _barracksBonus = $secBarracksUpgrades.luxury * 5>> +<<set _moraleTroopMod = Math.round(_moraleTroopMod * 100)>> +<<set _enemyMoraleTroopMod = Math.round(_enemyMoraleTroopMod * 100)>> +<<set _difficulty *= 100>> + +__Difficulty__: +<br> +<<if $difficulty == 0.5>> + Very easy +<<elseif $difficulty == 0.75>> + Easy +<<elseif $difficulty == 1>> + Normal +<<elseif $difficulty == 1.25>> + Hard +<<else>> + Very hard +<</if>> +<br> +<br> +__Army__: +<br>troops: <<print $troopCount>> +<br>attack: <<print Math.round(_attack)>> +<br>defense: <<print Math.round(_defense)>> +<br>hp: <<print Math.round(_hp)>> +<br>morale: <<print Math.round(_morale)>> +<br>attack modifier: <<if _atkMod > 0>>+<</if>>_atkMod% +<br>defense modifier: <<if _defMod > 0>>+<</if>>_defMod% +<br>average base HP: <<print Math.round(_baseHp)>> +<br>militia morale modifier: <<if _militiaMod > 0>>+<</if>>_militiaMod% +<br>slaves morale modifier: <<if _slaveMod > 0>>+<</if>>_slaveMod% +<br>mercenaries morale modifier: <<if _mercMod > 0>>+<</if>>_mercMod% +<<if $SFIntervention == 1>> +<br>security force morale modifier: <<if _SFMod > 0>>+<</if>>_SFMod% +<</if>> +<<if $secBarracksUpgrades.luxury >= 1>> +<br>Barracks bonus morale modifier: +<<print _barracksBonus>>% +<</if>> +<<if _moraleTroopMod>> + <br>morale increase due to troop numbers: +<<print _moraleTroopMod>>% +<</if>> +<br> +<br> +__Tactics__: +<br>tactic chance of success: <<print Math.round(_tacChance * 100)>>% +<br>was tactic chosen successful?: <<if $tacticsSuccessful == 1>> yes <<else>> no<</if>> +<br> +<br> +__Enemy__: +<br>enemy troops: <<print $attackTroops>> +<br>enemy attack: <<print Math.round(_enemyAttack)>> +<br>enemy defense: <<print Math.round(_enemyDefense)>> +<br>enemy Hp: <<print Math.round(_enemyHp)>> +<br>enemy morale: <<print Math.round(_enemyMorale)>> +<br>enemy base Hp: <<print Math.round(_enemyBaseHp)>> +<br>enemy morale modifier: <<if _enemyMod > 0>>+<</if>>_enemyMod% +<<if _enemyMoraleTroopMod > 0>> + <br>enemy morale increase due to troop numbers: +<<print _enemyMoraleTroopMod>>% +<</if>> +<br>Difficulty modifier: <<if _difficulty > 0>>+<</if>><<print _difficulty>>% +<</if>> + + +/* simulates the combat by pitting attk against def */ +<<for _i = 0; _i < _turns; _i++>> + <br><br> + <<if $showBattleStatistics == 1>> turn: <<print _i + 1>><</if>> + /* player army attacks */ + <<set _damage = Math.clamp(_attack - _enemyDefense,_attack * 0.1,_attack)>> + <br> + <<if $showBattleStatistics == 1>> player damage: <<print Math.round(_damage)>><</if>> + <<set _enemyHp -= _damage>> + <br> + <<if $showBattleStatistics == 1>> remaining enemy Hp: <<print Math.round(_enemyHp)>><</if>> + <<set $enemyLosses += _damage / _enemyBaseHp>> + <<set _moraleDamage = Math.clamp(_damage / 2 + _damage / _enemyBaseHp,0,_damage*1.5)>> + <<set _enemyMorale -= _moraleDamage>> + <br> + <<if $showBattleStatistics == 1>> remaining enemy morale: <<print Math.round(_enemyMorale)>><</if>> + <<if _enemyHp <= 0 || _enemyMorale <= 0>> + <br> + <<if $showBattleStatistics == 1>> <br>Victory!<</if>> + <<set $battleResult = 3>> + <<set $battleTurns = _i>> + <<break>> + <</if>> + + /* attacker army attacks */ + <<set _damage = _enemyAttack - _defense>> + <<if _damage < _enemyAttack * 0.1>> + <<set _damage = _enemyAttack * 0.1>> + <</if>> + <br> + <<if $showBattleStatistics == 1>> enemy damage: <<print Math.round(_damage)>><</if>> + <<set _hp -= _damage>> + <br> + <<if $showBattleStatistics == 1>> remaining hp: <<print Math.round(_hp)>><</if>> + <<set $losses += _damage / _baseHp>> + <<set _moraleDamage = Math.clamp(_damage / 2 + _damage / _baseHp,0,_damage*1.5)>> + <<set _morale -= _moraleDamage>> + <br> + <<if $showBattleStatistics == 1>> remaining morale: <<print Math.round(_morale)>><</if>> + <<if _hp <= 0 || _morale <= 0>> + <br> + <<if $showBattleStatistics == 1>> <br>Defeat!<</if>> + <<set $battleResult = -3>> + <<set $battleTurns = _i>> + <<break>> + <</if>> +<</for>> +<<if $battleResult != 3 && $battleResult != -3>> + <br> + <<if _morale > _enemyMorale>> + <<if $showBattleStatistics == 1>> <br>Partial victory!<</if>> + <<set $battleResult = 2>> + <<elseif _morale < _enemyMorale>> + <<if $showBattleStatistics == 1>> <br>Partial defeat!<</if>> + <<set $battleResult = -2>> + <</if>> +<</if>> + +<<if $showBattleStatistics == 1>> + <br> + <br>Losses: <<print Math.trunc($losses)>> + <br>Enemy losses: <<print Math.trunc($enemyLosses)>> +<</if>> + +<<if $battleResult > 3 || $battleResult < -3>> + <br><br>@@.red;Error: failed to determine battle result@@ +<</if>> + +<<if $showBattleStatistics == 1 && $majorBattle == 1 && $majorBattleGameOver == 1 && $battleResult == -3>> + <br><br> + <<link "Proceed">> + <<set $gameover to "major battle defeat">> + <<goto "Gameover">> + <</link>> +<<elseif $majorBattle == 1 && $majorBattleGameOver == 1 && $battleResult == -3>> + <<set $gameover to "major battle defeat">> + <<goto "Gameover">> +<<elseif $showBattleStatistics == 1>> + <br><br> + <<link "Proceed">> + <<goto "attackReport">> + <</link>> +<<else>> + <<goto "attackReport">> +<</if>> + +<</if>> /* closes check for bribery */ \ No newline at end of file diff --git a/src/SecExp/attackOptions.tw b/src/SecExp/attackOptions.tw new file mode 100644 index 0000000000000000000000000000000000000000..8ee016fc43eb119051a4b0396b31adefb26b14f0 --- /dev/null +++ b/src/SecExp/attackOptions.tw @@ -0,0 +1,499 @@ +:: attackOptions [nobr] + +<<set $nextButton = " ", $nextLink = "attackOptions", $showEncyclopedia = 1, $encyclopedia = "Battles">> + +<<if $majorBattle == 0>> + <strong>Attack Imminent</strong> +<<else>> + <strong>Major Attack Imminent</strong> +<</if>> +<hr> +<<if $majorBattle == 0>> + <<if $hasFoughtOnce == 1>> + The ominous message dominates the screens of your office, <<print $assistantName>> quickly gathers all information available to prepare for battle. + <<if $attackType == "raiders">> + <<if $recon >= 1>> + A disorganized horde of raiders is coming to your city. To such jackals your arcology surely looks like an appetizing morsel. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the disorganized horde of raiders coming towards the city and quickly reported it. To such jackals your arcology surely looks like an appetizing morsel. + <</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 $recon >= 1>> + A menacing column of consumed mercenaries and slavers is coming to your city. Another free city is ready to use their best tools to hit a dangerous competitor where it hurts. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the menacing column of consumed mercenaries and slavers and rushed to your office to bring the grim news. Another free city is ready to use their best tools to bring down a dangerous competitor. + <</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 $recon >= 1>> + A dangerous looking army of guerrillas is gathering just outside the arcology. Fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the dangerous looking army of guerrillas is gathering just outside the arcology. Fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire. + <</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 strenght 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 $recon >= 1>> + A diciplined yet dusty, scruffy old world army is approaching the confines of your arcology. There's nothing better than a good war to unite the electorate and your arcology is just the perfect target. + Fortunately you knew of their coming, thanks to your recon systems. + <<else>> + Some of your citizens saw the diciplined yet dusty, scruffy old world army is approaching the confines of your arcology. There's nothing better than a good war to unite the electorate and your arcology is just the perfect target. + <</if>> + <br> + Old world expeditions are usually sent to secure resources and trade routs for their nation or, more often, to provide their citizens with a boogey man to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. They however often lack in mobility. + <</if>> + <<else>> + Your assistant interrupted your rest to bring the grim news. You quickly rush to your console, where you can see one of the convoys supplying your arcology has been attacked and looted. It seems a group of desperate looking bandits decided it was a good idea to steal from you. + 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 $assistantName>> quickly gathers all information available to prepare for battle. + <<if $attackType == "raiders">> + <<if $recon >= 1>> + A massive, disorganized horde of raiders is coming to your city. It seems a warlord of the wastelands massed 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 massed 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 $recon >= 1>> + A massive, menacing column of consumed mercenaries and slavers 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 consumed mercenaries and slavers 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 $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 strenght 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 $recon >= 1>> + A massive, diciplined ld 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, diciplined 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 routs for their nation or, more often, to provide their citizens with a boogey man to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. They however often lack in mobility. + <</if>> + <<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 $recon >= 1>> + A massive, disorganized horde of raiders is coming to your city. It seems a warlord of the wastelands massed 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 massed 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 $recon >= 1>> + A massive, menacing column of consumed mercenaries and slavers 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 consumed mercenaries and slavers 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 $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 strenght 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 $recon >= 1>> + A massive, diciplined ld 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, diciplined 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 routs for their nation or, more often, to provide their citizens with a boogey man to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. They however often lack in mobility. + <</if>> + <</if>> +<</if>> +<br><br> +__Recon__: +<br> +It seems your troops and your adversary will fight +<<if $battleTerrain == "rural">> + in <strong>the rural land</strong> surrounding the free city. +<<elseif $battleTerrain == "urban">> + in the old <strong>abandoned city</strong> surrounding the free city. +<<elseif $battleTerrain == "hills">> + on <strong>the hills</strong> around the free city. +<<elseif $battleTerrain == "coast">> + along <strong>the coast</strong> just outside the free city. +<<elseif $battleTerrain == "outskirts">> + right against <strong>the walls of the arcology.</strong> +<<elseif $battleTerrain == "mountains">> + in <strong>the mountains</strong> overlooking the arcology. +<<elseif $battleTerrain == "wasteland">> + in <strong>the wastelands</strong> outside the free city territory. +<<elseif $battleTerrain == "error">> + <br>@@.red;Error: failed to assign terrain@@. battleTerrain reads "<<print $battleTerrain>>". +<<else>> + <br>@@.red;Error: failed to read terrain@@. battleTerrain reads "<<print $battleTerrain>>". +<</if>> +<<if $recon == 3>> + Your recon capabilities are top notch. The information collected will be most likely correct or very close to be so: +<<elseif $recon == 2>> + Your recon capabilities are decent. The information collected will be mostly close to the truth: +<<elseif $recon == 1>> + Your recon capabilities are fairly low. The information collected will be quite inaccurate: +<<else>> + Your recon capabilities are almost non-existent. The information collected will be wild guesses at best: +<</if>> +approximately <strong><<print $estimatedMen>> men</strong> are coming, they seems to be +<<if $expectedEquip <= 0>> + <strong>poorly armed</strong>. Old rusty small arms are the norm with just a few barely working civilian vehicles. +<<elseif $expectedEquip == 1>> + <strong>lightly armed</strong>. Mostly small arms with some repurposed civilian vehicles and a scattered few machine guns. There's no sign of heavy vehicles, artillery or aircrafts. +<<elseif $expectedEquip == 2>> + <strong>decently armed</strong>. Good quality small arms, machine guns a few mortars. There seems to be some heavy military vehicles coming as well. +<<elseif $expectedEquip == 3>> + <strong>well armed</strong>. High quality small arms, snipers, demolitions teams, heavy duty machine guns and mortars. Heavy military vehicles are numerous and a few artillery piecies are accompaning the detachment. +<<elseif $expectedEquip >= 4>> + <strong>extremely well armed</strong>. Excellent small arms and specialized teams with heavy duty infantry support weapons. Heavy presence of armored military vehicles, artillery pieces and even some attack helicopters. +<</if>> + +<hr> +__Battle Plan__: +<br> + +/* leader assignment */ +<span id="leader"><strong><<print $assistantName>></strong></span> will lead your troops. + <br> + <<link "Personally join the battle">> + <<set $leadingTroops = "PC">> + <<replace "#leader">><strong><<print $PC.name>></strong><</replace>> + <</link>> + | + <<link "Let $assistantName lead the troops">> + <<set $leadingTroops = "assistant">> + <<replace "#leader">><strong><<print $assistantName>></strong><</replace>> + <</link>> + <<if $Bodyguard != 0 && $slavesOfficers == 1>> + | + <<link "Let your bodyguard lead your troops">> + <<set $leadingTroops = "bodyguard">> + <<replace "#leader">><strong><<print $Bodyguard.slaveName>></strong><</replace>> + <</link>> + <</if>> + <<if $HeadGirl != 0 && $slavesOfficers == 1>> + | + <<link "Let your head girl lead your troops">> + <<set $leadingTroops = "headGirl">> + <<replace "#leader">><strong><<print $HeadGirl.slaveName>></strong><</replace>> + <</link>> + <</if>> + <<if $militiaFounded == 1>> + | + <<link "Let the citizens' militia officers lead the troops">> + <<set $leadingTroops = "citizen">> + <<replace "#leader">><strong>The citizens' militia commander</strong><</replace>> + <</link>> + <</if>> + <<if $mercenaries > 0>> + | + <<link "Let the mercenary officers lead the troops">> + <<set $leadingTroops = "mercenary">> + <<replace "#leader">><strong>The mercenary commander</strong><</replace>> + <</link>> + <</if>> + <<if $securityForceCreate == 1>> + | + <<link "Let the colonel lead the troops">> + <<set $leadingTroops = "colonel">> + <<replace "#leader">><strong>$securityForceName's colonel</strong><</replace>> + <</link>> + <</if>> + +/* troop deployment */ +<br><br> +With your current readiness level you can <<if $deployedUnits > 0>>still send <strong><<print $deployableUnits>></strong> more units.<<else>>send <strong><<print $deployableUnits>></strong> units.<</if>> +<br>Deployable units: +<br> +<<set _mL = $militiaUnits.length>> +<<set _sL = $slaveUnits.length>> +<<set _meL = $mercUnits.length>> +<<if $deployableUnits > 0>> + <<if $secBots.active == 1 && $secBots.isDeployed == 0 && $secBots.troops > 0>> + <br> + <<secBotsDescription>> + <br> + <<link "Deploy the unit">> + <<set $secBots.isDeployed = 1>> + <<set $deployableUnits-->> + <<set $deployedUnits++>> + <<set $deployingBots = 1>> + <<goto "attackOptions">> + <</link>> + <</if>> + <<for _i = 0; _i < _mL; _i++>> + <<capture _i>> + <<if $militiaUnits[_i].active == 1 && $militiaUnits[_i].isDeployed == 0 && $militiaUnits[_i].troops > 0>> + <br> + <<militiaUnitsDescription $militiaUnits[_i]>> + <br> + <<link "Deploy the unit">> + <<set $militiaUnits[_i].isDeployed = 1>> + <<set $deployableUnits-->> + <<set $deployedUnits++>> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> + <<for _i = 0; _i < _sL; _i++>> + <<capture _i>> + <<if $slaveUnits[_i].active == 1 && $slaveUnits[_i].isDeployed == 0 && $slaveUnits[_i].troops > 0>> + <br> + <<slaveUnitsDescription $slaveUnits[_i]>> + <br> + <<link "Deploy the unit">> + <<set $slaveUnits[_i].isDeployed = 1>> + <<set $deployableUnits-->> + <<set $deployedUnits++>> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> + <<for _i = 0; _i < _meL; _i++>> + <<capture _i>> + <<if $mercUnits[_i].active == 1 && $mercUnits[_i].isDeployed == 0 && $mercUnits[_i].troops > 0>> + <br> + <<mercUnitsDescription $mercUnits[_i]>> + <br> + <<link "Deploy the unit">> + <<set $mercUnits[_i].isDeployed = 1>> + <<set $deployableUnits-->> + <<set $deployedUnits++>> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> +<<else>> + <br> + <strong>Unit roster full.</strong> +<</if>> + +<br><br> + +Units about to be deployed: +<br> +<<if $deployedUnits > 0>> + <<if $secBots.isDeployed == 1>> + <br> + <<secBotsDescription>> + <br> + <<link "Remove the unit">> + <<set $secBots.isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<set $deployingBots = 0>> + <<goto "attackOptions">> + <</link>> + <</if>> + <<for _i = 0; _i < _mL; _i++>> + <<capture _i>> + <<if $militiaUnits[_i].isDeployed == 1>> + <br> + <<militiaUnitsDescription $militiaUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $militiaUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> + <<for _i = 0; _i < _sL; _i++>> + <<capture _i>> + <<if $slaveUnits[_i].isDeployed == 1>> + <br> + <<slaveUnitsDescription $slaveUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $slaveUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> + <<for _i = 0; _i < _meL; _i++>> + <<capture _i>> + <<if $mercUnits[_i].isDeployed == 1>> + <br> + <<mercUnitsDescription $mercUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $mercUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackOptions">> + <</link>> + <</if>> + <</capture>> + <</for>> +<</if>> + +<<if $majorBattle == 1 && $securityForceCreate == 1>> + <br> + <br> + The size of the incoming attack warrants the intervention of the security force in its full force. They will <span id="SFI">not intervene</span>. + <br> + <<if $SFIntervention == 0>> + <<link "Let the Security force intervene">> + <<set $SFIntervention = 1>> + <<replace "#SFI">> + intervene + <</replace>> + <</link>> + //The security force will join the battle with all the equipment they can mobilize within a short timeframe// + <<else>> + <<link "Do not let the Security force intervene">> + <<set $SFIntervention = 0>> + <<replace "#SFI">> + not intevene + <</replace>> + <</link>> + //The security force will not join the battle// + <</if>> + <br>//Some upgrades will be able to support the troops even if the security force does not intervene directly in the fight.// +<</if>> + +<br><br> + +/* tactics */ +For this battle you choose to follow <span id="tactic"><strong><<print $chosenTactic>></strong></span> tactics. +<br><br> +Defensive tactics +<br> +<<link "Bait and Bleed">> + <<set $chosenTactic = "Bait and Bleed">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Combines bait and switch tactics with guerriglia style assaults, with the objective of slowly bleed the enemy.// +<br> +<<link "Guerrilla">> + <<set $chosenTactic = "Guerrilla">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves using terrain knowledge and small fast attacks to hinder and weaken the enemy.// +<br> +<<link "Choke Points">> + <<set $chosenTactic = "Choke Points">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves using terrain knowledge and strong fortifications in order to stop the enemy on its track.// +<br> +<<link "Interior Lines">> + <<set $chosenTactic = "Interior Lines">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves exploiting a defender's shorter logistics lines and redeployment times in order to keep the enemy pressured.// +<br> +<<link "Pincer Manouver">> + <<set $chosenTactic = "Pincer Manouver">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves letting the enemy push back the centre in order to envelop their formation.// +<br> +<<link "Defense In Depth">> + <<set $chosenTactic = "Defense In Depth">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves letting the enemy gain terrain to gain tactical superiority by alternating between delaying actions and small counterattacks.// +<br> +Offensive Tactics +<br> +<<link "Blitzkrieg">> + <<set $chosenTactic = "Blitzkrieg">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves breaking the front of the enemy with a fast armored force concentrated into a small area.// +<br> +<<link "Human Wave">> + <<set $chosenTactic = "Human Wave">> + <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> +<</link>> +<br> //Involves assaulting the enemy with large numbers of infantry to overwhelm their lines.// +<br> +<br> +<<if $deployedUnits > 0>> + <<link "Send your orders">> + <<set $battleResult = 4>> /* sets $battleResult value outside accepted range to avoid evaluation problems */ + <<if $hasFoughtOnce == 0>> + <<set $hasFoughtOnce = 1>> + <</if>> + <<set $foughtThisWeek = 1>> + <<goto "attackHandler">> + <</link>> +<<else>> + You need at least a unit in your roster to proceed to battle. +<</if>> +<br> +<<link "Surrender">> + <<set $battleResult = -1>> + <<if $hasFoughtOnce == 0>> + <<set $hasFoughtOnce = 1>> + <</if>> + <<set $foughtThisWeek = 1>> + <<goto "attackReport">> +<</link>> +<br> +/* calculates bribe cost */ +<<if $week <= 30>> + <<set $bribeCost = 5000 + $baseBribePerAttacker * $attackTroops>> +<<elseif $week <= 30>> + <<set $bribeCost = 10000 + $baseBribePerAttacker * $attackTroops>> +<<elseif $week <= 30>> + <<set $bribeCost = 15000 + $baseBribePerAttacker * $attackTroops>> +<<elseif $week <= 30>> + <<set $bribeCost = 20000 + $baseBribePerAttacker * $attackTroops>> +<<elseif $week <= 30>> + <<set $bribeCost = 25000 + $baseBribePerAttacker * $attackTroops>> +<</if>> +<<if $majorBattle == 1>> + <<set $bribeCost *= 3>> +<</if>> + +<<link "Attempt to bribe">> + <<set $battleResult = 1>> + <<if $hasFoughtOnce == 0>> + <<set $hasFoughtOnce = 1>> + <</if>> + <<set $foughtThisWeek = 1>> + <<goto "attackHandler">> +<</link>> +<br> //Will cost around ¤<<print Math.round($bribeCost * (1 + either(-1,1) * random(2) * 0.1))>> (estimate).// \ No newline at end of file diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..b6f921182ff98da7ad6ef7a5f852b1e5d30abebe --- /dev/null +++ b/src/SecExp/attackReport.tw @@ -0,0 +1,1459 @@ +:: attackReport [nobr] + +<<set $nextButton = "Continue", $nextLink = "Scheduled Event", $showEncyclopedia = 1, $encyclopedia = "Battles">> + +/*init*/ +<<set _oldRep = $rep>> +<<set _oldAuth = $authority>> +<<set $enemyLosses = Math.trunc($enemyLosses)>> +<<if $enemyLosses > $attackTroops>> + <<set $enemyLosses = $attackTroops>> +<</if>> +<<set $totalKills += $enemyLosses>> +<<set $losses = Math.trunc($losses)>> +<<set _loot = 0>> + +/* result */ +<<if $majorBattle == 0>> + <<set $battlesCount++>> + <<set _majorBattleMod = 1>> + <<if $battleResult == 3>> + <strong>Victory!</strong> + <<set $PClossStreak = 0>> + <<set $PCvictoryStreak += 1>> + <<set $PCvictories++>> + <<elseif $battleResult == -3>> + <strong>Defeat!</strong> + <<set $PClossStreak += 1>> + <<set $PCvictoryStreak = 0>> + <<set $PClosses++>> + <<elseif $battleResult == 2>> + <strong>Partial victory!</strong> + <<set $PCvictories++>> + <<elseif $battleResult == -2>> + <strong>Partial defeat!</strong> + <<set $PClosses++>> + <<elseif $battleResult == -1>> + <strong>We surrendered</strong> + <<set $PClosses++>> + <<elseif $battleResult == 0>> + <strong>Failed bribery!</strong> + <<set $PClosses++>> + <<elseif $battleResult == 1>> + <strong>Successful bribery!</strong> + <<set $PCvictories++>> + <</if>> +<<else>> + <<set _majorBattleMod = 2>> + <<set $battlesCount++>> + <<set $majorBattlesCount++>> + <<if $battleResult == 3>> + <strong>Major victory!</strong> + <<set $PClossStreak = 0>> + <<set $PCvictoryStreak += 1>> + <<set $PCvictories++>> + <<elseif $battleResult == -3>> + <strong>Major Defeat!</strong> + <<set $PClossStreak += 1>> + <<set $PCvictoryStreak = 0>> + <<set $PClosses++>> + <<elseif $battleResult == 2>> + <strong>Partial victory!</strong> + <<set $PCvictories++>> + <<elseif $battleResult == -2>> + <strong>Partial defeat!</strong> + <<set $PClosses++>> + <<elseif $battleResult == -1>> + <strong>We surrendered</strong> + <<set $PClosses++>> + <<elseif $battleResult == 0>> + <strong>Failed bribery!</strong> + <<set $PClosses++>> + <<elseif $battleResult == 1>> + <strong>Successful bribery!</strong> + <<set $PCvictories++>> + <</if>> +<</if>> +<<set _day = $day + random(0,7)>> +<<set _month = $month>> +<<set _year = $year>> +<<switch _month>> +<<case "January">> +<<if _day > 31>> + <<set _day -= 31, _month = "February">> +<</if>> +<<case "February">> +<<if _day > 28>> + <<set _day -= 28, _month = "March">> +<</if>> +<<case "March">> +<<if _day > 31>> + <<set _day -= 31, _month = "April">> +<</if>> +<<case "April">> +<<if _day > 30>> + <<set _day -= 30, _month = "May">> +<</if>> +<<case "May">> +<<if _day > 31>> + <<set _day -= 31, _month = "June">> +<</if>> +<<case "June">> +<<if _day > 30>> + <<set _day -= 30, _month = "July">> +<</if>> +<<case "July">> +<<if _day > 31>> + <<set _day -= 31, _month = "August">> +<</if>> +<<case "August">> +<<if _day > 31>> + <<set _day -= 31, _month = "September">> +<</if>> +<<case "September">> +<<if _day > 30>> + <<set _day -= 30, _month = "October">> +<</if>> +<<case "October">> +<<if _day > 31>> + <<set _day -= 31, _month = "November">> +<</if>> +<<case "November">> +<<if _day > 30>> + <<set _day -= 30, _month = "December">> +<</if>> +<<default>> +<<if _day > 31>> + <<set _day -= 31, _month = "January", _year += 1>> +<</if>> +<</switch>> +<hr> + +<<if $attackType == "raiders">> + Today, the _day of _month _year, our arcology was attacked by a band of wild raiders, $attackTroops men strong. + <<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>> + Our defense forces, $troopCount strong, clashed with them + <<if $battleTerrain == "urban">> + in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>, + <<elseif $battleTerrain == "rural">> + in the rural land surrounding the free city, + <<elseif $battleTerrain == "hills">> + on the hills around the free city, + <<elseif $battleTerrain == "coast">> + along the coast just outside the free city, + <<elseif $battleterrain == "outskirts">> + just against the walls of the arcology, + <<elseif $battleTerrain == "mountains">> + in the mountains overlooking the arcology, + <<elseif $battleTerrain == "wasteland">> + in the wastelands outside the free city territory, + <</if>> + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <</if>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the disorganized horde futile attempt at raiding your arcology + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the disorganized horde attempt at raiding your arcology + <<else>> + The fight was long and hard, but our men managed to stop the horde raiding party + <</if>> + <<if $PCvictoryStreak >= 2>> + , adding another victory to the growing list of our military's successes. + <<elseif $PClossStreak >= 2>> + , finally putting an end to a series of unfortunate defeats. + <<else>> + . + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the barbaric horde of raiders + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the bandits proved too much to handle for our men + <<else>> + The fight was long and hard, but despite their bravery the horde proved too much for our men + <</if>> + <<if $PCvictoryStreak >= 2>> + , so interrupting a long series of military successes. + <<elseif $PClossStreak >= 2>> + , confirming the long list of recent failures our armed forces collected. + <<else>> + . + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to repel the raiders, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the horde raiders, which was fortunately unable to capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <<elseif $battleResult == 0>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <<elseif $battleResult == 1>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <</if>> +<<elseif $attackType == "free city">> + Today, the _day of _month _year, our arcology was attacked by a contingent of mercenaries hired by a competing free city, $attackTroops men strong. + <<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>> + Our defense forces, $troopCount strong, clashed with them + <<if $battleTerrain == "urban">> + in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>, + <<elseif $battleTerrain == "rural">> + in the rural land surrounding the free city, + <<elseif $battleTerrain == "hills">> + on the hills around the free city, + <<elseif $battleTerrain == "coast">> + along the coast just outside the free city, + <<elseif $battleterrain == "outskirts">> + just against the walls of the arcology, + <<elseif $battleTerrain == "mountains">> + in the mountains overlooking the arcology, + <<elseif $battleTerrain == "wasteland">> + in the wastelands outside the free city territory, + <</if>> + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <</if>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the mercenaries dead in their tracks + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the slavers attempt at weakening your arcology + <<else>> + The fight was long and hard, but our men managed to stop the free city mercenaries + <</if>> + <<if $PCvictoryStreak >= 2>> + , adding another victory to the growing list of our military's successes. + <<elseif $PClossStreak >= 2>> + , finally putting an end to a series of unfortunate defeats. + <<else>> + . + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the consumed mercenary veterans sent against us + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the slavers proved too much to handle for our men + <<else>> + The fight was long and hard, but despite their bravery the mercenary slavers proved too much for our men + <</if>> + <<if $PCvictoryStreak >= 2>> + , so interrupting a long series of military successes. + <<elseif $PClossStreak >= 2>> + , confirming the long list of recent failures our armed forces collected. + <<else>> + . + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to repel the mercenaries, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the slavers, which were fortunately unable to capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <<elseif $battleResult == 0>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <<elseif $battleResult == 1>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <</if>> +<<elseif $attackType == "freedom fighters">> + Today, the _day of _month _year, our arcology was attacked by a group of freedom fighters bent on the destruction of the institution of slavery, $attackTroops men strong. + <<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>> + Our defense forces, $troopCount strong, clashed with them + <<if $battleTerrain == "urban">> + in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>, + <<elseif $battleTerrain == "rural">> + in the rural land surrounding the free city, + <<elseif $battleTerrain == "hills">> + on the hills around the free city, + <<elseif $battleTerrain == "coast">> + along the coast just outside the free city, + <<elseif $battleterrain == "outskirts">> + just against the walls of the arcology, + <<elseif $battleTerrain == "mountains">> + in the mountains overlooking the arcology, + <<elseif $battleTerrain == "wasteland">> + in the wastelands outside the free city territory, + <</if>> + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <</if>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the freedom fighters dead in their tracks + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the fighters attack + <<else>> + The fight was long and hard, but our men managed to stop the freedom fighters + <</if>> + <<if $PCvictoryStreak >= 2>> + , adding another victory to the growing list of our military's successes. + <<elseif $PClossStreak >= 2>> + , finally putting an end to a series of unfortunate defeats. + <<else>> + . + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the fanatical fury of the freedom fighters + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the freedom fighters proved too much to handle for our men + <<else>> + The fight was long and hard, but despite their bravery the freedom fighters fury proved too much for our men + <</if>> + <<if $PCvictoryStreak >= 2>> + , so interrupting a long series of military successes. + <<elseif $PClossStreak >= 2>> + , confirming the long list of recent failures our armed forces collected. + <<else>> + . + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to repel the freedom fighters, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the freedom fighters, which were fortunately unable to capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <<elseif $battleResult == 0>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <<elseif $battleResult == 1>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <</if>> +<<elseif $attackType == "old world">> + Today, the _day of _month _year, our arcology was attacked by an old world nation boasting a misplaced sense of superiority, $attackTroops men strong. + <<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>> + Our defense forces, $troopCount strong, clashed with them + <<if $battleTerrain == "urban">> + in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>, + <<elseif $battleTerrain == "rural">> + in the rural land surrounding the free city, + <<elseif $battleTerrain == "hills">> + on the hills around the free city, + <<elseif $battleTerrain == "coast">> + along the coast just outside the free city, + <<elseif $battleterrain == "outskirts">> + just against the walls of the arcology, + <<elseif $battleTerrain == "mountains">> + in the mountains overlooking the arcology, + <<elseif $battleTerrain == "wasteland">> + in the wastelands outside the free city territory, + <</if>> + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <</if>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the old world soldiers dead in their tracks + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the soldiers of the old world + <<else>> + The fight was long and hard, but our men managed to stop the old world soldiers + <</if>> + <<if $PCvictoryStreak >= 2>> + , adding another victory to the growing list of our military's successes. + <<elseif $PClossStreak >= 2>> + , finally putting an end to a series of unfortunate defeats. + <<else>> + . + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the discipline of the old world armies + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the old world proved too much to handle for our men + <<else>> + The fight was long and hard, but despite their bravery the determination of the old world troops proved too much for our men + <</if>> + <<if $PCvictoryStreak >= 2>> + , so interrupting a long series of military successes. + <<elseif $PClossStreak >= 2>> + , confirming the long list of recent failures our armed forces collected. + <<else>> + . + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to repel the old world soldiers, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the old world soldiers, which were fortunately unable to capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <<elseif $battleResult == 0>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <<elseif $battleResult == 1>> + You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls. + <</if>> +<</if>> +<br><br> +/* calculates effects on the city */ +<<if $battleResult == 3>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ increased. You were also able to capture + <<if $attackType == "raiders">> + <<set $rep += 800 * _majorBattleMod>> + <<set $authority += 800 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep += 1200 * _majorBattleMod>> + <<set $authority += 1200 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep += 1500 * _majorBattleMod>> + <<set $authority += 1500 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep += 1200 * _majorBattleMod>> + <<set $authority += 1200 * _majorBattleMod>> + <</if>> + <<if $attackTroops - $enemyLosses <= 50>> + a small amount of attackers, + <<set _captives = ($attackTroops - $enemyLosses) * 0.1 * random(1,3)>> + <<elseif $attackTroops - $enemyLosses <= 100>> + an healthy group of attackers, + <<set _captives = ($attackTroops - $enemyLosses) * 0.1 * random(1,3)>> + <<elseif $attackTroops - $enemyLosses <= 150>> + a big group of attackers, + <<set _captives = ($attackTroops - $enemyLosses) * 0.1 * random(1,3)>> + <<elseif $attackTroops - $enemyLosses <= 200>> + a huge group of attackers, + <<set _captives = ($attackTroops - $enemyLosses) * 0.1 * random(1,3)>> + <<elseif $attackTroops - $enemyLosses > 200>> + a great amount of attackers, + <<set _captives = ($attackTroops - $enemyLosses) * 0.1 * random(1,3)>> + <</if>> + and some of their equipment, which once sold produced + <<if $attackEquip == 0>> + @@.yellowgreen;a small amount of cash.@@ + <<set _loot += 1000 * _majorBattleMod>> + <<elseif $attackEquip == 1>> + @@.yellowgreen;a moderate amount of cash.@@ + <<set _loot += 5000 * _majorBattleMod>> + <<elseif $attackEquip == 2>> + @@.yellowgreen;a good amount of cash.@@ + <<set _loot += 10000 * _majorBattleMod>> + <<elseif $attackEquip == 3>> + @@.yellowgreen;a great amount of cash.@@ + <<set _loot += 15000 * _majorBattleMod>> + <<elseif $attackEquip == 4>> + @@.yellowgreen;wealth worthy of the mightiest warlord.@@ + <<set _loot += 20000 * _majorBattleMod>> + <</if>> + <<if $mercSoldierPrivilege == 1 && $deployingMercs == 1>> + Part of the loot is distributed to your mercenaries. + <<set _captives = Math.trunc(_captives * 0.6)>> + <<set _loot = Math.trunc(_loot * 0.6)>> + <</if>> + <<set $cash += _loot>> + <br> + Damage to the infrastructure was @@.yellow;virtually non-existent@@, costing only pocket cash to bring the structure back to normal. The inhabitants as well reported little to no injuries, because of this the prosperity of the arcology did not suffer. + <<set $cash -= 1000 * _majorBattleMod>> + <<if $PCvictoryStreak >= 3>> + It seems your victories over the constant threats directed your way is having @@.green;a positive effect on the prosperity of the arcology@@, due to the security your leadership affords. + <<set $arcologies[0].prosperity += 5 * _majorBattleMod>> + <</if>> +<<elseif $battleResult == -3>> + Due to your defeat, your @@.red;reputation@@ and @@.red;authority@@ decreased. Obviously your troops were not able to capture anyone or anything. + <<if $attackType == "raiders">> + <<set $rep -= 400 * _majorBattleMod>> + <<set $authority -= 400 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep -= 600 * _majorBattleMod>> + <<set $authority -= 600 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep -= 750 * _majorBattleMod>> + <<set $authority -= 750 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep -= 600 * _majorBattleMod>> + <<set $authority -= 600 * _majorBattleMod>> + <</if>> + <br> + In the raiding following the battle @@.red;the arcology sustained heavy damage@@, which will cost quite the amount of cash to fix. Reports of @@.red;citizens or slaves killed or missing@@ flood your office for a few days following the defeat. + <<set $cash -= 5000 * _majorBattleMod>> + <<if $week <= 30>> + <<set $ACitizens -= random(100) * _majorBattleMod>> + <<set $ASlaves -= random(150) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(5) * _majorBattleMod>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(120) * _majorBattleMod>> + <<set $ASlaves -= random(170) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(10) * _majorBattleMod>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(140) * _majorBattleMod>> + <<set $ASlaves -= random(190) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(15) * _majorBattleMod>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(160) * _majorBattleMod>> + <<set $ASlaves -= random(210) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(20) * _majorBattleMod>> + <<else>> + <<set $ACitizens -= random(180) * _majorBattleMod>> + <<set $ASlaves -= random(230) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(25) * _majorBattleMod>> + <</if>> + <<if $PClossStreak >= 3>> + This only confirms the fears of many, @@.red;your arcology is not safe@@ and it is clear their business will be better somewhere else. + <<set $arcologies[0].prosperity -= 5 * _majorBattleMod>> + <</if>> +<<elseif $battleResult == 2>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ slightly increased. Our men were not able to capture any attacker, however some equipment was seized during the enemy hasty retreat, + <<if $attackType == "raiders">> + <<set $rep += 200 * _majorBattleMod>> + <<set $authority += 200 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep += 300 * _majorBattleMod>> + <<set $authority += 300 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep += 450 * _majorBattleMod>> + <<set $authority += 450 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep += 300 * _majorBattleMod>> + <<set $authority += 300 * _majorBattleMod>> + <</if>> + which once sold produced + <<if $attackEquip == 0>> + @@.yellowgreen;a bit of cash.@@ + <<set _loot += 500 * _majorBattleMod>> + <<elseif $attackEquip == 1>> + @@.yellowgreen;a small amount of cash.@@ + <<set _loot += 2500 * _majorBattleMod>> + <<elseif $attackEquip == 2>> + @@.yellowgreen;a moderate amount of cash.@@ + <<set _loot += 5000 * _majorBattleMod>> + <<elseif $attackEquip == 3>> + @@.yellowgreen;a good amount of cash.@@ + <<set _loot += 7500 * _majorBattleMod>> + <<elseif $attackEquip == 4>> + @@.yellowgreen;a great amount of cash.@@ + <<set _loot += 10000 * _majorBattleMod>> + <</if>> + <<if $mercSoldierPrivilege == 1 && $deployingMercs == 1>> + Part of the loot is distributed to your mercenaries. + <<set _loot = Math.trunc(_loot * 0.6)>> + <</if>> + <<set $cash += _loot>> + <br> + Damage to the city was @@.red;limited@@, it won't take much to rebuild. Very few citizens or slaves were involved in the fight and even fewer met their end, safeguarding the prosperity of the arcology. + <<set $cash -= 2000 * _majorBattleMod>> + <<set $ACitizens -= random(10) * _majorBattleMod>> + <<set $ASlaves -= random(20) * _majorBattleMod>> +<<elseif $battleResult == -2>> + It was a close defeat, but nonetheless your @@.red;reputation@@ and @@.red;authority@@ slightly decreased. Your troops were not able to capture anyone or anything. + <<if $attackType == "raiders">> + <<set $rep -= 40 * _majorBattleMod>> + <<set $authority -= 40 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep -= 60 * _majorBattleMod>> + <<set $authority -= 60 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep -= 75 * _majorBattleMod>> + <<set $authority -= 75 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep -= 60 * _majorBattleMod>> + <<set $authority -= 60 * _majorBattleMod>> + <</if>> + <br> + The enemy did not have the strength to raid the arcology for long, still @@.red;the arcology sustained some damage damage@@, which will cost a moderate amount of cash to fix. Some citizens and slaves found themselves on the wrong end of a gun and met their demise. + Some business sustained heavy damage, slightly impacting the arcology's prosperity. + <<set $cash -= 3000 * _majorBattleMod>> + <<if $week <= 30>> + <<set $ACitizens -= random(50) * _majorBattleMod>> + <<set $ASlaves -= random(75) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(2) * _majorBattleMod>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(60) * _majorBattleMod>> + <<set $ASlaves -= random(65) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(5) * _majorBattleMod>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(70) * _majorBattleMod>> + <<set $ASlaves -= random(95) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(7) * _majorBattleMod>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(80) * _majorBattleMod>> + <<set $ASlaves -= random(105) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(10) * _majorBattleMod>> + <<else>> + <<set $ACitizens -= random(90) * _majorBattleMod>> + <<set $ASlaves -= random(115) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(12) * _majorBattleMod>> + <</if>> +<<elseif $battleResult == -1>> + Rather than waste the lives of your men you decided to surrender, hoping your enemy will cause less damage if you indulge them, this is however a big hit to your status. Your @@.red;reputation@@ and @@.red;authority@@ are significantly impacted. + <<if $attackType == "raiders">> + <<set $rep -= 600 * _majorBattleMod>> + <<set $authority -= 600 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep -= 800 * _majorBattleMod>> + <<set $authority -= 800 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep -= 1000 * _majorBattleMod>> + <<set $authority -= 1000 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep -= 800 * _majorBattleMod>> + <<set $authority -= 800 * _majorBattleMod>> + <</if>> + <br> + The surrender allows the arcology to survive @@.red;mostly intact@@, however reports of @@.red;mass looting and killing of citizens@@ flood your office for a few days. + <<set $cash -= 1000 * _majorBattleMod>> + <<if $week <= 30>> + <<set $ACitizens -= random(80) * _majorBattleMod>> + <<set $ASlaves -= random(120) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(5) * _majorBattleMod>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(100) * _majorBattleMod>> + <<set $ASlaves -= random(140) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(10) * _majorBattleMod>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(120) * _majorBattleMod>> + <<set $ASlaves -= random(160) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(15) * _majorBattleMod>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(140) * _majorBattleMod>> + <<set $ASlaves -= random(180) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(20) * _majorBattleMod>> + <<else>> + <<set $ACitizens -= random(160) * _majorBattleMod>> + <<set $ASlaves -= random(190) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(25) * _majorBattleMod>> + <</if>> +<<elseif $battleResult == 0>> + Unfortunately your adversary did not accept your money. <<if $attackType == "freedom fighters">> Their ideological crusade would not allow such thing<<else>>They saw your attempt as nothing more than admission of weakness<</if>>. There was no time to organize a defense and so the enemy walked into the arcology as it was his. + Your reputation and authority suffer a hit. + <<if $attackType == "raiders">> + <<set $rep -= 400 * _majorBattleMod>> + <<set $authority -= 400 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep -= 600 * _majorBattleMod>> + <<set $authority -= 600 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep -= 750 * _majorBattleMod>> + <<set $authority -= 750 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep -= 600 * _majorBattleMod>> + <<set $authority -= 600 * _majorBattleMod>> + <</if>> + <br> + Fortunately the arcology survives @@.yellow;mostly intact@@, however reports of @@.red;mass looting and killing of citizens@@ flood your office for a few days. + <<set $cash -= 1000>> + <<if $week <= 30>> + <<set $ACitizens -= random(80) * _majorBattleMod>> + <<set $ASlaves -= random(120) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(5) * _majorBattleMod>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(100) * _majorBattleMod>> + <<set $ASlaves -= random(140) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(10) * _majorBattleMod>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(120) * _majorBattleMod>> + <<set $ASlaves -= random(160) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(15) * _majorBattleMod>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(140) * _majorBattleMod>> + <<set $ASlaves -= random(180) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(20) * _majorBattleMod>> + <<else>> + <<set $ACitizens -= random(160) * _majorBattleMod>> + <<set $ASlaves -= random(190) * _majorBattleMod>> + <<set $arcologies[0].prosperity -= random(25) * _majorBattleMod>> + <</if>> + <br> +<<elseif $battleResult == 1>> + The attackers wisely take the money offered them to leave your territory without further issues. The strength of the free cities was never in their guns but in their dollars and today events are the perfect demonstration of such strength. + Your @@.green;reputation slightly increases@@. + <<if $attackType == "raiders">> + <<set $rep += 100 * _majorBattleMod>> + <<elseif $attackType == "free city">> + <<set $rep += 150 * _majorBattleMod>> + <<elseif $attackType == "freedom fighters">> + <<set $rep += 200 * _majorBattleMod>> + <<elseif $attackType == "old world">> + <<set $rep += 150 * _majorBattleMod>> + <</if>> + <<set $cash -= $bribeCost>> +<</if>> +<<if !isInt($ACitizens)>> + <br>@@.red;Error: ACitizens is Nan, please report this issue@@ +<</if>> +<<if !isInt($ASlaves)>> + <br>@@.red;Error: ASlaves is Nan, please report this issue@@ +<</if>> + +<br><br> +<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>> + + /* leaders */ + <<if $leadingTroops == "PC">> + You decided to personally lead the defense of your arcology. + <<if $deployingMilitia == 1>> + <<if _oldRep <= 2500 && _oldRep > 1000>> + You're not particularly popular between the inhabitants of your arcology, so your presence does little to reassure the volunteers + <<elseif _oldRep <= 1000>> + As your low reputation proves, your volunteers do not particularly enjoy your company. As far as they are concerned your presence is more of an hindrance than an advantage + <</if>> + <<if $PC.career == "celebrity">> + , still your past celebrity does carry some weight, many do look forward to fight alongside a famous name. + <<elseif $PC.career == "capitalist">> + , still your past life as a famous venture capitalist does carry some weight, many trust in your cunning to save them in the incoming battle. + <<elseif $PC.career == "gang">> + , the situation is not made easier by your past. Many still remember you as the gang leader who used to be on the other side of their guns. + <<elseif $PC.career == "escort">> + , the situation is not made easier by your past. Many still remember your past career as an escort and doubt you'll be of any use during the fighting. + <</if>> + <<if _oldRep >= 5000 && _oldRep < 15000>> + Your citizens are honored that their arcology owner is willing to put <<if $PC.title == 0>>her<<else>>his<</if>> life in danger + <<elseif _oldRep >= 15000>> + Many among the volunteers are awed by your presence, never would they have thought they would fight shoulder to shoulder with their famous arcology owner + <</if>> + <<if $PC.career == "celebrity">> + , not to mention the priceless opportunity of fighting together with someone with such a renowned past as yours. Your celebrity still does carry its weight. + <<elseif $PC.career == "capitalist">> + , not to mention the priceless opportunity of fighting together with one of the great capitalist sharks of their time. Such fine mind on their side can only bring victory! + <<elseif $PC.career == "gang">> + , your past however does not help you: many still remember you as the gang leader who used to be on the other side of their guns. + <<elseif $PC.career == "escort">> + your past however does not help you: many still remember your past career as an escort and doubt you'll be of any use during the fighting. + <</if>> + <</if>> + <<if $deployingSlaves == 1>> + <<if _oldAuth <= 2500 &&_oldAuth > 1000>> + Your slave soldiers do not feel bound to you as much as they should, as your authority is far from absolute + <<elseif _oldAuth <= 1000>> + Your slave soldiers are often openly rebellious. Only the threat of execution hold them in line + <</if>> + <<if $PC.career == "escort">> + , fortunately many feel some level of kinship with you, thanks to your past as an escort. + <<elseif $PC.career == "servant">> + , fortunately many feel some level of kinship with you, thanks to your past as a servant. + <<elseif $PC.career == "slaver">> + , things are made worse by your past as a notorious slaver. + <</if>> + <<if _oldAuth >= 5000 && _oldAuth < 15000>> + Your slave soldiers show a surprising amount of discipline, thanks to your high authority + <<elseif _oldAuth >= 15000>> + Your slave soldiers show almost a fanatical level of martial discipline. Your absolute authority has a great effect on them + <</if>> + <<if $PC.career == "escort">> + and the feeling of kinship they instinctively feel towards you, because of your past as an escort. + <<elseif $PC.career == "servant">> + and the feeling of kinship they instinctively feel towards you, because of your past as a servant. + <<elseif $PC.career == "slaver">> + . Still some rebellious looks can be spotted once in a while, in their eyes your slaver past will always paint you in a dark light. + <</if>> + <</if>> + <<if $deployingMercs == 1>> + <<if $mercLoyalty <= 25>> + Your presence does little to spur your mercenaries into action, their loyalty is straining and their performance suffers + <<elseif $mercLoyalty <= 10>> + Your mercenaries barely bother to pretend being loyal, their battle performance is obviously barely passable + <</if>> + <<if $PC.career == "mercenary">> + , thankfully they hold in high regard someone who made their fortune as a mercenary themselves. + <<elseif $PC.career == "wealth">> + and they do little to hide the contempt they have for someone who was born into wealth, rather than gaining it from their sweat. + <<elseif $PC.career == "servant">> + and they do little to hide their disgust at being ordered around by an ex-servant. + <</if>> + <<if $mercLoyalty >= 50 && $mercLoyalty < 75>> + Your mercenaries are ready to fight their hardest for you, their loyalty a testament to your capability as a leader + <<elseif $mercLoyalty >= 75>> + Your mercenaries fight with a martial fury worthy of religious fanatics. Their loyalty to you is absolute + <</if>> + <<if $PC.career == "mercenary">> + , not to mention they're more than willing to follow someone who walked their same steps once as a gun for hire. + <<elseif $PC.career == "wealth">> + , unfortunately many do still resent you being born into your wealth and power, rather than having earned it with sweat and tears. + <<elseif $PC.career == "servant">> + , unfortunately some still resent the fact they are ordered around by an ex-servant. + <</if>> + <<if _oldRep >= 15000>> + Your reputation is so high your name carries power by itself. Having you on the battlefield puts fear even in the hardiest of warriors. + <</if>> + <</if>> + <<if $SFIntervention == 1>> + <<if $PC.career == "mercenary" || $PC.career == "slaver" || $PC.career == "capitalist" || $PC.career == "gang" || $PC.warfare > 75>> + The soldiers of the $securityForceName are ready and willing to follow you into battle, confident in your past experience. + <<elseif $PC.career == "wealth" || $PC.career == "medicine" || $PC.career == "engineer">> + The soldiers of the $securityForceName, as loyal as they are, are not enthusiastic to follow the orders of someone who has no experience leading men. + <<elseif $PC.career == "servant">> + The soldiers of the $securityForceName, as loyal as they are, are not enthusiastic to follow the orders of an ex-servant. + <<elseif $PC.career == "escort">> + The soldiers of the $securityForceName, as loyal as they are, are not enthusiastic to follow the orders of an ex-escort. + <</if>> + <</if>> + <<if $PC.warfare <= 25 && $PC.warfare > 10>> + Your inexperience in military matters has a negative impact on your troops performance and the effectiveness of your battleplan. + <<elseif $PC.warfare <= 10>> + Your ignorance in military matters has a severe negative impact on your troops performance and the effectiveness of your battleplan. + <<elseif $PC.warfare >= 50 && $PC.warfare >= 50>> + Your experience in military matters has a positive impact on your troops performance and the effectiveness of your battleplan. + <<elseif $PC.warfare >= 75>> + Your great experience in military matters has a major positive impact on your troops performance and the effectiveness of your battleplan. + <</if>> + <<if $gainedWarfare == 1>> + Battlefield experience increased your understanding of warfare, making you a better commander. + <</if>> + <<if $PCWounded == 1>> + During the fighting @@.red;you were wounded@@. Your medics assure you it's nothing life threatening, but you'll be weakened for a few weeks. + <<set $PCWoundCooldown = 3>> + <</if>> + <<elseif $leadingTroops == "assistant">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> let your personal assistant lead the troops. + <<if $deployingMercs == 1 || $deployingMilitia == 1 || $deployingSlaves == 1>> + <<if _oldRep < 10000 && _oldAuth < 10000>> + No soldier trusts a computer to be their commander, no algorithm can substitute experience <<if $assistantPower == 0>>and as expected<<else>>, however <</if>> + <<else>> + No soldier trusts a computer to be their commander, but they trust you enough to not question your decision<<if $assistantPower == 0>>, however<<else>>, <</if>> + <</if>> + <</if>> + <<if $assistantPower == 0>> + your assistant gives a rather poor field performance, due to the limited computing power available to her. + <<elseif $assistantPower == 1>> + your assistant performs decently. While nothing to write home about your men are pleasantly surprised. + <<elseif $assistantPower == 2>> + your assistant performs admirably. Her vast computing power allows her to be everywhere on the battlefield, greatly enhancing the efficacy of your troops and the effectiveness of your battleplan. + <</if>> + <<elseif $leadingTroops == "bodyguard">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> decided it will be your bodyguard to lead the troops. + <<if $deployingSlaves == 1>> + <<if $HeadGirl.devotion < -20>> + Her low devotion has a negative impact on the morale of your slave soldiers. + <<elseif $HeadGirl.devotion > 51>> + Her devotion to you has a positive impact on the morale of your slave soldiers, proud to be lead by one of their own. + <</if>> + <</if>> + <<if _oldRep < 10000 && _oldAuth < 10000 || $HeadGirl.prestige < 1>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1 && $SFIntervention == 1>> + and neither are your mercenaries or your soldiers. + <<elseif $deployingMercs == 1>> + and neither are your mercenaries. + <<elseif $SFIntervention == 1>> + and neither are your soldiers. + <<else>> + . + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <<elseif $deployingMercs == 1>> + Your mercenaries <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <<elseif $SFIntervention == 1>> + Your soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <</if>> + <<elseif $HeadGirl.prestige >= 2>> + <<if $deployingMilitia == 1>> + Your volunteers + <<if $deployingMercs == 1>> + and your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<else>> + are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<elseif $deployingMercs == 1>> + Your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<if $deployingMilitia == 1>> + Your volunteers + <<if $deployingMercs == 1 && $SFIntervention == 1>> + , your mercenaries and your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $deployingMercs == 1>> + and your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $SFIntervention == 1>> + and your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<else>> + are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $deployingMercs == 1>> + Your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $SFIntervention == 1>> + Your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<else>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1 && $SFIntervention == 1>> + and neither are your mercenaries and soldiers, but they trust you enough not to question your decision. + <<elseif $deployingMercs == 1>> + and neither are your mercenaries, but they trust you enough not to question your decision. + <<elseif $SFIntervention == 1>> + and neither are your soldiers, but they trust you enough not to question your decision. + <<else>> + , but they trust you enough not to question your decision. + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <<elseif $deployingMercs == 1>> + Your mercenaries <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <<elseif $SFIntervention == 1>> + Your soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <</if>> + <</if>> + <<if (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 3>> + With her experience and her great intellect, she is able to exploits the smallest of tactical advantages, making your troops very effective. + <<elseif $Bodyguard.intelligence == 3>> + While she lacks experience, her great intellect allows her to seize and exploit any tactical advantage the battlefield offers her. + <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 2>> + Having both the experience and the intelligence, she performs admirably as your commander. Her competence greatly increases the efficacy of your troops. + <<elseif $Bodyguard.intelligence == 2>> + Despite not having a lot of experience as a leader, her intelligence makes her a good commander, increasing the efficacy of your troops. + <<elseif setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career) && $Bodyguard.intelligence >= 1>> + Thanks to her experience, she is a decent commander, competently guiding your troops through the battle. + <<elseif $Bodyguard.intelligence >= 1>> + Lacking experience her performance as a commander is rather forgettable. + <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -2>> + Despite the experience she accumulated during her past career, her very low intelligence is a great disadvantage for your troops. + <<elseif $Bodyguard.intelligence <= -2>> + Without experience and low intelligence, she performs horribly as a commander, greatly affecting your troops. + <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -1>> + Despite the experience she accumulated during her past career, she lacks the intelligence to apply it quickly and effectively, making for a rather poor performance in the field. + <<elseif $Bodyguard.intelligence <= -1>> + She lacks the experience and the intelligence to be an effective commander, the performance of your troops suffers because of her poor leadership. + <</if>> + <<if $gainedCombat == 1>> + During the battle, she had to fight for her life, giving her experience in modern combat. She is now proficient with modern firearms and hand to hand combat. + <</if>> + <<if $woundType != 0>> + Unfortunately @@.red;she reported injuries@@. + <<if $woundType == 1>> + A stray bullet hit her neck. While she fortunately avoided fatal hemorrhages, her vocal cords were irreparably damaged. + <<elseif $woundType == 2>> + A few shrapnels found her eyes as final target, blinding her permanently. + <<elseif $woundType == 3>> + A grenade landed close to her, rendering her a quadruple amputee. + <<elseif $woundType >= 4>> + While grave wounds, it seems she will be able to fully recover, given enough time. + <</if>> + Your troops were greatly affected by the loss of their leader. + <</if>> + <<elseif $leadingTroops == "headGirl">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> decided it will be your head girl to lead the troops. + <<if $deployingSlaves == 1>> + <<if $HeadGirl.devotion < -20>> + Her low devotion has a negative impact on the morale of your slave soldiers. + <<elseif $HeadGirl.devotion > 51>> + Her devotion to you has a positive impact on the morale of your slave soldiers, proud to be lead by one of their own. + <</if>> + <</if>> + <<if _oldRep < 10000 && _oldAuth < 10000 || $HeadGirl.prestige < 1>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1 && $SFIntervention == 1>> + and neither are your mercenaries or your soldiers. + <<elseif $deployingMercs == 1>> + and neither are your mercenaries. + <<elseif $SFIntervention == 1>> + and neither are your soldiers. + <<else>> + . + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <<elseif $deployingMercs == 1>> + Your mercenaries <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <<elseif $SFIntervention == 1>> + Your soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander. + <</if>> + <<elseif $HeadGirl.prestige >= 2>> + <<if $deployingMilitia == 1>> + Your volunteers + <<if $deployingMercs == 1>> + and your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<else>> + are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<elseif $deployingMercs == 1>> + Your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<if $deployingMilitia == 1>> + Your volunteers + <<if $deployingMercs == 1 && $SFIntervention == 1>> + , your mercenaries and your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $deployingMercs == 1>> + and your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $SFIntervention == 1>> + and your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<else>> + are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $deployingMercs == 1>> + Your mercenaries are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <<elseif $SFIntervention == 1>> + Your soldiers are delighted to have such a prestigious individual as their commander, almost forgetting she is a slave. + <</if>> + <<else>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1 && $SFIntervention == 1>> + and neither are your mercenaries and soldiers, but they trust you enough not to question your decision. + <<elseif $deployingMercs == 1>> + and neither are your mercenaries, but they trust you enough not to question your decision. + <<elseif $SFIntervention == 1>> + and neither are your soldiers, but they trust you enough not to question your decision. + <<else>> + , but they trust you enough not to question your decision. + <</if>> + <<elseif $deployingMercs == 1 && $SFIntervention == 1>> + Your mercenaries and soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <<elseif $deployingMercs == 1>> + Your mercenaries <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <<elseif $SFIntervention == 1>> + Your soldiers <<if $deployingSlaves == 1>>however<</if>> are not enthusiastic to have a slave as a commander, but they trust you enough not to question your decision. + <</if>> + <</if>> + <<if (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 3>> + With her experience and her great intellect, she is able to exploits the smallest of tactical advantages, making your troops greatly effective. + <<elseif $HeadGirl.intelligence == 3>> + While she lacks experience, her great intellect allows her to seize and exploit any tactical advantage the battlefield offers her. + <<elseif (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 2>> + Having both the experience and the intelligence, she performs admirably as your commander. Her competence greatly increases the efficacy of your troops. + <<elseif $HeadGirl.intelligence == 2>> + Despite not having a lot of experience as a leader, her intelligence makes her a good commander, increasing the efficacy of your troops. + <<elseif setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career) && $HeadGirl.intelligence >= 1>> + Thanks to her experience, she is a decent commander, competently guiding your troops through the battle. + <<elseif $HeadGirl.intelligence >= 1>> + Lacking experience her performance as a commander is rather forgettable. + <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -2>> + Despite the experience she accumulated during her past career, her very low intelligence is a great disadvantage for your troops. + <<elseif $HeadGirl.intelligence <= -2>> + Without experience and low intelligence, she performs horribly as a commander, greatly affecting your troops. + <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -1>> + Despite the experience she accumulated during her past career, she lacks the intelligence to apply it quickly and effectively, making for a rather poor performance in the field. + <<elseif $HeadGirl.intelligence <= -1>> + She lacks the experience and the intelligence to be an effective commander, the performance of your troops suffers because of her poor leadership. + <</if>> + <<if $gainedCombat == 1>> + During the battle, she had to fight for her life, giving her experience in modern combat. She is now proficient with modern firearms and hand to hand combat. + <</if>> + <<if $woundType != 0>> + Unfortunately @@.red;she reported injuries@@. + <<if $woundType == 1>> + A stray bullet hit her neck. While she fortunately avoided fatal hemorrhages, her vocal cords were irreparably damaged. + <<elseif $woundType == 2>> + A few shrapnels found her eyes as final target, blinding her permanently. + <<elseif $woundType == 3>> + A grenade landed close to her, rendering her a quadruple amputee. + <<elseif $woundType >= 4>> + While grave wounds, it seems she will be able to fully recover, given enough time. + <</if>> + Your troops were greatly affected by the loss of their leader. + <</if>> + <<elseif $leadingTroops == "citizen">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> decided to appoint one of your volunteers as the commander. + <<if $arcologies[0].FSDegradationist == "unset" && $arcologies[0].FSPaternalist == "unset">> + <<if $deployingMilitia == 1>> + Your volunteers are honored and pleased that one of their own is leading the defense force of the city. + <</if>> + <<if $deployingSlaves == 1>> + Your slaves<<if $deployingMilitia == 1>>, however,<</if>> are not thrilled by the news. + <</if>> + <<elseif $arcologies[0].FSPaternalist != "unset">> + <<if $deployingMilitia == 1>> + Your volunteers are honored and pleased that one of their own is leading the defense force of the city. + <</if>> + <<if $deployingSlaves == 1>> + Thanks to your paternalistic society, your slave soldiers trust your chosen citizen to treat them as more than cannon fodder. + <</if>> + <<elseif $arcologies[0].FSDegradationist != "unset">> + <<if $deployingMilitia == 1>> + Your volunteers are honored and pleased that one of their own is leading the defense force of the city. + <</if>> + <<if $deployingSlaves == 1>> + Because of your degradationist society,<<if $deployingMilitia == 1>> however,<</if>> your slave soldiers are deeply distrustful of the new leader. + <</if>> + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset" && $deployingMercs == 1>> + Since you decided to revive old Rome, many of your citizens took on themselves to educate themselves in martial matters, because of this your mercenaries feel safe enough in the hands of one of your volunteers. + <<elseif $deployingMercs == 1>> + You mercenaries are not thrilled to be lead by a civilian without any formal martial training or education. + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset" && $SFIntervention == 1>> + Since you decided to revive old Rome, many of your citizens took on themselves to educate themselves in martial matters, because of this your mercenaries feel safe enough in the hands of one of your volunteers. + <<elseif $SFIntervention == 1>> + You soldiers are not thrilled to be lead by a civilian without any formal martial training or education. + <</if>> + <<if $leaderWounded == 1>> + During the battle a stray bullet managed to reach the leader. Your troops were greatly affected by the loss. + <</if>> + <<elseif $leadingTroops == "mercenary">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> decided to appoint one of your mercenary officers as the commander. + <<if $deployingMercs == 1>> + Your mercenaries of course approve of your decision. + <</if>> + <<if $SFIntervention == 1>> + Your soldiers feel more confident going into battle with an experienced commander. + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset" && $deployingMilitia == 1>> + Since you decided to revive old Rome, your volunteers are more willing to trust one of your mercenaries as their leader. + <<elseif $deployingMilitia == 1>> + Your volunteers are not enthusiastic at the prospect of being commanded around by a gun for hire. + <</if>> + <<if $arcologies[0].FSDegradationist != "unset" && $deployingSlaves == 1>> + Because of your degradationist society, your slave soldiers are highly distrustful of the gun for hire you forced them to accept as leader. + <</if>> + <<if $leaderWounded == 1>> + During the battle a stray bullet managed to reach the mercenary. Your troops were greatly affected by the loss of their leader. + <</if>> + <<elseif $leadingTroops == "colonel">> + <<if $auto == 1>>$assistantName<<else>>You<</if>> decided to appoint The Colonel as the commander. + <<if $deployingMercs == 1>> + Your mercenaries approve of such decisions, as they feel more confident by having a good, experienced commander. + <</if>> + <<if $SFIntervention == 1>> + The soldiers of $securityForceName obviously approved of your decision. + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset" && $deployingMilitia == 1>> + Since you decided to revive old Rome, your volunteers are more willing to trust one of your soldiers as their leader. + <<elseif $deployingMilitia == 1>> + Your volunteers are not enthusiastic at the prospect of being commanded around by an old style military officer. + <</if>> + <<if $arcologies[0].FSDegradationist != "unset" && $deployingSlaves == 1>> + Because of your degradationist society, your slave soldiers are highly distrustful of the soldier you forced them to accept as leader. + <</if>> + <<if $leaderWounded == 1>> + During the battle a stray bullet managed to reach the colonel, wounding her slightly. Your troops were greatly affected by the loss of their leader. + <</if>> + <</if>> + + <br><br> + + /* tactics */ + <<if $auto == 1>>$assistantName<<else>>You<</if>> + <<if $chosenTactic == "Bait and Bleed">> + chose to employ "bait and bleed" tactics or relying on quick attacks and harassment to tire and wound the enemy until their surrender. + <<elseif $chosenTactic == "Guerrilla">> + chose to employ "guerrilla" tactics or relying on stealth, terrain knowledge and subterfuge to undermine and ultimately destroy the enemy. + <<elseif $chosenTactic == "Choke Points">> + chose to employ "choke points" tactics or the extensive use of fortified or highly defensive positions to slow down and eventually stop the enemy. + <<elseif $chosenTactic == "Interior Lines">> + chose to employ "interior lines" tactics or exploiting the defender's shorter front to quickly disengage and concentrate troops when and where needed. + <<elseif $chosenTactic == "Pincer Manouver">> + chose to employ "pincer maneuver" tactics or attempting to encircle the enemy by faking a collapsing centre front. + <<elseif $chosenTactic == "Defense In Depth">> + chose to employ "defense in depth" tactics or relying on mobility to disengage and exploit overextended enemy troops by attacking their freshly exposed flanks. + <<elseif $chosenTactic == "Blitzkrieg">> + chose to employ "blitzkrieg" tactics or shattering the enemy's frontline with a violent, concentrated armored assault. + <<elseif $chosenTactic == "Human Wave">> + chose to employ "human wave" tactics or overwhelming the enemy's army with a massive infantry assault. + <</if>> + <<if $battleTerrain == "urban">> + <<if $chosenTactic == "Bait and Bleed">> + The urban terrain synergized well with bait and bleed tactics, slowly chipping away at the enemy's forces from the safety of the narrow streets and empty buildings. + <<elseif $chosenTactic == "Guerrilla">> + The urban terrain synergized well with guerrilla tactics, eroding your enemy's determination from the safety of the narrow streets and empty buildings. + <<elseif $chosenTactic == "Choke Points">> + The urban environment offers many opportunities to hunker down and stop the momentum of the enemy's assault while keeping your soldiers in relative safety. + <<elseif $chosenTactic == "Interior Lines">> + While the urban environment offers many highly defensive position, it does restrict movement and with it the advantages of exploiting interior lines. + <<elseif $chosenTactic == "Pincer Manouver">> + The urban terrain does not allow for wide maneuvers, the attempts of your forces to encircle the assaulters are mostly unsuccessful. + <<elseif $chosenTactic == "Defense In Depth">> + While the urban environment offers many defensive positions, it limits mobility, limiting the advantages of using a defense in depth tactic. + <<elseif $chosenTactic == "Blitzkrieg">> + The urban terrain is difficult to traverse, making your troops attempt at a lightning strike unsuccessful. + <<elseif $chosenTactic == "Human Wave">> + The urban terrain offers great advantages to the defender, your men find themselves in great disadvantage while mass assaulting the enemy's position. + <</if>> + <<elseif $battleTerrain == "rural">> + <<if $chosenTactic == "Bait and Bleed">> + The open terrain of rural lands does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority. + <<elseif $chosenTactic == "Guerrilla">> + The open terrain of rural lands does not offer many hiding spots, making it harder for your men to perform guerrilla actions effectively. + <<elseif $chosenTactic == "Choke Points">> + The open terrain of rural lands does not offer many natural choke points, making it hard for your troops to funnel the enemy towards highly defended positions. + <<elseif $chosenTactic == "Interior Lines">> + The open terrain allows your men to easily exploit the superior mobility of the defender, making excellent use of interior lines to strike where it hurts. + <<elseif $chosenTactic == "Pincer Manouver">> + The open terrain affords your men great mobility, allowing them to easily position themselves for envelopment. + <<elseif $chosenTactic == "Defense In Depth">> + The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters. + <<elseif $chosenTactic == "Blitzkrieg">> + The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes. + <<elseif $chosenTactic == "Human Wave">> + The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults. + <</if>> + <<elseif $battleTerrain == "hills">> + <<if $chosenTactic == "Bait and Bleed">> + While the hills offer some protection, they also make it harder to maneuver, bait and bleed tactics will not be 100% effective here. + <<elseif $chosenTactic == "Guerrilla">> + The hills offer protection to both your troops and your enemy's, making it harder for your men to accomplish guerrilla attacks effectively. + <<elseif $chosenTactic == "Choke Points">> + While not as defensible as mountains, hills offer numerous opportunities to funnel the enemy towards highly defensible choke points. + <<elseif $chosenTactic == "Interior Lines">> + The limited mobility on hills hampers the capability of your troops to exploit the defender's greater mobility afforded by interior lines. + <<elseif $chosenTactic == "Pincer Manouver">> + Limited mobility due to the hills is a double edged sword, affording your men a decent shot at encirclement. + <<elseif $chosenTactic == "Defense In Depth">> + The limited mobility on hills hampers the capability of your troops to use elastic defense tactics. + <<elseif $chosenTactic == "Blitzkrieg">> + The limited mobility on hills hampers the capability of your troops to organize lightning strikes. + <<elseif $chosenTactic == "Human Wave">> + The defensibility of hills makes it harder to accomplish victory through mass assaults. + <</if>> + <<elseif $battleTerrain == "coast">> + <<if $chosenTactic == "Bait and Bleed">> + On the coast there's little space and protection to effectively employ bait and bleed tactics. + <<elseif $chosenTactic == "Guerrilla">> + On the coast there's little space and protection to effectively employ guerrilla tactics. + <<elseif $chosenTactic == "Choke Points">> + Amphibious attacks are difficult in the best of situations, the defender has a very easy time funneling the enemy towards their key defensive positions. + <<elseif $chosenTactic == "Interior Lines">> + While in an amphibious landing mobility is not the defender best weapon, exploiting interior lines still affords your troops some advantages. + <<elseif $chosenTactic == "Pincer Manouver">> + Attempting to encircle a landing party is not the best course of action, but not the worst either. + <<elseif $chosenTactic == "Defense In Depth">> + In an amphibious assault it's very easy for the enemy to overextend, making defense in depth tactics quite effective. + <<elseif $chosenTactic == "Blitzkrieg">> + The rough, restricted terrain does not lend itself well to lightning strikes, but the precarious position of the enemy still gives your mobile troops tactical superiority + <<elseif $chosenTactic == "Human Wave">> + The rough, restricted terrain does not lend itself well to mass assaults, but the precarious position of the enemy still gives your troops tactical superiority. + <</if>> + <<elseif $battleTerrain == "outskirts">> + <<if $chosenTactic == "Bait and Bleed">> + Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops bait and bleed tactics would require. + <<elseif $chosenTactic == "Guerrilla">> + Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops guerrilla tactics would require. + <<elseif $chosenTactic == "Choke Points">> + The imposing structure of the arcology itself provides plenty of opportunities to create fortified choke points where to shatter the enemy assault. + <<elseif $chosenTactic == "Interior Lines">> + While the presence of the arcology near the battlefield is an advantage, it does limit manouverability, lowering overall effectiveness of interior lines tactics. + <<elseif $chosenTactic == "Pincer Manouver">> + While the presence of the arcology near the battlefield is an advantage, it does limit manouverability, lowering the chances of making an effective encirclement. + <<elseif $chosenTactic == "Defense In Depth">> + Having the arcology near the battlefield means there are limited available maneuvers to your troops, who still needs to defend the structure, making defense in depth tactics not as effective. + <<elseif $chosenTactic == "Blitzkrieg">> + While an assault may save the arcology from getting involved at all, having the imposing structure so near does limit manouverability and so the impetus of the lightning strike. + <<elseif $chosenTactic == "Human Wave">> + While an attack may save the arcology from getting involved at all, having the imposing structure so near does limit manouverability and so the impetus of the mass assault. + <</if>> + <<elseif $battleTerrain == "mountains">> + <<if $chosenTactic == "Bait and Bleed">> + While the mountains offer great protection, they also limit manouverability, bait and bleed tactics will not be quite as effective here. + <<elseif $chosenTactic == "Guerrilla">> + The mountains offer many excellent hiding spots and defensive positions, making guerrilla tactics very effective. + <<elseif $chosenTactic == "Choke Points">> + The mountains offer plenty of opportunity to build strong defensive positions where to shatter the enemy's assault. + <<elseif $chosenTactic == "Interior Lines">> + While the rough terrain complicates maneuvers, the defensive advantages offered by the mountains offsets its negative impact. + <<elseif $chosenTactic == "Pincer Manouver">> + The rough terrain complicates maneuvers, your men have a really hard time pulling off an effective encirclement in this environment. + <<elseif $chosenTactic == "Defense In Depth">> + While mobility is limited, defensive positions are plentiful, your men are not able to fully exploit overextended assaults, but are able to better resist them. + <<elseif $chosenTactic == "Blitzkrieg">> + The rough terrain complicates maneuvers, your men have a really hard time pulling off an effective lightning strike in this environment. + <<elseif $chosenTactic == "Human Wave">> + The rough terrain complicates maneuvers, your men have a really hard time pulling off an effective mass assault in this environment. + <</if>> + <<elseif $battleTerrain == "wasteland">> + <<if $chosenTactic == "Bait and Bleed">> + While the wastelands are mostly open terrain, there are enough hiding spots to make bait and bleed tactics work well enough. + <<elseif $chosenTactic == "Guerrilla">> + While the wastelands are mostly open terrain, there are enough hiding spots to make guerrilla tactics work well enough. + <<elseif $chosenTactic == "Choke Points">> + The wastelands are mostly open terrain, your men have a difficult time setting up effective fortified positions. + <<elseif $chosenTactic == "Interior Lines">> + The wastelands, while rough, are mostly open terrain, where your men can exploit to the maximum the superior mobility of the defender. + <<elseif $chosenTactic == "Pincer Manouver">> + The wastelands, while rough, are mostly open terrain, your men can set up an effective encirclement here. + <<elseif $chosenTactic == "Defense In Depth">> + The wastelands, while rough, are mostly open terrain, allowing your men to liberally maneuver to exploit overextended enemies. + <<elseif $chosenTactic == "Blitzkrieg">> + The wastelands, while rough, are mostly open terrain, where your men are able to mount effective lightning strikes. + <<elseif $chosenTactic == "Human Wave">> + The wastelands, while rough, are mostly open terrain, where your men are able to mount effective mass assaults. + <</if>> + <</if>> + + <<if $chosenTactic == "Bait and Bleed">> + <<if $attackType == "raiders">> + Since the bands of raiders are used to be on high alert and on the move constantly, bait and bleed tactics are not effective against them. + <<elseif $attackType == "free city">> + The modern armies hired by free cities are decently mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack. + <<elseif $attackType == "old world">> + While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics. + <<elseif $attackType == "freedom fighters">> + Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it. + <</if>> + <<elseif $chosenTactic == "Guerrilla">> + <<if $attackType == "raiders">> + Since the bands of raiders are used to be on high alert and on the move constantly, guerrilla tactics are not effective against them. + <<elseif $attackType == "free city">> + The modern armies hired by free cities are highly mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack. + <<elseif $attackType == "old world">> + While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics. + <<elseif $attackType == "freedom fighters">> + Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it. + <</if>> + <<elseif $chosenTactic == "Choke Points">> + <<if $attackType == "raiders">> + Raiders lack heavy weaponry or armour, so making use of fortified positions is an excellent way to dissipate the otherwise powerful momentum of their assault. + <<elseif $attackType == "free city">> + The high tech equipment free cities can afford to give their guns for hire means there's no defensive position strong enough to stop them, still the relatively low numbers means they will have to take a careful approach, slowing them down. + <<elseif $attackType == "old world">> + Old world armies have both the manpower and the equipment to conquer any defensive position, making use of strong fortifications will only bring you this far against them. + <<elseif $attackType == "freedom fighters">> + The lack of specialized weaponry means freedom fighters have a rather hard time overcoming tough defensive positions, unfortunately they have also a lot of experience in avoiding them. + <</if>> + <<elseif $chosenTactic == "Interior Lines">> + <<if $attackType == "raiders">> + The highly mobile horde of raiders will not give much room for your troops to maneuver, lowering their tactical superiority. + <<elseif $attackType == "free city">> + While decently mobile, free cities forces are not in high enough numbers to risk maintaining prolonged contact, allowing your troops to quickly disengage and redeploy where it hurts. + <<elseif $attackType == "old world">> + Old world armies are not famous for the mobility, which makes them highly susceptible to any tactic that exploits manouverability and speed. + <<elseif $attackType == "freedom fighters">> + While not the best equipped army, the experience and mobility typical of freedom fighters groups make them tough targets for an army that relies itself on mobility. + <</if>> + <<elseif $chosenTactic == "Pincer Manouver">> + <<if $attackType == "raiders">> + While numerous, the undisciplined masses of raiders are easy prey for encirclements. + <<elseif $attackType == "free city">> + While decently mobile, the low number of free cities expedition forces make them good candidates for encirclements. + <<elseif $attackType == "old world">> + The discipline and numbers of old world armies make them quite difficult to encircle. + <<elseif $attackType == "freedom fighters">> + While not particularly mobile, freedom fighters are used to fight against overwhelming odds, diminishing the effectiveness of the encirclement. + <</if>> + <<elseif $chosenTactic == "Defense In Depth">> + <<if $attackType == "raiders">> + While their low discipline makes them prime candidates for an elastic defense type of strategy, their high numbers limit your troops manouverability. + <<elseif $attackType == "free city">> + With their low numbers free cities mercenaries are quite susceptible to this type of tactic, despite their mobility. + <<elseif $attackType == "old world">> + With their low mobility old world armies are very susceptible to this type of strategy. + <<elseif $attackType == "freedom fighters">> + Low mobility and not particularly high numbers mean freedom fighters can be defeated by employing elastic defense tactics. + <</if>> + <<elseif $chosenTactic == "Blitzkrieg">> + <<if $attackType == "raiders">> + With their low discipline and lack of heavy equipment, lightning strikes are very effective against raider hordes. + <<elseif $attackType == "free city">> + Having good equipment and discipline on their side, free cities expeditions are capable of responding to even strong lightning strikes. + <<elseif $attackType == "old world">> + While disciplined, old world armies low mobility makes them highly susceptible to lightning strikes. + <<elseif $attackType == "freedom fighters">> + While not well equipped, freedom fighters have plenty of experience fighting small, mobile attacks, making them difficult to defeat with lightning strikes. + <</if>> + <<elseif $chosenTactic == "Human Wave">> + <<if $attackType == "raiders">> + The hordes of raiders are much more experienced than your soldiers in executing mass assaults and they also have a lot more bodies to throw in the grinder. + <<elseif $attackType == "free city">> + The good equipment and mobility of free cities mercenaries cannot save them from an organized mass assault. + <<elseif $attackType == "old world">> + Unfortunately the discipline and good equipment of old world armies allow them to respond well against a mass assault. + <<elseif $attackType == "freedom fighters">> + The relative low numbers and not great equipment typical of freedom fighters make them susceptible to being overwhelmed by an organized mass assault. + <</if>> + <</if>> + <<if $tacticsSuccessful == 1>> + In the end <<if $leadingTroops == "PC">>you were<<else>>your commander was<</if>> @@.green;able to successfully employ <<print $chosenTactic>> tactics@@, greatly enhancing the efficacy of your army. + <<else>> + In the end <<if $leadingTroops == "PC">>you were<<else>>your commander was<</if>> @@.red;not able to effectively employ <<print $chosenTactic>> tactics@@, greatly affecting the efficacy of your army. + <</if>> + <br> + <br> + <<include "unitsBattleReport">> + + <<if $securityForceArcologyUpgrades >= 7 || $securityForceFortressZeppelin >= 1 || $securityForceSatalitePower >= 11 || $securityForceGiantRobot >= 6 || $securityForceMissileSilo >= 1>> + /* SF upgrades effects */ + <br> + <br> + <<if $securityForceArcologyUpgrades >= 7>> + The artillery pieces installed around the $securityForceName barracks provided vital fire support to the troops in the field. + <</if>> + <<if $securityForceFortressZeppelin >= 1>> + The fortress zeppelin gave our troops an undeniable advantage in recon capabilities, air superiority and fire support. + <</if>> + <<if $securityForceSatalitePower >= 11>> + The $securityForceName satellite devastating power was employed with great efficacy against the enemy. + <</if>> + <<if $securityForceGiantRobot >= 6>> + The giant robot of the $securityForceName proved to be a great boon to our troops, shielding many from the worst the enemy had to offer. + <</if>> + <<if $securityForceMissileSilo >= 1>> + The missile silo exterminated many enemy soldiers even before the battle would begin. + <</if>> + <</if>> + +<</if>> /* closes check for surrender and bribery */ + +<br><br> + +<<set _menialPrice = Math.trunc(($slaveCostFactor*1000)/100)*100>> +<<set _menialPrice = Math.clamp(_menialPrice, 500, 1500)>> + +<<set _captives = Math.trunc(_captives)>> +<<if _captives > 0>> + During the battle <<print _captives>> attackers were captured. + /* + <<if random(1,100) <= 25>> + <<set _roll = random(1,100)>> + <<if _roll <= 33>> + Three of them have the potential to be sex slaves. + <<set _candidates = 3>> + + <<elseif _roll <= 66>> + Two of them have the potential to be sex slaves. + <<set _candidates = 2>> + <<else>> + One of them have the potential to be sex slaves. + <<set _candidates = 1>> + <</if>> + <</if>> + */ + <br> + <span id="captOptions"> + <<link "sell them all immediately">> + <<set $cash += _menialPrice * _captives>> + <<replace "#captOptions">>Captives sold<</replace>> + <</link>> + | + <<link "Keep them as menial slaves">> + <<set $helots += _captives>> + <<replace "#captOptions">>Captives added as menial slaves<</replace>> + <</link>> + </span> +<</if>> + +/* resets variables */ +<<set $leaderWounded = 0>> +<<set $gainedWarfare = 0>> +<<set $woundType = 0>> +<<set $tacticsSuccessful = 0>> +<<set $attackType = "none">> +<<set $chosenTactic = "none">> +<<set $leadingTroops = "none">> +<<set $attackTroops = 0>> +<<set $attackEquip = 0>> +<<set $deployableUnits = 0>> +<<set $deployedUnits = 0>> +<<set $deployingBots = 0>> +<<set $deployingMilitia = 0>> +<<set $deployingSlaves = 0>> +<<set $deployingMercs = 0>> +<<set $battleTerrain = "none">> +<<set $attackThisWeek = 0>> +<<set $deployableUnits = 0>> +<<set $deployedUnits = 0>> +<<set $enemyLosses = 0>> +<<set $losses = 0>> +<<set $battleTurns = 0>> +<<set $majorBattle = 0>> +<<set $SFIntervention = 0>> +<<set $secBots.isDeployed = 0>> +<<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set $militiaUnits[_i].isDeployed = 0>> +<</for>> +<<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set $slaveUnits[_i].isDeployed = 0>> +<</for>> +<<for _i = 0; _i < $mercUnits.length; _i++>> + <<set $mercUnits[_i].isDeployed = 0>> +<</for>> \ No newline at end of file diff --git a/src/SecExp/authorityReport.tw b/src/SecExp/authorityReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..31ee3ea1c634e20b78dd42dec2ef34969879ad7d --- /dev/null +++ b/src/SecExp/authorityReport.tw @@ -0,0 +1,169 @@ +:: authorityReport [nobr] + +<<if $useTabs == 0>>__Authority__<</if>> +<br> + + +<<if $authority > 19500>> + Your authority is nearly absolute. The arcology is yours to command as it pleases you. +<<elseif $authority > 15000>> + Your authority is extremely high. There's little you cannot do within the walls of your arcology. +<<elseif $authority > 10000>> + Your authority is high. You command respect and fear in equal measure. +<<elseif $authority > 5000>> + Your authority is moderate. You command some respect from your citizens. +<<else>> + Your authority is low. You command no respect or fear from your citizens. +<</if>> + +<<if $PC.career == "wealth">> + As part of the idle wealth, you were used to have obedience coming naturally to you. Now you find it harder to maintain authority over the arcology. + <<set _authGrowth -= 10 * random(5,15)>> +<<elseif $PC.career == "slaver">> + Your past as a slaver helps you assert your authority over the arcology. + <<set _authGrowth += 10 * random(5,15)>> +<<elseif $PC.career == "escort">> + Given your past career as an escort, you find it hard to assert your authority over the arcology and its inhabitants. + <<set _authGrowth -= 10 * random(5,15)>> +<<elseif $PC.career == "servant">> + Given your past career as a servant, you find it hard to assert your authority over the arcology and its inhabitants. + <<set _authGrowth -= 10 * random(5,15)>> +<<elseif $PC.career == "gang">> + Given your past life as a gang leader, you find it easier to assert your authority over the arcology and its inhabitants. + <<set _authGrowth += 10 * random(5,15)>> +<</if>> +<<set _authGrowth = 0>> +<<if $rep >= 19500>> + Your legend is so well known that your mere presence command respect and obedience, increasing your authority. + <<set _authGrowth += 10 * random(10,20)>> +<<elseif $rep >= 15000>> + Your reputation is so high that your mere presence command respect, increasing your authority. + <<set _authGrowth += 10 * random(5,15)>> +<<elseif $rep >= 10000>> + Your reputation is high enough that your presence command some respect, increasing your authority. + <<set _authGrowth += 10 * random(2,8)>> +<</if>> + +<<if $security >= 90>> + Your arcology is incredibly secure and your citizens know quite well who to thank, greatly increasing your authority. + <<set _authGrowth += 10 * random(10,20)>> +<<elseif $security >= 70>> + Your arcology is really secure and your citizens know quite well who to thank, increasing your authority. + <<set _authGrowth += 10 * random(5,15)>> +<<elseif $security >= 50>> + Your arcology is quite secure and your citizens know who to thank, increasing your authority. + <<set _authGrowth += 10 * random(2,8)>> +<</if>> + +<<if $crime >= 90>> + The all powerful criminal organizations controlling the arcology has a very easy time undermining your authority. + <<set _authGrowth -= 10 * random(10,20)>> +<<elseif $crime >= 70>> + Crime is king in the arcology, powerful criminals have a very easy time undermining your authority. + <<set _authGrowth -= 10 * random(5,15)>> +<<elseif $crime >= 50>> + Criminal organizations have a strong foothold in the arcology, their activities undermine your authority. + <<set _authGrowth -= 10 * random(2,8)>> +<</if>> + +<<if $averageDevotion >= 50 && $averageTrust >= 50>> + The high devotion and trust of your slaves speak eloquently of your leadership capabilities, helping your authority grow. + <<set _authGrowth += 5 * (($averageDevotion + $averageTrust) / 10)>> +<<elseif $averageDevotion >= 50>> + The high devotion of your slaves speak eloquently of your leadership capabilities, helping your authority grow. + <<set _authGrowth += 5 * ($averageDevotion / 10)>> +<<elseif $averageTrust >= 50>> + The high trust of your slaves speak eloquently of your leadership capabilities, helping your authority grow. + <<set _authGrowth += 5 * ($averageTrust / 10)>> +<</if>> + +<<if $arcologies[0].ownership >= 90>> + You own so much of the arcology that your authority quickly increases. + <<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>> +<<elseif $arcologies[0].ownership >= 70>> + You own a big part of the arcology, causing your authority to increase. + <<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>> +<<elseif $arcologies[0].ownership >= 50>> + You own the majority of the arcology, causing your authority to slowly increase. + <<set _authGrowth += 5 * Math.trunc($arcologies[0].ownership / 10)>> +<<else>> + Your low ownership of the arcology causes your authority to decrease. + <<set _authGrowth -= 5 * Math.trunc($arcologies[0].ownership / 10)>> +<</if>> + +<<if $activeUnits >= 9>> + Your military is massive, commanding so many troops greatly increases your authority. + <<set _authGrowth += 12 * $activeUnits>> +<<elseif $activeUnits >= 7>> + Your military is huge, commanding such a number of soldiers increases your authority. + <<set _authGrowth += 12 * $activeUnits>> +<<elseif $activeUnits >= 4>> + Your military is at a decent size, commanding a small army increases your authority. + <<set _authGrowth += 12 * $activeUnits>> +<</if>> + +<<if $arcologies[0].FSChattelReligionist >= 90>> + Religious organizations have a tight grip on the minds of your residents and their dogma greatly helps your authority grow. + <<set _authGrowth += $arcologies[0].FSChattelReligionist>> +<<elseif $arcologies[0].FSChattelReligionist >= 90>> + Religious organizations have a tight grip on the minds of your residents and their dogma helps your authority grow. + <<set _authGrowth += $arcologies[0].FSChattelReligionist>> +<</if>> + +<<if $arcologies[0].FSRestart >= 90>> + The arcology's society is extremely stratified. The reliance on the societal elite by the lower classes greatly increases your reputation. + <<set _authGrowth += $arcologies[0].FSRestart>> +<<elseif $arcologies[0].FSRestart >= 50>> + The arcology's society is very stratified. The reliance on the societal elite by the lower classes increases your reputation. + <<set _authGrowth += $arcologies[0].FSRestart>> +<</if>> + +<<if $arcologies[0].FSPaternalist >= 90>> + Your extremely paternalistic society has the unfortunate side effects of spreading dangerous ideals in the arcology, damaging your authority. + <<set _authGrowth -= $arcologies[0].FSPaternalist>> +<<elseif $arcologies[0].FSPaternalist >= 50>> + Your paternalistic society has the unfortunate side effects of spreading dangerous ideals in the arcology, damaging your authority. + <<set _authGrowth -= $arcologies[0].FSPaternalist>> +<</if>> + +<<if $arcologies[0].FSNull >= 90>> + Cultural openess allows dangerous ideas to spread in your arcology, damaging your reputation. + <<set _authGrowth -= $arcologies[0].FSNull>> +<<elseif $arcologies[0].FSNull >= 50>> + Cultural openess allows dangerous ideas to spread in your arcology, damaging your reputation. + <<set _authGrowth -= $arcologies[0].FSNull>> +<</if>> + +<<if $miniTruth >= 1>> + Your authenticity department works tirelessly to impose your authority in all the arcology. + <<set _authGrowth += 15 * $miniTruth>> +<</if>> + +<<if $secretService >= 1>> + Your secret services constantly keep under surveillance any potential threat, intervenening when necessary. Rumors of the secretive security service and mysterious disappereances make your authority increase. + <<set _authGrowth += 15 * $secretService>> +<</if>> + +<<if $edictsAuthUpkeep > 0>> + Some of your authority is spent maintaining your edicts + <<set _authGrowth -= $edictsAuthUpkeep>> +<</if>> + +This week +<<if _authGrowth > 0>> + @@.green;authority has increased@@. +<<elseif _authGrowth == 0>> + @@.yellow;authority did not change@@. +<<else>> + @@.red;authority has decreased@@. +<</if>> + +<<set $authority += _authGrowth>> +<<set $authority = Math.trunc(Math.clamp($authority, 0, 20000))>> + +<<if $rebellionsEnabled == 1>> +/* rebellions */ + <br> + <br> + <<include "rebellionGenerator">> +<</if>> \ No newline at end of file diff --git a/src/SecExp/edicts.tw b/src/SecExp/edicts.tw new file mode 100644 index 0000000000000000000000000000000000000000..50d7371d1090d1ad2f9fac3ef41a3211ab938ffc --- /dev/null +++ b/src/SecExp/edicts.tw @@ -0,0 +1,719 @@ +:: edicts [nobr] + +<<set $nextButton = "Back">> +<<set $nextLink = "Main">> + +''__Active Edicts__'' + +<<if $alternativeRents == 1>> + <br>''Alternative rent payment:'' you are allowing citizens to pay for their rents in menial slaves rather than cash. + [[Repeal|edicts][$alternativeRents = 0]] +<</if>> + +<<if $enslavementRights == 1>> + <br>''Enslavement rights:'' you are the only authority able to declare a person enslaved or not. + [[Repeal|edicts][$enslavementRights = 0, $edictsAuthUpkeep -= 10]] +<</if>> + +<<if $sellData == 1>> + <br>''Private Data marketization:'' you are selling private citizens' data to the best bidder. + [[Repeal|edicts][$sellData = 0, $edictsAuthUpkeep -= 10]] +<</if>> + +<<if $propCampaignBoost == 1>> + <br>''Obligatory educational material:'' you are forcing residents to read curated educational material about the arcology. + [[Repeal|edicts][$propCampaignBoost = 0]] +<</if>> + +<<if $tradeLegalAid == 1>> + <br>''Legal aid for new businesses:'' New businesses can rely on your help for legal expenses and issues. + [[Repeal|edicts][$tradeLegalAid = 0, $edictsUpkeep -= 1000]] +<</if>> +<<if $taxTrade == 1>> + <br>''Trade tariffs:'' all goods transitioning in your arcology have to pay a transition fee. + [[Repeal|edicts][$taxTrade = 0]] +<</if>> + +<<if $slaveWatch == 1>> + <br>''@@.lime;Slave mistreatment watch:@@'' slaves are able access a special security service in case of mistreatment. + [[Repeal|edicts][$slaveWatch = 0, $edictsUpkeep -= 1000]] +<</if>> + +<<if $subsidyChurch == 1>> + <br>''@@.lime;Religious activities subsidy:@@'' you are providing economic support to religious activities following the official dogma. + [[Repeal|edicts][$subsidyChurch = 0, $edictsUpkeep -= 1000]] +<</if>> + +<<if $SFSupportLevel > 0>> + <br><br>__Special Force:__ + <<if $SFSupportLevel == 1>> + <br>''Equipment provision:'' $securityForceName is providing the security HQ with advanced equipment, boosting its efficacy. + [[Repeal|edicts][$SFSupportLevel--, $SFSupportUpkeep -= 1000, $reqHelots += 5]] + <<elseif $SFSupportLevel == 2>> + <br>''Personnel training:'' $securityForceName is currently providing advanced equipment and training to security HQ personnel. + [[Repeal|edicts][$SFSupportLevel--, $SFSupportUpkeep -= 2000, $reqHelots += 5]] + <<elseif $SFSupportLevel == 3>> + <br>''Troops detachment:'' $securityForceName has currently transfered troops to the security department HQ in additon to providing advanced equipment and training to security HQ personnel. + [[Repeal|edicts][$SFSupportLevel--, $SFSupportUpkeep -= 3000, $reqHelots += 5]] + <<elseif $SFSupportLevel == 4>> + <br>''Full support:''$securityForceName is currently providing it's full support to the security department, while transfering troops to the security department HQ in additon to providing advanced equipment and training to security HQ personnel. + [[Repeal|edicts][$SFSupportLevel--, $SFSupportUpkeep -= 3000, $reqHelots += 5]] + <<elseif $SFSupportLevel == 5>> + <br>''Network assistance:''$securityForceName is currently assiting with a local install of it's custom network full support and has transfered troops to the security department HQ in additon to providing advanced equipment and training to security HQ personnel. + [[Repeal|edicts][$SFSupportLevel--, $SFSupportUpkeep -= 4000, $secHQUpkeep -= 1000, $reqHelots += 5]] + <</if>> +<</if>> + +<<if $limitImmigration == 1 || $openBorders == 1>> + <br><br>__Immigration:__ + + <<if $limitImmigration == 1>> + <br>''Immigration limits:'' you put strict limits to the amount of people the arcology can accept each week. + [[Repeal|edicts][$limitImmigration = 0]] + <</if>> + + <<if $openBorders == 1>> + <br>''Open borders:'' you have lowered considerably the requirements to become citizens. + [[Repeal|edicts][$openBorders = 0]] + <</if>> +<</if>> + +<br><br>__Weapons:__ + +<<if $weaponsLaw == 0>> + <br>''Forbid weapons inside the arcology:'' residents are forbidden to buy, sell and keep weaponry while within the arcology. + [[Repeal|edicts][$weaponsLaw = 3, $edictsAuthUpkeep -= 30]] +<<elseif $weaponsLaw == 2>> + <br>''Heavy weaponry forbidden:'' residents are allowed to buy, sell and keep weapons within the arcology as long as they are non-heavy, non-explosive. + [[Repeal|edicts][$weaponsLaw = 3, $edictsAuthUpkeep -= 10]] +<<elseif $weaponsLaw == 1>> + <br>''Heavily restricted weaponry:'' residents are allowed to buy, sell and keep weapons within the arcology as long as they are non-automatic, non-high caliber. + [[Repeal|edicts][$weaponsLaw = 3, $edictsAuthUpkeep -= 20]] +<<else>> + <br>''All weapons allowed:'' residents are allowed to buy, sell and keep all kind of weapons in the arcology. +<</if>> + +<<if $hasFoughtOnce == 1>> +<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. + [[Repeal|edicts][$soldierWages = 1]] + <<elseif $soldierWages == 1>> + <br>''Average wages for soldiers:'' wages for soldiers are set to the market standards. + <<else>> + <br>''High wages for soldiers:'' wages for soldiers are set to a high level compared to market standards. + [[Repeal|edicts][$soldierWages = 1]] + <</if>> + + <<if $slavesOfficers == 1>> + <br>''Slave Officers:'' your trusted slaves are allowed to lead the defense forces of the arcology. + [[Repeal|edicts][$slavesOfficers = 0, $edictsAuthUpkeep -= 10]] + <</if>> + + <<if $mercenaries > 0>> + <<if $discountMercenaries == 1>> + <br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent. + [[Repeal|edicts][$discountMercenaries = 0]] + <</if>> + <</if>> + + <<if $militiaFounded == 1>> + <<if $conscription == 1>> + <br>''Conscription:'' every citizen is required to train in the militia and serve the arcology for a limited amount of time. + [[Repeal|edicts][$conscription = 0, $recruitVolunteers = 1]] + <</if>> + <<if $militaryService == 1>> + <br>''Obligatory military service:'' every citizen is required to register and serve under the militia. + [[Repeal|edicts][$militaryService = 0, $recruitVolunteers = 1]] + <</if>> + <<if $militarizedSociety == 1>> + <br>''Militarized Society:'' every adult citizen is required to train and actively participate in the military of the arcology. + [[Repeal|edicts][$militarizedSociety = 0, $recruitVolunteers = 1]] + <</if>> + + <<if $militaryExemption == 1>> + <br>''Military exemption:'' you allow citizens to avoid military duty by paying a weekly fee. + [[Repeal|edicts][$militaryExemption = 0]] + <</if>> + + <<if $lowerRquirements == 1>> + <br>''@@.lime;Revised minimum requirements:@@'' you allow citizens outside the normally accepted range to join the militia. + [[Repeal|edicts][$lowerRquirements = 0]] + <</if>> + + <<if $noSubhumansInArmy == 1>> + <br>''@@.lime;No subhumans in the militia:@@'' it is forbidden for subhumans to join the militia. + [[Repeal|edicts][$noSubhumansInArmy = 0]] + <</if>> + + <<if $pregExemption == 1>> + <br>''@@.lime;Military exemption for pregnancys:@@'' pregnant citizens are allowed, and encouraged, to avoid military service. + [[Repeal|edicts][$pregExemption = 0]] + <</if>> + <</if>> + + <<if $militiaSoldierPrivilege == 1>> + <br>''Special militia privileges:'' citizens joining the militia are exempt from rent payment. + [[Repeal|edicts][$militiaSoldierPrivilege = 0]] + <</if>> + + <<if $slaveSoldierPrivilege == 1>> + <br>''Special slaves privileges:'' Slaves into the army are allowed to have material possessions. + [[Repeal|edicts][$slaveSoldierPrivilege = 0, $edictsAuthUpkeep -= 10]] + <</if>> + + <<if $mercSoldierPrivilege == 1>> + <br>''Special mercenary privileges:'' Mercenaries under contract can claim part of the loot gained from battles. + [[Repeal|edicts][$mercSoldierPrivilege = 0]] + <</if>> + + <<if $martialSchool == 1>> + <br>''@@.lime;Slave martial schools:@@'' specialized schools are training slaves in martial arts and bodyguarding. + [[Repeal|edicts][$martialSchool = 0, $edictsUpkeep -= 1000, $slaveBaseMorale -= 5]] + <</if>> + + <<if $eliteOfficers == 1>> + <br>''@@.lime;Elite officers:@@'' officers are exclusively recruited from the elite of society. + [[Repeal|edicts][$eliteOfficers = 0, $militiaBaseMorale += 5, $slaveBaseMorale -= 5]] + <</if>> + + <<if $liveTargets == 1>> + <br>''@@.lime;Live targets drills:@@'' disobedient slaves are used as live targets at shooting ranges. + [[Repeal|edicts][$liveTargets = 0]] + <</if>> +<</if>> + +<<if $FSAnnounced>> + <<if $legionTradition == 1>> + <br>''@@.lime;Legionaries traditions:@@'' you are funding specialized training for your recruits following the Roman tradition of professional armies. + [[Repeal|edicts][$legionTradition = 0, $edictsUpkeep -= 1000, $militiaBaseDefense -= 2, $militiaBaseMorale -= 5, $militiaBaseHp--]] + <</if>> + + <<if $pharaonTradition == 1>> + <br>''@@.lime;Legionaries traditions:@@'' you are funding specialized training for your recruits to turn them into an army worthy of a pharaon. + [[Implement|edicts][$pharaonTradition = 0, $edictsUpkeep -= 1000, $militiaBaseAttack -= 2, $militiaBaseDefense -= 2, $militiaBaseMorale -= 10]] + <br> //Will increase attack, defense and morale of militia units, but will incur upkeep costs.// + <</if>> + + <<if $eagleWarriors == 1>> + <br>''@@.lime;Eagle warriors traditions:@@'' you are funding specialized training for your mercenaries following the Aztec tradition of elite warriors. + [[Repeal|edicts][$eagleWarriors = 0, $edictsUpkeep -= 1000, $mercBaseAttack -= 4, $mercBaseDefense += 2, $mercBaseMorale -= 10]] + <</if>> + + <<if $ronin == 1>> + <br>''@@.lime;Ronin traditions:@@'' you are funding specialized training for your mercenaries following the Japanese tradition of elite errant samurai. + [[Repeal|edicts][$ronin = 0, $edictsUpkeep -= 1000, $mercBaseAttack -= 2, $mercBaseDefense -= 2, $mercBaseMorale -= 10]] + <</if>> + + <<if $mamluks == 1>> + <br>''@@.lime;Mamluks traditions:@@'' you are funding specialized training for your slaves following the Arabian tradition of mamluks slave soldiers. + [[Repeal|edicts][$ronin = 0, $edictsUpkeep -= 1000, $slaveBaseAttack -= 2, $slaveBaseHp--, $slaveBaseMorale -= 10]] + <</if>> + + <<if $sunTzu == 1>> + <br>''@@.lime;Sun Tzu Teachings:@@'' you are funding specialized training for your units and officers to follow the teachings of the "Art of War". + [[Repeal|edicts][$sunTzu = 0, $edictsUpkeep -= 1000, $militiaBaseAttack--, $militiaBaseDefense--, $mercBaseAttack--, $mercBaseDefense--, $slaveBaseAttack--, $slaveBaseDefense--, $militiaBaseMorale -= 5, $mercBaseMorale -= 5, $slaveBaseMorale -= 5]] + <</if>> +<</if>> +<hr> + +''__Available Edicts__'' +<br>//Passing any edict will cost ¤5000 and some authority. More edicts will become available as the arcology develops.// +<br> +<<if $alternativeRents == 0>> + <br>''Alternative rent payment:'' allow citizens to pay for their rents in menial slaves rather than cash, if so they wish. + <<if $authority >= 1000>> + [[Implement|edicts][$alternativeRents = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will decrease rents, but will supply a small amount of menial slaves each week.// +<</if>> + +<<if $enslavementRights == 0>> + <br>''Enslavement rights:'' the arcology owner will be the only authority able to declare a person enslaved or not. + <<if $authority >= 1000>> + [[Implement|edicts][$enslavementRights = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will provide cash each week. The higher the flux of citizens to slaves the higher the income. Will cost a small amount of authority each week.// +<</if>> + +<<if $sellData == 0 && ($secUpgrades.nanoCams == 1 || $secUpgrades.cyberBots == 1 || $secUpgrades.eyeScan == 1 || $secUpgrades.cryptoAnalyzer == 1 || $crimeUpgrades.autoTrial == 1 || $crimeUpgrades.autoArchive == 1 || $crimeUpgrades.worldProfiler == 1 || $crimeUpgrades.advForensic == 1)>> + <br>''Private Data marketization:'' allow the selling of private citizens' data. + <<if $authority >= 1000>> + [[Implement|edicts][$sellData = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will generate income dependent on the amount of upgrades installed in the security HQ, but will cost a small amount of authority each week.// +<</if>> + +<<if $propHub == 1>> + <<if $propCampaignBoost == 0>> + <br>''Obligatory educational material:'' force residents to read curated educational material about the arcology. + <<if $authority >= 1000>> + [[Implement|edicts][$propCampaignBoost = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase the effectiveness of propaganda campaigns, but will incur upkeep costs.// + <</if>> +<</if>> + +<<if $transportHub == 1>> + <<if $tradeLegalAid == 0>> + <br>''Legal aid for new businesses:'' Support new businesses in the arcology by helping them cover legal costs and issues. + <<if $authority >= 1000>> + [[Implement|edicts][$tradeLegalAid = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase trade, but will incur upkeep costs.// + <</if>> + <<if $taxTrade == 0>> + <br>''Trade tariffs:'' all goods transitioning in your arcology will have to pay a transition fee. + <<if $authority >= 1000>> + [[Implement|edicts][$taxTrade = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will provide income based on trade level, but will negatively affect trade.// + <</if>> +<</if>> + +<<if $arcologies[0].FSPaternalist != "unset">> + <<if $slaveWatch == 0>> + <br>''@@.lime;Slave mistreatment watch:@@'' slaves will be able access a special security service in case of mistreatment. + <<if $authority >= 1000>> + [[Implement|edicts][$slaveWatch = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will help advance paternalism, but will incur upkeep costs.// + <</if>> +<</if>> + +<<if $arcologies[0].FSChattelReligionist >= 40>> + <<if $subsidyChurch == 0>> + <br>''@@.lime;Religious activities subsidy:@@'' will provide economic support to religious activities following the official dogma. + <<if $authority >= 1000>> + [[Implement|edicts][$subsidyChurch = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will provide authority each week, but will incur upkeep costs.// + <</if>> +<</if>> + +<<if $securityForceCreate == 1>> + <br><br>__Special Force:__ + <<if $SFSupportLevel == 0 && $reqHelots > 5>> + <br>''Equipment provision:'' $securityForceName will provide the security HQ with advanced equipment. + <<if $authority >= 1000>> + [[Implement|edicts][$SFSupportLevel++, $cash -=5000, $authority -= 1000, $SFSupportUpkeep += 1000, $reqHelots -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of personnel necessary to man the security HQ by 5, but will incur upkeep costs.// + <<elseif $SFSupportLevel == 1 && $securityForceArcologyUpgrades != 4 && $reqHelots > 5>> + <br>''Personnel training:'' $securityForceName will provide the security HQ personnel with advanced training. + <<if $authority >= 1000>> + [[Implement|edicts][$SFSupportLevel++, $cash -=5000, $authority -= 1000, $SFSupportUpkeep += 2000, $reqHelots -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.// + <<elseif $SFSupportLevel == 2 && $securityForceArcologyUpgrades != 6 && $reqHelots > 5>> + <br>''Troops detachment:'' $securityForceName will provide troops to the security department. + <<if $authority >= 1000>> + [[Implement|edicts][$SFSupportLevel++, $cash -=5000, $authority -= 1000, $SFSupportUpkeep += 3000, $reqHelots -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.// + <<elseif $SFSupportLevel == 3 && $securityForceArcologyUpgrades != 6 && $reqHelots > 5>> + <br>''Full Support:'' $securityForceName will give the security department it's full support. + <<if $authority >= 1000>> + [[Implement|edicts][$SFSupportLevel++, $cash -=5000, $authority -= 1000, $SFSupportUpkeep += 3000, $reqHelots -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.// + <<elseif $SFSupportLevel == 4 && $securityForceArcologyUpgrades == 13 && $reqHelots > 5>> + <br>''Network assistance:'' $securityForceName will assist the security department with installing a local version of their custom network. + <<if $authority >= 1000>> + [[Implement|edicts][$SFSupportLevel++, $cash -=50000, $authority -= 1000, $SFSupportUpkeep += 4000, $secHQUpkeep += 1000, $reqHelots -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.// + <</if>> +<</if>> + +<br><br>__Immigration:__ + +<<if $limitImmigration == 0>> + <br>''Immigration limits:'' institute limits to the amount of people the arcology will accept each week. + <<if $authority >= 1000>> + [[Implement|edicts][$openBorders = 0, $limitImmigration = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower the amount of people immigrating into the arcology and enhance security.// +<</if>> + +<<if $openBorders == 0>> + <br>''Open borders:'' considerably lower requirements to become citizens. + <<if $authority >= 1000>> + [[Implement|edicts][$openBorders = 1, $limitImmigration = 0, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase immigration to the arcology, but will increase crime.// +<</if>> + +<br><br>__Weapons:__ +<<if $weaponsLaw == 3>> + <br>''Heavy weaponry forbidden:'' set the range of weapons allowed within the arcology to non-heavy, non-explosive. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 2, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed.// +<<elseif $weaponsLaw == 2>> + <br>''All weapons allowed:'' allow residents of the arcology to buy, sell and keep weaponry of any kind within the arcology. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 3, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep -= 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly increase prosperity and provide a small weekly amount of reputation, but rebellions will be very well armed.// + <br>''Heavily restricted weaponry:'' set the range of weapons allowed within the arcology to non-automatic, non-high caliber. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will cost some authority each week, but rebellions will be poorly armed.// +<<elseif $weaponsLaw == 1>> + <br>''Heavy weaponry forbidden:'' set the range of weapons allowed within the arcology to non-heavy, non-explosive. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 2, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep -= 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed.// + <br>''Forbid weapons inside the arcology:'' forbid residents to buy, sell and keep weaponry while within the arcology. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 0, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will cost a moderate amount of authority each week, but rebellions will be very poorly armed.// +<<elseif $weaponsLaw == 0>> + <br>''Heavily restricted weaponry:'' set the range of weapons allowed within the arcology to non-automatic, non-high caliber. + <<if $authority >= 1000>> + [[Implement|edicts][$weaponsLaw = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep -= 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will cost some authority each week, but rebellions will be poorly armed.// +<</if>> + +<<if $hasFoughtOnce == 1 || $mercenaries > 0>> +<br><br>__Defense Force__: + + <<if $soldierWages == 0>> + <br>''Average wages for soldiers:'' will set the wages paid to the soldiers of the arcology to an average amount. + <<if $authority >= 1000>> + [[Implement|edicts][$soldierWages += 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will raise all units upkeep and push loyalty to average levels.// + <<elseif $soldierWages == 1>> + <br>''Low wages for soldiers:'' will set the wages paid to the soldiers of the arcology to a low amount. + <<if $authority >= 1000>> + [[Implement|edicts][$soldierWages -= 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower all units upkeep and push loyalty to low levels.// + <br>''High wages for soldiers:'' will set the wages paid to the soldiers of the arcology to a high amount. + <<if $authority >= 1000>> + [[Implement|edicts][$soldierWages += 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will raise all units upkeep and push loyalty to high levels.// + <<else>> + <br>''Average wages for soldiers:'' will set the wages paid to the soldiers of the arcology to an average amount. + <<if $authority >= 1000>> + [[Implement|edicts][$soldierWages -= 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will lower all units upkeep and push loyalty to average levels.// + <</if>> + + <<if $slavesOfficers == 0>> + <br>''Slave Officers:'' allow your trusted slaves to lead the defense forces of the arcology. + <<if $authority >= 1000>> + [[Implement|edicts][$slavesOfficers = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will allow your bodyguard and head girl to lead troops into battle, but will cost a small amount of authority each week.// + <</if>> + + <<if $mercenaries > 0>> + <<if $discountMercenaries == 0>> + <br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent. + <<if $authority >= 1000>> + [[Implement|edicts][$discountMercenaries = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly lower rent, but will increase the amount of available mercenaries.// + <</if>> + <</if>> + + <<if $militiaFounded == 0>> + <br>''Found the militia:'' lay the groundwork for the formation of the arcology's citizens' army. + <<if $authority >= 1000>> + [[Implement|edicts][$militiaFounded = 1, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will allow for the recruitment and training of citizens.// + <</if>> + + <<if $militiaFounded == 1>> + <<if $recruitVolunteers == 0>> + <br>''Volunteers' militia:'' only volunteers will be accepted in the militia. + <<if $authority >= 1000>> + [[Implement|edicts][$militarizedSociety = 0, $militaryService = 0, $conscription = 0, $recruitVolunteers = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will replenish militia manpower slowly and will cap at 2% of the total citizens population.// + <</if>> + <<if $conscription == 0>> + <br>''Conscription:'' every citizen is required to train in the militia and serve the arcology if the need arises. + <<if $authority >= 4000>> + [[Implement|edicts][$militarizedSociety = 0, $militaryService = 0, $conscription = 1, $recruitVolunteers = 0, $cash -=5000, $authority -= 4000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will replenish militia manpower moderatly fast and will cap at 5% of the total citizens population, but has a high authority cost// + <</if>> + <<if $militaryService == 0>> + <br>''Obligatory military service:'' every citizen is required to register and serve under the militia. + <<if $authority >= 6000>> + [[Implement|edicts][$militarizedSociety = 0, $militaryService = 1, $conscription = 0, $recruitVolunteers = 0, $cash -=5000, $authority -= 6000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will quickly replenish militia manpower and will cap at 10% of the total citizens population, but has a very high authority cost// + <</if>> + <<if $militarizedSociety == 0>> + <br>''Militarized Society:'' every adult citizen is required to train and participate in the defense of the arcology. + <<if $authority >= 8000>> + [[Implement|edicts][$militarizedSociety = 1, $militaryService = 0, $conscription = 0, $recruitVolunteers = 0, $cash -=5000, $authority -= 8000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will very quickly replenish militia manpower and will cap at 20% of the total citizens population, but has an extremely high authority cost// + <</if>> + + <<if $militaryExemption == 0 && ($conscription == 1 || $militaryService == 1 || $militarizedSociety == 1)>> + <br>''Military exemption:'' allow citizens to avoid military duty by paying a weekly fee. + <<if $authority >= 1000>> + [[Implement|edicts][$militaryExemption = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slow down the replenishment of manpower, but will supply cash each week. More profitable with stricter recruitment laws.// + <</if>> + + <<if $arcologies[0].FSHedonisticDecadence >= 40>> + <<if $lowerRquirements == 0>> + <br>''@@.lime;Revised minimum requirements:@@'' will allow citizens outside the normally accepted range to join the militia. + <<if $authority >= 1000>> + [[Implement|edicts][$lowerRquirements = 1, $cash -=5000, $authority -= 1000, $militiaBaseDefense--, $militiaBaseHp--]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly lower defense and hp of militia units, but will increase the manpower replenishment rate.// + <</if>> + <</if>> + + <<if $arcologies[0].FSSubjugationist >= 40>> + <<if $noSubhumansInArmy == 0>> + <br>''@@.lime;No subhumans in the militia:@@'' prevent subhumans from joining the militia. + <<if $authority >= 1000>> + [[Implement|edicts][$noSubhumansInArmy = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will help advance racial Subjugation, but will slow down slightly manpower replenishment.// + <</if>> + <</if>> + + <<if $arcologies[0].FSRepopulationFocus >= 40 && ($conscription == 1 || $militaryService == 1 || $militarizedSociety == 1)>> + <<if $pregExemption == 0>> + <br>''@@.lime;Military exemption for pregnancys:@@'' pregnant citizens will be allowed, and encouraged, to avoid military service. + <<if $authority >= 1000>> + [[Implement|edicts][$pregExemption = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will help advance repopulation focus, but will slow down slightly manpower replenishment.// + <</if>> + <</if>> + <</if>> + + <<if $militiaSoldierPrivilege == 0 && $militiaFounded == 1>> + <br>''Special militia privileges'' will allow citizens joining the militia to avoid paying rent. + <<if $authority >= 1000>> + [[Implement|edicts][$militiaSoldierPrivilege = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase the loyalty of militia units, but will decrease rents.// + <</if>> + + <<if $slaveSoldierPrivilege == 0>> + <br>''Special slaves privileges'' will allow slaves drafted into the army to be able to have material possessions. + <<if $authority >= 1000>> + [[Implement|edicts][$slaveSoldierPrivilege = 1, $cash -=5000, $authority -= 1000, $edictsAuthUpkeep += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase the loyalty of slave units, but will cost authority each week.// + <</if>> + + <<if $mercSoldierPrivilege == 0 && $mercenaries > 0>> + <br>''Special mercenary privileges'' will allow mercenaries under contract to claim part of the loot gained from battles. + <<if $authority >= 1000>> + [[Implement|edicts][$mercSoldierPrivilege = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase the loyalty of mercenary units, but will reduce cash and menial slaves gained from battles.// + <</if>> + + <<if $arcologies[0].FSPhysicalIdealist >= 40>> + <<if $martialSchool == 0>> + <br>''@@.lime;Slave martial schools:@@'' specialized schools will be set up to train slaves in martial arts and bodyguarding. + <<if $authority >= 1000>> + [[Implement|edicts][$martialSchool = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $slaveBaseMorale += 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly increase morale of slave units, but will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSRestart >= 40>> + <<if $eliteOfficers == 0>> + <br>''@@.lime;Elite officers:@@'' officers will be exclusively recruited from the elite of society. + <<if $authority >= 1000>> + [[Implement|edicts][$eliteOfficers = 1, $cash -=5000, $authority -= 1000, $militiaBaseMorale += 5, $slaveBaseMorale -= 5]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will help advance eugenics and provide a small morale boost to militia units, but will give a small morale malus to slave units.// + <</if>> + <</if>> + + <<if $arcologies[0].FSDegradationist >= 40>> + <<if $liveTargets == 0>> + <br>''@@.lime;Live targets drills:@@'' disobedient slaves will be used as live targets at shooting ranges. + <<if $authority >= 1000>> + [[Implement|edicts][$liveTargets = 1, $cash -=5000, $authority -= 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will help advance degredationism and provide a small amount of exp to units, but will make the slave population slowly decline.// + <</if>> + <</if>> +<</if>> + +<<if $FSAnnounced>> + <br><br>__Future Societies:__ + <<if $arcologies[0].FSRomanRevivalist >= 40 && $militiaFounded == 1>> + <<if $legionTradition == 0>> + <br>''@@.lime;Legionaries traditions:@@'' Fund specialized training for your recruits to turn them into the professional of Roman tradition. + <<if $authority >= 1000>> + [[Implement|edicts][$legionTradition = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $militiaBaseDefense += 2, $militiaBaseMorale += 5, $militiaBaseHp++]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase defense, morale and hp of militia units, but will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSEgyptianRevivalist >= 40 && $militiaFounded == 1>> + <<if $pharaonTradition == 0>> + <br>''@@.lime;Legionaries traditions:@@'' Fund specialized training for your recruits to turn them into an army worthy of a pharaon. + <<if $authority >= 1000>> + [[Implement|edicts][$pharaonTradition = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $militiaBaseAttack += 2, $militiaBaseDefense += 2, $militiaBaseMorale += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase attack, defense and morale of militia units, but will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSAztecRevivalist >= 40 && $mercenaries > 0>> + <<if $eagleWarriors == 0>> + <br>''@@.lime;Eagle warriors traditions:@@'' Fund specialized training for your mercenaries to turn them into the elite units of Aztec tradition. + <<if $authority >= 1000>> + [[Implement|edicts][$eagleWarriors = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $mercBaseAttack += 4, $mercBaseDefense -= 2, $mercBaseMorale += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will give a high increase in attack and morale, but will lower defense of mercenary units and will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSEdoRevivalist >= 40 && $mercenaries > 0>> + <<if $ronin == 0>> + <br>''@@.lime;Ronin traditions:@@'' Fund specialized training for your mercenaries to turn them into the errant samurai of Japanese tradition. + <<if $authority >= 1000>> + [[Implement|edicts][$ronin = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $mercBaseAttack += 2, $mercBaseDefense += 2, $mercBaseMorale += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase attack, defense and morale of mercenary units, but will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSArabianRevivalist >= 40>> + <<if $mamluks == 0>> + <br>''@@.lime;Mamluks traditions:@@'' Fund specialized training for your slaves to turn them into the mamluks slave soldiers of Arabian tradition. + <<if $authority >= 1000>> + [[Implement|edicts][$ronin = 1, $cash -=5000, $authority -= 1000, $edictsUpkeep += 1000, $slaveBaseAttack += 2, $slaveBaseHp++, $slaveBaseMorale += 10]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will increase attack, morale and hp of mercenary units, but will incur upkeep costs.// + <</if>> + <</if>> + + <<if $arcologies[0].FSChineseRevivalist >= 40>> + <<if $sunTzu == 0>> + <br>''@@.lime;Sun Tzu Teachings:@@'' Fund specialized training for your units and officers to comform your army to the teachings of the "Art of War". + <<if $authority >= 1000>> + [[Implement|edicts][$sunTzu = 1, $cash -=5000, $authority -= 1000, $militiaBaseAttack++, $militiaBaseDefense++, $mercBaseAttack++, $mercBaseDefense++, $slaveBaseAttack++, $slaveBaseDefense++, $militiaBaseMorale += 5, $mercBaseMorale += 5, $slaveBaseMorale += 5, $edictsUpkeep += 1000]] + <<else>> + <br>//Not enough Authority.// + <</if>> + <br> //Will slightly increase attack, defense and morale of all units, but will incur upkeep costs.// + <</if>> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/encyclopediaSecExpBattles.tw b/src/SecExp/encyclopediaSecExpBattles.tw new file mode 100644 index 0000000000000000000000000000000000000000..94be28f1f635813227c1546d403bab4fa42c55a1 --- /dev/null +++ b/src/SecExp/encyclopediaSecExpBattles.tw @@ -0,0 +1,45 @@ +:: encyclopediaSecExpBattles [nobr] + +Battles in the Security Expansion Mod +<hr> + +With the Security Expansion mod enabled there is a small chance each week that an attacking force will be approaching the arcology. Their motives may vary, but their intentions are clear: hit you where it hurts. +You arcology will start being the subject of incursions only when the "security drones" upgrade has been installed. +<br> +<br>Unit types: +<br><strong>Slave Units</strong>: recruitable from your stockpile of menial slaves. They are cheap, easy to replace troops that will hold the line well enough. +Of the three they have the lowest base stats, but they have the advantage of being available from the beginning, have the lowest upkeep and can be replenished in any moment, provided enough cash is available. +<br><strong>Militia Units</strong>: recruitable only after a special edict is passed. Once the militia is announced recruitment laws will become available and recruits will present themselves to the barracks, waiting to be assigned to a unit. +Militia units are slightly stronger than slave units, but their manpower is limited by the laws enacted and the citizen population. +<br><strong>Mercenary Units</strong>: installing a permanent platoon in the arcology is a great defensive tool, but if you need muscle outside the walls of your dominion you'll need to hire more. +Mercenary units have the highest base stats (in almost all categories), but are also only available if the arcology is garrisoned by the mercenary platoon, are fairly slow to replenish and have the highest upkeep. +One garrisoned by the mercenary platoon,more mercenaries will slowly make their way to the arcology. You have little control over their number other than increasing your arcology prosperity or your reputation. +<br><strong>The Security Drones</strong>: The security drones are a special unit. You cannot field more than one unit of this type and their stats (with the exception of their very high morale) are fairly low, however they cheap to replenish and have a low maintenance cost. +Security drones do not accumulate experience and are not affected by morale modifiers (for better or worse). +<br> +<br>Units statistics: +<br><strong>Troops</strong>: The number of active combatants the unit can field. If it reaches zero the unit will cease to be considered active. It may be reformed as a new unit without loosing the upgrades given to it, but experience is lost. +<br><strong>Maximum Troops</strong>: The maximum number of combatants the unit can field. You can increase this number through upgrade. +<br><strong>Equipment</strong>: The quality of equipment given to the unit. Each level of equipment will increase attack and defense values of the unit by 15%. +<br><strong>Experience</strong>: The quality of training provide/acquired in battle by the unit. Experience is a 0-100 scale with increasingly high bonuses to attack, defense and morale of the unit, to a maximum of 50% at 100 experience. +<br><strong>Medical support</strong>: Attaching medical support to the unit will decrease the amount of casualties the unit takes in battle. +<br> +<br>Battles: +<br>Battles are fought automatically, but you can control various fundamental parameters, here are the most important statistics: +<br><strong>Readiness</strong>: readiness represents how prepared the arcology is to face an attack. For every point of readiness you can field two units. You can find upgrades for in in the security HQ. +<br><strong>Tactics</strong>: Tactics are the chosen plan of action. You should carefully choose one depending on the terrain, type of enemy and leader choice, because if applied successfully they can sway a battle in your favor or doom your troops. +<br><strong>Terrain</strong>: Terrain has a great influence on everything, but mainly on the effectivenes of the tactic chosen. +<br><strong>Leader</strong>: The leader is who will command the combined troops in the field. Each type of leader has its bonuses and maluses. +<br> +<br>Leaders: +<br><strong>The Assistant</strong>: The assistant can lead the troops. Her performance will entirely depend on the computational power she has available. Non human soldiers will be happy to be lead by a computer however and will fight with less ardor, unless your own reputation or authority is high enough. +<br><strong>The Arcology Owner</strong>: You can join the fray yourself. your performance will depend greatly on your warfare skill and your past. The troops will react to your presence depending on your social standing and your past as well. + Do however there is the possibility of getting wounded, which makes you unable to focus on any task for a few weeks. +<br><strong>Your Bodyguard</strong>: Your bodyguard can guide the troops. Her performance will greatly depend on her intelligence and past. Slaves will be happy to be lead by one of them, but militia and mercenaries will not, unless your own authority is high enough to make up for the fact they are being lead by a slave. +<br><strong>Your Head Girl</strong>: Your Head Girl can guide the troops. She acts very similarly to the bodyguard in battle. Be aware that both her and the bodyguard run the risk of getting wounded, potentially with grave wounds like blindness or limb loss. +<br><strong>An Outstanding Citizen</strong>: One of your citizens can take the leading role. Their performance will be average, however the militia will be pleased to be guided by one of them. +<br>To allow slaves to lead troops a specific edict will have to be enacted. +<br><strong>A Mercenary Officer</strong>: One of the mercenary commanders can take the lead. Their performance will be above average and mercenary units will be more confident, knowing they're being lead by someone with experience. +<br><strong>The colonel</strong>: The special force's colonel can take the lead. Her performance will be above average and mercenary (in addiotn to her's obviously) units will be more confident, knowing they're being lead by someone with experience. Her tatics have a higher chance of success along with better offence and defense. +<br> +<br> \ No newline at end of file diff --git a/src/SecExp/encyclopediaSecExpMain.tw b/src/SecExp/encyclopediaSecExpMain.tw new file mode 100644 index 0000000000000000000000000000000000000000..bd0e062ac6cc28c31ab46430465872f173371c56 --- /dev/null +++ b/src/SecExp/encyclopediaSecExpMain.tw @@ -0,0 +1,35 @@ +:: encyclopediaSecExpMain [nobr] + +The Security Expansion Mod +<hr> +Note: The Security Expansion mod is an optional mod. It can be switched freely on and off from the game option menu or at the start of the game. +<br> +<br>The world of Free Cities is not a forgiving one, those who do not seek to dominate it, will inevitably be dominated themselves. +Good rulers need to keep control of its realm, if they want to have long and prosperous lives. +You will have to manage your authority inside the walls of your arcology, you will have to keep it secure and keep in check crime and rivals alike, you will have to take up arms and command your troops agaist those who defy your rule. +<br> +<br>Statistics: +<br><strong>Authority</strong>: +<br>representing the power the player holds over the arcology. If reputation is how well the protagonist is known, authority is how much is feared or respected. +Authority influences many things, but it is mainly used to enact edicts, who, similarly to policies, allow to shape the sociopolitical profile of your arcology. Like reputation, authority has a maximum of 20k. +<br><strong>Security</strong>: +<br>representing how safe the arcology is, how likely it is for a citizen to get stabbed, killed or simply mugged in the streets as well as wider concerns like +dangerous political organizations, terrorist groups and more. It influences many things, but its main task is to combat crime. +<br><strong>Crime</strong>: +<br>representing the accumulated power of criminals in the arcology. Rather than representing low level criminal activity, better represented by security (or better lack of), but +the influence, organization and radication of criminal organizations, be it classic mafia families or high tech hacker groups. Do not let their power run rampant or you'll find your treasury emptier and emptier. +Both security and crime are displayed a 0-100% scale. +<br> +<br>The battles: +<br>Arcologies are sturdy structures, difficult to assault without preparation or overwhelming numbers. Security drones can easily handle small incursion and a few well placed mercenary squads can handle the rest. +However, in ordor for free cities to survive they need many things, many of which expensive. If you want your arcology to survive the tide of times, you'll better prepare your soldiers and defend the vital lifelines that connect your arcology with the rest of the world. +For a detailed outlook of how battles work see the relative page. +<br> +<br>Buildings: +<br><strong>The Barracks</strong>: This is where troops can be prepared and organized to respond to threats encroaching on the arcology's territory. +<br><strong>The Security HQ</strong>: This is where your security department will manage the security of the arcology. +<br><strong>The Propaganda Hub</strong>: This is where your propaganda department will expand and deepen your authority over the arcology. +<br><strong>The transportHub</strong>: This is where trade happens. Mainly intended as a counter to proserity loss events. +<br><strong>The riotControlCenter</strong>: Fairly self explanitory, will help you manage rebellions. +<br> +<hr> \ No newline at end of file diff --git a/src/SecExp/proclamations.tw b/src/SecExp/proclamations.tw new file mode 100644 index 0000000000000000000000000000000000000000..c4bd9ba2199df0351169053fc0c9a92d4da9c455 --- /dev/null +++ b/src/SecExp/proclamations.tw @@ -0,0 +1,37 @@ +:: proclamations [nobr] + +<<set $nextButton = "Back to Main", $nextLink = "Main">> + +You can dedicate the week to issue a proclamation, a powerful tool that will have an immediate noticeable effect on the arcology. +You will use <<print $proclamationCurrency>> to enact it<<if $proclamationType != "none">> and will be about $proclamationType.<<else>>.<</if>> +<br> +<<link "Use authority">> + <<set $proclamationCurrency = "authority">> + <<goto "proclamations">> +<</link>> +| +<<link "Use reputation">> + <<set $proclamationCurrency = "reputation">> + <<goto "proclamations">> +<</link>> +| +<<link "Use cash">> + <<set $proclamationCurrency = "cash">> + <<goto "proclamations">> +<</link>> +<br> +<br> +<<link "Issue a proclamation about security">> + <<set $personalAttention = "proclamation", $personalAttentionChanged = 1, $proclamationType = "security">> + <<goto "Main">> +<</link>> +<br>//You will use your <<if $proclamationCurrency == "authority">>control over the arcology<<elseif $proclamationCurrency == "reputation">>great influence<<elseif $proclamationCurrency == "cash">> vast financial means<</if>> +to force citizens to give up on sensitive information for the good of the arcology.// +<br> +<br> +<<link "Issue a proclamation about crime">> + <<set $personalAttention = "proclamation", $personalAttentionChanged = 1, $proclamationType = "crime">> + <<goto "Main">> +<</link>> +<br>//You will use your <<if $proclamationCurrency == "authority">>control over the arcology<<elseif $proclamationCurrency == "reputation">>great influence<<elseif $proclamationCurrency == "cash">> vast financial means<</if>> +to force the arrest of suspected citizens without passing through the normal legal procedures.// \ No newline at end of file diff --git a/src/SecExp/propagandaHub.tw b/src/SecExp/propagandaHub.tw new file mode 100644 index 0000000000000000000000000000000000000000..6c974865e0251f727f2251ae5fa9f100edf6794d --- /dev/null +++ b/src/SecExp/propagandaHub.tw @@ -0,0 +1,195 @@ +:: propagandaHub [nobr] + +<<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">> + +Propaganda Hub +<hr> + +The propaganda hub is a surprisingly inconspicuous building, dimly lit from the outside. You are well aware however of its role and its importance. You confidently enter its unassuming doorway and calmly review the work being done here. + +<br> +<br> + +/* classic propaganda */ +<<if $propCampaign == 0>> + <<link "Set up a propaganda campaign">> + <<set $propCampaign += 1>> + <<set $cash -= 5000*$upgradeMultiplierArcology>> + <<set $propFocus = "social engineering">> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Set up a propaganda campaign to align your citizens with your goals. + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will provide the focused resource each week, but will cost reputation in upkeep.// +<<else>> + You have set up a team of trained slaves and expert propagandists, ready to spread the message of your choosing to the population. + <br> + <<if $propFocus == "social engineering">> + Focus on social engineering + <<else>> + <<link "Focus on social engineering">> + <<set $propFocus = "social engineering">> + <<goto "propagandaHub">> + <</link>> + <</if>> + | + <<if $propFocus == "immigration">> + Focus on immigration + <<else>> + <<link "Focus on immigration">> + <<set $propFocus = "immigration">> + <<goto "propagandaHub">> + <</link>> + <</if>> + | + <<if $propFocus == "enslavement">> + Focus on enslavement + <<else>> + <<link "Focus on enslavement">> + <<set $propFocus = "enslavement">> + <<goto "propagandaHub">> + <</link>> + <</if>> + | + <<if $propFocus == "recruitment">> + Focus on recruitment + <<else>> + <<link "Focus on recruitment">> + <<set $propFocus = "recruitment">> + <<goto "propagandaHub">> + <</link>> + <</if>> + <br> + <<if $propFocus == "social engineering">> + You are concentrating your propaganda efforts towards increasing the acceptance of your chosen future societies. + <<elseif $propFocus == "immigration">> + You are concentrating your propaganda efforts towards convincing more people to immigrate to your arcology. + <<elseif $propFocus == "enslavement">> + You are concentrating your propaganda efforts towards convincing more people to voluntarily enslave themselves. + <<elseif $propFocus == "recruitment">> + You are concentrating your propaganda efforts towards convincing more citizens to enter the militia. + <</if>> + <br> + <<if $propCampaign < 5>> + <<link "Invest more resources in the propaganda machine">> + <<set $propCampaign += 1>> + <<set $cash -= 5000 * $upgradeMultiplierArcology * ($propCampaign + 1)>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Invest more resources into the project to increase its effectiveness. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($propCampaign + 1))>>. Will provide more of the focused resource each week, but increase reputation upkeep.// + <<else>> + You upgraded your propaganda machine to its limits. + <</if>> +<</if>> + +<br> +<br> + +/* ministry of truth */ +<<if $miniTruth == 0>> + <<link "Set up the authenticity department">> + <<set $miniTruth += 1>> + <<set $cash -= 5000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Set up a department tasked with guaranteeing the authenticity of all information available in the arcology. Of course if reality is against what is best for the arcology, then it should be redacted as well. + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will provide authority and unlock special upgrades, but will increase upkeep.// +<<else>> + <<if $miniTruth < 5>> + <<link "Enlarge the authenticity department">> + <<set $miniTruth += 1>> + <<set $cash -= 5000*$upgradeMultiplierArcology * ($miniTruth + 1)>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Invest more resources into the project to increase its effectiveness. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($miniTruth + 1))>>. Will provide more authority each week, but increases upkeep.// + <<else>> + You have upgraded the authenticity department to its maximum. + <</if>> + <br> + <<if $fakeNews == 0>> + <<link "Install a news generator">> + <<set $fakeNews = 1>> + <<set $cash -= 10000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Install an automatic news generator, able to fabricate thousands of plausible sounding news every day. + <br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The authenticity dept. now provides a small amount of reputation as well as authority, but increases upkeep.// + <<else>> + You have installed an automatic news generator. + <</if>> + <br> + <<if $controlLeaks == 0>> + <<link "Institute controlled leaks protocols">> + <<set $controlLeaks = 1>> + <<set $cash -= 10000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Institute a system able to release erroneous, but plausible, information about your business, leading your competitors to prepared financial traps. + <br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The authenticity dept. now slightly increases prosperity each week as well as authority, but increases upkeep.// + <<else>> + You have instituted controlled leaks protocols, able to create fabricated leaks of sensible information. + <</if>> +<</if>> + +<br> +<br> + +/* secret police */ +<<if $secretService == 0>> + <<link "Set up personal secret service">> + <<set $secretService += 1>> + <<set $cash -= 10000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Set up a department tasked with the protection of your person, as well as operations requiring a delicate approach. + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will provide authority and unlock special upgrades, but will increase upkeep.// +<<else>> + <<if $secretService < 5 && $rep >= ($secretService * 1000) + 5000>> + <<link "Expand the secret service">> + <<set $secretService += 1>> + <<set $cash -= 5000*$upgradeMultiplierArcology * ($secretService + 1)>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Invest more resources into the project to increase its effectiveness. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($secretService + 1))>>. Will provide more authority each week, but increases upkeep.// + <<elseif $secretService < 5>> + You lack the reputation to further expand operations. + <<else>> + You have upgraded the secret service to its maximum. + <</if>> + <br> + <<if $blackOps == 0>> + <<link "Create a black ops team">> + <<set $blackOps = 1>> + <<set $cash -= 10000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Create a black ops team, ready to carry out corporate sabotage and sensitive operations to further your goals. + <br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The secret services now provides security as well as authority, but increases upkeep.// + <<else>> + You have created a black ops team. + <</if>> + <br> + <<if $marketInfiltration == 0>> + <<link "Infiltrate the black market">> + <<set $marketInfiltration = 1>> + <<set $cash -= 10000*$upgradeMultiplierArcology>> + <<set $propHubUpkeep += $upgradeUpkeep>> + <<goto "propagandaHub">> + <</link>> + <br>Establish a presence on the black market in order to manipulate it. + <br>//Costs ¤<<print Math.trunc(10000 * $upgradeMultiplierArcology)>>. The secret services now provides cash as well as authority each week, but will increase crime growth.// + <<else>> + You have infiltrated the black market and are now in partial control of it. + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/rebellionEvents.tw b/src/SecExp/rebellionEvents.tw new file mode 100644 index 0000000000000000000000000000000000000000..170174efd2214a551ebcd5efa4fe9a92fc77d15e --- /dev/null +++ b/src/SecExp/rebellionEvents.tw @@ -0,0 +1,119 @@ +:: rebellionEvents [nobr] + +<<if $slaveRebellionEventFires == 1>> + <<if $tension <= 33>> + <<set _event = 1>> + <<elseif $tension <= 66>> + <<set _event = 2>> + <<else>> + <<set _event = 3>> + <</if>> +<<elseif $citizenRebellionEventFires == 1>> + <<if $tension <= 33>> + <<set _event = 4>> + <<elseif $tension <= 66>> + <<set _event = 5>> + <<else>> + <<set _event = 6>> + <</if>> +<</if>> + +<<switch _event>> +<<case 1>> + /* low tension slave rebellion events */ + <<set _rand = random(0,6)>> + <<if _rand == 0>> + This week several slaves were found plotting the death of their master. They were quickly dealt with, but their owner's choice of punishment did little to calm tensions in the arcology. + <<elseif _rand == 1>> + This week a large group of slaves attempted to escape. Several were recaptured, but others were deemed to dangerous and were shot on sight. The unfortunate circumstances raised the disapproval of many citizens, either because of the waste of good slaves or the brutality with which the operation was carried. With a bit of luck, however, the incident will be soon forgotten. + <<elseif _rand == 2>> + This week books of unknown origin and dangerous content were found in the possession of several slaves. They were mostly sociopolitical treaties, making it clear that the intent of the responsible was to fan the fire of rebellion. The books were quickly collected and archived, hopefully this affair will not have lasting consequences. + <<elseif _rand == 3>> + This week a citizen was caught giving refuge to an escaped slave. He was not able to pay for the value of the stolen goods, so he was processed as the case required and the slave returned to their rightful master. Many questions however remain without answers. + <<elseif _rand == 4>> + This week a member of a well known anti-slavery group was caught trying to infiltrate the arcology. During the capture attempt shots were fired and several guards were injured, unfortunately the fugitive managed in the end to escape. Reports indicate several slaves helped the criminal, some going as far as using themselves as shields against the bullets of the security drones. + <<elseif _rand == 5>> + This week a slave was caught attempting to sabotage a machine in one of the factories. She explained her action as "trying to defend herself from a dangerous machine". Reports confirmed that the apparatus is indeed quite deadly, having killed several slave since it was installed, but the expert way she handled the sabotage leaves open the possibility of a deliberate plan or even external help. + <<else>> + This week a slave was found dead in one of the sewer tunnels. It seems she was stabbed repeatedly with a sharp object. She was fairly famous for her capabilities as a slave trainer, her old master spent not an insignificant amount of money trying to find her once he realized she was missing. The episode might have been a simple mugging gone wrong, but her activities as a slave breaker might have played a role in her homicide. + <</if>> + <<set $tension += random(1,5)>> +<<case 2>> + /* med tension slave rebellion events */ + <<set _rand = random(0,5)>> + <<if _rand == 0>> + This week some strange reports came in: it seems some assemblies of slaves were observed several nights in a row. The slaves were traced and their masters notified, but many suspect there may be something deeper than a few slaves congregating in the night. + <<elseif _rand == 1>> + This week an underground railroad was discovered. The rebels did not go down without a fight, but in the end <<if $mercenaries >= 1>>your mercenaries<<else>>your security drones<</if>> managed to destroy the old tunnels they were using to ship out slaves out of the arcology. + <<elseif _rand == 2>> + This week a famous citizen was assaulted and brutally murdered by his slaves. The responsible were apprehended and dealt with easily enough, but the mere fact something like this could have happened is concerning. Those slaves had to be aware of their certain doom. + <<elseif _rand == 3>> + This week a group of slavers entering the arcology was assaulted. Many reported heavy injuries, but fortunately there were no casualties. The assaulters were disguised, but the security systems already identified several slaves who were likely part of the group, based on camera feeds. + <<elseif _rand == 4>> + This week the waterways were found infected by a virulent pathogen. The cause was later found to be a diseased slave that died while in the maintenance tunnels. It's not clear if the slave was there because of orders given to him or if he was trying to escape. + <<else>> + This week a sleeper cell of a famous anti slavery organization was discovered in the low levels of the arcology. The group however was aware of the coming security forces and repeated before they could be dealt with. + <</if>> + <<set $tension += random(5,10)>> +<<case 3>> + /* high tension slave rebellion events */ + <<set _rand = random(0,4)>> + <<if _rand == 0>> + This week a group of slaves took control of one of the manufacturing plants and barricaded themselves inside. It took several days of negotiations and skirmishes to finally end this little insurrection. Many of the slaves involved will be executed in the next days. + <<elseif _rand == 1>> + This week a number of shops were burned to the ground by rioting slaves and sympathetic citizens. It took considerable effort for the security forces to take control of the situation. Harsh punishment is required and scheduled for the instigators. + <<elseif _rand == 2>> + This week a mass escape attempt was barely stopped before becoming a catastrophe. Many citizens were trampled by their terrorized peers of the desperate horde of slaves. It will take some time to restore the streets involved to working order. + <<elseif _rand == 3>> + This week a number of riots inflamed the arcology. Many slaves took violent actions against citizens and security personnel. The number of victims keeps getting higher as still now the last sparks of revolt are still active. + <</if>> + <<set $tension += random(10,15)>> +<<case 4>> + <<set _rand = random(0,6)>> + <<if _rand == 0>> + This week a citizen refused to pay rent, claiming ideological opposition to the arcology's owner policies. He was quickly dealt with, but his words might not have fallen silent yet. + <<elseif _rand == 1>> + This week books of unknown origin and dangerous content were found in the possession of several citizens. They were mostly sociopolitical treaties, making it clear that the intent of the responsible was to fan the fire of rebellion. Most of them were bought and archived, but a few are still circling between the citizens of the arcology. + <<elseif _rand == 2>> + This week a citizen was caught giving refuge to other citizens, who would be liable to be enslaved because of their debts. The situation was quickly resolved, but the misplaced generosity of that citizen might have inflamed a few souls. + <<elseif _rand == 3>> + This week a citizen died in one of the factories. His death sparked some outrage, even some talk of protests against the owners of the factory, but things seem to have calmed down for now. + <<elseif _rand == 4>> + This week a citizen refused to be evicted from his house. After some negotiations the man was forcibly removed from the property by your security forces. Unfortunately the forced entry caused some damage to the building. + <<elseif _rand == 5>> + This week a citizen refused to be enslaved as his contract established. With an impressive display of his rhetoric capabilities he managed to gather a small crowd agreeing with his position. The impromptu assembly was promptly disrupted by the drones. + <<else>> + This week a security drone was found disabled and stripped of important electronic components. It seems the act was not dictated by greed, as the most precious parts of the drone were left on the machine, but rather to cover up something that the drone saw. + <</if>> + <<set $tension += random(1,5)>> +<<case 5>> + <<set _rand = random(0,5)>> + <<if _rand == 0>> + This week a factory was subject to a strike by a group of citizens protesting against the owner. They were promptly arrested and the factory returned to its rightful proprietor by our security department. + <<elseif _rand == 1>> + This week a group of citizens organized a protest against the systemic enslavement of the citizens of the arcology. Their little parade gathered a surprisingly large crowd, but it was nonetheless quickly suppressed by our forces. + <<elseif _rand == 2>> + This week the security department registered the formation of several assemblies of citizens, whose purpose seems to be political in nature. For now no further steps were taken, but it's a worrying sign of further political opposition within the arcology. + <<elseif _rand == 3>> + This week there was a protest against one of the wealthiest citizen of the arcology. Many criticize his near monopoly. Supporters of the citizen met the protestors on the streets and it was just thanks to the intervention of the security drones that violence was avoided. + <<elseif _rand == 4>> + This week several cameras were sabotaged and in many cases damaged beyond repair. A group of anonymous citizens claims to be responsible, their motivation is apparently the excessive surveillance in the arcology and their attack a response to the breach of their privacy. + <<else>> + This week several citizens barricaded themselves in a private brothel. It seems their intention is to protest against the use of ex-citizens in the sex trade, claiming that such a position is unfitting for them. The problem was quickly resolved with the intervention of the security department. + <</if>> + <<set $tension += random(5,10)>> +<<case 6>> + <<set _rand = random(0,4)>> + <<if _rand == 0>> + This week the arcology was shaken by a number of strikes throughout the manufacturing levels. Many lament the predatory nature of Free Cities society, many other just want to cause damage to their perceived oppressors. It was a significant effort for the security department to stop all protests. + <<elseif _rand == 1>> + This week several factories were set aflame by their workers. The security department worked day and night to control the fire and apprehend the criminals behind the act. Many are known dissidents, but there are a fair few new faces within them. This is a worrying sign. + <<elseif _rand == 2>> + This week numerous riots exploded all over the arcology. Many citizens went in the streets to protest against the arcology owner and its supporters. The security forces slowly managed to stop the rioters, with no little trouble and only through generous use of violence. + <<elseif _rand == 3>> + This week a massive protest of citizens and slaves gathered just outside the penthouse. The crowd was dispersed only after several hours. There were several victims from both sides and no shortage of injured. + <</if>> + <<set $tension += random(10,15)>> +<</switch>> + +<<set $tension = Math.clamp($tension,0,100)>> \ No newline at end of file diff --git a/src/SecExp/rebellionGenerator.tw b/src/SecExp/rebellionGenerator.tw new file mode 100644 index 0000000000000000000000000000000000000000..4905a6cd146db452e0cf126ad730022ddc6be03b --- /dev/null +++ b/src/SecExp/rebellionGenerator.tw @@ -0,0 +1,390 @@ +:: rebellionGenerator [nobr] + +<<set _slave = 0>> +<<set _citizen = 0>> +<<set _CSratio = $ACitizens / $ASlaves>> + +<strong>Slaves security analysis:</strong> +<<if $authority <= 3000>> + Your very low authority allows slaves to think too freely.<<set _slave += 30>> +<<elseif $authority <= 6000>> + Your low authority allows slaves to think too freely.<<set _slave += 25>> +<<elseif $authority <= 9000>> + Your moderate authority allows slaves to think a bit too freely.<<set _slave += 20>> +<<elseif $authority <= 12000>> + Your good authority does not allow slaves to think too freely.<<set _slave += 15>> +<<elseif $authority <= 15000>> + Your high authority does not allow slaves to think too freely.<<set _slave += 10>> +<<elseif $authority <= 18000>> + Your very high authority does not allow slaves to think too freely.<<set _slave += 5>> +<</if>> +<<if _CSratio <= 0.2>> + There are a lot more slaves than citizens, making some doubt their masters are strong enough to stop them.<<set _slave += 30>> +<<elseif _CSratio <= 0.4>> + There are a lot more slaves than citizens, making some doubt their masters are strong enough to stop them.<<set _slave += 25>> +<<elseif _CSratio <= 0.6>> + There are more slaves than citizens, making some doubt their masters are strong enough to stop them.<<set _slave += 20>> +<<elseif _CSratio <= 0.8>> + There are more slaves than citizens, making some doubt their masters are strong enough to stop them.<<set _slave += 15>> +<<elseif _CSratio <= 1>> + There are less slaves than citizens, making some doubt they would be strong enough to defeat their masters.<<set _slave += 10>> +<<elseif _CSratio >= 1.2>> + There are less slaves than citizens, making some doubt they would be strong enough to defeat their masters.<<set _slave -= 5>> +<</if>> +<<if $security <= 10>> + The very low security of the arcology leaves free space for slaves to organize and agitate.<<set _slave += 30>> +<<elseif $security <= 30>> + The low security of the arcology leaves free space for slaves to organize and agitate.<<set _slave += 20>> +<<elseif $security <= 60>> + The moderate security of the arcology does not allow free space for slaves to organize and agitate.<<set _slave += 10>> +<<elseif $security >= 90>> + The high security of the arcology does not allow free space for slaves to organize and agitate.<<set _slave -= 5>> +<</if>> +<<if $arcologies[0].FSDegradationist != "unset">> + Many slaves are so disgusted by your degradationist society, that are willing to rise up against their masters to escape.<<set _slave += 30>> +<<elseif $arcologies[0].FSPaternalist != "unset">> + Many slaves are content to live in your paternalist society.<<set _slave -= 5>> +<<else>> + <<set _slave += 5>> +<</if>> +<<if $arcologies[0].FSRestart != "unset">> + Many slaves are worried by your eugenics projects and some are pushed towards radicalization.<<set _slave += 30>> +<<elseif $arcologies[0].FSRepopulationFocus != "unset">> + Many slaves are pleasantly happy of your repopulation effort, affording them the freedom to reproduce.<<set _slave -= 5>> +<<else>> + <<set _slave += 5>> +<</if>> +<br> +<br> +<strong>Citizens security analysis:</strong> +<<if $authority <= 3000>> + Your very low authority allows your citizens to think too freely.<<set _citizen += 30>> +<<elseif $authority <= 6000>> + Your very low authority allows your citizens to think too freely.<<set _citizen += 25>> +<<elseif $authority <= 9000>> + Your moderate authority allows your citizens to think a bit too freely.<<set _citizen += 20>> +<<elseif $authority <= 12000>> + Your good authority does not allow your citizens to think too freely.<<set _citizen += 15>> +<<elseif $authority <= 15000>> + Your high authority does not allow your citizens to think too freely.<<set _citizen += 10>> +<<elseif $authority <= 18000>> + Your very high authority does not allow your citizens to think too freely.<<set _citizen += 5>> +<</if>> +<<if $crime >= 90>> + The very high crime level of the arcology breeds extreme discontent between your citizens.<<set _citizen += 30>> +<<elseif $crime >= 60>> + The high crime level of the arcology breeds high discontent between your citizens.<<set _citizen += 15>> +<<elseif $crime >= 30>> + The low crime level of the arcology leaves your citizens happy and satisfied.<<set _citizen += 5>> +<<else>> + The very low crime level of the arcology leaves your citizens happy and satisfied.<<set _citizen -= 5>> +<</if>> +<<if $militiaFounded == 1>> + <<if ($arcologies[0].FSRomanRevivalist == "unset" && $arcologies[0].FSAztecRevivalist == "unset" && $arcologies[0].FSEgyptianRevivalist == "unset" && $arcologies[0].FSEdoRevivalist == "unset" && $arcologies[0].FSArabianRevivalist == "unset" && $arcologies[0].FSChineseRevivalist == "unset")>> + <<if $militarizedSociety == 1>> + Many of your citizens are offended by your extreme militarization of the arcology's society.<<set _citizen += 20>> + <<elseif $militaryService == 1>> + Many of your citizens are offended by your militarization of the arcology's society.<<set _citizen += 15>> + <<else>> + <<set _citizen += 10>> + <</if>> + <<else>> + <<if $militarizedSociety == 1>> + Some of your citizens are offended by your extreme militarization of the arcology's society<<set _citizen += 10>> + <<elseif $militaryService == 1>> + Some of your citizens are offended by your militarization of the arcology's society<<set _citizen += 5>> + <<else>> + <<set _citizen -= 5>> + <</if>> + <</if>> +<</if>> +<<if $arcologies[0].FSNull != "unset">> + Many of your more conservative citizens do not enjoy the cultural freedom you afford the residents of the arcology.<<set _citizen += either(20,30)>> +<</if>> +<<if $arcologies[0].FSRestart != "unset">> + <<if _CSratio > 1>> + Your citizens are not happy with the noticeable lack of slaves compared to their numbers.<<set _citizen +=20>> + <<elseif _CSratio > 0.5>> + Your citizens are not happy with the lack of slaves compared to their numbers.<<set _citizen += 15>> + <<elseif _CSratio < 0.2>> + <<set _citizen -= 5>> + <</if>> +<<elseif $arcologies[0].FSRepopulationFocus != "unset">> + <<if _CSratio < 0.5>> + Your citizens are not happy of being outbred by the slaves of the arcology<<set _citizen +=20>> + <<elseif _CSratio < 1>> + Your citizens are not happy of being outbred by the slaves of the arcology<<set _citizen += 15>> + <<elseif _CSratio > 1.4>> + <<set _citizen += 5>> + <</if>> +<</if>> + +/* rolls to see if event happens */ +<<if _slave < 0>> + <<set _slave = 0>> +<<elseif _slave >= 95>> + <<set _slave = 95>> /* there's always a min 5% chance nothing happens */ +<</if>> +<<if _citizen < 0>> + <<set _citizen = 0>> +<<elseif _citizen >= 95>> + <<set _citizen = 95>> +<</if>> +<<set _roll = random(1,_slave + _citizen)>> +<<if $brainImplant == 106>> + <<set _slave = Math.trunc(_slave * 0.2), _citizen = Math.trunc(_citizen * 0.2)>> +<<else>> + <<set _slave = Math.trunc(_slave * 0.75), _citizen = Math.trunc(_citizen * 0.75)>> +<</if>> +<<if _roll <= _slave>> + <<if random(1,100) < _slave>> + <<set $slaveRebellionEventFires = 1>> + <<set $citizenRebellionEventFires = 0>> + <<if $tension != 0>> + <<set $slaveProgress += Math.trunc(random(1,5) * ($tension / 100) * 10)>> /* progress scales with tension */ + <<else>> + <<set $slaveProgress += random(1,5)>> + <</if>> + <</if>> +<<else>> + <<if random(1,100) < _citizen>> + <<set $slaveRebellionEventFires = 0>> + <<set $citizenRebellionEventFires = 1>> + <<if $tension != 0>> + <<set $citizenProgress += Math.trunc(random(1,5) * ($tension / 100) * 10)>> + <<else>> + <<set $citizenProgress += random(1,5)>> + <</if>> + <</if>> +<</if>> + +/* if there is an advancement selects a random mini event */ +<<set _oldTension = $tension>> +<<if $slaveRebellionEventFires == 1 || $citizenRebellionEventFires == 1>> + <br> + <br> + <<include "rebellionEvents">> +<<elseif $tension > 0>> + /* otherwise tension decays */ + <br> + <br> + <strong>Tension</strong>: + <<if $riotUpgrades.freeMedia >= 1>> + The guaranteed free media access you offer does wonders to lower tensions in the arcology. + <<set $tension = Math.trunc(Math.clamp($tension - $riotUpgrades.freeMedia / 2,0,100))>> + <</if>> + In the absence of noteworthy events, tensions in the arcology are able to relax. + <<set $tension = Math.trunc(Math.clamp($tension * 0.97,0,100))>> +<</if>> +<br> +<<if $tension < _oldTension>> + <br>This week @@.green;tensions relaxed@@. +<<elseif $tension == _oldTension && $tension != 0>> + <br>This week @@.yellow;tensions did not change@@. +<<elseif $tension > _oldTension>> + <br>This week @@.red;tension rose@@ and + <<if $slaveRebellionEventFires == 1>> + @@.red;slave malcontent increased@@. + <<elseif $citizenRebellionEventFires == 1>> + @@.red;citizen malcontent increased@@. + <</if>> +<<elseif !isInt($tension)>> + <br>Error: tension is outside accepted range. +<</if>> + +/* resets flags */ +<<set $slaveRebellionEventFires = 0>> +<<set $citizenRebellionEventFires = 0>> + +/* rolls for rebellions */ +<<if $slaveProgress >= 100>> + <<if random(1,100) <= 80>> /* 80% of firing a rebellion once progress is at 100 */ + <<set $slaveRebellion = 1>> + <<set $slaveProgress = 0>> + <<set $citizenProgress *= 0.2>> + <<else>> + <<set $slaveProgress = 100>> + <</if>> +<<elseif $citizenProgress >= 100>> + <<if random(1,100) <= 80>> + <<set $citizenRebellion = 1>> + <<set $citizenProgress = 0>> + <<set $slaveProgress *= 0.2>> + <<else>> + <<set $citizenProgress = 100>> + <</if>> +<</if>> + +<<if $forceRebellion == 1 && $foughtThisWeek == 0>> + <<if random(1,100) <= 50>> + <<set $slaveRebellion = 1>> + <<set $citizenRebellion = 0>> + <<else>> + <<set $slaveRebellion = 0>> + <<set $citizenRebellion = 1>> + <</if>> +<</if>> + +<<set _weekMod = 0.50>> +<<if $week <= 30>> + <<set _weekMod = 0.75>> +<<elseif $week <= 60>> + <<set _weekMod = 1>> +<<elseif $week <= 90>> + <<set _weekMod = 1.25>> +<<elseif $week <= 120>> + <<set _weekMod = 1.50>> +<<else>> + <<set _weekMod = 1.75>> +<</if>> + +/* resetting ID list */ +<<unset $rebellingID>> +<<set $rebellingID = []>> +<<unset $loyalID>> +<<set $loyalID = []>> + +/* if a rebellion fires determine amount of rebels and rebelling units */ +<<if $slaveRebellion == 1>> + <<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 - ($authority / 20000),0.4,0.6)>> + <<set _repFactor = Math.clamp($rep / 20000,0.4,0.6)>> + <<set _rebelPercent = 0.3 * _authFactor>> + <<set _irregularPercent = 0.2 * _repFactor>> + <<set $attackTroops = Math.clamp(Math.trunc($ASlaves * _rebelPercent + random(-100,100)) * _weekMod,50,$ASlaves)>> + <<set $irregulars = Math.clamp(Math.trunc($ACitizens * _irregularPercent + random(-100,100)) * _weekMod,50,$ACitizens)>> + /* calc if units rebel */ + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <<elseif $slaveUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <<elseif $slaveUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($slaveUnits[_i].ID))>> + <<set $loyalID.push($slaveUnits[_i].ID)>> + <</if>> + <</for>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <<elseif $militiaUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <<elseif $militiaUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($militiaUnits[_i].ID))>> + <<set $loyalID.push($militiaUnits[_i].ID)>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <<elseif $mercUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <<elseif $mercUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($mercUnits[_i].ID))>> + <<set $loyalID.push($mercUnits[_i].ID)>> + <</if>> + <</for>> + <<set $attackEquip = Math.clamp($weaponsLaw + random(-2,1),0,4)>> +<<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 - ($authority / 20000),0.4,0.6)>> + <<set _repFactor = Math.clamp($rep / 20000,0.4,0.6)>> + <<set _rebelPercent = 0.3 * _authFactor>> + <<set _irregularPercent = 0.2 * _repFactor>> + <<set $attackTroops = Math.clamp(Math.trunc($ACitizens * _rebelPercent + random(-100,100)) * _weekMod,50,$ACitizens)>> + <<set $irregulars = Math.clamp(Math.trunc($ACitizens * _irregularPercent + random(-100,100)) * _weekMod,50,$ACitizens)>> + /* calc if units rebel */ + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <<elseif $militiaUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <<elseif $militiaUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($militiaUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($militiaUnits[_i].ID))>> + <<set $loyalID.push($militiaUnits[_i].ID)>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <<elseif $slaveUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <<elseif $slaveUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($slaveUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($slaveUnits[_i].ID))>> + <<set $loyalID.push($slaveUnits[_i].ID)>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].loyalty < 10>> + <<if random(1,100) <= 70>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <<elseif $mercUnits[_i].loyalty < 33>> + <<if random(1,100) <= 30>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <<elseif $mercUnits[_i].loyalty < 66>> + <<if random(1,100) <= 10>> + <<set $rebellingID.push($mercUnits[_i].ID)>> + <</if>> + <</if>> + <<if !($rebellingID.includes($mercUnits[_i].ID))>> + <<set $loyalID.push($mercUnits[_i].ID)>> + <</if>> + <</for>> + <<set $attackEquip = Math.clamp($weaponsLaw + random(-1,1),0,4)>> +<<else>> + <<set $lastRebellionWeeks++>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/rebellionHandler.tw b/src/SecExp/rebellionHandler.tw new file mode 100644 index 0000000000000000000000000000000000000000..81fb290a138ca44250a14bfd7e52be906cc019de --- /dev/null +++ b/src/SecExp/rebellionHandler.tw @@ -0,0 +1,422 @@ +:: rebellionHandler [nobr] + +<<set $nextButton = " ", $nextLink = "attackReport", $showEncyclopedia = 0>> + +<<set _turn = 0>> +<<set _turns = $maxTurns * 2>> +<<set _attack = 0>> +<<set _defense = 0>> +<<set _morale = 0>> +<<set _hp = 0>> +<<set _baseHp = 0>> +<<set _enemyAttack = 0>> +<<set _enemyDefense = 0>> +<<set _enemyMorale = 0>> +<<set _enemyHp = 0>> +<<set _enemyBaseHp = 0>> +<<set _woundChance = 5>> /* leader has a base chance of 5% to get wounded */ +<<set _tacChance = 0.5>> /* by default tactics have a 50% chance of succeeding */ +<<set _expBonus = 0>> +<<set _loyaltyBonus = 0>> +<<set _irregularMod = 0>> +<<set _armyMod = 0>> + +/* calculates PC army stats */ +<<if $engageRule == 0>> + <<set _engageMod = 0.5>> +<<elseif $engageRule == 1>> + <<set _engageMod = 0.75>> +<<elseif $engageRule == 2>> + <<set _engageMod = 1>> +<<else>> + <<set _engageMod = 1.4>> +<</if>> + +<<if $week <= 30>> + <<set _irregularMod = $irregulars / 60>> +<<elseif $week <= 60>> + <<set _irregularMod = $irregulars / 50>> +<<elseif $week <= 90>> + <<set _irregularMod = $irregulars / 40>> +<<elseif $week <= 120>> + <<set _irregularMod = $irregulars / 30>> +<<else>> + <<set _irregularMod = $irregulars / 20>> +<</if>> +<<if $irregulars > 0>> + <<set $deployingMilitia = 1>> + <<set _irregularMod = Math.trunc(_irregularMod)>> + <<set _attack += (($militiaBaseAttack - $humanUpgrade.attack) + ($militiaBaseAttack - $humanUpgrade.attack) * $attackEquip * $equipMod) * _irregularMod * 0.80>> + <<set _defense += (($militiaBaseDefense - $humanUpgrade.defense) + ($militiaBaseDefense - $humanUpgrade.defense) * $attackEquip * $equipMod) * _irregularMod * 0.80>> + <<set _hp += $militiaBaseHp * $irregulars>> +<</if>> + +<<if $secBots.active == 1>> + <<set _attack += ($secBotsBaseAttack + $secBotsBaseAttack * $secBots.equip * $equipMod)>> + <<set _defense += ($secBotsBaseDefense + $secBotsBaseDefense * $secBots.equip * $equipMod)>> + <<set _hp += $secBotsBaseHp * $secBots.troops>> + <<set $deployedUnits++>> +<</if>> + +<<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && $loyalID.includes($militiaUnits[_i].ID)>> + <<set $deployingMilitia = 1>> + <<set $deployedUnits++>> + <<if $militiaUnits[_i].training <= 10>> + <<set _expBonus = 0>> + <<elseif $militiaUnits[_i].training <= 33>> + <<set _expBonus = 0.10>> + <<elseif $militiaUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $militiaUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $militiaUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $militiaUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($militiaBaseAttack + $militiaBaseAttack * $militiaUnits[_i].equip * $equipMod + $militiaBaseAttack * _expBonus + $militiaBaseAttack * _loyaltyBonus + $militiaBaseAttack * $militiaUnits[_i].SF * 0.20)>> + <<set _defense += ($militiaBaseDefense + $militiaBaseDefense * $militiaUnits[_i].equip * $equipMod + $militiaBaseDefense * _expBonus + $militiaBaseDefense * _loyaltyBonus + $militiaBaseDefense * $militiaUnits[_i].SF * 0.20)>> + <<set _hp += ($militiaBaseHp + $militiaBaseHp * $militiaUnits[_i].medics * $equipMod) * $militiaUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && $loyalID.includes($slaveUnits[_i].ID)>> + <<set $deployingSlaves = 1>> + <<set $deployedUnits++>> + <<if $slaveUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $slaveUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $slaveUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $slaveUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $slaveUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($slaveBaseAttack + $slaveBaseAttack * $slaveUnits[_i].equip * $equipMod + $slaveBaseAttack * _expBonus + $slaveBaseAttack * _loyaltyBonus + $slaveBaseAttack * $slaveUnits[_i].SF * 0.20)>> + <<set _defense += ($slaveBaseDefense + $slaveBaseDefense * $slaveUnits[_i].equip * $equipMod + $slaveBaseDefense * _expBonus + $slaveBaseDefense * _loyaltyBonus + $slaveBaseDefense * $slaveUnits[_i].SF * 0.20)>> + <<set _hp += ($slaveBaseHp + $slaveBaseHp * $slaveUnits[_i].medics * 0.25) * $slaveUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && $loyalID.includes($mercUnits[_i].ID)>> + <<set $deployingMercs = 1>> + <<set $deployedUnits++>> + <<if $mercUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $mercUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<if $mercUnits[_i].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $mercUnits[_i].loyalty <= 33>> + <<set _loyaltyBonus = 0.10>> + <<elseif $mercUnits[_i].loyalty <= 66>> + <<set _loyaltyBonus = 0.20>> + <<else>> + <<set _loyaltyBonus = 0.30>> + <</if>> + <<set _attack += ($mercBaseAttack + $mercBaseAttack * $mercUnits[_i].equip * $equipMod + $mercBaseAttack * _expBonus + $mercBaseAttack * _loyaltyBonus + $mercBaseAttack * $mercUnits[_i].SF * 0.20)>> + <<set _defense += ($mercBaseDefense + $mercBaseDefense * $mercUnits[_i].equip * $equipMod + $mercBaseDefense * _expBonus + $mercBaseDefense * _loyaltyBonus + $mercBaseDefense * $mercUnits[_i].SF * 0.20)>> + <<set _hp += ($mercBaseHp + $mercBaseHp * $mercUnits[_i].medics * 0.25) * $mercUnits[_i].troops>> + <</if>> +<</for>> + +<<if $securityForceCreate == 1>> + <<set $SFatk = 0>> + <<set $SFdef = 0>> + <<set $SFhp = 0>> + <<calcSFStatistics>> + <<set _attack += $SFatk>> + <<set _defense += $SFdef>> + <<set _hp += $SFhp>> + +<</if>> + +<<set _attack *= _engageMod>> +<<set _defense *= _engageMod>> +<<set _hp *= _engageMod>> + +<<if $garrison.assistant == 1>> + <<set _attack *= 0.95>> + <<set _defense *= 0.95>> + <<set _hp *= 0.95>> +<</if>> +<<if $garrison.reactor == 1>> + <<set _attack *= 0.95>> + <<set _defense *= 0.95>> + <<set _hp *= 0.95>> +<</if>> +<<if $garrison.penthouse == 1>> + <<set _attack *= 0.95>> + <<set _defense *= 0.95>> + <<set _hp *= 0.95>> +<</if>> +<<if $garrison.waterway == 1>> + <<set _attack *= 0.95>> + <<set _defense *= 0.95>> + <<set _hp *= 0.95>> +<</if>> + +<<set $troopCount = 0>> +<<calcTroopCount>> +<<set _moraleTroopMod = Math.clamp($troopCount / 200,1,10)>> + +/* morale and baseHp calculation */ +<<set _morale = ($secBotsMorale * $secBots.active + $militiaBaseMorale * $deployingMilitia + $slaveBaseMorale * $deployingSlaves + $mercBaseMorale * $deployingMercs + $SFBaseMorale * $securityForceCreate) / ($secBots.active + $deployingMilitia +$deployingSlaves + $deployingMercs + $securityForceCreate)>> +<<set _morale = _morale + _morale * $secBarracksUpgrades.luxury * 0.05>> /* barracks bonus */ +<<set _morale *= _moraleTroopMod>> +<<set _baseHp = ($secBotsBaseHp * $secBots.active + $militiaBaseHp * $deployingMilitia + $slaveBaseHp * $deployingSlaves + $mercBaseHp * $deployingMercs + $SFBaseHp * $securityForceCreate) / ($secBots.active + $deployingMilitia +$deployingSlaves + $deployingMercs + $securityForceCreate)>> + +/* calculates rebelling army stats */ +<<if $week <= 30>> + <<set _armyMod = $attackTroops / 100>> +<<elseif $week <= 60>> + <<set _armyMod = $attackTroops / 90>> +<<elseif $week <= 90>> + <<set _armyMod = $attackTroops / 80>> +<<elseif $week <= 120>> + <<set _armyMod = $attackTroops / 70>> +<<else>> + <<set _armyMod = $attackTroops / 60>> +<</if>> +<<set _armyMod = Math.trunc(_armyMod)>> + +<<if $slaveRebellion == 1>> + <<set $rebellingSlaves = 1>> + <<set _enemyAttack += (($slaveBaseAttack - $humanUpgrade.attack) + ($slaveBaseAttack - $humanUpgrade.attack) * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense += (($slaveBaseDefense - $humanUpgrade.defense) + ($slaveBaseDefense - $humanUpgrade.defense) * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyHp += $slaveBaseHp * $attackTroops>> +<<else>> + <<set $rebellingMilitia = 1>> + <<set _enemyAttack += (($militiaBaseAttack - $humanUpgrade.attack) + ($militiaBaseAttack - $humanUpgrade.attack) * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyDefense += (($militiaBaseDefense - $humanUpgrade.defense) + ($militiaBaseDefense - $humanUpgrade.defense) * $attackEquip * $equipMod) * _armyMod>> + <<set _enemyHp += $militiaBaseHp * $attackTroops>> +<</if>> + +<<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && $rebellingID.includes($militiaUnits[_i].ID)>> + <<set $rebellingMilitia = 1>> + <<set $attackTroops += $militiaUnits[_i].troops>> + <<if $militiaUnits[_i].training <= 10>> + <<set _expBonus = 0>> + <<elseif $militiaUnits[_i].training <= 33>> + <<set _expBonus = 0.10>> + <<elseif $militiaUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<set _enemyAttack += ($militiaBaseAttack + $militiaBaseAttack * $militiaUnits[_i].equip * $equipMod + $militiaBaseAttack * _expBonus + $militiaUnits[_i].SF)>> + <<set _enemyDefense += ($militiaBaseDefense + $militiaBaseDefense * $militiaUnits[_i].equip * $equipMod + $militiaBaseDefense * _expBonus + $militiaUnits[_i].SF)>> + <<set _enemyHp += ($militiaBaseHp + $militiaBaseHp * $militiaUnits[_i].medics * $equipMod) * $militiaUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && $rebellingID.includes($slaveUnits[_i].ID)>> + <<set $rebellingSlaves = 1>> + <<set $attackTroops += $slaveUnits[_i].troops>> + <<if $slaveUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $slaveUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<set _enemyAttack += ($slaveBaseAttack + $slaveBaseAttack * $slaveUnits[_i].equip * $equipMod + $slaveBaseAttack * _expBonus + $slaveUnits[_i].SF)>> + <<set _enemyDefense += ($slaveBaseDefense + $slaveBaseDefense * $slaveUnits[_i].equip * $equipMod + $slaveBaseDefense * _expBonus + $slaveUnits[_i].SF)>> + <<set _enemyHp += ($slaveBaseHp + $slaveBaseHp * $slaveUnits[_i].medics * 0.25) * $slaveUnits[_i].troops>> + <</if>> +<</for>> +<<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && $rebellingID.includes($mercUnits[_i].ID)>> + <<set $rebellingMercs = 1>> + <<set $attackTroops += $mercUnits[_i].troops>> + <<if $mercUnits[_i].training <= 33>> + <<set _expBonus = 0>> + <<elseif $mercUnits[_i].training <= 66>> + <<set _expBonus = 0.25>> + <<else>> + <<set _expBonus = 0.50>> + <</if>> + <<set _enemyAttack += ($mercBaseAttack + $mercBaseAttack * $mercUnits[_i].equip * $equipMod + $mercBaseAttack * _expBonus + $mercUnits[_i].SF)>> + <<set _enemyDefense += ($mercBaseDefense + $mercBaseDefense * $mercUnits[_i].equip * $equipMod + $mercBaseDefense * _expBonus + $mercUnits[_i].SF)>> + <<set _enemyHp += ($mercBaseHp + $mercBaseHp * $mercUnits[_i].medics * 0.25) * $mercUnits[_i].troops>> + <</if>> +<</for>> + +<<set _enemyMoraleTroopMod = Math.clamp($attackTroops / 300,1,10)>> + +<<set _enemyMorale = 1.5 * ($militiaBaseMorale * $rebellingMilitia + $slaveBaseMorale * $rebellingSlaves + $mercBaseMorale * $rebellingMercs) / ($rebellingMilitia + $rebellingSlaves + $rebellingMercs)>> +<<set _enemyMorale *= _enemyMoraleTroopMod>> +<<set _enemyBaseHp = ($militiaBaseHp * $rebellingMilitia + $slaveBaseHp * $rebellingSlaves + $mercBaseHp * $rebellingMercs) / ($rebellingMilitia +$rebellingSlaves + $rebellingMercs)>> + +<<if isNaN(_attack)>> + <br>@@.red;Error: attack value reported NaN@@ +<</if>> +<<if isNaN(_defense)>> + <br>@@.red;Error: defense value reported NaN@@ +<</if>> +<<if isNaN(_hp)>> + <br>@@.red;Error: hp value reported NaN@@ +<</if>> +<<if isNaN(_morale)>> + <br>@@.red;Error: morale value reported NaN@@ +<</if>> +<<if isNaN(_enemyAttack)>> + <br>@@.red;Error: enemy attack value reported NaN@@ +<</if>> +<<if isNaN(_enemyDefense)>> + <br>@@.red;Error: enemy defense value reported NaN@@ +<</if>> +<<if isNaN(_enemyHp)>> + <br>@@.red;Error: enemy hp value reported NaN@@ +<</if>> +<<if isNaN(_enemyMorale)>> + <br>@@.red;Error: enemy morale value reported NaN@@ +<</if>> + + +/* difficulty */ +<<set _enemyAttack *= $difficulty>> +<<set _enemyDefense *= $difficulty>> +<<set _enemyMorale *= $difficulty>> +<<set _enemyHp *= $difficulty>> +<<set _enemyBaseHp *= $difficulty>> + +<<if $showBattleStatistics == 1>> +<<set _engageMod -= 1>> +<<set _engageMod = Math.round(_engageMod * 100)>> +<<set _difficulty = ($difficulty -1) * 100>> + +__Difficulty__: +<br> +<<if $difficulty == 0.5>> + Very easy +<<elseif $difficulty == 0.75>> + Easy +<<elseif $difficulty == 1>> + Normal +<<elseif $difficulty == 1.25>> + Hard +<<else>> + Very hard +<</if>> +<br> +<br> +__Army__: +<br>troops: <<print $troopCount>> +<br>attack: <<print Math.round(_attack)>> +<br>defense: <<print Math.round(_defense)>> +<br>engagement rule modifier: <<if _engageMod > 0>>+<</if>><<print _engageMod>>% +<br>Hp: <<print Math.round(_hp)>> +<br>base HP: <<print Math.round(_baseHp)>> +<br>morale: <<print Math.round(_morale)>> +<<if _enemyMoraleTroopMod > 0>> + <br>morale increase due to troop numbers: +<<print _moraleTroopMod>>% +<</if>> +<br> +<br> +__Rebels__: +<br>enemy troops: <<print $attackTroops>> +<br>enemy attack: <<print Math.round(_enemyAttack)>> +<br>enemy defense: <<print Math.round(_enemyDefense)>> +<br>enemy Hp: <<print Math.round(_enemyHp)>> +<br>enemy base Hp: <<print Math.round(_enemyBaseHp)>> +<br>enemy morale: <<print Math.round(_enemyMorale)>> +<<if _enemyMoraleTroopMod > 0>> + <br>enemy morale increase due to troop numbers: +<<print _enemyMoraleTroopMod>>% +<</if>> +<br>Difficulty modifier: <<if _difficulty > 0>>+<</if>><<print _difficulty>>% +<</if>> + +/* simulates the combat by pitting attk against def */ +<<for _i = 0; _i < _turns; _i++>> + <br><br> + <<if $showBattleStatistics == 1>> turn: <<print _i + 1>><</if>> + /* player army attacks */ + <<set _damage = Math.clamp(_attack - _enemyDefense,_attack * 0.1,_attack)>> + <br> + <<if $showBattleStatistics == 1>> player damage: <<print Math.round(_damage)>><</if>> + <<set _enemyHp -= _damage>> + <br> + <<if $showBattleStatistics == 1>> remaining enemy Hp: <<print Math.round(_enemyHp)>><</if>> + <<set $enemyLosses += _damage / _enemyBaseHp>> + <<set _moraleDamage = Math.clamp(_damage/ 2 + _damage / _enemyBaseHp,0,_damage*1.5)>> + <<set _enemyMorale -= _moraleDamage>> + <br> + <<if $showBattleStatistics == 1>> remaining enemy morale: <<print Math.round(_enemyMorale)>><</if>> + <<if _enemyHp <= 0 || _enemyMorale <= 0>> + <<if $showBattleStatistics == 1>> <br>Victory!<</if>> + <<set $battleResult = 3>> + <<set $battleTurns = _i>> + <<break>> + <</if>> + + /* attacker army attacks */ + <<set _damage = _enemyAttack - _defense>> + <<if _damage < _enemyAttack * 0.1>> + <<set _damage = _enemyAttack * 0.1>> + <</if>> + <br> + <<if $showBattleStatistics == 1>> enemy damage: <<print Math.round(_damage)>><</if>> + <<set _hp -= _damage>> + <br> + <<if $showBattleStatistics == 1>> remaining hp: <<print Math.round(_hp)>><</if>> + <<set $losses += _damage / _baseHp>> + <<set _moraleDamage = Math.clamp(_damage / 2 + _damage / _baseHp,0,_damage*1.5)>> + <<set _morale -= _moraleDamage>> + <br> + <<if $showBattleStatistics == 1>> remaining morale: <<print Math.round(_morale)>><</if>> + <<if _hp <= 0 || _morale <= 0>> + <<if $showBattleStatistics == 1>> <br>Defeat!<</if>> + <<set $battleResult = -3>> + <<set $battleTurns = _i>> + <<break>> + <</if>> +<</for>> +<<if $battleResult != 3 && $battleResult != -3>> + <<if _morale > _enemyMorale>> + <<if $showBattleStatistics == 1>> <br>Partial victory!<</if>> + <<set $battleResult = 2>> + <<elseif _morale < _enemyMorale>> + <<if $showBattleStatistics == 1>> <br>Partial defeat!<</if>> + <<set $battleResult = -2>> + <</if>> +<</if>> + +<<if $battleResult > 3 || $battleResult < -3>> + <br>@@.red;Error: failed to determine battle result@@ +<</if>> + +<<if $showBattleStatistics == 1 && $rebellionGameOver == 1 && $battleResult == -3>> + <br><br> + <<link "Proceed">> + <<set $gameover to "Rebellion defeat">> + <<goto "Gameover">> + <</link>> +<<elseif $rebellionGameOver == 1 && $battleResult == -3>> + <<set $gameover to "Rebellion defeat">> + <<goto "Gameover">> +<<elseif $showBattleStatistics == 1>> + <br><br> + <<link "Proceed">> + <<goto "rebellionReport">> + <</link>> +<<else>> + <<goto "rebellionReport">> +<</if>> \ No newline at end of file diff --git a/src/SecExp/rebellionOptions.tw b/src/SecExp/rebellionOptions.tw new file mode 100644 index 0000000000000000000000000000000000000000..f6424e599e17a2f081972ef294691030366badc0 --- /dev/null +++ b/src/SecExp/rebellionOptions.tw @@ -0,0 +1,313 @@ +:: rebellionOptions [nobr] + +<<set $nextButton = " ", $nextLink = "rebellionOptions", $showEncyclopedia = 1, $encyclopedia = "Battles">> + +<<if $slaveRebellion == 1>> + <strong>Slave Rebellion!</strong> +<<else>> + <strong>Citizen Rebellion!</strong> +<</if>> +<hr> + +<<if $slaveRebellion == 1>> + In the end it happened, the slaves of your arcology dared took up arms and raised up against their betters. Your penthouse is flooded with reports from all over the arcology of small skirmishes between the rioting slaves and the security forces. + It appears <strong><<print Math.trunc($attackTroops)>></strong> rebels are in the streets right now, building barricades and freeing their peers. They are + <<if $attackEquip <= 0>> + <strong>poorly armed</strong>. + <<elseif $attackEquip == 1>> + <strong>lightly armed</strong>. + <<elseif $attackEquip == 2>> + <strong>decently armed</strong>. + <<elseif $attackEquip == 3>> + <strong>well armed</strong>. + <<elseif $attackEquip >= 4>> + <strong>extremely well armed</strong>. + <</if>> + <<if $irregulars > 0>> + <<print Math.trunc($irregulars)>> of your citizens took up arms to defend their arcology owner. + <</if>> + <<set _count = 0>> + <<if $rebellingID.length > 0>> + <br> + <br> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && ($rebellingID.includes($militiaUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $militiaUnits[_i].platoonName, + <<else>> + $militiaUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && ($rebellingID.includes($slaveUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $slaveUnits[_i].platoonName, + <<else>> + $slaveUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && ($rebellingID.includes($mercUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $mercUnits[_i].platoonName, + <<else>> + $mercUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + betrayed you and joined the insurrection. + <</if>> + <<set _count = 0>> + <<if $loyalID.length > 0>> + <br> + <br> + <<if $arcologyUpgrade.drones == 1>>Your security drones,<</if>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && ($loyalID.includes($militiaUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $militiaUnits[_i].platoonName, + <<else>> + $militiaUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && ($loyalID.includes($slaveUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $slaveUnits[_i].platoonName, + <<else>> + $slaveUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && ($loyalID.includes($mercUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $mercUnits[_i].platoonName, + <<else>> + $mercUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<if $securityForceActive == 1>>and $securityForceName, $securityForcePersonnel strong<</if>> + are called to defend the arcology from this menace. + <<else>> + <<if $arcologyUpgrade.drones == 1>>Your security drones<<if $securityForceActive == 1>>and $securityForceName, $securityForcePersonnel strong<</if>><</if>> + are called to defend the arcology from this menace. + <</if>> + <hr> +<<else>> + In the end it happened, the citizens of your arcology dared took up arms and raised up against their betters. Your penthouse is flooded with reports from all over the arcology of small skirmishes between the rioting residents and the security forces. + It appears <<print Math.trunc($attackTroops)>> rebels are in the streets right now, building barricades and destroying your property. They are + <<if $attackEquip <= 0>> + <strong>poorly armed</strong>. + <<elseif $attackEquip == 1>> + <strong>lightly armed</strong>. + <<elseif $attackEquip == 2>> + <strong>decently armed</strong>. + <<elseif $attackEquip == 3>> + <strong>well armed</strong>. + <<elseif $attackEquip >= 4>> + <strong>extremely well armed</strong>. + <</if>> + <<if $irregulars > 0>> + <<print Math.trunc($irregulars)>> of your citizens took up arms to defend their arcology owner. + <</if>> + <<set _count = 0>> + <br> + <<if $rebellingID.length > 0>> + <br> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && ($rebellingID.includes($militiaUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $militiaUnits[_i].platoonName, + <<else>> + $militiaUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && ($rebellingID.includes($slaveUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $slaveUnits[_i].platoonName, + <<else>> + $slaveUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && ($rebellingID.includes($mercUnits[_i].ID))>> + <<set _count++>> + <<if _count < $rebellingID.length>> + $mercUnits[_i].platoonName, + <<else>> + $mercUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + betrayed you and joined the insurrection. + <</if>> + <br> + <<set _count = 0>> + <<if $loyalID.length > 0>> + <br> + <<if $arcologyUpgrade.drones == 1>>your security drones,<</if>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && ($loyalID.includes($militiaUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $militiaUnits[_i].platoonName, + <<else>> + $militiaUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && ($loyalID.includes($slaveUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $slaveUnits[_i].platoonName, + <<else>> + $slaveUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && ($loyalID.includes($mercUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $mercUnits[_i].platoonName, + <<else>> + $mercUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<if $securityForceActive == 1>>and $securityForceName, $securityForcePersonnel strong<</if>> + are called to defend the arcology from this menace. + <<else>> + <<if $arcologyUpgrade.drones == 1>>Your security drones<<if $securityForceActive == 1>>and $securityForceName, $securityForcePersonnel strong<</if>><</if>> + are called to defend the arcology from this menace. + <</if>> + <hr> +<</if>> + +<br> +<br> +The confined spaces of the arcology and the number of vital yet delicate systems within its walls do not allow a lot of tactical flexibility. This will be a long and strenous fight, stree after street, barricade after barricade. +In order to preserve the structural integrity of the building and the lives of our civilians, we will have to limit our firepower. +<br><<link "Only light firearms and non lethal weapons">> + <<set $engageRule = 0>> + <<replace "#engage">> + <br>Your troops will use only non lethal weapons or light firearms to limit to the maximum the collateral damage. This will however weaken our troops considerably. + <</replace>> +<</link>> +<br><<link "No heavy ordnance">> + <<set $engageRule = 1>> + <<replace "#engage">> + <br>Your troops will limit the use of explosives and heavy weapons to limit considerably the collateral damage. This will however weaken our troops. + <</replace>> +<</link>> +<br><<link "Normal engagement rules">> + <<set $engageRule = 2>> + <<replace "#engage">> + <br>Your troops will not limit their arsenal. This will put the structure and your citizens at risk, but our troops will be at full capacity. + <</replace>> +<</link>> + +<<if $advancedRiotEquip == 1>> + <br><<link "Advanced riot protocol">> + <<set $engageRule = 3>> + <<replace "#engage">> + <br>Your troops will make use of the special weaponry, equipment and infrastructure developed by the riot control center to surgically eliminate rebels and dissidents with little to no collateral damage. + <</replace>> + <</link>> +<</if>> + +<span id="engage"> + <br>Your troops will use only non lethal weapons or light firearms to limit to the maximum the collateral damage. This will however weaken our troops considerably. +</span> + +<br> +<br> + +We can dedicate some of our forces to the protection of the vital parts of the arcology, doing so will prevent the failure of said systems, but will also take away strength from our assault. +<<if $garrison.penthouse == 0>> + <br><<link "Garrison the penthouse">> + <<set $garrison.penthouse = 1>> + <<goto "rebellionOptions">> + <</link>> +<<else>> + <br>Troops will be dispatched to the penthouse. + <<link "Discard the order">> + <<set $garrison.penthouse = 0>> + <<goto "rebellionOptions">> + <</link>> +<</if>> +<<if $garrison.reactor == 0>> + <br><<link "Garrison the reactors">> + <<set $garrison.reactor = 1>> + <<goto "rebellionOptions">> + <</link>> +<<else>> + <br>Troops will be dispatched to the reactors. + <<link "Discard the order">> + <<set $garrison.reactor = 0>> + <<goto "rebellionOptions">> + <</link>> +<</if>> +<<if $garrison.assistant == 0>> + <br><<link "Garrison the assistant's central CPU">> + <<set $garrison.assistant = 1>> + <<goto "rebellionOptions">> + <</link>> +<<else>> + <br>Troops will be dispatched to the assistant's central CPU. + <<link "Discard the order">> + <<set $garrison.assistant = 0>> + <<goto "rebellionOptions">> + <</link>> +<</if>> +<<if $garrison.waterway == 0>> + <br><<link "Garrison the waterways">> + <<set $garrison.waterway = 1>> + <<goto "rebellionOptions">> + <</link>> +<<else>> + <br>Troops will be dispatched to the waterways. + <<link "Discard the order">> + <<set $garrison.waterway = 0>> + <<goto "rebellionOptions">> + <</link>> +<</if>> + + +<br> +<br> +<<link "Proceed">> + <<set $battleResult = 4>> /* sets $battleResult value outside accepted range to avoid evaluation problems */ + <<if $hasFoughtOnce == 0>> + <<set $hasFoughtOnce = 1>> + <</if>> + <<set $foughtThisWeek = 1>> + <<goto "rebellionHandler">> +<</link>> +<br> +<<link "Surrender">> + <<set $battleResult = -1>> + <<if $hasFoughtOnce == 0>> + <<set $hasFoughtOnce = 1>> + <</if>> + <<set $foughtThisWeek = 1>> + <<goto "rebellionHandler">> +<</link>> + \ No newline at end of file diff --git a/src/SecExp/rebellionReport.tw b/src/SecExp/rebellionReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..713df8c486c49a138989249d1159763dfa9f7aaa --- /dev/null +++ b/src/SecExp/rebellionReport.tw @@ -0,0 +1,834 @@ +:: rebellionReport [nobr] + +<<set $nextButton = "Continue", $nextLink = "Scheduled Event", $showEncyclopedia = 1, $encyclopedia = "Battles">> + +<<set _oldRep = $rep>> +<<set _oldAuth = $authority>> +<<set $enemyLosses = Math.trunc($enemyLosses)>> +<<if $enemyLosses > $attackTroops>> + <<set $enemyLosses = $attackTroops>> +<</if>> +<<set $totalKills += $enemyLosses>> +<<set $losses = Math.trunc($losses)>> +<<set $rebellionsCount++>> +<<if $battleResult == 3>> + <strong>Victory!</strong> + <<set $PCrebWon++>> +<<elseif $battleResult == -3>> + <strong>Defeat!</strong> + <<set $PCrebLoss++>> +<<elseif $battleResult == 2>> + <strong>Partial victory!</strong> + <<set $PCrebWon++>> + <<elseif $battleResult == -2>> + <strong>Partial defeat!</strong> + <<set $PCrebLoss++>> +<<elseif $battleResult == -1>> + <strong>We surrendered</strong> + <<set $PCrebLoss++>> +<</if>> +<<set _day = $day + random(0,7)>> +<<set _month = $month>> +<<set _year = $year>> +<<switch _month>> +<<case "January">> +<<if _day > 31>> + <<set _day -= 31, _month = "February">> +<</if>> +<<case "February">> +<<if _day > 28>> + <<set _day -= 28, _month = "March">> +<</if>> +<<case "March">> +<<if _day > 31>> + <<set _day -= 31, _month = "April">> +<</if>> +<<case "April">> +<<if _day > 30>> + <<set _day -= 30, _month = "May">> +<</if>> +<<case "May">> +<<if _day > 31>> + <<set _day -= 31, _month = "June">> +<</if>> +<<case "June">> +<<if _day > 30>> + <<set _day -= 30, _month = "July">> +<</if>> +<<case "July">> +<<if _day > 31>> + <<set _day -= 31, _month = "August">> +<</if>> +<<case "August">> +<<if _day > 31>> + <<set _day -= 31, _month = "September">> +<</if>> +<<case "September">> +<<if _day > 30>> + <<set _day -= 30, _month = "October">> +<</if>> +<<case "October">> +<<if _day > 31>> + <<set _day -= 31, _month = "November">> +<</if>> +<<case "November">> +<<if _day > 30>> + <<set _day -= 30, _month = "December">> +<</if>> +<<default>> +<<if _day > 31>> + <<set _day -= 31, _month = "January", _year += 1>> +<</if>> +<</switch>> +<hr> + +<<if $slaveRebellion == 1>> + Today, the _day of _month _year, our arcology was inflamed by the fires of rebellion. $attackTroops rebels from all over the structure dared rise up against their owners and conquer their freedom through blood. Our defense force, $troopCount strong, fought with them street by street + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <<set $ASlaves -= $enemyLosses>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the disorganized revolt in a few well aimed assaults. + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the disorganized revolt with several well aimed assaults. + <<else>> + The fight was long and hard, but in the end our men stopped the revolt before it could accumulate momentum. + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the furious charge of the rebels. + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the rebels proved too much to handle for our men. + <<else>> + The fight was long and hard, but despite their bravery the rebels proved too much for our men. + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to stop the revolt, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the rebelling slaves, which were fortunately unable to capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <</if>> + + /* effects */ + <<if $battleResult == 3>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ increased. + <<set $rep += random(800,1000)>> + <<set $authority += random(800,1000)>> + <br>Many of the rebelling slaves were recaptured and punished. The instigators were executed one after another in a public trial that lasted for almost three days. + <<set $ASlaves -= random(10,30)>> + <<elseif $battleResult == -3>> + Due to your defeat, your @@.red;reputation@@ and @@.red;authority@@ decreased. + <<set $rep -= random(800,1000)>> + <<set $authority -= random(800,1000)>> + <br>After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time. + <<set $ACitizens -= random(50,100)>> + <<set $ASlaves -= Math.trunc(($attackTroops - $enemyLosses) * 0.8)>> + <<set $rebelDefeatAftermath = 5>> + <<elseif $battleResult == -2>> + Due to your defeat, your @@.red;reputation@@ and @@.red;authority@@ decreased. + <<set $rep -= random(600,800)>> + <<set $authority -= random(600,800)>> + <br>After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time. + <<set $ACitizens -= random(40,80)>> + <<set $ASlaves -= Math.trunc(($attackTroops - $enemyLosses) * 0.6)>> + <<set $rebelDefeatAftermath = 3>> + <<elseif $battleResult == 2>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ increased. + <<set $rep += random(600,180)>> + <<set $authority += random(600,800)>> + <br>Many of the rebelling slaves were recaptured and punished. The instigators were executed one after another in a public trial that lasted for almost three days. + <<set $ASlaves -= random(10,30)>> + <<elseif $battleResult == -1>> + Rather than waste the lives of your men you decided to surrender, hoping the rebels will cause less damage if you indulge them, this is however a big hit to your status. Your @@.red;reputation@@ and @@.red;authority@@ are significantly impacted. + <<set $rep -= random(1000,1200)>> + <<set $authority -= random(1000,1200)>> + <br> + The surrender allows the arcology to survive @@.yellow;mostly intact@@, however reports of @@.red;mass looting and killing of citizens@@ flood your office for a few days. + <<set $cash -= 1000>> + <<if $week <= 30>> + <<set $ACitizens -= random(100)>> + <<set $ASlaves -= random(150)>> + <<set $arcologies[0].prosperity -= random(5)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(120)>> + <<set $ASlaves -= random(170)>> + <<set $arcologies[0].prosperity -= random(10)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(140)>> + <<set $ASlaves -= random(190)>> + <<set $arcologies[0].prosperity -= random(15)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(160)>> + <<set $ASlaves -= random(210)>> + <<set $arcologies[0].prosperity -= random(20)>> + <<else>> + <<set $ACitizens -= random(180)>> + <<set $ASlaves -= random(230)>> + <<set $arcologies[0].prosperity -= random(25)>> + <</if>> + <br>After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time. + <<set $ACitizens -= random(50,100)>> + <<set $ASlaves -= Math.trunc(($attackTroops - $enemyLosses) * 0.8)>> + <<set $rebelDefeatAftermath = 5>> + <</if>> +<<else>> + Today, the _day of _month _year, our arcology was inflamed by the fires of rebellion. $attackTroops rebels from all over the structure dared rise up to dethrone their arcology owner. Our defense force, $troopCount strong, fought with them street by street + <<if $enemyLosses != $attackTroops>> + inflicting <<print $enemyLosses>> casualties, while sustaining <<print $losses>> casualties themselves. + <<else>> + completely annihilating their troops, while sustaining <<print $losses>> casualties. + <</if>> + <<set $ASlaves -= $enemyLosses>> + <<if $battleResult == 3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men easily stopped the disorganized revolt in a few well aimed assaults. + <<elseif $battleTurns <= 7>> + The fight was hard, but in the end our men stopped the disorganized revolt with several well aimed assaults. + <<else>> + The fight was long and hard, but in the end our men stopped the revolt before it could accumulate momentum. + <</if>> + <<elseif $battleResult == -3>> + <<if $battleTurns <= 5>> + The fight was quick and one sided, our men were easily crushed by the furious charge of the rebels. + <<elseif $battleTurns <= 7>> + The fight was hard and in the end the rebels proved too much to handle for our men. + <<else>> + The fight was long and hard, but despite their bravery the rebels proved too much for our men. + <</if>> + <<elseif $battleResult == 2>> + The fight was long and hard, but in the end our men managed to stop the revolt, though not without difficulty. + <<elseif $battleResult == -2>> + The fight was long and hard. Our men in the end had to yield to the rebelling slaves, which were fortunately unable to fully capitalized on their victory. + <<elseif $battleResult == -1>> + You gave your troops the order to surrender, obediently they stand down. + <</if>> + + /* effects */ + <<if $battleResult == 3>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ increased. + <<set $rep += random(800,1000)>> + <<set $authority += random(800,1000)>> + <br>Many of the rebelling citizens were captured and punished, many others enslaved. The instigators were executed one after another in a public trial that lasted for almost three days. + <<set $ACitizens -= random(10,30)>> + <<elseif $battleResult == -3>> + Due to your defeat, your @@.red;reputation@@ and @@.red;authority@@ decreased. + <<set $rep -= random(800,1000)>> + <<set $authority -= random(800,1000)>> + <br>After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time. + <<set $ACitizens -= Math.trunc(($attackTroops - $enemyLosses) * 0.8)>> + <<set $rebelDefeatAftermath = 5>> + <<elseif $battleResult == -2>> + Due to your defeat, your @@.red;reputation@@ and @@.red;authority@@ decreased. + <<set $rep -= random(600,800)>> + <<set $authority -= random(600,800)>> + <br>After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time. + <<set $ACitizens -= random(40,80)>> + <<set $ASlaves -= Math.trunc(($attackTroops - $enemyLosses) * 0.6)>> + <<set $rebelDefeatAftermath = 3>> + <<elseif $battleResult == 2>> + Thanks to your victory, your @@.green;reputation@@ and @@.darkviolet;authority@@ increased. + <<set $rep += random(600,180)>> + <<set $authority += random(600,800)>> + <br>Many of the rebelling citizens were captured and punished, many others enslaved. The instigators were executed one after another in a public trial that lasted for almost three days. + <<set $ASlaves -= random(10,30)>> + <<elseif $battleResult == -1>> + Rather than waste the lives of your men you decided to surrender, hoping the rebels will cause less damage if you indulge them, this is however a big hit to your status. Your @@.red;reputation@@ and @@.red;authority@@ are significantly impacted. + <<set $rep -= random(1000,1200)>> + <<set $authority -= random(1000,1200)>> + <br> + The surrender allows the arcology to survive @@.yellow;mostly intact@@, however reports of @@.red;mass looting and killing of citizens@@ flood your office for a few days. + <<set $cash -= 1000>> + <<if $week <= 30>> + <<set $ACitizens -= random(100)>> + <<set $ASlaves -= random(150)>> + <<set $arcologies[0].prosperity -= random(5)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(120)>> + <<set $ASlaves -= random(170)>> + <<set $arcologies[0].prosperity -= random(10)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(140)>> + <<set $ASlaves -= random(190)>> + <<set $arcologies[0].prosperity -= random(15)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(160)>> + <<set $ASlaves -= random(210)>> + <<set $arcologies[0].prosperity -= random(20)>> + <<else>> + <<set $ACitizens -= random(180)>> + <<set $ASlaves -= random(230)>> + <<set $arcologies[0].prosperity -= random(25)>> + <</if>> + <br>After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time. + <<set $ACitizens -= random(50,100)>> + <<set $ASlaves -= Math.trunc(($attackTroops - $enemyLosses) * 0.8)>> + <<set $rebelDefeatAftermath = 5>> + <</if>> +<</if>> + +/* engage rules */ +<<if $battleResult != -1>> + <<if $engageRule == 0>> + Since you ordered your troops to limit their weaponry to low caliber or non lethal, the arcology reported only @@.red;minor damage@@. Most citizens and non involved slaves remained unharmed, though some casualties between the civilians were inevitable. + A few businesses were looted and burned, but the damage was pretty limited. + <<set $arcRepairTime += 3>> + <<if $week <= 30>> + <<set $ACitizens -= random(40)>> + <<set $ASlaves -= random(65)>> + <<set $arcologies[0].prosperity -= random(2)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(50)>> + <<set $ASlaves -= random(55)>> + <<set $arcologies[0].prosperity -= random(5)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(60)>> + <<set $ASlaves -= random(85)>> + <<set $arcologies[0].prosperity -= random(7)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(70)>> + <<set $ASlaves -= random(95)>> + <<set $arcologies[0].prosperity -= random(10)>> + <<else>> + <<set $ACitizens -= random(80)>> + <<set $ASlaves -= random(105)>> + <<set $arcologies[0].prosperity -= random(12)>> + <</if>> + <<elseif $engageRule == 1>> + You ordered your troops to limit their weaponry to non-heavy, non-explosive, because of this the arcology reported @@.red;moderate damage@@. Most citizens and non involved slaves remained unharmed or only lightly wounded, but many others did not make it. Unfortunately casualties between the civilians were inevitable. + A few businesses were looted and burned, but the damage was pretty limited. + <<set $arcRepairTime += 5>> + <<if $week <= 30>> + <<set $ACitizens -= random(60)>> + <<set $ASlaves -= random(85)>> + <<set $arcologies[0].prosperity -= random(4)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(70)>> + <<set $ASlaves -= random(75)>> + <<set $arcologies[0].prosperity -= random(7)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(80)>> + <<set $ASlaves -= random(105)>> + <<set $arcologies[0].prosperity -= random(9)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(90)>> + <<set $ASlaves -= random(115)>> + <<set $arcologies[0].prosperity -= random(12)>> + <<else>> + <<set $ACitizens -= random(100)>> + <<set $ASlaves -= random(125)>> + <<set $arcologies[0].prosperity -= random(14)>> + <</if>> + <<elseif $engageRule == 2>> + Since you did not apply any restriction on the weapons your forces should use, the arcology reported @@.red;heavy damage@@. Many citizens and uninvolved slaves are reported killed or missing. Casualties between the civilians were inevitable. + Many businesses were damaged during the battle either by the fight itself, by fires which spread unchecked for hours or by looters. + <<set $arcRepairTime += 7>> + <<if $week <= 30>> + <<set $ACitizens -= random(100)>> + <<set $ASlaves -= random(150)>> + <<set $arcologies[0].prosperity -= random(5)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(120)>> + <<set $ASlaves -= random(170)>> + <<set $arcologies[0].prosperity -= random(10)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(140)>> + <<set $ASlaves -= random(190)>> + <<set $arcologies[0].prosperity -= random(15)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(160)>> + <<set $ASlaves -= random(210)>> + <<set $arcologies[0].prosperity -= random(20)>> + <<else>> + <<set $ACitizens -= random(180)>> + <<set $ASlaves -= random(230)>> + <<set $arcologies[0].prosperity -= random(25)>> + <</if>> + <<else>> + Thanks to the advance riot control weaponry developed by your experts, the rebels were mostly subdued or killed with @@.yellow;little to no collateral damage to the arcology@@ and its inhabitants. + A few businesses were looted, but the damage was very limited. + <<set $arcRepairTime += 2>> + <<set $cash -= 1000>> + <<if $week <= 30>> + <<set $ACitizens -= random(20)>> + <<set $ASlaves -= random(45)>> + <<set $arcologies[0].prosperity -= random(2)>> + <<elseif $week <= 60>> + <<set $ACitizens -= random(30)>> + <<set $ASlaves -= random(35)>> + <<set $arcologies[0].prosperity -= random(4)>> + <<elseif $week <= 90>> + <<set $ACitizens -= random(40)>> + <<set $ASlaves -= random(65)>> + <<set $arcologies[0].prosperity -= random(6)>> + <<elseif $week <= 120>> + <<set $ACitizens -= random(50)>> + <<set $ASlaves -= random(75)>> + <<set $arcologies[0].prosperity -= random(8)>> + <<else>> + <<set $ACitizens -= random(60)>> + <<set $ASlaves -= random(85)>> + <<set $arcologies[0].prosperity -= random(10)>> + <</if>> + <</if>> +<</if>> +<<if $ACitizens < 100>> + <<set $ACitizens = 100>> +<</if>> +<<if $ASlaves < 200>> + <<set $ASlaves = 200>> +<</if>> + +/* garrisons */ +<<if $garrison.reactor == 0>> + <<if random(1,100) <= (75 - ($fort.reactor * 25))>> + Unfortunately during the fighting a group of slaves infiltrated the reactor complex and sabotaged it, causing massive power fluctuations and blackouts. + It will take @@.red;time and money to repair the damage@@. + <<set $garrison.reactorTime = $repairTime + random(1) - $fort.reactor>> + <<set $cash -= 2000>> + <<else>> + While the reactor was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky. + <</if>> +<<else>> + The garrison assigned to the reactor protected it from the multiple sabotage attempts carried out by the rebels. +<</if>> +<<if $garrison.waterway == 0>> + <<if random(1,100) <= (75 - ($fort.waterway * 25))>> + Unfortunately during the fighting a group of slaves infiltrated the water management complex and sabotaged it, causing huge water leaks throughout the arcology and severely limiting the water supply. + It will take @@.red;time and money to repair the damage@@. + <<set $garrison.waterwayTime = $repairTime + random(1) - $fort.waterway>> + <<set $cash -= 2000>> + <<else>> + While the water management complex was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky. + <</if>> +<<else>> + The garrison assigned to the water management complex protected it from the sabotage attempt of the rebels. +<</if>> +<<if $garrison.assistant == 0>> + <<if random(1,100) <= (75 - ($fort.assistant * 25))>> + Unfortunately during the fighting a group of slaves infiltrated the facility housing $assistantName's mainframe and sabotaged it. Without its AI the arcology will be next to impossible to manage. + It will take @@.red;time and money to repair the damage@@. + <<set $garrison.assistantTime = $repairTime + random(1) - $fort.assistant>> + <<set $cash -= 2000>> + <<else>> + While the $assistantName's mainframe was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky. + <</if>> +<<else>> + The garrison assigned to the facility housing $assistantName's mainframe prevented any sabotage attempt. +<</if>> +<<if $garrison.penthouse == 1 && $Bodyguard != 0>> + The garrison assigned to the penthouse together with your loyal bodyguard stopped all assaults against your penthouse with ease. +<<elseif $Bodyguard != 0>> + <<if random(1,100) <= 75>> + During the fighting a group of slaves assaulted the penthouse. Your bodyguard, $Bodyguard.slaveName, stood strong against the furious attack. + <<set _woundChance = 0>> + <<if $PC.career == "mercenary" || $PC.career == "gang">> + <<set _woundChance -= 5>> + <</if>> + <<if $personalArms >= 1>> + <<set _woundChance -= 5>> + <</if>> + <<if $PC.physicalAge >= 60>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.belly > 5000>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.boobsBonus >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.butt >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.preg >= 30>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.balls == 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.ballsImplant >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if random(1,100) <= _woundChance>> + A lucky shot managed to find your way to you, leaving a painful, but thankfully not lethal, wound. + <<set $PCWounded = 1>> + <<set $PCWoundCooldown = 3>> + <<else>> + Fortunately you managed to avoid injury. + <</if>> + <<if $Concubine != 0>> + <<set _woundChance = 0>> + <<if $Concubine.combatSkill == 1>> + <<set _woundChance -= 2>> + <</if>> + <<if $Concubine.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.health >= 50>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<set _woundChance *= random(2,4)>> + <<if random(1,100) <= _woundChance>> + Your concubine was unfortunately caught in the crossfire and + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + a splinter pierced her throat, severing her vocal cords. + <<set $Concubine.voice = 0>> + <<elseif $woundType == 2>> + a splinter hit her face, severely damaging her eyes. + <<set $Concubine.eyes = -2>> + <<elseif $woundType == 3>> + an explosion near her caused the loss of all her limbs. + <<set $Concubine.amp = 1>> + <<elseif $woundType >= 4>> + a stray shot severely wounded her. + <<if $Concubine.health >= -60>> + <<set $Concubine.health -= 30>> + <<else>> + <<set $Concubine.health -= Math.abs(90 - $Concubine.health)>> + <</if>> + <</if>> + <</if>> + <</if>> + <<set _woundChance = 0>> + <<if $Bodyguard.combatSkill == 1>> + <<set _woundChance -= 2>> + <</if>> + <<if $Bodyguard.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $Bodyguard.health >= 50>> + <<set _woundChance -= 1>> + <</if>> + <<if $Bodyguard.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Bodyguard.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<set _woundChance *= random(2,4)>> + <<if random(1,100) <= _woundChance>> + During one of the assaults your bodyguard was hit. + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + A splinter pierced her throat, severing her vocal cords. + <<set $Bodyguard.voice = 0>> + <<elseif $woundType == 2>> + A splinter hit her face, severely damaging her eyes. + <<set $Bodyguard.eyes = -2>> + <<elseif $woundType == 3>> + An explosion near her caused the loss of all her limbs. + <<set $Bodyguard.amp = 1>> + <<elseif $woundType >= 4>> + A stray shot severely wounded her. + <<if $Bodyguard.health >= -60>> + <<set $Bodyguard.health -= 30>> + <<else>> + <<set $Bodyguard.health -= Math.abs(90 - $Bodyguard.health)>> + <</if>> + <</if>> + <</if>> + The damage to the structure will be @@.red;costly to repair@@. + <<set $cash -= 2000>> + <<else>> + While the penthouse was left without a sizeable garrison, there was no dangerous assault against it. Let's hope we'll always be this lucky. + <</if>> +<<elseif $garrison.penthouse == 1>> + <<if random(1,100) <= 75>> + During the fighting a group of slaves assaulted the penthouse. The garrison stood strong against the furious attack. + <<set _woundChance = 0>> + <<if $PC.career == "mercenary" || $PC.career == "gang">> + <<set _woundChance -= 5>> + <</if>> + <<if $personalArms >= 1>> + <<set _woundChance -= 5>> + <</if>> + <<if $PC.physicalAge >= 60>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.belly > 5000>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.boobsBonus >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.butt >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.preg >= 30>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.balls == 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.ballsImplant >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<set _woundChance *= random(1,2)>> + <<if random(1,100) <= _woundChance>> + A lucky shot managed to find your way to you, leaving a painful, but thankfully not lethal, wound. + <<set $PCWounded = 1>> + <<set $PCWoundCooldown = 3>> + <<else>> + Fortunately you managed to avoid injury. + <</if>> + <<if $Concubine != 0>> + <<set _woundChance = 0>> + <<if $Concubine.combatSkill == 1>> + <<set _woundChance -= 2>> + <</if>> + <<if $Concubine.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.health >= 50>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<set _woundChance *= random(2,4)>> + <<if random(1,100) <= _woundChance>> + Your concubine was unfortunately caught in the crossfire and + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + a splinter pierced her throat, severing her vocal cords. + <<set $Concubine.voice = 0>> + <<elseif $woundType == 2>> + a splinter hit her face, severely damaging her eyes. + <<set $Concubine.eyes = -2>> + <<elseif $woundType == 3>> + an explosion near her caused the loss of all her limbs. + <<set $Concubine.amp = 1>> + <<elseif $woundType >= 4>> + a stray shot severely wounded her. + <<if $Concubine.health >= -60>> + <<set $Concubine.health -= 30>> + <<else>> + <<set $Concubine.health -= Math.abs(90 - $Concubine.health)>> + <</if>> + <</if>> + <</if>> + <</if>> + The damage to the structure will be @@.red;costly to repair@@. + <<set $cash -= 2000>> + <<else>> + There was no sizeable assault against the penthouse. Let's hope we'll always be this lucky. + <</if>> +<<else>> + <<if random(1,100) <= 75>> + During the fighting a group of slaves assaulted the penthouse. Isolated and alone, you stood strong against the furious attack. + <<set _woundChance = 0>> + <<if $PC.career == "mercenary" || $PC.career == "gang">> + <<set _woundChance -= 5>> + <</if>> + <<if $personalArms >= 1>> + <<set _woundChance -= 5>> + <</if>> + <<if $PC.physicalAge >= 60>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.belly > 5000>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.boobsBonus >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.butt >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.preg >= 30>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.balls == 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<if $PC.ballsImplant >= 2>> + <<set _woundChance += random(1,5)>> + <</if>> + <<set _woundChance *= random(1,2)>> + <<if random(1,100) <= _woundChance>> + A lucky shot managed to find your way to you, leaving a painful, but thankfully not lethal, wound. + <<set $PCWounded = 1>> + <<set $PCWoundCooldown = 3>> + <<else>> + Fortunately you managed to avoid injury. + <</if>> + <<if $Concubine != 0>> + <<set _woundChance = 0>> + <<if $Concubine.combatSkill == 1>> + <<set _woundChance -= 2>> + <</if>> + <<if $Concubine.amp >= -4>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.health >= 50>> + <<set _woundChance -= 1>> + <</if>> + <<if $Concubine.weight > 130>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.muscles < -30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.eyes <= -2>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.heels == 1>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.boobs >= 1400>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.butt >= 6>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.preg >= 30>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.dick >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.balls >= 8>> + <<set _woundChance += 1>> + <</if>> + <<if $Concubine.intelligence <= -3>> + <<set _woundChance += 1>> + <</if>> + <<set _woundChance *= random(2,4)>> + <<if random(1,100) <= _woundChance>> + Your concubine was unfortunately caught in the crossfire and + <<set $woundType = random(1,10)>> + <<if $woundType == 1>> + a splinter pierced her throat, severing her vocal cords. + <<set $Concubine.voice = 0>> + <<elseif $woundType == 2>> + a splinter hit her face, severely damaging her eyes. + <<set $Concubine.eyes = -2>> + <<elseif $woundType == 3>> + an explosion near her caused the loss of all her limbs. + <<set $Concubine.amp = 1>> + <<elseif $woundType >= 4>> + a stray shot severely wounded her. + <<if $Concubine.health >= -60>> + <<set $Concubine.health -= 30>> + <<else>> + <<set $Concubine.health -= Math.abs(90 - $Concubine.health)>> + <</if>> + <</if>> + <</if>> + <</if>> + <<else>> + There was no sizeable assault against the penthouse. Let's hope we'll always be this lucky. + <</if>> +<</if>> + +<br> +<br> + +<<include "unitsRebellionReport">> + +/* resets variables and flags */ +<<set $attackTroops = 0>> +<<set $attackEquip = 0>> +<<set $enemyLosses = 0>> +<<set $losses = 0>> +<<set $battleTurns = 0>> +<<set $slaveRebellion = 0>> +<<set $citizenRebellion = 0>> +<<set $irregulars = 0>> +<<set $deployingMilitia = 0>> +<<set $deployingSlaves = 0>> +<<set $deployingMercs = 0>> +<<if $slaveRebellion == 1>> + <<set $slaveProgress = 0>> + <<set $citizenProgress = Math.clamp($citizenProgress - random(50,100), 0, 100)>> +<<else>> + <<set $citizenProgress = 0>> + <<set $slaveProgress = Math.clamp($slaveProgress - random(50,100), 0, 100)>> +<</if>> +<<set $tension = Math.clamp($tension - random(50,100), 0, 100)>> \ No newline at end of file diff --git a/src/SecExp/riotControlCenter.tw b/src/SecExp/riotControlCenter.tw new file mode 100644 index 0000000000000000000000000000000000000000..a31a92119a889c63befeae46fb8e029966c32ff4 --- /dev/null +++ b/src/SecExp/riotControlCenter.tw @@ -0,0 +1,214 @@ +:: riotControlCenter [nobr] + +<<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">> + +Riot Control Center +<hr> + +The riot control center opens its guarded doors to you. The great chamber inside is dominated by massive screens filled with vital information and propaganda being tested. +<br> +<br> +<<if $tension <= 33>> + Tensions in the arcology are low. Political and ideological opposition against the arcology owner is almost unheard of. +<<elseif $tension <= 66>> + Tensions in the arcology are rising, political and ideological opposition against the arcology owner are becoming a part of the daily life of the arcology. +<<else>> + Tensions are high. Opposition to the arcology owner is a sentiment shared by many and armed resistance is on the rise. +<</if>> +<br> +<<if $riotUpgrades.freeMedia == 0>> + [[Provide free media access in all the arcology|riotControlCenter][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $riotUpgrades.freeMedia = 1, $riotUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will slowly lower tensions in the arcology, but will incur in upkeep costs.// +<<else>> + You are providing free access to many mass media in the arcology. + <<if $riotUpgrades.freeMedia < 5>> + <<link "Invest more resources in the free media project">> + <<set $riotUpgrades.freeMedia += 1>> + <<set $cash -= 5000 * $upgradeMultiplierArcology * ($riotUpgrades.freeMedia + 1)>> + <<set $riotUpkeep += $upgradeUpkeep>> + <<goto "riotControlCenter">> + <</link>> + <br>Invest more resources into the project to increase its effectiveness. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($riotUpgrades.freeMedia + 1))>>. Will accelerate the tension decay, but will increase upkeep costs.// + <<else>> + You upgraded your free media scheme to its limits. + <</if>> +<</if>> +<br> +<br> +<<if $slaveProgress <= 25>> + There is very low unrest between slaves in the arcology. The chances of a rebellion igniting are extremely low. +<<elseif $slaveProgress <= 50>> + There is some unrest between the slaves. No major movement is forming yet, but it might be time to consider preventive measures. +<<elseif $slaveProgress <= 75>> + Unrest is getting high between the slaves of the arcology. Preventive measures are necessary if we want to prevent a violent rebellion. +<<else>> + Unrest is extremely high between slaves. The chances of a rebellion happening in the near future are extremely high. +<</if>> +<br> +<<if $citizenProgress <= 25>> + There is very low unrest between the citizens of the arcology. The chances of a rebellion igniting are extremely low. +<<elseif $citizenProgress <= 50>> + There is some unrest between the citizens. No major movement is forming yet, but it might be time to consider preventive measures. +<<elseif $citizenProgress <= 75>> + Unrest is getting high between the citizens of the arcology. Preventive measures are necessary if we want to prevent a violent rebellion. +<<else>> + Unrest is extremely high between citizens. The chances of a rebellion happening in the near future are extremely high. +<</if>> +<br> +<br> +<<if $riotUpgrades.rapidUnit == 0>> + [[Create rapid deployment riot units|riotControlCenter][$cash -= Math.trunc(7500*$upgradeMultiplierArcology), $riotUpgrades.rapidUnit = 1, $riotUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(7500*$upgradeMultiplierArcology)>>. Will allow spending authority or reputation to lower the progress of rebellions.// +<<else>> + You created a rapid deployment riot unit. + <<if $riotUpgrades.rapidUnit < 5>> + <<link "Invest more resources in the rapid deployment unit">> + <<set $riotUpgrades.rapidUnit += 1>> + <<set $cash -= 5000 * $upgradeMultiplierArcology * ($riotUpgrades.rapidUnit + 1)>> + <<set $riotUpkeep += $upgradeUpkeep>> + <<goto "riotControlCenter">> + <</link>> + <br>Invest more resources into the project to increase its effectiveness. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($riotUpgrades.rapidUnit + 1))>>. Will lower action costs.// + <<else>> + <br>You upgraded your rapid deployment unit to its limits. + <</if>> + <<if $riotUpgrades.rapidUnitSpeed < 2>> + <<link "Enhance the internal informants network">> + <<set $riotUpgrades.rapidUnitSpeed += 1>> + <<set $cash -= 5000 * $upgradeMultiplierArcology * ($riotUpgrades.rapidUnitSpeed + 1)>> + <<set $riotUpkeep += $upgradeUpkeep>> + <<goto "riotControlCenter">> + <</link>> + <br>Invest more resources into the effectivenes of the informants network. + <br>//Costs ¤<<print Math.trunc(5000 * $upgradeMultiplierArcology * ($riotUpgrades.rapidUnitSpeed + 1))>>. Will reduce cooldown of the rapid deployment riot unit.// + <<else>> + <br>You enhanced your informants network to its limits. + <</if>> + <br> + <br>You can send out the squad to slow down the progress of hostile groups within the arcology: + <<link "spend authority">> + <<set $riotUpgrades.rapidUnitCost = 0>> + <<goto "riotControlCenter">> + <</link>> | + <<link "spend reputation">> + <<set $riotUpgrades.rapidUnitCost = 1>> + <<goto "riotControlCenter">> + <</link>> + <br> + <<if $riotUpgrades.rapidUnitCost == 0>> + Your authority will be leveraged to suppress the rebels. + <<else>> + Your reputation will be leveraged to suppress the rebels. + <</if>> + <br> + <span id="result"> + <<if $sentUnitCooldown == 0>> + <br><<link "Deploy the unit against slaves rebel leaders">> + <<if $riotUpgrades.rapidUnitCost == 0>> + <<set $authority -= 1000 + 50 * $riotUpgrades.rapidUnit>> + <<else>> + <<set $reputation -= 1000 + 50 * $riotUpgrades.rapidUnit>> + <</if>> + <<set _change = random(15) + random(1,2) * $riotUpgrades.rapidUnit>> + <<set $slaveProgress = Math.clamp($slaveProgress - _change,0,100)>> + <<set $sentUnitCooldown = 3 - $riotUpgrades.rapidUnitSpeed>> + <<replace "#result">> + Slave rebellion progress set back by <<print _change>>%. + The unit will be able to deployed again in $sentUnitCooldown weeks. + <</replace>> + <</link>> + <br><<link "Deploy the unit against citizens rebel leaders">> + <<if $riotUpgrades.rapidUnitCost == 0>> + <<set $authority -= 1000 + 50 * $riotUpgrades.rapidUnit>> + <<else>> + <<set $reputation -= 1000 + 50 * $riotUpgrades.rapidUnit>> + <</if>> + <<set _change = random(15) + random(1,2) * $riotUpgrades.rapidUnit>> + <<set $citizenProgress = Math.clamp($citizenProgress - _change,0,100)>> + <<set $sentUnitCooldown = 3 - $riotUpgrades.rapidUnitSpeed>> + <<replace "#result">> + Citizen rebellion progress set back by <<print _change>>%. + The unit will be able to deployed again in $sentUnitCooldown weeks. + <</replace>> + <</link>> + <<else>> + <br>The unit cannot be deployed again for $sentUnitCooldown weeks. + <</if>> + </span> +<</if>> +<br> +<br> +<<if $brainImplant < 106>> + <<if $brainImplantProject == 0>> + <<link "Start secretly installing brain implants in your citizens and resident slaves">> + <<set $brainImplantProject = 1>> + <<set $brainImplant = 0>> + <<set $riotUpkeep += 5000>> + <<goto "riotControlCenter">> + <</link>> + <br>//Will take weeks of work and will cost 10000 each, but once finished rebellions will progress a lot slower.// + <<elseif $brainImplantProject < 5>> + <<link "Invest more resources in the brain implant project">> + <<set $brainImplantProject += 1>> + <<set $cash -= 50000 * $upgradeMultiplierArcology * $brainImplantProject>> + <<set $riotUpkeep += $upgradeUpkeep * 100>> + <<goto "riotControlCenter">> + <</link>> + <br>Invest more resources into the project to increase its speed. + <br>//Costs ¤<<print Math.trunc(50000 * $upgradeMultiplierArcology * $brainImplantProject)>>. Will shorten the time required to complete the project.// + <<else>> + You sped up the project to its maximum. + <</if>> + <<if $brainImplant != -1>> + <br><br>The great brain implant project is underway. Estimated time to completion: <<print Math.trunc((100 - $brainImplant) / $brainImplantProject)>> + <</if>> +<<else>> + The great brain implant project is completed, rebellions against you will be extremely difficult to organize. +<</if>> +<br> +<br> +<<if $advancedRiotEquip == 0>> + <<link "Develop advanced anti-riot equipment">> + <<set $advancedRiotEquip = 1>> + <<set $cash -= 30000>> + <<goto "riotControlCenter">> + <</link>> + <br>//Costs ¤30000. Will allow the selection of advanced riot equipment in case of a rebellion, which will let your troops fight at full effectiveness while doing reduced collateral damage.// +<<else>> + You developed advanced riot equipment, which allows your troops to fight within the confies of your arcology without the fear of doing major collateral damage. +<</if>> +<br> +<<if $fort.reactor == 0>> + <<link "Reinforce the reactor complex">> + <<set $fort.reactor = 1>> + <<set $cash -= 10000 * $upgradeMultiplierArcology>> + <<goto "riotControlCenter">> + <</link>> + <br>//Costs ¤<<print 10000 * $upgradeMultiplierArcology>>. Will add protection to the reactor building, making it less likely to be damaged and speeding up repairs if our defensive efforts should fail.// +<<else>> + You have installed additional protection layers and redundant systems in the reactor complex. +<</if>> +<br> +<<if $fort.waterway == 0>> + <<link "Reinforce the waterways">> + <<set $fort.waterway = 1>> + <<set $cash -= 10000 * $upgradeMultiplierArcology>> + <<goto "riotControlCenter">> + <</link>> + <br>//Costs ¤<<print 10000 * $upgradeMultiplierArcology>>. Will add protection to the waterways, making it less likely to be damaged and speeding up repairs if our defensive efforts should fail.// +<<else>> + You have installed additional protection layers and redundant systems in the waterways. +<</if>> +<br> +<<if $fort.assistant == 0>> + <<link "Reinforce the assistant CPU core">> + <<set $fort.assistant = 1>> + <<set $cash -= 10000 * $upgradeMultiplierArcology>> + <<goto "riotControlCenter">> + <</link>> + <br>//Costs ¤<<print 10000 * $upgradeMultiplierArcology>>. Will add protection to the assistant CPU core, making it less likely to be damaged and speeding up repairs if our defensive efforts should fail.// +<<else>> + You have installed additional protection layers and redundant systems in the assistant CPU core. +<</if>> \ No newline at end of file diff --git a/src/SecExp/secBarracks.tw b/src/SecExp/secBarracks.tw new file mode 100644 index 0000000000000000000000000000000000000000..d9bd64ce6dda04b0950f0bbe395d75c653d46b46 --- /dev/null +++ b/src/SecExp/secBarracks.tw @@ -0,0 +1,675 @@ +:: secBarracks [nobr] + +<<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">> + +The Barracks +<hr> +__Upgrades__ +<br> +While for many a sore sight in a free city, the barracks stand proud before you. +<<if $secBarracksUpgrades.size == 0>> + The building is relatively small and able to house a limited number of units. +<<elseif $secBarracksUpgrades.size == 1>> + The building has been expanded and can now house more units comfortably. +<<elseif $secBarracksUpgrades.size == 2>> + The building has been further expanded and can now house a high number of units. +<<elseif $secBarracksUpgrades.size == 3>> + The building has been greatly expanded and can now house a sizable military. +<<elseif $secBarracksUpgrades.size == 4>> + The building has been greatly expanded and can now house a small army. +<<else>> + The building has been greatly expanded and can now house an army worthy of an old world nation. +<</if>> +<<if $secBarracksUpgrades.luxury == 0>> + The barracks are a spartan building, with little to make the day to day lives of your soldiers pleasant. +<<elseif $secBarracksUpgrades.luxury == 1>> + The barracks have been made more comfortable by installing high tech furniture. +<<elseif $secBarracksUpgrades.luxury == 2>> + The barracks have been made more comfortable by installing high tech furniture and advanced kitchen facilities. +<<elseif $secBarracksUpgrades.luxury == 3>> + The barracks have been made more comfortable by installing high tech furniture and advanced kitchen facilities. It also provides free access to any digital media. +<<else>> + The barracks have been made more comfortable by installing high tech furniture and advanced kitchen facilities. It also provides free access to any digital media. A small limited access brothel has been added to the structure. +<</if>> +<<if $secBarracksUpgrades.training == 0>> + The building lacks the space and the equipment to train your units. +<<elseif $secBarracksUpgrades.training == 1>> + A training facility has been set up, allowing your units to better their skills with time. +<<else>> + The training facility has been filled with specialized equipment and skilled trainers. +<</if>> +<<if $secBarracksUpgrades.loyaltyMod == 0>> + The barracks lack an indocrination facility. +<<elseif $secBarracksUpgrades.loyaltyMod == 1>> + The barracks have been fitted with an indoctrination facility. +<<else>> + The barracks have been fitted with an advanced indoctrination facility. +<</if>> +<br> +<br> +<<if $secBarracksUpgrades.size < 5>> + <<link "Increase the size of the barracks">> + <<set $cash -= 5000 * ($secBarracksUpgrades.size + 1)>> + <<set $secBarracksUpgrades.size += 1>> + <<set $maxUnits += 2>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤<<print 5000 * ($secBarracksUpgrades.size + 1)>> and will increase the maximum number of units by 2.// +<<else>> + You've expanded the barracks to their maximum. +<</if>> +<br> +<<if $secBarracksUpgrades.luxury == 0>> + <<link "Increase the quality of life of your soldiers by installing high tech furniture and appliances.">> + <<set $secBarracksUpgrades.luxury += 1>> + <<set $cash -= 5000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤5000 and will provide a 5% bonus to morale.// +<<elseif $secBarracksUpgrades.luxury == 1>> + <<link "Further increase the quality of life of your soldiers by installing advanced kitchen equipment and hiring skilled chefs.">> + <<set $secBarracksUpgrades.luxury += 1>> + <<set $cash -= 10000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤10000 and will provide a 5% bonus to morale, for a total of +10%.// +<<elseif $secBarracksUpgrades.luxury == 2>> + <<link "Further increase the quality of life of your soldiers by providing high speed, free access to digital media">> + <<set $secBarracksUpgrades.luxury += 1>> + <<set $cash -= 10000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤10000 and will provide a 5% bonus to morale, for a total of +15%.// +<<elseif $secBarracksUpgrades.luxury == 3>> + <<link "Further increase the quality of life of your soldiers by adding and staffing an exclusive brothel to the structure">> + <<set $secBarracksUpgrades.luxury += 1>> + <<set $cash -= 15000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤15000 and will provide a 5% bonus to morale, for a total of +20%.// +<<else>> + You've made life in your barracks as good as it can get. +<</if>> +<br> +<<if $secBarracksUpgrades.training == 0>> + <<link "Add a training facility to the barracks">> + <<set $secBarracksUpgrades.training += 1>> + <<set $cash -= 10000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤10000 and will allow units to accumulate some experience each week.// +<<elseif $secBarracksUpgrades.training == 1>> + <<link "Improve the training facility with modern equipment and skilled personnel">> + <<set $secBarracksUpgrades.training += 1>> + <<set $cash -= 20000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤20000 and will allow units to accumulate experience each week.// +<<else>> + You have improved the training facility to the limit. +<</if>> +<br> +<<if $secBarracksUpgrades.loyaltyMod == 0>> + <<link "Add an indoctrination facility to the barracks">> + <<set $secBarracksUpgrades.loyaltyMod += 1>> + <<set $cash -= 10000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤10000 and will slowly raise loyalty of all units// +<<elseif $secBarracksUpgrades.loyaltyMod == 1>> + <<link "Improve the indoctrination facility with advanced equipment and skilled personnel">> + <<set $secBarracksUpgrades.loyaltyMod += 1>> + <<set $cash -= 20000>> + <<set $secBarracksUpkeep += $upgradeUpkeep>> + <<goto "secBarracks">> + <</link>> + <br>//Costs ¤20000 and will raise loyalty of all units faster.// +<<else>> + You have improved the indocrination facility to the limit. +<</if>> + +<hr> +__Units__ +<br> +Your maximum number of units is <<print $maxUnits>>, currently you have <<print $activeUnits>>. <<if $secBarracksUpgrades.luxury > 0>>The barracks provide <<print $secBarracksUpgrades.luxury * 5>>% bonus morale in case of a battle.<</if>><<if $secBarracksUpgrades.training > 0>> The training facility will increase the effectiveness of your units with time.<</if>> +<<if $arcologies[0].FSRomanRevivalist != "unset" || $arcologies[0].FSChineseRevivalist != "unset" || $arcologies[0].FSArabianRevivalist != "unset" || $arcologies[0].FSEdoRevivalist != "unset" || $arcologies[0].FSEgyptianRevivalist != "unset" || $arcologies[0].FSAztecRevivalist != "unset">> +<</if>> +<br> +<br> +__Security Drones__ +/* drones */ +<<if $secBots.active == 1>> + <br> + <<secBotsDescription>> + <br> + <<link "Review Equipment and upgrades">> + <<set $targetUnit = "secBots">> + <<goto "seeUnit">> + <</link>> + <<if $secBots.troops < $secBots.maxTroops>> + | + <<link "Replenish the unit">> + <<set $cash -= ($secBots.maxTroops - $secBots.troops) * $secBotsCost>> + <<set $secBots.troops = $secBots.maxTroops>> + <<goto "secBarracks">> + <</link>> + <</if>> +<<else>> + You have lost too many security drones to be able to field them again. + <<link "Reform the unit">> + <<set $cash -= $secBots.maxTroops * $secBotsCost>> + <<set $secBots.troops = $secBots.maxTroops>> + <<set $secBots.active = 1>> + <<goto "secBarracks">> + <</link>> +<</if>> + +<br> +<br> + +__Slaves__ +<br>/* slaves */ +You are free to organize your menial slaves into fighting units. Currently you have <<print $helots>> slaves available, while <<print $slavesEmployedManpower>> are already employed as soldiers. During all your battles you lost a total of <<print $slavesTotalCasualties>>. +<<set _menialPrice = Math.trunc(($slaveCostFactor*1000)/100)*100>> +<<set _menialPrice = Math.clamp(_menialPrice, 500, 1500)>> +<<silently>><<MenialPopCap>><</silently>> +<<if $PopCap > $helots+$fuckdolls+$menialBioreactors>> + <br> + [[Buy|secBarracks][$helots+=1,$menialDemandFactor+=1,$cash-=_menialPrice]] + <<if $cash > _menialPrice*10>> + [[(x10)|secBarracks][$helots+=10,$menialDemandFactor+=10,$cash-=_menialPrice*10]] + <</if>> + <<if $cash > _menialPrice*100>> + [[(x100)|secBarracks][$helots+=100,$menialDemandFactor+=100,$cash-=_menialPrice*100]] + <</if>> + <<if $cash > _menialPrice*2>> + [[(max)|secBarracks][$helots+=Math.trunc($cash/(_menialPrice)),$menialDemandFactor+=Math.trunc($cash/(_menialPrice)),$cash-=Math.trunc($cash/(_menialPrice))*(_menialPrice)]] + <</if>> +<</if>> +<br> +<<set _sL = $slaveUnits.length>> +<<if $helots > 0 && $activeUnits < $maxUnits>> + <br> + <<link "Form a new unit">> + <<if $createdSlavesUnits == 0>> + <<set _name = (1+$createdSlavesUnits) + "st slave platoon">> + <<elseif $createdSlavesUnits == 1>> + <<set _name = (1+$createdSlavesUnits) + "nd slave platoon">> + <<elseif $createdSlavesUnits == 2>> + <<set _name = (1+$createdSlavesUnits) + "rd slave platoon">> + <<else>> + <<set _name = (1+$createdSlavesUnits) + "th slave platoon">> + <</if>> + <<if $helots >= $maxTroops>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $maxTroops, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $slaveUnits.push(_newUnit)>> + <<set $helots -= 30>> + <<set $slavesEmployedManpower += 30>> + <<set $createdSlavesUnits++>> + <<else>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $helots, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $slaveUnits.push(_newUnit)>> + <<set $slavesEmployedManpower += _newUnit.troops>> + <<set $helots = 0>> + <<set $createdSlavesUnits++>> + <</if>> + <<set $activeUnits++>> + <<goto "secBarracks">> + <</link>> +<<elseif $helots > 0>> + You have reached the maximum number of units. You'll have to disband one or enlarge the barracks before forming a new unit. +<<elseif $activeUnits < $maxUnits>> + You don't have any free menial slave with which to form a new unit. +<</if>> +<<for _i = 0; _i < _sL; _i++>> + <<capture _i>> + <<if $slaveUnits[_i].active == 1>> + <br> + <br> + <<slaveUnitsDescription $slaveUnits[_i]>> + <br> + <<link "Disband the unit">> + <<set $helots += $slaveUnits[_i].troops>> + <<set $slavesEmployedManpower -= $slaveUnits[_i].troops>> + <<set _elimUnit = $slaveUnits[_i]>> + <<set _newSlaveUnits = []>> + <<for _y = 0; _y < _sL; _y++>> + <<if $slaveUnits[_y] != _elimUnit>> + <<set _newSlaveUnits.push($slaveUnits[_y])>> + <</if>> + <</for>> + <<set $slaveUnits = _newSlaveUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<link "Review Equipment and upgrades">> + <<set $targetUnit = "slaveUnits">> + <<set $targetIndex = _i>> + <<goto "seeUnit">> + <</link>> + | + <<if $slaveUnits[_i].troops < $slaveUnits[_i].maxTroops && $helots > 0>> + <<link "Replenish unit">> + <<if $helots >= $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>> + <<set $helots -= $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>> + <<set $slavesEmployedManpower += $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>> + <<set _expLoss = ($slaveUnits[_i].maxTroops - $slaveUnits[_i].troops) / $slaveUnits[_i].troops>> + <<set $slaveUnits[_i].training -= $slaveUnits[_i].training * _expLoss>> + <<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>> + <<else>> + <<set $slavesEmployedManpower += $helots>> + <<set _expLoss = $helots / $slaveUnits[_i].troops>> + <<set $slaveUnits[_i].training -= $slaveUnits[_i].training * _expLoss>> + <<set $slaveUnits[_i].troops += $helots>> + <<set $helots = 0>> + <</if>> + <<goto "secBarracks">> + <</link>> + <</if>> + + <<else>> + <br> + <br> + $slaveUnits[_i].platoonName lost too many operatives to be considered active. + <br> + <<link "Disband the unit">> + <<set _elimUnit = $slaveUnits[_i]>> + <<set _newSlaveUnits = []>> + <<for _y = 0; _y < _sL; _y++>> + <<if $slaveUnits[_y] != _elimUnit>> + <<set _newSlaveUnits.push($slaveUnits[_y])>> + <</if>> + <</for>> + <<set $slaveUnits = _newSlaveUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<if $helots > 0>> + <<link "Reform the unit">> + <<if $helots >= $slaveUnits[_i].maxTroops>> + <<set $slavesEmployedManpower += $slaveUnits[_i].maxTroops>> + <<set $helots -= $slaveUnits[_i].maxTroops>> + <<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>> + <<set $slaveUnits[_i].training = 0>> + <<else>> + <<set $slavesEmployedManpower += $helots>> + <<set $slaveUnits[_i].troops += $helots>> + <<set $helots = 0>> + <<set $slaveUnits[_i].training = 0>> + <</if>> + <<set $slaveUnits[_i].active = 1>> + <<goto "secBarracks">> + <</link>> + <</if>> + <</if>> + <</capture>> +<</for>> + +<<if $militiaFounded == 1>> +<br> +<br> +__Militia__ +<br>/* militia */ + You founded the $arcologies[0].name free militia. You are now able to organize your citizens in fighting units. + <<if $militiaRecruitment == 0>> + The militia is composed entirely of volunteers, your manpower is approximately 1.5% of the citizens population of your arcology. + <<elseif $militiaRecruitment == 1>> + With the establishment of conscription, your available manpower has increased to now approximately 3% of the arcology's citizens population. + <<elseif $militiaRecruitment == 2>> + By establishing obligatory military service to obtain citizenship you have enlarged your manpower pool to be approximately 5% of the arcology's citizens population. + <</if>> + Your current total manpower is <<print $militiaTotalManpower>>, of which <<print $militiaEmployedManpower>> is in active duty. You lost in total <<print $militiaTotalCasualties>> citizens, leaving you with <<print $militiaFreeManpower>> available citizens. + <br> + <<set _mL = $militiaUnits.length>> + <<if $militiaFreeManpower > 0 && $activeUnits < $maxUnits>> + <br> + <<link "Form a new unit">> + <<if $createdMilitiaUnits == 0>> + <<set _name = (1+$createdMilitiaUnits) + "st citizens' platoon">> + <<elseif $createdMilitiaUnits == 1>> + <<set _name = (1+$createdMilitiaUnits) + "nd citizens' platoon">> + <<elseif $createdMilitiaUnits == 2>> + <<set _name = (1+$createdMilitiaUnits) + "rd citizens' platoon">> + <<else>> + <<set _name = (1+$createdMilitiaUnits) + "th citizens' platoon">> + <</if>> + <<if $militiaFreeManpower >= $maxTroops>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $maxTroops, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $militiaUnits.push(_newUnit)>> + <<set $militiaFreeManpower -= 30>> + <<set $militiaEmployedManpower += 30>> + <<set $createdMilitiaUnits++>> + <<else>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $militiaFreeManpower, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $militiaUnits.push(_newUnit)>> + <<set $militiaEmployedManpower += _newUnit.troops>> + <<set $militiaFreeManpower = 0>> + <<set $createdMilitiaUnits++>> + <</if>> + <<set $activeUnits++>> + <<goto "secBarracks">> + <</link>> + <<elseif $militiaFreeManpower > 0>> + You have reached the maximum number of units. You'll have to disband one or enlarge the barracks before forming a new unit. + <<elseif $activeUnits < $maxUnits>> + You don't have any free recruits with which to form a new unit. + <</if>> + <<for _i = 0; _i < _mL; _i++>> + <<capture _i>> + <<if $militiaUnits[_i].active == 1>> + <br> + <br> + <<militiaUnitsDescription $militiaUnits[_i]>> + <br> + <<link "Disband the unit">> + <<set $militiaFreeManpower += $militiaUnits[_i].troops>> + <<set $militiaEmployedManpower -= $militiaUnits[_i].troops>> + <<set _elimUnit = $militiaUnits[_i]>> + <<set _newMilitiaUnits = []>> + <<for _y = 0; _y < _sL; _y++>> + <<if $militiaUnits[_y] != _elimUnit>> + <<set _newMilitiaUnits.push($militiaUnits[_y])>> + <</if>> + <</for>> + <<set $militiaUnits = _newMilitiaUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<link "Review Equipment and upgrades">> + <<set $targetUnit = "militiaUnits">> + <<set $targetIndex = _i>> + <<goto "seeUnit">> + <</link>> + | + <<if $militiaUnits[_i].troops < $militiaUnits[_i].maxTroops && $militiaFreeManpower > 0>> + <<link "Replenish unit">> + <<if $militiaFreeManpower >= $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>> + <<set $militiaFreeManpower -= $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>> + <<set $militiaEmployedManpower += $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>> + <<set _expLoss = ($militiaUnits[_i].maxTroops - $militiaUnits[_i].troops) / $militiaUnits[_i].troops>> + <<set $militiaUnits[_i].training -= $militiaUnits[_i].training * _expLoss>> + <<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>> + <<else>> + <<set $militiaEmployedManpower += $militiaFreeManpower>> + <<set _expLoss = $militiaFreeManpower / $militiaUnits[_i].troops>> + <<set $militiaUnits[_i].training -= $militiaUnits[_i].training * _expLoss>> + <<set $militiaUnits[_i].troops += $militiaFreeManpower>> + <<set $militiaFreeManpower = 0>> + <</if>> + <<goto "secBarracks">> + <</link>> + <</if>> + <<else>> + <br> + <br> + $militiaUnits[_i].platoonName lost too many operatives to be considered active. + <br> + <<link "Disband the unit">> + <<set $militiaFreeManpower += $militiaUnits[_i].troops>> + <<set $militiaEmployedManpower -= $militiaUnits[_i].troops>> + <<set _elimUnit = $militiaUnits[_i]>> + <<set _newMilitiaUnits = []>> + <<for _y = 0; _y < _sL; _y++>> + <<if $slaveUnits[_y] != _elimUnit>> + <<set _newMilitiaUnits.push($militiaUnits[_y])>> + <</if>> + <</for>> + <<set $militiaUnits = _newMilitiaUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<if $militiaFreeManpower > 0>> + <<link "Reform the unit">> + <<if $militiaFreeManpower >= $militiaUnits[_i].maxTroops>> + <<set $militiaEmployedManpower += $militiaUnits[_i].maxTroops>> + <<set $militiaFreeManpower -= $militiaUnits[_i].maxTroops>> + <<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>> + <<set $militiaUnits[_i].training = 0>> + <<else>> + <<set $militiaEmployedManpower += $militiaFreeManpower>> + <<set $militiaUnits[_i].troops += $militiaFreeManpower>> + <<set $militiaFreeManpower = 0>> + <<set $militiaUnits[_i].training = 0>> + <</if>> + <<set $militiaUnits[_i].active = 1>> + <<goto "secBarracks">> + <</link>> + <</if>> + <</if>> + <</capture>> + <</for>> + <br> +<<else>> + <br> + <br> + You have not yet founded the militia, you will not be able to form citizens units. +<</if>> + +<<if $mercenaries >= 1>> +<br> +<br> +__Mercenaries__ +<br>/* mercenaries */ + With the installation of a mercenary company in the arcology, many other are attracted to your free city, hoping to land a contract with you. + You are able to organize them in units to use in the defense of the arcology. Excluding the defense force you set up, there are <<print $mercTotalManpower>> mercenaries in your arcology, of which <<print $mercEmployedManpower>> actively employed and <<print $mercFreeManpower>> not yet under contract. In total <<print $mercTotalCasualties>> mercenaries have died defending your arcology. + <br> + <<set _meL = $mercUnits.length>> + <<if $mercFreeManpower > 0 && $activeUnits < $maxUnits>> + <br> + <<link "Form a new unit">> + <<if $createdMercUnits == 0>> + <<set _name = (1+$createdMercUnits) + "st mercenary platoon">> + <<elseif $createdMercUnits == 1>> + <<set _name = (1+$createdMercUnits) + "nd mercenary platoon">> + <<elseif $createdMercUnits == 2>> + <<set _name = (1+$createdMercUnits) + "rd mercenary platoon">> + <<else>> + <<set _name = (1+$createdMercUnits) + "th mercenary platoon">> + <</if>> + <<if $mercFreeManpower >= $maxTroops>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $maxTroops, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $mercUnits.push(_newUnit)>> + <<set $mercFreeManpower -= 30>> + <<set $mercEmployedManpower += 30>> + <<set $createdMercUnits++>> + <<else>> + <<set _newUnit = { + ID: 0, + platoonName: _name, + active: 1, + isDeployed: 0, + troops: $mercFreeManpower, + maxTroops: $maxTroops, + equip: 0, + training: 0, + loyalty: random(40,60), + medics: 0, + SF: 0, + commissars: 0, + battlesFought: 0}>> + <<generateUnitID _newUnit>> + <<set $mercUnits.push(_newUnit)>> + <<set $mercEmployedManpower += _newUnit.troops>> + <<set $mercFreeManpower = 0>> + <<set $createdMercUnits++>> + <</if>> + <<set $activeUnits++>> + <<goto "secBarracks">> + <</link>> + <<elseif $mercFreeManpower > 0>> + You have reached the maximum number of units. You'll have to disband one or enlarge the barracks before forming a new unit. + <<elseif $activeUnits < $maxUnits>> + You don't have any free mercenaries with which to form a new unit. + <</if>> + <<for _i = 0; _i < _meL; _i++>> + <<capture _i>> + <<if $mercUnits[_i].active == 1>> + <br> + <br> + <<mercUnitsDescription $mercUnits[_i]>> + <br> + <<link "Disband the unit">> + <<set $mercFreeManpower += $mercUnits[_i].troops>> + <<set $mercEmployedManpower -= $mercUnits[_i].troops>> + <<set _elimUnit = $mercUnits[_i]>> + <<set _newMercUnits = []>> + <<for _y = 0; _y < _meL; _y++>> + <<if $mercUnits[_y] != _elimUnit>> + <<set _newMercUnits.push($mercUnits[_y])>> + <</if>> + <</for>> + <<set $mercUnits = _newMercUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<link "Review Equipment and upgrades">> + <<set $targetUnit = "mercUnits">> + <<set $targetIndex = _i>> + <<goto "seeUnit">> + <</link>> + | + <<if $mercUnits[_i].troops < $mercUnits[_i].maxTroops && $mercFreeManpower > 0>> + <<link "Replenish unit">> + <<if $mercFreeManpower >= $mercUnits[_i].maxTroops - $mercUnits[_i].troops>> + <<set $mercFreeManpower -= $mercUnits[_i].maxTroops - $mercUnits[_i].troops>> + <<set $mercEmployedManpower += $mercUnits[_i].maxTroops - $mercUnits[_i].troops>> + <<set _expLoss = ($mercUnits[_i].maxTroops - $mercUnits[_i].troops) / $mercUnits[_i].troops>> + <<set $mercUnits[_i].training -= $mercUnits[_i].training * _expLoss>> + <<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>> + <<else>> + <<set $mercEmployedManpower += $mercFreeManpower>> + <<set _expLoss = $mercFreeManpower / $mercUnits[_i].troops>> + <<set $mercUnits[_i].training -= $mercUnits[_i].training * _expLoss>> + <<set $mercUnits[_i].troops += $mercFreeManpower>> + <<set $mercFreeManpower = 0>> + <</if>> + <<goto "secBarracks">> + <</link>> + <</if>> + + <<else>> + <br> + <br> + $mercUnits[_i].platoonName lost too many operatives to be considered active. + <br> + <<link "Disband the unit">> + <<set _elimUnit = $mercUnits[_i]>> + <<set _newMercUnits = []>> + <<for _y = 0; _y < _sL; _y++>> + <<if $mercUnits[_y] != _elimUnit>> + <<set _newMercUnits.push($mercUnits[_y])>> + <</if>> + <</for>> + <<set $mercUnits = _newMercUnits>> + <<set $activeUnits-->> + <<goto "secBarracks">> + <</link>> + | + <<if $mercFreeManpower > 0>> + <<link "Reform the unit">> + <<if $mercFreeManpower >= $mercUnits[_i].maxTroops>> + <<set $mercEmployedManpower += $mercUnits[_i].maxTroops>> + <<set $mercFreeManpower -= $mercUnits[_i].maxTroops>> + <<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>> + <<set $mercUnits[_i].training = 0>> + <<else>> + <<set $mercEmployedManpower += $mercFreeManpower>> + <<set $mercUnits[_i].troops += $mercFreeManpower>> + <<set $mercFreeManpower = 0>> + <<set $mercUnits[_i].training = 0>> + <</if>> + <<set $mercUnits[_i].active = 1>> + <<goto "secBarracks">> + <</link>> + <</if>> + <</if>> + <</capture>> + <</for>> +<<else>> + <br> + <br> + Mercenaries are not allowed inside the arcology. You will not be able to recruit mercenary units. +<</if>> \ No newline at end of file diff --git a/src/SecExp/secExpOptions.tw b/src/SecExp/secExpOptions.tw new file mode 100644 index 0000000000000000000000000000000000000000..14f5d7b9675c6a0d547e8fbf68dcabdb70dcbc41 --- /dev/null +++ b/src/SecExp/secExpOptions.tw @@ -0,0 +1,408 @@ +:: secExpOptions [nobr] + +<<set $showEncyclopedia = 1, $encyclopedia = "Security Expansion", $nextButton = "Back to Options", $nextLink = "Options">> + +__Battles__: +<<if $terrain != "oceanic">> + <br><<if $battlesEnabled == 0>> + Battles are @@.red;DISABLED@@. + <<link "Enable battles">> + <<set $battlesEnabled = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Battles are @@.cyan;ENABLED@@. + <<link "Disable battles">> + <<set $battlesEnabled = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Enable/disable battles.// + <<if $battlesEnabled == 1>> + <br> + <<if $majorBattlesEnabled == 0>> + Major battles are @@.red;DISABLED@@. + <<link "Enable major battles">> + <<set $majorBattlesEnabled = 1>> + <<set $battlesEnabled = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battles are @@.cyan;ENABLED@@. + <<link "Disable major battles">> + <<set $majorBattlesEnabled = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Enable/disable late game large scale battles.// + <br> + <<if $majorBattleGameOver == 0>> + Major battles can cause gameover is @@.red;FALSE@@. + <<link "Activate game loss in case of major battle defeat">> + <<set $majorBattleGameOver = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battles can cause gameover is @@.cyan;TRUE@@. + <<link "Deactivate game loss in case of major battle defeat">> + <<set $majorBattleGameOver = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //By default a total defeat in a major battle will cause a gameover.// + <br> + <<if $forceBattle == 0>> + Battle guaranteed this week is @@.red;FALSE@@. + <<link "Force engagement every week">> + <<set $forceBattle = 1>> + <<goto "secExpOptions">> + <</link>> + + <<else>> + Battle guaranteed this week is @@.cyan;TRUE@@. + <<link "Do not force engagement every week">> + <<set $forceBattle = 0>> + <<set $forceMajorBattle = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Will force battles to happen every week.// + <br> + <<if $forceMajorBattle == 0>> + Major battle guaranteed this week is @@.red;FALSE@@. + <<link "Force major engagement every week">> + <<set $forceMajorBattle = 1>> + <<set $forceBattle = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battle guaranteed this week is @@.cyan;TRUE@@. + <<link "Do not force major engagement every week">> + <<set $forceMajorBattle = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Will force major battles to happen every week. // + <</if>> +<<else>> + <br>Oceanic arcologies are not by default subject to external attacks. You can however allow them to happen anyway. If you choose to do so please keep in mind that descriptions and mechanics are not intended for naval combat but land combat. + <br> + <<if $battlesEnabled == 0>> + Battles are @@.red;DISABLED@@. + <<link "Enable battles">> + <<set $battlesEnabled = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Battles are @@.cyan;ENABLED@@. + <<link "Disable battles">> + <<set $battlesEnabled = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Enable/disable battles.// + <<if $battlesEnabled == 1>> + <br> + <<if $majorBattlesEnabled == 0>> + Major battles are @@.red;DISABLED@@. + <<link "Enable major battles">> + <<set $majorBattlesEnabled = 1>> + <<set $battlesEnabled = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battles are @@.cyan;ENABLED@@. + <<link "Disable major battles">> + <<set $majorBattlesEnabled = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Enable/disable late game large scale battles.// + <br> + <<if $majorBattleGameOver == 0>> + Major battles can cause gameover is @@.red;FALSE@@. + <<link "Activate game loss in case of major battle defeat">> + <<set $majorBattleGameOver = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battles can cause gameover is @@.cyan;TRUE@@. + <<link "Deactivate game loss in case of major battle defeat">> + <<set $majorBattleGameOver = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //By default a total defeat in a major battle will cause a gameover.// + <br> + <<if $forceBattle == 0>> + Battle guaranteed this week is @@.red;FALSE@@. + <<link "Force engagement every week">> + <<set $forceBattle = 1>> + <<goto "secExpOptions">> + <</link>> + + <<else>> + Battle guaranteed this week is @@.cyan;TRUE@@. + <<link "Do not force engagement every week">> + <<set $forceBattle = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Will force battles to happen every week.// + <br> + <<if $forceMajorBattle == 0>> + Major battle guaranteed this week is @@.red;FALSE@@. + <<link "Force major engagement every week">> + <<set $forceMajorBattle = 1>> + <<set $forceBattle = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Major battle guaranteed this week is @@.cyan;TRUE@@. + <<link "Do not force major engagement every week">> + <<set $forceMajorBattle = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Will force major battles to happen every week. // + <</if>> +<</if>> +<br> +<br> +__Rebellions__: + <br> + <<if $rebellionsEnabled == 0>> + Rebellions are @@.red;DISABLED@@. + <<link "Enable rebellions">> + <<set $rebellionsEnabled = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Rebellions are @@.cyan;ENABLED@@. + <<link "Disable rebellions">> + <<set $rebellionsEnabled = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Enable/disable rebellions.// + <<if $rebellionsEnabled == 1>> + <br> + <<if $forceRebellion == 0>> + Rebellions guaranteed this week is @@.red;FALSE@@. + <<link "Force engagement every week">> + <<set $forceRebellion = 1>> + <<goto "secExpOptions">> + <</link>> + <<else>> + Rebellions guaranteed this week is @@.cyan;TRUE@@. + <<link "Do not force engagement every week">> + <<set $forceRebellion = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Will force rebellions to happen every week. Rebellions will take precedence over battles.// + <br> + <<if $rebellionGameOver == 0>> + Rebellions can cause gameover is @@.red;FALSE@@. + <<link "Activate game loss in case of rebellions succeeding">> + <<set $rebellionGameOver = 1>> + <<goto "secExpOptions">> + <</link>> + <<elseif $rebellionGameOver == 1>> + Rebellions can cause gameover is @@.cyan;TRUE@@. + <<link "Deactivate game loss in case of rebellions succeeding">> + <<set $rebellionGameOver = 0>> + <<goto "secExpOptions">> + <</link>> + <</if>> + <br> //Determines wheter a total defeat in a rebellion will cause a gameover.// + <</if>> +<br> +<br> +<<if $showBattleStatistics == 0 &&($battlesEnabled == 1 || $rebellionsEnabled == 1)>> + Detailed battle statistics are @@.red;HIDDEN@@. + <<link "enable detailed battle statistics">> + <<set $showBattleStatistics = 1>> + <<goto "secExpOptions">> + <</link>> + <br> //Will show detailed statistics and battle turns.// + <br><br> +<<elseif ($battlesEnabled == 1 || $rebellionsEnabled == 1)>> + Detailed battle statistics are @@.cyan;SHOWN@@. + <<link "enable detailed battle statistics">> + <<set $showBattleStatistics = 0>> + <<goto "secExpOptions">> + <</link>> + <br> //Will show detailed statistics and battle turns.// + <br><br> +<</if>> + +__Battles/Rebellions Difficulty__: +<br>Difficulty is set to:<span id="difficulty"> +<<if $difficulty == 0.5>> + @@.green;Very easy@@ +<<elseif $difficulty == 0.75>> + @@.limegreen;Easy@@ +<<elseif $difficulty == 1>> + @@.yellow;Normal@@ +<<elseif $difficulty == 1.25>> + @@.red;Hard@@ +<<else>> + @@.darkred;Very hard@@ +<</if>> +</span> +<br> +<<link "Very easy">> + <<set $difficulty = 0.5>> + <<replace "#difficulty">> + @@.green;Very easy@@ + <</replace>> +<</link>> | <<link "Easy">> + <<set $difficulty = 0.75>> + <<replace "#difficulty">> + @@.limegreen;Easy@@ + <</replace>> +<</link>> | <<link "Normal">> + <<set $difficulty = 1>> + <<replace "#difficulty">> + @@.yellow;Normal@@ + <</replace>> +<</link>> | <<link "Hard">> + <<set $difficulty = 1.25>> + <<replace "#difficulty">> + @@.red;Hard@@ + <</replace>> +<</link>> | <<link "Very hard">> + <<set $difficulty = 1.5>> + <<replace "#difficulty">> + @@.darkred;Very hard@@ + <</replace>> +<</link>> + + +<br> +<br> + +__Debug/cheats:__ +<<silently>><<MenialPopCap>><</silently>> +<br> +<<link "Set loyalty high">> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set $militiaUnits[_i].loyalty = random(80,100)>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set $slaveUnits[_i].loyalty = random(80,100)>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<set $mercUnits[_i].loyalty = random(80,100)>> + <</for>> + <<goto "secExpOptions">> +<</link>> | <<link "Set loyalty average">> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set $militiaUnits[_i].loyalty = random(40,60)>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set $slaveUnits[_i].loyalty = random(40,60)>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<set $mercUnits[_i].loyalty = random(40,60)>> + <</for>> + <<goto "secExpOptions">> +<</link>> | <<link "Set loyalty low">> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set $militiaUnits[_i].loyalty = random(20)>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set $slaveUnits[_i].loyalty = random(20)>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<set $mercUnits[_i].loyalty = random(20)>> + <</for>> + <<goto "secExpOptions">> +<</link>> | <<link "Randomize loyalty">> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set $militiaUnits[_i].loyalty = random(100)>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set $slaveUnits[_i].loyalty = random(100)>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<set $mercUnits[_i].loyalty = random(100)>> + <</for>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Give Authority">> + <<set $authority = Math.clamp($authority + 1000, 0, 20000)>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove Authority">> + <<set $authority = Math.clamp($authority - 1000, 0, 20000)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Raise security">> + <<set $security = Math.clamp($security + 5, 0, 100)>> + <<goto "secExpOptions">> +<</link>> | <<link "Lower security">> + <<set $security = Math.clamp($security - 5, 0, 100)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Raise crime">> + <<set $crime = Math.clamp($crime + 5, 0, 100)>> + <<goto "secExpOptions">> +<</link>> | <<link "Lower crime">> + <<set $crime = Math.clamp($crime - 5, 0, 100)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Give menial slaves">> + <<set $helots = Math.clamp($helots + 30, 0, $PopCap)>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove menial slaves">> + <<set $helots = Math.clamp($helots - 30, 0, $PopCap)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Give militia manpower">> + <<set $militiaFreeManpower += 30>> + <<recalcManpower>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove militia manpower">> + <<set $militiaFreeManpower = Math.clamp($militiaFreeManpower - 30, 0, $militiaFreeManpower)>> + <<recalcManpower>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Give mercs manpower">> + <<set $mercFreeManpower += 30>> + <<recalcManpower>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove mercs manpower">> + <<set $mercFreeManpower = Math.clamp($mercFreeManpower - 30, 0, $mercFreeManpower)>> + <<recalcManpower>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Add citizens">> + <<set $ACitizens = Math.clamp($ACitizens + 200, 0, $ACitizenLimit)>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove citizens">> + <<set $ACitizens = Math.clamp($ACitizens - 200, 0, $ACitizenLimit)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Add slaves">> + <<set $ASlaves = Math.clamp($ASlaves + 200, 0, $ASlaveLimit)>> + <<goto "secExpOptions">> +<</link>> | <<link "Remove slaves">> + <<set $ASlaves = Math.clamp($ASlaves - 200, 0, $ASlaveLimit)>> + <<goto "secExpOptions">> +<</link>> +<br><<link "Raise prosperity">> + <<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity + 10, 0, 1000)>> + <<goto "secExpOptions">> +<</link>> | <<link "Lower prosperity">> + <<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity - 10, 0, 1000)>> + <<goto "secExpOptions">> +<</link>> \ No newline at end of file diff --git a/src/SecExp/secExpSmilingMan.tw b/src/SecExp/secExpSmilingMan.tw new file mode 100644 index 0000000000000000000000000000000000000000..c7334d5bd8c78fc97425cd40294084cf5a478bc1 --- /dev/null +++ b/src/SecExp/secExpSmilingMan.tw @@ -0,0 +1,392 @@ +:: secExpSmilingMan [nobr] + +<strong>The Smiling Man</strong> +<br> + +<<if $smilingManProgress == 0>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + + <br> + During your morning routine you stumble upon a peculiar report: it's been several weeks now that your arcology has been victim of a series of cyber-crimes conducted by a mysterious figure. + The egocentric criminal took great pride in its acts, to the point of signing his acts with his or her peculiar symbol: a stylized smiling face. Your arcology was not the only one under assault by the + machinations of what the media would quickly nicknamed //the smiling man//. + <br>Despite the sheer damage this criminal was doing, you cannot help but admire the skill with which every misdeed is carried: the worst white collar crimes of the century carried out with such elegancy + they almost seemed the product of natural laws rather than masterful manipulation of the digital market. + While you sift through the pages of the report, $assistantName remains strangely quiet. "I'm worried <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>, this individual seems to be able to penetrate whatever system gathers his attention. I... feel vulnerable" she said "It's not something I'm used to." + <br>Fortunately you have not been hit directly by this criminal, not yet at least. Still the repercussions of numerous bankruptcies take their toll on your arcology, whose @@.red;prosperty suffers@@. + <br><<set $arcologies[0].prosperity *= random(80,90) * 0.01>> + <br> + <span id="result"> + <br> + <<link "Devote funds to the search for this dangerous criminal">> + <<if $cash >= 10000>> + <<set $cash -= 10000>> + <<set $investedFunds = 1>> + <<else>> + <<set $investedFunds += cash>> + <<set $cash = 0>> + <</if>> + <<set $relationshipLM += 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You devote funds to capture and neutralize the threat. You cannot help but wonder what is the end game of the laughing man. Money? Fame? Or is he on an ideological crusade? + <</replace>> + <</link>> + <br> + <<link "Attempt to contact the mysterious figure, whatever it takes">> + <<if $cash >= 10000>> + <<set $cash -= 10000>> + <<set $investedFunds = 1>> + <<else>> + <<set $investedFunds += cash>> + <<set $cash = 0>> + <</if>> + <<set $relationshipLM += 2>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You devote funds to the attempt at communicating with the smiling man. You cannot help but wonder what is the end game of the laughing man. Money? Fame? Or is he on an ideological crusade? + <</replace>> + <</link>> + <br> + <<link "Invest funds to increase the cyber-security of the arcology">> + <<if $cash >= 10000>> + <<set $cash -= 10000>> + <<set $investedFunds = 1>> + <<else>> + <<set $investedFunds += cash>> + <<set $cash = 0>> + <</if>> + <<set $relationshipLM += random(5,10)>> + <<set $hostileRoute -= 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You devote funds to the improvement of the cyber-security of your arcology. You cannot help but wonder what is the end game of the laughing man. Money? Fame? Or is he on an ideological crusade? + <</replace>> + <</link>> + <br> + <<link "Ignore the issue">> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You do not consider this individual a threat. + <</replace>> + <</link>> + </span> +<<elseif $smilingManProgress == 1>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + + <br> + You just reached your penthouse, when your faithful assistant appears in front of you, evidently exited. + "<<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Sir<<else>>Ma'am<</if>>, I have just received news of a new attack by the Smiling Man. It appears just a few hours ago he infiltrated another arcology and caused a catastrophic failure of its power plant. + Between old debts and the loss of value for his shares, the owner went bankrupt in minutes. It seems the Smiling Man managed to keep a small auxiliary generator functioning enough to project a giant holographic picture of his symbol on the arcology's walls. + You can say whatever you want about him, but he has style... Anyway this opens up a great opportunity to gain control of the structure for ourselves." + It is indeed a great opportunity, one you cannot resist. You quickly organize the affair and in a few minutes a message reaches your assistant. + <br>"Should I open it?" asks. You silently nod. + <br>Suddenly the room flashes red, while your assistant fades for half a second. When it reappears her face was replaced by a stylized smiling face. + <br>"Hello, my dear $PC.name. Can I call you by name, right? I've been keeping an eye on you for so long now, it feels like we're friends! I am terribly sorry for my unannounced visit, but I wanted to meet face to face... well face to hologram." said while letting out a very childlike giggle. + "You see I'm sure you're aware of my recent activities around this rock of ours and... well to put it simply it's your turn to contribute to my great project! Oh you'll love it when you see it, I'm sure! By the way, thanks for the offer, it's so nice to see people contribute to a worthy cause so generously! Well I've taken enough of your time, see you soon!" + <br>The lights flickered once more and an instant later your assistant returned to her usual self. + <br>"I... I... I couldn't stop him! I'm sorry <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>." + <br>Without wasting time you rush the console and check your finances. It's as you feared, @@.red;you have been robbed@@. + <<set _lostCash = 200000>> + <<if $assistantPower == 1>> + <<set _lostCash -= 20000>> + <br>Fortunately the computing power available to $assistantName allowed her to somewhat limit the losses. + <<elseif $assistantPower == 2>> + <<set _lostCash -= 30000>> + <br>Fortunately the computing power available to $assistantName allowed her to limit the losses. + <</if>> + <<if $secUpgrades.cyberBots == 1>> + <<set _lostCash -= 30000>> + The additional cyber defenses acquired and running in the security HQ <<if _lostCash < 200000>>further<</if>> limit the damage. + <</if>> + <<if $investedFunds == 1>> + <<set _lostCash -= 20000>> + The funding you dedicated to the Smiling Man case saved some of the assets that would have otherwise lost. + <</if>> + <<set $cash -= _lostCash>> + <br> + <br> + <span id="result"> + <br> + <<link ""I want him dead. Now."">> + <<set $relationshipLM -= 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to double down on the search and elimination of the threat. + <</replace>> + <</link>> + <br> + <<link ""I want him, dead or alive!"">> + <<set $relationshipLM += 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to double down on the search and capture of the threat. + <</replace>> + <</link>> + <br> + <<link ""If we don't find him soon we will regret it."">> + <<set $relationshipLM += 2>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to double down on the search and neutralization of the threat. + <</replace>> + <</link>> + <br> + <<link ""He got what he wanted, hopefully we will be left in peace."">> + <<set $smilingManProgress += 1>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + <<replace "#result">> + You take no further action. Hopefully this ordeal is over. + <</replace>> + <</link>> + </span> +<<elseif $smilingManProgress == 2>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + + <br> + <<set $smilingManWeek = $week>> + $assistantName wakes you up violently, her worried expression can mean only one thing: the smiling man was back. "Today at midnight a new site popped up in the web: it's a very simple site, no visuals, no text, no data, only a countdown ticking away. It will reach zero this evening." said. + This is troubling yet exciting news. The smiling man never failed to cause damage, but his ego got the best of him this time: having time to prepare before its attack will give you a chance to find him. For the rest of the day you do your best to plan, prepare and focus. + <br> + <br>Evening came faster than you anticipated, by now your security team was already at full alert, waiting for any signal on the horizon. The die was cast. + <br>Suddenly all the computers in the room start acting weirdly, then it happened. On all screens in all the arcology the smiling man icon appeared, then every speaker started broadcasting the same voice, one that you already heard once before: + <br>"Hello citizens of Earth! I am here in this special day to relay to you a very important message: we find ourselves in very peculiar times, times of strife and suffering! But also of change and regeneration! Indeed I say humanity is regenerating itself, turning into a new being for which the + ideals of the old world no longer hold meaning. A new blank page from which humanity can start to prosper again. + <br>Alas my friends not all is good, as in this rebirth a great injustice is being perpetrated. If we truly want to ascend to this new form of humanity the old must give space to the new. If we must cleanse our mind of old ideas, our world must clease itself of them as well. + It's to fix this unjustice that I worked so hard all this time! To cleanse the world of the old, we must get rid of our precious, precious data. At the end of this message every digital device will se its memory erased, every archived cleaned, every drive deleted. + <br>It will be a true rebirth! A true new beginning! No longer the chains of the past will keep humanity anchored!" + <br>The voice stopped for a second. + <br>"Have a good day." simply concluded, then it happened. + <br>In little more than seconds all the data collected in the years vanished. It is a disaster. + <<if $cash < 0>> + The vast majority of currency is digital, so the actions of the smiling man have a devastating effect on the money supply. Luckily for you this means that your @@.yellowgreen;debt is reduced@@. + <<set $cash *= 0.2>> + <<else>> + The vast majority of currency is digital, so the actions of the smiling man have a devastating effect on the money supply. Unfortunately this means that your @@.red;cash reserves are gutted@@. + <<set $cash *= 0.2>> + <</if>> + You are not the only one affected by this however. @@.red;The economy of the entire world is severely affected@@ by the loss of vast quantities of currency. Who knows how long will it take for the global economy to recover. + <<set $globalCrisisWeeks = random(8,16)>> + Trade is @@.red;severely affected@@. + <<set $trade *= 0.2>> + With the loss of so much information, most of your accomplishments are simply forgotten, @@.red;your reputation suffers.@@ + <<set $rep *= 0.6>> + <<if $arcologies[0].ownership >= 60>> + <<if $authority <= 10000>> + <<for _i = 1; _i < $sectors.length; _i++>> + <<if $sectors[_i].ownership == 1>> + <<if $sectors[_i].type != "Brothel">> + <<if $sectors[_i].type != "Club">> + <<if $sectors[_i].type != "Arcade">> + <<if $sectors[_i].type != "Dairy">> + <<if $sectors[_i].type != "Pit">> + <<if $sectors[_i].type != "Sweatshops">> + <<if $sectors[_i].type != "Pens">> + <<if $sectors[_i].type != "Barracks">> + <<if random(1,100) >= 66>> + <<set $sectors[_i].ownership = 0>> + Vast amount of data relative to the ownership of the arcology is lost. You lost all legal claims to one of the sectors. + <<break>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</if>> + <</for>> + Vast amount of data relative to the ownership of the arcology is lost. You would've run the risk of loosing ownership of one of the sectors, but fortunately your authority is so high your citizens do not dare question your claims even in the absence of a valid legal case. + <</if>> + <</if>> + <<if $secUpgrades.coldstorage > 3>> + Your cold storage facility has ensured that the Smiling Man's destruction of the primary archives was unable to damage the security of your archology. + <<elseif $secUpgrades.coldstorage == 0>> + Your security department sees its archives butchered by the Smiling Man. Almost all data on criminals, citizens, operations, all lost. The @@.red;security of the arcology is greatly reduced@@. Criminals on the other hand, with their past cleansed, cannot wait to join this new world, @@.red;crime will inevitably increase@@. + <<set $security = Math.clamp($security * 0.2,0,100)>> + <<set $crime = Math.clamp($crime * 1.5, 20,100)>> + <</if>> + + <br>A short meek man approaches you with a weak smile. "Not all is lost, <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>sir<<else>>ma'am<</if>>. We have a lead on him: he is here, in $arcologies[0].name." + <br>Despite the bleak situation, you could not help but smile back. + <br> + <br> + <span id="result"> + <br> + <<link ""Eliminate the threat, once and for all."">> + <<set $relationshipLM -= 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to prepare for a manhunt. + <</replace>> + <</link>> + <br> + <<link ""Bring him to me."">> + <<set $relationshipLM += 1>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to prepare for a manhunt. + <</replace>> + <</link>> + <br> + <<link ""Such skill on my side would be a great boon, find him."">> + <<set $relationshipLM += 2>> + <<set $smilingManProgress += 1>> + <<replace "#result">> + You command your loyal operatives to prepare for a manhunt. + <</replace>> + <</link>> + <br> + <<link ""He finally had what he always wanted. Let him have is victory, we have better things to do."">> + <<set $smilingManProgress += 1>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + <<replace "#result">> + You take no further action. Hopefully this ordeal is finally over. + <</replace>> + <</link>> + </span> +<<elseif $smilingManProgress == 3>> + <<set $nextButton = " ">> + + <br> + The day has come to finally put an end to this story. Your men are ready to go, waiting only your signal. You quickly finish to wear your protective gear and proceed down the busy streets of yoru arcology. + You carefully planned the day so that nothing could exit the arcology without being scanned at least three times and poked twice. The smiling man has no escape. + <br>After a short walk you are in front of the criminal's lair, an rundown old apartment in a scarcely populated part of the arcology. You give the order to breach and your men rush inside without problems. + A couple of seconds pass without a single noise coming out of the apartment, you start to worry, when you hear the captain calling you inside. + <br>"So it was you to find me first. + <<if $relationshipLM > 2>> + I was hoping you would be the one! + <<else>> + I expected you would be the one. + <</if>> + Well I hope I am everything you expected" said. Despite recognizing the quirky voice you struggle to convice yourself that the little girl in front of you is indeed the famous international criminal. + "As you can see I have no intention of escaping. I knew my life was over the second my plan would start. I accepted my end a long time ago, so feel free to do your worst, my life has already ended in triumph." + <br>You evaluate the situation: the burning desire of vengeance for all the damage that little twerp caused is hard to ignore, but it's equally so the admiration for her skill and determination. Indeed she would be a great addition to your court, as free individual or not. + <br> + <br> + <<link "Offer her a new life">> + <<set $smilingManFate = 0>> + <<replace "#result">> + You decide it would a criminally wasteful to throw away such talent. You offer her a new life at your side. Her expertise will surely guarantee safety, if not supremacy to your arcology in cyberspace, while she will have safety and luxury in the physical world. + <br> + <<link "Continue">> + <<set $smilingManProgress += 1>> + <<goto "secExpSmilingMan">> + <</link>> + <</replace>> + <</link>> + <br> + <<link "make her pay">> + <<set $smilingManFate = 1>> + <<replace "#result">> + You decide to end her pitiful life. She has crossed the wrong master of the new world she worked so hard to create. No mercy was asked and no mercy will be given. + <br> + <<link "Continue">> + <<set $smilingManProgress += 1>> + <<goto "secExpSmilingMan">> + <</link>> + <</replace>> + <</link>> + <br> + <<link "Enslave her">> + <<set $smilingManFate = 2>> + <<replace "#result">> + You decide to enslave the girl. Her skill may be great, her crimes equally so, but that makes is all so much sweeter to turn her into an obedient little toy to play with. + <br> + <<link "Continue">> + <<set $smilingManProgress += 1>> + <<goto "secExpSmilingMan">> + <</link>> + <</replace>> + <</link>> + <br> + <br> + <span id="result"> + </span> + <br> +<<else>> + <<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">> + + <<if $smilingManFate == 0>> + <<if $relationshipLM >= 4>> + The girl asks for a few minutes to think about your offer, but she quickly comes to terms with the situation and accepts. In the following weeks she will get aquainted with the security network of the arcology and work to protect her new home in the new world she created. + The world at large will never find out what was the end of the Smiling Man and his legend will only grow with the years, outliving his creator and maybe even her new employer. + <<else>> + The girl asks for a few minutes to think about your offer and after some time she reluctantly accepts. In the following weeks she will get aquainted with the security network of the arcology and work to protect her new home in the new world she created. + The world at large will never find out what was the end of the Smiling Man and his legend will only grow with the years, outliving his creator and maybe even her new employer. + <</if>> + <br>The collaboration of the ex-Smiling Man permanently increases @@.green;security and the rate of prosperity growth@@. Also from time to time @@.limegreen;cash will be provided@@, however it is better not to know the sources. + <<elseif $smilingManFate == 1>> + For such a criminal a simple execution is not enough. You order the girl captured and crucified outside the city, with a mask resembling her famous symbol. Your men quickly obey. She never once showed sign of pain or fear, remaining stoic and proud to the end. + Once her life ended you ordered a statue be erected in commemoration of the death of the Smiling Man. From this day forward the statue of the crucified criminal will adorn your arcology and his legend will be forever entangled with yours. + <br>Having dealt with the Smiling Man will provide @@.green;a moderate amount of reputation each week as well as an large immediate bonus@@. + <<elseif $smilingManFate == 2>> + <<if $relationshipLM >= 4>> + Your men move to immobilize her. Terror flashes through her eyes for a second, but she quickly recover her usual attitude. + <<else>> + Your men move to immobilize her. Terror flashes through her eyes for a second, she barely manages to recover her usual attitude. + <</if>> + <<include "Generate XX Slave">> + <<set $activeSlave.origin = "She was a criminal mastermind, captured shortly after completing her master plan.">> + <<set $activeSlave.career = "a student from a private school">> + <<set $activeSlave.nationality = "Japanese">> + <<set $activeSlave.intelligence = 3>> + <<set $activeSlave.intelligenceImplant = 1>> + <<NationalityToName $activeSlave>> + <<NationalityToAccent $activeSlave>> + <<NationalityToRace $activeSlave>> + <<set $activeSlave.slaveSurname = "Yamadera">> + <<set $activeSlave.birthSurname = "Yamadera">> + <<set $activeSlave.skin = "pale">> + <<set $activeSlave.devotion = 5 * $relationshipLM>> + <<set $activeSlave.trust = 5 * $relationshipLM>> + <<set $activeSlave.face = random(10,50)>> + <<set $activeSlave.health = 70>> + <<set $activeSlave.teeth = "normal">> + <<set $activeSlave.faceShape = "cute">> + <<set $activeSlave.boobShape = "perky">> + <<set $activeSlave.boobs = 450>> + <<set $activeSlave.nipples = "cute">> + <<set $activeSlave.areolae = 0>> + <<set $activeSlave.anus = 0>> + <<set $activeSlave.butt = 3>> + <<set $activeSlave.vagina = 0>> + <<set $activeSlave.ovaries = 1>> + <<set $activeSlave.lips = 15>> + <<set $activeSlave.behavioralFlaw = "odd">> + <<set $activeSlave.vaginalSkill = 0>> + <<set $activeSlave.oralSkill = 0>> + <<set $activeSlave.analSkill = 0>> + <<set $activeSlave.whoreSkill = 0>> + <<set $activeSlave.entertainSkill = 0>> + <<set $activeSlave.birthWeek = random(0,50)>> + <<set $activeSlave.voice = 2>> + <<set $activeSlave.weight = -20>> + <<set $activeSlave.muscles = 0>> + <<set $activeSlave.shoulders = -1>> + <<set $activeSlave.hips = 0>> + <<set $activeSlave.clit = 0>> + <<set $activeSlave.labia = 0>> + <<set $activeSlave.waist = 10>> + <<set $activeSlave.preg = 0>> + <<set $activeSlave.prestige = 3>> + <<set $activeSlave.prestigeDesc = "She was the famous Smiling Man.">> + <<if $minimumSlaveAge > 16>> + <<set $activeSlave.actualAge = $minimumSlaveAge>> + <<set $activeSlave.physicalAge = $minimumSlaveAge>> + <<set $activeSlave.visualAge = $minimumSlaveAge>> + <<else>> + <<set $activeSlave.actualAge = 16>> + <<set $activeSlave.physicalAge = 16>> + <<set $activeSlave.visualAge = 16>> + <</if>> + <br> + <br> + <<set $saleDescription = 0, $applyLaw = 0>> + <<include "Long Slave Description">> + <br> + <<include "New Slave Intro">> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/secInit.tw b/src/SecExp/secInit.tw new file mode 100644 index 0000000000000000000000000000000000000000..5faad4468a687e9e308fc3f6b576f552b266ba9d --- /dev/null +++ b/src/SecExp/secInit.tw @@ -0,0 +1,336 @@ +:: secInit [nobr] + +/* base vars */ +<<set $authority = 0>> +<<set $security = 30>> +<<set $secRestPoint = 30>> +<<set $crime = 30>> +<<set $crimeCap = 100>> +<<set $readiness = 1>> +<<set $recon = 0>> +<<set $maxUnits = 6>> +<<set $trade = 0>> +<<set $activeUnits = 0>> +<<set $attackType = "none">> +<<set $attackThisWeek = 0>> +<<set $lastAttackWeeks = 0>> +<<set $hasFoughtOnce = 0>> +<<set $hasFoughtMajorBattleOnce = 0>> +<<set $hasRebelledOnce = 0>> +<<set $majorBattle = 0>> +<<set $PCvictoryStreak = 0>> +<<set $PCvictories = 0>> +<<set $PClossStreak = 0>> +<<set $PClosses = 0>> +<<set $oldFlux = 0>> +<<set $showBattleStatistics = 0>> +<<set $forceBattle = 0>> +<<set $forceMajorBattle = 0>> +<<set $foughtThisWeek = 0>> +<<set $battlesEnabled = 1>> +<<set $battlesEnabledOceanic = 0>> +<<set $majorBattlesEnabled = 1>> +<<set $majorBattleGameOver = 1>> +<<set $rebellionsEnabled = 1>> +<<set $forceRebellion = 0>> +<<set $rebellionGameOver = 1>> + +/* edicts */ +<<set $edictsUpkeep = 0>> +<<set $edictsAuthUpkeep = 0>> +<<set $alternativeRents = 0>> +<<set $enslavementRights = 0>> +<<set $securityExemption = 0>> +<<set $sellData = 0>> +<<set $propCampaignBoost = 0>> +<<set $slaveWatch = 0>> +<<set $subsidyChurch = 0>> +<<set $limitImmigration = 0>> +<<set $openBorders = 0>> +<<set $limitSubhumans = 0>> +<<set $slavesOfficers = 0>> +<<set $martialSchool = 0>> +<<set $discountMercenaries = 0>> +<<set $militiaFounded = 0>> +<<set $recruitVolunteers = 0>> +<<set $militaryService = 0>> +<<set $militarizedSociety = 0>> +<<set $militaryExemption = 0>> +<<set $lowerRquirements = 0>> +<<set $noSubhumansInArmy = 0>> +<<set $pregExemption = 0>> +<<set $eliteOfficers = 0>> +<<set $liveTargets = 0>> +<<set $legionTradition = 0>> +<<set $eagleWarriors = 0>> +<<set $ronin = 0>> +<<set $sunTzu = 0>> +<<set $weaponsLaw = 3>> +<<set $soldierWages = 1>> +<<set $militiaSoldierPrivilege = 0>> +<<set $slaveSoldierPrivilege = 0>> +<<set $mercSoldierPrivilege = 0>> +<<set $tradeLegalAid = 0>> +<<set $taxTrade = 0>> + +/* proclamations */ +<<set $proclamationsCooldown = 0>> +<<set $proclamationCurrency = "authority">> +<<set $proclamationType = "none">> + +/* buildings */ +<<set $upgradeUpkeep = 40>> +<<set $secHQ = 0>> +<<set $secHQUpkeep = $facilityCost * 5>> +<<set $secBarracks = 0>> +<<set $secBarracksUpkeep = $facilityCost * 5>> +<<set $secBarracksUpgrades ={ + size: 0, + luxury: 0, + training: 0, + loyaltyMod: 0}>> +<<set $secHelots = 0>> +<<set $reqHelots = 20>> +<<set $secUpgrades = { + nanoCams: 0, + cyberBots: 0, + eyeScan: 0, + cryptoAnalyzer: 0, + coldstorage: 0}>> +<<set $crimeUpgrades = { + autoTrial: 0, + autoArchive: 0, + worldProfiler: 0, + advForensic: 0}>> +<<set $intelUpgrades = { + sensors: 0, + radar: 0, + signalIntercept: 0}>> +<<set $readinessUpgrades = { + earlyWarn: 0, + rapidPlatforms: 0, + pathways: 0, + rapidVehicles: 0}>> +<<set $propHub = 0>> +<<set $propHubUpkeep = $facilityCost * 5>> +<<set $propCampaign = 0>> +<<set $propFocus = "none">> +<<set $miniTruth = 0>> +<<set $fakeNews = 0>> +<<set $controlLeaks = 0>> +<<set $secretService = 0>> +<<set $blackOps = 0>> +<<set $marketInfiltration = 0>> +<<set $riotCenter = 0>> +<<set $riotUpkeep = $facilityCost * 5>> +<<set $riotUpgrades = { + freeMedia: 0, + rapidUnit: 0, + rapidUnitSpeed: 0}>> +<<set $fort = { + reactor: 0, + waterway: 0, + assistant:0}>> +<<set $sentUnitCooldown = 0>> +<<set $advancedRiotEquip = 0>> +<<set $brainImplant = -1>> +<<set $brainImplantProject = 0>> +<<set $weapManu = 0>> +<<set $weapHelots = 0>> +<<set $weapProductivity = 1>> +<<set $weapLab = 1>> +<<set $baseUpgradeTime = 10>> +<<set $currentUpgrade = { + name: " ", + unit: 0, + type: 0, + time: 0}>> +<<set $droneUpgrades = { + attack: 0, + defense: 0, + hp:0}>> +<<set $humanUpgrade = { + attack: 0, + defense: 0, + hp:0, + morale: 0}>> +<<set $sellTo = { + citizen: 1, + raiders: 1, + oldWorld: 1, + FC: 1}>> +<<set $completedUpgrades = []>> +<<set $transportHub = 0>> +<<set $airport = 0>> +<<set $railway = 0>> +<<set $docks = 0>> +<<set $hubSecurity = 1>> + +/* events */ +<<set $smilingManProgress = 0>> +<<set $investedFunds = 0>> +<<set $relationshipLM = 0>> +<<set $captureRoute = 0>> +<<set $collaborationRoute = 0>> +<<set $hostileRoute = 0>> +<<set $smilingManWeek = 0>> +<<set $globalCrisisWeeks = 0>> +<<set $smilingManFate = 4>> + +/* rebellions */ +<<set $tension = 0>> +<<set $slaveProgress = 0>> +<<set $citizenProgress = 0>> +<<set $slaveRebellionEventFires = 0>> +<<set $citizenRebellionEventFires = 0>> +<<set $slaveRebellion = 0>> +<<set $citizenRebellion = 0>> +<<set $rebellingUnits = []>> +<<set $notInvolved = 0>> +<<set $irregulars = 0>> +<<set $engageRule = 0>> +<<set $rebellingMilitia = 0>> +<<set $rebellingSlaves = 0>> +<<set $rebellingMercs = 0>> +<<set $repairTime = 3>> +<<set $arcRepairTime = 0>> +<<set $rebelDefeatAftermath = 0>> +<<set $garrison = { + penthouse: 0, + reactor: 0, + assistant: 0, + waterway: 0, + reactorTime: 0, + assistantTime: 0, + waterwayTime: 0 }>> +<<set $rebellionsCount = 0>> +<<set $PCrebWon = 0>> +<<set $PCrebLoss = 0>> + + +/* armed forces stats */ +<<set $difficulty = 1>> +<<set $targetUnit = 0>> +<<set $targetIndex = 0>> +<<set $secBotsCost = 500>> +<<set $secBotsUpgradeCost = 250>> +<<set $equipUpgradeCost = 250>> +<<set $maxTroops = 30>> +<<set $militiaTotalManpower = 0>> +<<set $militiaFreeManpower = 0>> +<<set $militiaEmployedManpower = 0>> +<<set $militiaTotalCasualties = 0>> +<<set $slavesOfficers = 0>> +<<set $slavesEmployedManpower = 0>> +<<set $slavesTotalCasualties = 0>> +<<set $mercTotalManpower = 0>> +<<set $mercEmployedManpower = 0>> +<<set $mercTotalCasualties = 0>> +<<set $soldierUpkeep = 10>> +<<set $createdSlavesUnits = 0>> +<<set $createdMilitiaUnits = 0>> +<<set $createdMercUnits = 0>> +<<set $mercFreeManpower = 0>> +<<if $wasToggledBefore == 0>> + <<if $mercenaries == 1>> + <<set $mercFreeManpower = random(5,20)>> + <<elseif $mercenaries > 1>> + <<set $mercFreeManpower = random(10,30)>> + <</if>> +<</if>> + +/* battle relevant variables */ +<<set $troopCount = 0>> +<<set $totalKills = 0>> +<<set $battlesCount = 0>> +<<set $majorBattlesCount = 0>> +<<set $chosenTactic = "none">> +<<set $leadingTroops = "none">> +<<set $attackTroops = 0>> +<<set $attackEquip = 0>> +<<set $deployableUnits = 0>> +<<set $deployedUnits = 0>> +<<set $deployingBots = 0>> +<<set $deployingMilitia = 0>> +<<set $deployingSlaves = 0>> +<<set $deployingMercs = 0>> +<<set $battleTerrain = "none">> +<<set $maxTurns = 10>> +<<set $battleResult = 4>> /* sets $battleResult value outside accepted range (-3,3) to avoid evaluation problems */ +<<set $losses = 0>> +<<set $enemyLosses = 0>> +<<set $battleTurns = 0>> +<<set $bribeCost = 0>> +<<set $tacticsSuccessful = 0>> +<<set $leaderWounded = 0>> +<<set $woundType = 0>> /* 0=no wound, 1=mute, 2=blind, 3=amputee, 4<=health */ +<<set $gainedCombat = 0>> +<<set $gainedWarfare = 0>> +<<set $PCWounded = 0>> +<<set $PCWoundCooldown = 0>> +<<set $expectedEquip = 0>> +<<set $estimatedMen = 0>> +<<set $SFIntervention = 0>> +<<set $carriableSoldiers = 0>> +<<set $SFatk = 0>> +<<set $SFdef = 0>> +<<set $SFhp = 0>> +<<set $rebellingID = []>> + +/* statistics */ +<<set $baseBribePerAttacker = 5>> +<<set $equipMod = 0.15>> +<<set $secBotsBaseAttack = 7>> +<<set $secBotsBaseDefense = 3>> +<<set $secBotsMorale = 200>> +<<set $secBotsBaseHp = 3>> +<<set $militiaBaseAttack = 7>> +<<set $militiaBaseDefense = 5>> +<<set $militiaBaseMorale = 140>> +<<set $militiaBaseHp = 3>> +<<set $slaveBaseAttack = 8>> +<<set $slaveBaseDefense = 3>> +<<set $slaveBaseMorale = 110>> +<<set $slaveBaseHp = 3>> +<<set $mercBaseAttack = 8>> +<<set $mercBaseDefense = 4>> +<<set $mercBaseMorale = 125>> +<<set $mercBaseHp = 4>> +<<set $SFBaseAttack = 8>> +<<set $SFBaseDefense = 4>> +<<set $SFBaseMorale = 140>> +<<set $SFBaseHp = 4>> + +<<set $raBaseAttack = 7>> +<<set $raBaseDefense = 2>> +<<set $raBaseMorale = 100>> +<<set $raBaseHp = 2>> +<<set $fcBaseAttack = 6>> +<<set $fcBaseDefense = 4>> +<<set $fcBaseMorale = 130>> +<<set $fcBaseHp = 3>> +<<set $owBaseAttack = 8>> +<<set $owBaseDefense = 4>> +<<set $owBaseMorale = 110>> +<<set $owBaseHp = 2>> +<<set $ffBaseAttack = 9>> +<<set $ffBaseDefense = 2>> +<<set $ffBaseMorale = 160>> +<<set $ffBaseHp = 2>> + +<<set $secBots = { + active: 0, + isDeployed: 0, + troops: 0, + maxTroops: 0, + equip: 0} >> +<<set $militiaUnits = []>> +<<set $slaveUnits = []>> +<<set $mercUnits = []>> + +/* SFanon additons */ +<<set $SFSupportLevel = 0>> +<<set $SFSupportUpkeep = 0>> + +/* helper widgets */ +<<calcInitialTrade>> \ No newline at end of file diff --git a/src/SecExp/securityHQ.tw b/src/SecExp/securityHQ.tw new file mode 100644 index 0000000000000000000000000000000000000000..189ab8922482e1e9f27940cf17c6fe4238398425 --- /dev/null +++ b/src/SecExp/securityHQ.tw @@ -0,0 +1,329 @@ +:: securityHQ [nobr] + +<<set $nextButton = "Back to Arcology Management", $nextLink = "Manage Arcology", $returnTo = "Manage Arcology">> + +Security headquarters +<hr> + +The security headquarters stand in front of you. Innumerable screens flood with light the great central room. <<if $secHelots > 0>>Some slaves see you enter and interrupt their work to greet you.<</if>> From here you can build a safe and prosperous arcology. +<br> +/* security level. Slaves */ +You have <span id="secHel"><<print $secHelots>></span> slaves working in the HQ. $reqHelots are required and you have <span id="hel"><<print $helots>></span> free menial slaves. +<<if $secHelots < $reqHelots>> + You do not have enough slaves here. You will not receive the full benefit of the installed upgrades. +<<else>> + You have enough slaves to man all security systems. +<</if>> +<<silently>><<MenialPopCap>><</silently>> +<<set _menialPrice = Math.trunc(($slaveCostFactor*1000)/100)*100>> +<<set _menialPrice = Math.clamp(_menialPrice, 500, 1500)>> +<<if $PopCap > $helots+$fuckdolls+$menialBioreactors || $helots+$fuckdolls+$menialBioreactors == 0>> + <br> + [[Buy|securityHQ][$helots+=1,$menialDemandFactor+=1,$cash-=_menialPrice]] + <<if $cash > _menialPrice*10>> + [[(x10)|securityHQ][$helots+=10,$menialDemandFactor+=10,$cash-=_menialPrice*10]] + <</if>> + <<if $cash > _menialPrice*100>> + [[(x100)|securityHQ][$helots+=100,$menialDemandFactor+=100,$cash-=_menialPrice*100]] + <</if>> + <<if $cash > _menialPrice*2>> + [[(max)|securityHQ][$helots+=Math.trunc($cash/(_menialPrice)),$menialDemandFactor+=Math.trunc($cash/(_menialPrice)),$cash-=Math.trunc($cash/(_menialPrice))*(_menialPrice)]] + <</if>> +<</if>> +<br> +<<if $helots >= 5>> + <<link "Transfer 5 menial slaves to the headquarters">> + <<set $helots -= 5>> + <<set $secHelots += 5>> + <<replace "#secHel">><<print $secHelots>><</replace>> + <<replace "#hel">><<print $helots>><</replace>> + <<if $helots < 5 || $secHelots >= $reqHelots || $secHelots == 5>> + <<goto "securityHQ">> + <</if>> + <</link>> +<<else>> + Transfer 5 menial slaves to the headquarters +<</if>> +| +<<if $secHelots >= 5>> + <<link "Transfer out 5 slaves">> + <<set $helots += 5>> + <<set $secHelots -= 5>> + <<replace "#secHel">><<print $secHelots>><</replace>> + <<replace "#hel">><<print $helots>><</replace>> + <<if $secHelots < 5>> + <<goto "securityHQ">> + <</if>> + <<if $secHelots < $reqHelots>> + <<goto "securityHQ">> + <</if>> + <</link>> +<<else>> + Transfer out 5 slaves +<</if>> +| +<<if $secHelots != $reqHelots>> + <<link "Match the requirement">> + <<if $helots >= $reqHelots - $secHelots>> + <<set $helots -= $reqHelots - $secHelots>> + <<set $secHelots = $reqHelots>> + <<elseif $reqHelots < $secHelots>> + <<set $helots += $secHelots - $reqHelots>> + <<set $secHelots = $reqHelots>> + <<else>> + <<set $secHelots += $helots>> + <<set $helots = 0>> + <</if>> + <<replace "#secHel">><<print $secHelots>><</replace>> + <<replace "#hel">><<print $helots>><</replace>> + <<if $secHelots == $reqHelots>> + <<goto "securityHQ">> + <</if>> + <</link>> +<<else>> + Match the requirement +<</if>> + +<br> +<br> + +/* security level and upgrades */ +<<if $security <= 20>> + Your security level (@@.deepskyblue;<<print $security>>@@) is dangerously low. +<<elseif $security <= 40>> + Your security level (@@.deepskyblue;<<print $security>>@@) is low. +<<elseif $security <= 60>> + Your security level (@@.deepskyblue;<<print $security>>@@) is decent. +<<elseif $security <= 80>> + Your security level (@@.deepskyblue;<<print $security>>@@) is good. +<<else>> + Your security level (@@.deepskyblue;<<print $security>>@@) is great. +<</if>> +Considering the current upgrades the resting level for security is <<print $secRestPoint>>, while the effective maximum level is <<print Math.trunc($secRestPoint * (Math.clamp($secHelots,0,$reqHelots) / $reqHelots))>>. + +<br> +<br> + +<<if $secUpgrades.nanoCams == 0>> + [[Install a nano-camera system |securityHQ][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $secUpgrades.nanoCams = 1, $secRestPoint += 15, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will raise rest point of security by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have installed all across the arcology closed circuit nano-cameras to keep the arcology under your watchful eye. +<</if>> +<br> +<<if $secUpgrades.cyberBots == 0>> + [[Buy cybersecurity algorithms|securityHQ][$cash -= Math.trunc(7500*$upgradeMultiplierArcology), $secUpgrades.cyberBots = 1, $secRestPoint += 15, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(7500*$upgradeMultiplierArcology)>>. Will raise rest point of security by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have bought advanced cybersecurity algorithms that will defend your arcology against hack attempts or cyber frauds. +<</if>> +<br> +<<if $rep > 10000>> + <<if $secUpgrades.eyeScan == 0>> + [[Install invisible eye scanners|securityHQ][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $secUpgrades.eyeScan = 1, $secRestPoint += 20, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>. Will raise rest point of security by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have installed numerous hidden eye scanners that accurately register the movements of everyone inside the arcology. + <</if>> + <br> + <<if $secUpgrades.cryptoAnalyzer == 0>> + [[Buy and install crypto analyzers|securityHQ][$cash -= Math.trunc(15000*$upgradeMultiplierArcology), $secUpgrades.cryptoAnalyzer = 1, $secRestPoint += 20, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(15000*$upgradeMultiplierArcology)>>. Will raise rest point of security by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have bought and employed sophisticated crypto analyzing software to accurately track and archive every financial movement or transaction made inside the walls of your arcology. + <</if>> +<<else>> + <br>You lack the reputation to access more advanced upgrades. +<</if>> + +<br> +<br> + +/* crime level and upgrades */ +<<if $crime <= 20>> + Your crime level (@@.orangered;<<print $crime>>@@) is very low. +<<elseif $crime <= $upgradeUpkeep>> + Your crime level (@@.orangered;<<print $crime>>@@) is low. +<<elseif $crime <= 60>> + Your crime level (@@.orangered;<<print $crime>>@@) is average. +<<elseif $crime <= $upgradeUpkeep>> + Your crime level (@@.orangered;<<print $crime>>@@) is high. +<<else>> + Your crime level (@@.orangered;<<print $crime>>@@) is extremely high. +<</if>> +Considering the current upgrades the maximum level of crime is <<print $crimeCap>>, while the effective maximum level is <<print Math.trunc(Math.clamp($crimeCap + ($crimeCap - $crimeCap * ($secHelots / $reqHelots)),0,100))>>. + +<br> +<br> + +<<if $crimeUpgrades.advForensic == 0>> + [[Install advanced forensic equipment|securityHQ][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $crimeUpgrades.advForensic = 1, $crimeCap -= 10, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will bring down the crime level cap by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have installed advanced forensic equipment, able to extract every bit of precious information from any clue. +<</if>> +<br> +<<if $crimeUpgrades.autoArchive == 0>> + [[Install auto-curating archiver|securityHQ][$cash -= Math.trunc(7500*$upgradeMultiplierArcology), $crimeUpgrades.autoArchive = 1, $crimeCap -= 10, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(7500*$upgradeMultiplierArcology)>>. Will bring down the crime level cap by 10 points, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have installed auto-curating archiver software, which will update in real time your data archives with any new relevant information on criminals residing in your arcology. +<</if>> +<br> +<<if $rep > 10000>> + <<if $crimeUpgrades.autoTrial == 0>> + [[Install automated trials software|securityHQ][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $crimeUpgrades.autoTrial = 1, $crimeCap -= 15, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>. Will bring down the crime level cap by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have installed advanced legal algorithms that allows the handling of legal matters much quicker and much more accurately. + <</if>> + <br> + <<if $crimeUpgrades.worldProfiler == 0>> + [[Install worldwide profilers|securityHQ][$cash -= Math.trunc(15000*$upgradeMultiplierArcology), $crimeUpgrades.worldProfiler = 1, $crimeCap -= 15, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(15000*$upgradeMultiplierArcology)>>. Will bring down the crime level cap by 15 points, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have installed advanced profiler software, which will constantly scour every known data archive on the globe (legally or not) to gather as much information as possible on dangerous criminals. + <</if>> +<<else>> + <br>You lack the reputation to access more advanced upgrades. +<</if>> + +<br> +<br> + +/* intelligence */ + +<<if $recon == 0>> + Your reconnaissance capabilities are very limited. Very little information will be available if the arcology is attacked. +<<elseif $recon == 1>> + You have limited reconnaissance capabilities. You'll have limited intel available in case of an attack. +<<elseif $recon == 2>> + You have good reconnaissance capabilities. Good, reliable intel will be available if the arcology is attacked. +<<else>> + You have great reconnaissance capabilities. You'll have very accurate information on the enemy if the arcology is attacked. +<</if>> + +<br> +<br> + +<<if $intelUpgrades.sensors == 0>> + [[Install perimeter sensors|securityHQ][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $intelUpgrades.sensors = 1, $recon += 1, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will increase recon capabilites, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have installed perimeter seismic sensors able to detect movement with high accuracy. +<</if>> +<br> +<<if $intelUpgrades.signalIntercept == 0>> + [[Create signal interception hub|securityHQ][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $intelUpgrades.signalIntercept = 1, $recon += 1, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>. Will increase recon capabilites, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have installed advanced signal interception equipment. +<</if>> +<br> +<<if $rep > 10000>> + <<if $intelUpgrades.radar == 0>> + [[Install advanced radar equipment|securityHQ][$cash -= Math.trunc(15000*$upgradeMultiplierArcology), $intelUpgrades.radar = 1, $recon += 1, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(15000*$upgradeMultiplierArcology)>>. Will increase recon capabilites, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have installed sophisticated radar equipment. + <</if>> +<<else>> + <br>You lack the reputation to access more advanced upgrades. +<</if>> + +<br> +<br> + +/* readiness */ + +<<if $readiness == 1>> + You have low readiness. You won't be able to mobilize many troops in time in case of an attack. +<<elseif $readiness == 2>> + You have decent readiness. You will be able to muster up sufficient forces to handle an average attack. +<<elseif $readiness == 3>> + You have good readiness. You will be able to mobilize a lot of troops in case of an attack. +<<else>> + You have great readiness. You can mobilize an small army in very little time. +<</if>> + +<br> +<br> + +<<if $readinessUpgrades.pathways == 0>> + [[Build specialized pathways in the arcology|securityHQ][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $readinessUpgrades.pathways = 1, $readiness += 1, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>. Will increase readiness by 1, but will increases upkeep.// +<<else>> + You have built specialized pathways inside the arcology to quickly move troops around the structure. +<</if>> +<br> +<<if $readinessUpgrades.rapidVehicles == 0>> + [[Buy rapid armored transport vehicles|securityHQ][$cash -= Math.trunc(7500*$upgradeMultiplierArcology), $readinessUpgrades.rapidVehicles = 1, $readiness += 2, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(75000*$upgradeMultiplierArcology)>>. Will increase readiness by 2, but will require 5 extra slaves in the headquarters and increases upkeep.// +<<else>> + You have bought rapid armored transport vehicles able to bring your troops to battle much quicker than before. +<</if>> +<br> +<<if $rep > 10000>> + <<if $readinessUpgrades.rapidPlatforms == 0>> + [[Build rapid deployment platforms|securityHQ][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $readinessUpgrades.rapidPlatforms = 1, $readiness += 2, $reqHelots += 5, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>. Will increase readiness by 2, but will require 5 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have built rapid deployment platforms able to equip and deploy units within very limited time windows. + <</if>> + <br> + <<if $readinessUpgrades.earlyWarn == 0>> + [[Institute early warning systems|securityHQ][$cash -= Math.trunc(15000*$upgradeMultiplierArcology), $readinessUpgrades.earlyWarn = 1, $readiness += 2, $reqHelots += 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(15000*$upgradeMultiplierArcology)>>. Will increase readiness by 2, but will require 10 extra slaves in the headquarters and increases upkeep.// + <<else>> + You have created early warning systems that constantly analyze in real time data to determine the likeness of an attack. + <</if>> +<<else>> + <br>You lack the reputation to access more advanced upgrades. +<</if>> + +<br> +<br> + +<<if $rep > 12000>> + <br>__Cold Data Storage Facility__: + <<if $secUpgrades.coldstorage == 6 && $rep >= 19500 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of two years. + <br> + [[Expand the cold storage facility to increase data retention to three years|securityHQ][$cash -= Math.trunc(2400000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(2400000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 5 && $rep >= 19500 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of one year. + <br> + [[Expand the cold storage facility to increase data retention to two years|securityHQ][$cash -= Math.trunc(1200000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(1200000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 4 && $rep >= 19500 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of nine months. + <br> + [[Expand the cold storage facility to increase data retention to one year|securityHQ][$cash -= Math.trunc(900000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(900000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 3 && $rep > 18000 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of six months. + <br> + [[Expand the cold storage facility to increase data retention to nine months|securityHQ][$cash -= Math.trunc(600000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(600000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 2 && $rep > 16000 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of three months. + <br> + [[Expand the cold storage facility to increase data retention to six months|securityHQ][$cash -= Math.trunc(300000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(300000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 1 && $rep > 14000 && $reqHelots > 10>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of one month. + <br> + [[Expand the cold storage facility to increase data retention to three months|securityHQ][$cash -= Math.trunc(100000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(1000000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by a further 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage == 0 && $rep > 12000 && $reqHelots > 10>> + [[Install a cold storage facility|securityHQ][$cash -= Math.trunc(50000*$upgradeMultiplierArcology), $secUpgrades.coldstorage++, $reqHelots -= 10, $secHQUpkeep += $upgradeUpkeep]] + <br>//Costs ¤<<print Math.trunc(500000*$upgradeMultiplierArcology)>>. Will lower the amount of required slaves by 10, but will increases upkeep.// + <<elseif $secUpgrades.coldstorage > 6>> + <br>You have installed a cold storage facility for the Security HQ's archives with a data retention capability of three years. + <<elseif $reqHelots <= 10>> + <br>Personnel cannot be further reduced. + <<else>> + <br>You lack the reputation to access more advanced upgrades. + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..aad8825bfde6c675012cb7a798f40fe0d2e017d8 --- /dev/null +++ b/src/SecExp/securityReport.tw @@ -0,0 +1,620 @@ +:: securityReport [nobr] + +/* init */ +<<set _immigration = $ACitizens - $oldACitizens>> +<<set _secGrowth = 0>> +<<set _secRest = 0>> +<<set _restGrowth = 0>> +<<set _newSec = 0>> +<<set _crimeGrowth = 0>> +<<set _crimeCap = 0>> +<<set _newCrime = 0>> +<<set _recruits = 0>> +<<set _newMercs = 0>> + +<<if $useTabs == 0>>__Security__<</if>> +<br> + +<strong>Security</strong>: +<<if $secHelots > 0>> + <<print $secHelots>> slaves work to improve the security of your arcology + <<if $mercenaries >= 1 && $arcologyUpgrade.drones == 1>> + , while your mercenaries and security drones tirelessly patrol the streets to keep them safe. + <<elseif $arcologyUpgrade.drones == 1>> + , while your security drones tirelessly patrol the arcology to keep it safe. + <<else>> + , while your loyal subordinates try to keep the arcology safe to the best of their abilites. + <</if>> +<<else>> + <<if $mercenaries >= 1 && $arcologyUpgrade.drones == 1>> + Your mercenaries and security drones tirelessly patrol the streets to keep them safe. + <<elseif $arcologyUpgrade.drones == 1>> + Your security drones tirelessly patrol the arcology to keep it safe. + <<else>> + Your loyal subordinates try to keep the arcology safe to the best of their abilites. + <</if>> +<</if>> + +/* security modifiers */ +<<if $PC.career == "mercenary">> + Your past life as a mercenary makes it easier to manage the security of the arcology. + <<set _secGrowth += 1>> +<</if>> +<<if $smilingManFate == 0>> + The ex-criminal known to the world as The Smiling Man puts her impressive skills to work, dramatically increasing the efficacy of your security measures. + <<set _secGrowth += 2>> +<</if>> +<<if $ACitizens + $ASlaves <= 2000>> + The small number of residents makes their job easier.<<set _secGrowth += 2>> +<<elseif $ACitizens + $ASlaves <= 4000>> + The fairly low number of residents makes their job a little easier.<<set _secGrowth += 1>> +<<elseif $ACitizens + $ASlaves <= 6000>> + The fairly high number of residents makes their job a little harder.<<set _secGrowth -= -0.5>> +<<elseif $ACitizens + $ASlaves <= 8000>> + The high number of residents makes their job harder.<<set _secGrowth -= 1>> +<<else>> + The extremely high number of residents makes their job a lot harder.<<set _secGrowth -= 2>> +<</if>> +<<if _immigration < 10>> + The limited number of immigrants that reached the arcology this week does not have any serious impact on the efficacy of current security measures.<<set _secGrowth += 0.5>> +<<elseif _immigration < 30>> + The number of immigrants that reached the arcology this week is high enough to complicate security protocols.<<set _secGrowth -= 0.2>> +<<elseif _immigration < 60>> + The high number of immigrants that reached the arcology this week complicates security protocols.<<set _secGrowth -= 0.5>> +<<elseif _immigration < 80>> + The high number of immigrants that reached the arcology this week severely complicates security protocols.<<set _secGrowth -= 1>> +<<else>> + The extremely high number of immigrants that reached the arcology this week severely complicates security protocols.<<set _secGrowth -= 2>> +<</if>> +<<if $crime < 20>> + Crime is a distant problem in the arcology, which makes improving security easier.<<set _secGrowth += 1>> +<<elseif $crime < 40>> + Crime is a minor problem in the arcology, not serious enough to disrupt security efforts. +<<elseif $crime < 60>> + Crime is an issue in the arcology, which makes improving security harder.<<set _secGrowth -= 0.5>> +<<elseif $crime < 80>> + Crime is an overbearing problem in the arcology, which makes improving security a lot harder.<<set _secGrowth -= 1>> +<<else>> + Crime is sovereign in the arcology, which makes improving security extremely difficult.<<set _secGrowth -= 2>> +<</if>> +<<if $authority < 5000>> + The low authority you hold on the arcology hampers the efforts of your security department.<<set _secGrowth -= 1>> +<<elseif $authority < 7500>> + The limited authority you hold on the arcology hampers the efforts of your security department.<<set _secGrowth -= 0.5>> +<<elseif $authority < 10000>> + The authority you hold on the arcology does not significantly impact the efforts of your security department. +<<elseif $authority < 15000>> + The high authority you hold on the arcology facilitates the security department's work.<<set _secGrowth += 0.5>> +<<else>> + The absolute authority you hold on the arcology makes the security department's work a lot easier.<<set _secGrowth += 1>> +<</if>> +<<if $activeUnits >= 6>> + 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>> + The recent attack has a negative effect on the security of the arcology.<<set _secGrowth -= 1>> +<<elseif $lastAttackWeeks < 5 && $hasFoughtOnce == 1>> + 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>> + The arcology has not been attacked in a while, which has a positive effect on security.<<set _secGrowth += 0.5>> +<</if>> + +<<if $transportHub == 1>> + <<if $terrain != "oceanic" || $terrain != "marine">> + <<set _secGrowth += ($airport + $railway - $hubSecurity * 3) / 2>> + <<else>> + <<set _secGrowth += ($airport + $docks - $hubSecurity * 3) / 2>> + <</if>> + <<if $airport + $docks > $hubSecurity * 3>> + The transport hub, for all its usefulness, is a hotspot of malicious activity and hub security forces are not sufficient to keep up with all threats. + <<else>> + The transport hub, for all its usefulness, is a hotspot of malicious activity, but the hub security forces are up to the task. + <</if>> +<</if>> + +<<if $blackOps == 1>> + Your black ops team proves to be a formidable tool against anyone threatening the security of your arcology. + <<set _secGrowth += 0.5 * random(1,2)>> +<</if>> + +<<if $garrison.assistantTime > 0>> + With the central CPU core of the assistant down, managing security is a much harder task. Inevitably some little but important details will slip past your agents. + It will still take <<if $garrison.assistantTime> 1>>$garrison.assistantTime weeks<<else>>a week<</if>> to finish repair works. + <<set _secGrowth-->> + <<set _crimeGrowth++>> + <<set $garrison.assistantTime-->> +<</if>> + +<<if $SFSupportLevel >= 3>> + The two squads of $securityForceName assigned to the Security HQ provide an essential help to the security department. +<</if>> +<<if $SFSupportLevel >= 2>> + The training officers of $securityForceName assigned to the Security HQ improve its effectiveness. +<</if>> +<<if $SFSupportLevel >= 1>> + Providing your Security Department with equipment from $securityForceName slightly boosts the security of your arology. +<</if>> + +/* resting point */ +<<set _secRest = $secRestPoint * (Math.clamp($secHelots,0,$reqHelots) / $reqHelots)>> +<<if _secRest < 0>> + <<set _secRest = 20>> +<</if>> +<<if _secRest < $secRestPoint && $secHQ == 1>> + The limited staff assigned to the HQ hampered the improvements to security achieved this week. +<<elseif _secRest < $secRestPoint>> + The limited infrastructure available slowly erodes away the security level of the arcology. +<</if>> +<<if $security > (_secRest + 5)>> + The security level of the arcology is over its effective resting point, limiting the achievable growth this week. + <<set _secGrowth *= 0.5>> +<<elseif $security < (_secRest - 5)>> + The security level of the arcology is under its effective resting point, speeding up its growth. + <<set _secGrowth *= 1.5>> +<<elseif $security == _secRest>> + The security level of the arcology is at its effective resting point, this severely limits the influence of external factors on the change achievable this week. + <<set _secGrowth *= 0.3>> +<<else>> + The security level of the arcology is near its effective resting point, this severely limits the influence of external factors on the change achievable this week. + <<if _secGrowth < 0>> + <<set _secGrowth *= 0.3>> + <</if>> +<</if>> +<<set _restGrowth = (_secRest - $security) * 0.2>> +<<set _newSec = Math.trunc($security + _secGrowth + _restGrowth)>> +<<if _newSec < $security>> + This week @@.red;security decreased@@. +<<elseif _newSec == $security>> + This week @@.yellow;security did not change@@. +<<else>> + This week @@.green;security improved@@. +<</if>> +<<set $security = Math.clamp(_newSec, 0, 100)>> + +<br> +<br> + +<strong>Crime</strong>: +/* crime modifiers */ +<<if $week < 30>> + Due to the deterioration of the old world countries, organized crime focuses more and more on the prosperous free cities, yours included. This has a small impact on the growth of criminal activities in your arcology.<<set _crimeGrowth += 0.5>> +<<elseif $week < 60>> + Due to the deterioration of the old world countries, organized crime focuses more and more on the prosperous free cities, yours included. This has a noticeable impact on the growth of criminal activities in your arcology.<<set _crimeGrowth += 1>> +<<elseif $week < 90>> + Due to the deterioration of the old world countries, organized crime focuses more and more on the prosperous free cities, yours included. This has a moderate impact on the growth of criminal activities in your arcology.<<set _crimeGrowth += 1.5>> +<<elseif $week < 120>> + Due to the deterioration of the old world countries, organized crime focuses more and more on the prosperous free cities, yours included. This has a big impact on the growth of criminal activities in your arcology.<<set _crimeGrowth += 2>> +<<else>> + Due to the deterioration of the old world countries, organized crime focuses more and more on the prosperous free cities, yours included. This has a huge impact on the growth of criminal activities in your arcology.<<set _crimeGrowth += 2.5>> +<</if>> +<<if $arcologies[0].prosperity < 50>> + The low prosperity of the arcology facilitates criminal recruitment and organization.<<set _crimeGrowth += 1>> +<<elseif $arcologies[0].prosperity < 80>> + The fairly low prosperity of the arcology facilitates criminal recruitment and organization.<<set _crimeGrowth += 0.5>> +<<elseif $arcologies[0].prosperity < 120>> + The prosperity of the arcology is not high or low enough to have significant effects on criminal recruitment and organization. +<<elseif $arcologies[0].prosperity < 160>> + The prosperity of the arcology is high enough to provide its citizens a decent life, hampering criminal recruitment and organization.<<set _crimeGrowth -= 0.5>> +<<elseif $arcologies[0].prosperity < 180>> + The prosperity of the arcology is high enough to provide its citizens a decent life, significantly hampering criminal recruitment and organization.<<set _crimeGrowth -= 1>> +<<else>> + The prosperity of the arcology is high enough to provide its citizens a very good life, significantly hampering criminal recruitment and organization.<<set _crimeGrowth -= 2>> +<</if>> +<<if $ASlaves < 1000>> + The low number of slaves in the arcology does not hinder the activity of law enforcement, limiting crime growth.<<set _crimeGrowth -= 1>> +<<elseif $ASlaves < 2000>> + The fairly low number of slaves in the arcology does not hinder significantly the activity of law enforcement, limiting crime growth.<<set _crimeGrowth -= 0.5>> +<<elseif $ASlaves < 3000>> + The number of slaves in the arcology is becoming an impediment for law enforcement, facilitating crime growth.<<set _crimeGrowth += 1>> +<<else>> + The number of slaves in the arcology is becoming a a big issue for law enforcement, facilitating crime growth.<<set _crimeGrowth += 1.5>> +<</if>> +<<if $security <= 20>> + The security measures in place are severely limited, allowing crime to grow uncontested. +<<elseif $security <= 50>> + The security measures in place are of limited effect and use, giving only mixed results in their fight against crime.<<set _crimeGrowth -= 1.5>> +<<elseif $security <= 75>> + The security measures in place are well developed and effective, making a serious dent in the profitability of criminal activity in your arcology.<<set _crimeGrowth -= 3>> +<<else>> + The security measures in place are extremely well developed and very effective, posing a serious threat even to the most powerful criminal organizations in existence.<<set _crimeGrowth -= 5.5>> +<</if>> +<<if $authority < 5000>> + Your low authority allows crime to grow undisturbed.<<set _crimeGrowth += 1>> +<<elseif $authority < 7500>> + Your relatively low authority facilitates criminal activities.<<set _crimeGrowth += 0.5>> +<<elseif $authority < 10000>> + Your authority is not high enough to discourage criminal activity. +<<elseif $authority < 15000>> + Your high authority is an effective tool against crime.<<set _crimeGrowth -= 1>> +<<else>> + Your absolute authority is an extremely effective tool against crime.<<set _crimeGrowth -= 2>> +<</if>> +<<if $cash >= 100000>> + Your great wealth acts as a beacon for the greediest criminals, calling them to your arcology as moths to a flame.<<set _crimeGrowth += 0.5>> +<</if>> +<<if $marketInfiltration == 1>> + <<set _crimeGrowth += 0.5 * random(1,2)>> +<</if>> + +/* crime cap */ +<<set _crimeCap = Math.trunc(Math.clamp($crimeCap + ($crimeCap - $crimeCap * ($secHelots / $reqHelots)),0,100))>> +<<if _crimeCap < $crimeCap && $secHQ == 1>> + The limited staff assigned to the HQ allows more space for criminals to act. +<</if>> +<<set _newCrime = Math.trunc($crime + _crimeGrowth)>> +<<if _newCrime > _crimeCap>> + <<set _newCrime = _crimeCap>> +<</if>> +<<if _newCrime > $crime>> + This week @@.red;crime increased@@. +<<elseif _newCrime == $crime>> + This week @@.yellow;crime did not change@@. +<<else>> + This week @@.green;crime decreased@@. +<</if>> +<<set $crime = Math.clamp(_newCrime,0,100)>> + + + +<<if $militiaFounded == 1 || $activeUnits >= 1>> + <br> + <br> + /* militia */ + <strong>Military</strong>: + <<if $recruitVolunteers == 1>> + Your militia accepts only volunteering citizens, ready to defend their arcology. + <<set _recruits = random(1,2)>> + <<if $rep >= 10000>> + Many citizens volunteer just to fight for someone of your renown. + <<set _recruits += 1>> + <</if>> + <<if $authority >= 10000>> + Many citizens feel it is their duty to fight for you, boosting volunteer enrollment. + <<set _recruits += 1>> + <</if>> + <<if $lowerRquirements == 1>> + Your lax phisical requirements to enter the militia allows for a greater number of citizens to join. + <<set _recruits += 1>> + <</if>> + <<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.02 * $ACitizens>> + <<set $militiaTotalManpower += _recruits>> + <<set $militiaFreeManpower += _recruits>> + This week <<print _recruits>> citizens joined the militia. + <<else>> + There are not many more citizens willing to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower. + <</if>> + <<elseif $conscription == 1>> + Adult citizens are required to join the militia for a period of time. + <<set _recruits = random(3,5)>> + <<if $militaryExemption == 1>> + Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@. + <<set _recruits -= random(1,2)>> + <<set $cash += 250>> + <</if>> + <<if $lowerRquirements == 1>> + Your lax phisical requirements to enter the militia allows for a greater number of citizens to join. + <<set _recruits += 1>> + <</if>> + <<if $noSubhumansInArmy == 1>> + Guaranteeing the purity of your armed forces comes with a small loss of potential recruits. + <<set _recruits -= random(0,1)>> + <</if>> + <<if $pregExemption == 1>> + Many pregnant citizens prefer to avoid military service not to endager themselves and their children. + <<set _recruits -= 1>> + <</if>> + <<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.05 * $ACitizens>> + <<set $militiaTotalManpower += _recruits>> + <<set $militiaFreeManpower += _recruits>> + This week <<print _recruits>> citizens joined the militia. + <<else>> + There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower. + <</if>> + <<elseif $militaryService == 1>> + Adult citizens are required to register and serve in the militia whenever necessary. + <<set _recruits = random(5,7)>> + <<if $militaryExemption == 1>> + Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@. + <<set _recruits -= random(1,2)>> + <<set $cash += 250>> + <</if>> + <<if $lowerRquirements == 1>> + Your lax phisical requirements to enter the militia allows for a greater number of citizens to join. + <<set _recruits += 1>> + <</if>> + <<if $noSubhumansInArmy == 1>> + Guaranteeing the purity of your armed forces comes with a small loss of potential recruits. + <<set _recruits -= random(0,1)>> + <</if>> + <<if $pregExemption == 1>> + Many pregnant citizens prefer to avoid military service not to endager themselves and their children. + <<set _recruits -= 1>> + <</if>> + <<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.10 * $ACitizens>> + <<set $militiaTotalManpower += _recruits>> + <<set $militiaFreeManpower += _recruits>> + This week <<print _recruits>> citizens joined the militia. + <<else>> + There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower. + <</if>> + <<elseif $militarizedSociety == 1>> + Every citizen is required to train and participate in the military activities of the arcology. + <<set _recruits = random(7,9)>> + <<if $militaryExemption == 1>> + Some citizens prefer to contribute to the arcology's defense through financial support rather than military service, making you @@.yellowgreen;a small sum@@. + <<set _recruits -= random(1,2)>> + <<set $cash += 250>> + <</if>> + <<if $lowerRquirements == 1>> + Your lax phisical requirements to enter the militia allows for a greater number of citizens to join. + <<set _recruits += 1>> + <</if>> + <<if $noSubhumansInArmy == 1>> + Guaranteeing the purity of your armed forces comes with a small loss of potential recruits. + <<set _recruits -= random(0,1)>> + <</if>> + <<if $pregExemption == 1>> + Many pregnant citizens prefer to avoid military service not to endager themselves and their children. + <<set _recruits -= 1>> + <</if>> + <<if $militiaTotalManpower - $militiaTotalCasualties + _recruits <= 0.20 * $ACitizens>> + <<set $militiaTotalManpower += _recruits>> + <<set $militiaFreeManpower += _recruits>> + This week <<print _recruits>> citizens joined the militia. + <<else>> + There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower. + <</if>> + <</if>> + + /* mercs */ + <<if $mercenaries >= 1>> + <<set _newMercs = random(0,3)>> + <<if $rep < 6000>> + Your low reputation turns some mercenaries away, hoping to find contracts that would bring them more renown.<<set _newMercs -= 1>> + <<elseif $rep < 12000>> + Your reputation is not high enough to attract many mercenaries to your free city. + <<else>> + Your reputation attracts many guns for hire who would be proud to have such distinct character on their resume.<<set _newMercs += 1>> + <</if>> + <<if $arcologies[0].prosperity < 50>> + The low prosperity of the arcology discourages new guns for hire from coming to your arcology.<<set _newMercs -= 1>> + <<elseif $arcologies[0].prosperity < 80>> + The fairly low prosperity of the arcology discourages new guns for hire from coming to your arcology.<<set _newMercs += 1>> + <<elseif $arcologies[0].prosperity < 120>> + The prosperity of the arcology attracts a few mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(1,2)>> + <<elseif $arcologies[0].prosperity < 160>> + The fairly high prosperity of the arcology attracts some mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(2,3)>> + <<elseif $arcologies[0].prosperity < 180>> + The high prosperity of the arcology is attracts some mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(2,4)>> + <<else>> + The very high prosperity of the arcology attracts a lot of mercenaries, hopeful to find lucrative contracts within its walls.<<set _newMercs += random(3,5)>> + <</if>> + <<if $crime > 60>> + The powerful crime organizatiosn that nested themselves in the arcology have an unending need for cheap guns for hire, many mercenaries flock to your free city in search of employment.<<set _newMercs += random(1,2)>> + <</if>> + <<set _newMercs = Math.trunc(_newMercs / 2)>> + <<if _newMercs > 0>> + <<set $mercTotalManpower += _newMercs>> + <<set $mercFreeManpower += _newMercs>> + This week <<print _newMercs>> mercenaries reached the arcology. + <<else>> + This week no new mercenaries reached the arcology. + <</if>> + <<if $mercFreeManpower > 2000>> + <<set $mercTotalManpower -= $mercFreeManpower - 2000>> + <<set $mercFreeManpower = 2000>> + <</if>> + <</if>> + <br> + /* loyalty and training */ + <<set _sL = $slaveUnits.length>> + <<for _i = 0; _i < _sL; _i++>> + <<set _loyaltyChange = 0>> + <br> + <br>$slaveUnits[_i].platoonName: + <<if $secBarracksUpgrades.loyaltyMod >= 1>> + <<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>> + is periodically sent to the indoctrination facility in the barracks for thought correction therapy. + <</if>> + <<if $slaveUnits[_i].commissars >= 1>> + The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination. + <<set _loyaltyChange += 2 * $slaveUnits[_i].commissars>> + <</if>> + <<if $soldierWages == 2>> + The slaves greatly appreciate the generous wage given to them for their service as soldiers. Occasions to earn money for a slave are scarce after all. + <<set _loyaltyChange += random(5,10)>> + <<elseif $soldierWages == 1>> + The slaves appreciate the wage given to them for their service as soldiers, despite it being just adequate. Occasions to earn money for a slave are scarce after all. + <<set _loyaltyChange += random(-5,5)>> + <<else>> + The slaves do not appreciate the low wage given to them for their service as soldiers, but occasions to earn money for a slave are scarce, so they're not too affected by it. + <<set _loyaltyChange -= random(5,10)>> + <</if>> + <<if $slaveSoldierPrivilege == 1>> + Allowing them to hold material possessions earns you their devotion and loyalty. + <<set _loyaltyChange += random(1,2)>> + <</if>> + <<if _loyaltyChange > 0>> + The loyalty of this unit @@.green;increased@@ this week. + <<elseif _loyaltyChange == 0>> + The loyalty of this unit @@.yellow;did not change@@ this week. + <<else>> + The loyalty of this unit @@.red;decreased@@ this week. + <</if>> + <<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + _loyaltyChange,0,100)>> + <<if $slaveUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>> + <br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level. + <<set $slaveUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>> + <</if>> + <</for>> + <<set _mL = $militiaUnits.length>> + <<for _i = 0; _i < _mL; _i++>> + <br> + <br>$militiaUnits[_i].platoonName: + <<set _loyaltyChange = 0>> + <<if $secBarracksUpgrades.loyaltyMod >= 1>> + <<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>> + is periodically sent to the indoctrination facility in the barracks for thought correction therapy. + <</if>> + <<if $militiaUnits[_i].commissars >= 1>> + The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination. + <<set _loyaltyChange += 2 * $militiaUnits[_i].commissars>> + <</if>> + <<if $soldierWages == 2>> + The soldiers greatly appreciate the generous wage given to them for their service. They are proud to defend their homes while making a small fortune out of it. + <<set _loyaltyChange += random(5,10)>> + <<elseif $soldierWages == 1>> + The soldiers appreciate the wage given to them for their service, despite it being just adequate. They are proud to defend their homes, though at the cost of possible financial gains. + <<set _loyaltyChange += random(-5,5)>> + <<else>> + The soldiers do not appreciate the low wage given to them for their service. Their sense of duty keeps them proud of their role as defenders of the arcology, but many do feel its financial weight. + <<set _loyaltyChange -= random(5,10)>> + <</if>> + <<if $militiaSoldierPrivilege == 1>> + Allowing them to avoid rent payment for their military service earns you their happiness and loyalty. + <<set _loyaltyChange += random(1,2)>> + <</if>> + <<if _loyaltyChange > 0>> + The loyalty of this unit @@.green;increased@@ this week. + <<elseif _loyaltyChange == 0>> + The loyalty of this unit @@.yellow;did not change@@ this week. + <<else>> + The loyalty of this unit @@.red;decreased@@ this week. + <</if>> + <<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + _loyaltyChange,0,100)>> + <<if $militiaUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>> + <br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level. + <<set $militiaUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>> + <</if>> + <</for>> + <<set _meL = $mercUnits.length>> + <<for _i = 0; _i < _meL; _i++>> + <br> + <br>$mercUnits[_i].platoonName: + <<set _loyaltyChange = 0>> + <<if $secBarracksUpgrades.loyaltyMod >= 1>> + <<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>> + is periodically sent to the indoctrination facility in the barracks for thought correction therapy. + <</if>> + <<if $mercUnits[_i].commissars >= 1>> + The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination. + <<set _loyaltyChange += 2 * $mercUnits[_i].commissars>> + <</if>> + <<if $soldierWages == 2>> + The mercenaries greatly appreciate the generous wage given to them for their service. After all coin is the fastest way to reach their hearts. + <<set _loyaltyChange += random(5,10)>> + <<elseif $soldierWages == 1>> + The mercenaries do not appreciate the barely adequate wage given to them for their service. Still their professionalism keeps them determined to finish their contract. + <<set _loyaltyChange += random(-5,5)>> + <<else>> + The mercenaries do not appreciate the low wage given to them for their service.Their skill would be better served by a better contract and this world does not lack demand for guns for hire. + <<set _loyaltyChange -= random(5,10)>> + <</if>> + <<if $mercSoldierPrivilege == 1>> + Allowing them to keep part of the loot gained from your enemies earns you their trust and loyalty. + <<set _loyaltyChange += random(1,2)>> + <</if>> + <<if _loyaltyChange > 0>> + The loyalty of this unit @@.green;increased@@ this week. + <<elseif _loyaltyChange == 0>> + The loyalty of this unit @@.yellow;did not change@@ this week. + <<else>> + The loyalty of this unit @@.red;decreased@@ this week. + <</if>> + <<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + _loyaltyChange,0,100)>> + <<if $mercUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>> + <br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level. + <<set $mercUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>> + <</if>> + <</for>> +<</if>> + + +<<if $brainImplantProject > 0 && $brainImplant < 106>> + <br> + <br> + <<set $brainImplant += $brainImplantProject>> + <<if 100 - $brainImplant <= 0>> + The project has been completed! + <<set $brainImplant = 106>> + <<set $riotUpkeep -= 5000 * $brainImplantProject>> + <<else>> + The great brain implant project is proceeding steadily. This week we made + <<if $brainImplantProject <= 2>> + some small + <<elseif $brainImplantProject <= 4>> + some + <<else>> + good + <</if>> + progress + <</if>> +<</if>> + +<<if $currentUpgrade.time > 0>> + <br> + <br> + In the research lab, <<print $currentUpgrade.name>> is being developed, with the objective to enhance + <<if $currentUpgrade.type == "attack">> + attack power + <<elseif $currentUpgrade.type == "defense">> + defense capabilities + <<elseif $currentUpgrade.type == "hp">> + survivability + <<elseif $currentUpgrade.type == "morale">> + standing power + <<elseif $currentUpgrade.type == "attackAndDefense">> + offensive and defensive effectiveness + <<elseif $currentUpgrade.type == "hpAndMorale">> + morale and survivability + <<elseif $currentUpgrade.type == "all">> + offensive,defensive effectiveness in addition to morale and survivability + <</if>> + for <<if $currentUpgrade.unit == 0>> the security drones<<else>> our human troops<</if>>. + + <<set $currentUpgrade.time-->> + <<if $currentUpgrade.time <= 0>> + Reports indicate it is ready for deployment and will be issued to + <<if $currentUpgrade.unit == 0>> + the security drones + <<if $currentUpgrade.type == "attack">> + <<set $droneUpgrades.attack++>> + <<elseif $currentUpgrade.type == "defense">> + <<set $droneUpgrades.defense++>> + <<elseif $currentUpgrade.type == "hp">> + <<set $droneUpgrades.hp++>> + <</if>> + <<else>> + all human troops + <<if $currentUpgrade.type == "attack">> + <<set $humanUpgrade.attack++>> + <<elseif $currentUpgrade.type == "defense">> + <<set $humanUpgrade.defense++>> + <<elseif $currentUpgrade.type == "hp">> + <<set $humanUpgrade.hp++>> + <<elseif $currentUpgrade.type == "morale">> + <<set $humanUpgrade.morale += 10>> + <<elseif $currentUpgrade.type == "attackAndDefense">> + <<set $humanUpgrade.attack++>> + <<set $humanUpgrade.defense++>> + <<elseif $currentUpgrade.type == "hpAndMorale">> + <<set $humanUpgrade.hp++>> + <<set $humanUpgrade.morale += 10>> + <<elseif $currentUpgrade.type == "all">> + <<set $humanUpgrade.attack++>> + <<set $humanUpgrade.defense++>> + <<set $humanUpgrade.hp++>> + <<set $humanUpgrade.morale += 10>> + <</if>> + <</if>> + <<set $currentUpgrade.name = " ">> + <<set $currentUpgrade.type = " ">> + <<set $currentUpgrade.unit = -1>> + <<set $currentUpgrade.time = 0>> + in the next days. + <<recalcBaseStats>> + <<set $completedUpgrades.push($currentUpgrade.ID)>> + <<else>> + It will be finished in <<if $currentUpgrade.time == 1>> one week.<<else>><<print $currentUpgrade.time>> weeks.<</if>> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/seeUnit.tw b/src/SecExp/seeUnit.tw new file mode 100644 index 0000000000000000000000000000000000000000..ff5202f440fdad98d3abb5a4964d896aae821d5b --- /dev/null +++ b/src/SecExp/seeUnit.tw @@ -0,0 +1,481 @@ +:: seeUnit [nobr] + +<<if $attackThisWeek == 1>> + <<set $nextButton = "Back", $nextLink = "attackOption", $returnTo = "secBarracks">> +<<else>> + <<set $nextButton = "Back", $nextLink = "secBarracks", $returnTo = "secBarracks">> +<</if>> + +<<if $targetUnit == "secBots">> + <<secBotsDescription>> + <<if $secBots.maxTroops > $secBots.troops>> + <br> + <<link "Replenish the unit">> + <<set $cash -= ($secBots.maxTroops - $secBots.troops) * $secBotsCost>> + <<set $secBots.troops = $secBots.maxTroops>> + <<goto "seeUnit">> + <</link>> + <</if>> + <br> + <<if $secBots.maxTroops < 80>> + <br> + <<link "Improve the digital control matrix">> + <<set $secBots.maxTroops += 10>> + <<set $cash -= 5000>> + <<goto "seeUnit">> + <</link>> + Invest in the development of more refined controls for your drones to increase the maximum number of drones in the unit. + <br>//Costs 5000 per upgrade and each will increase the max by 10// + <<elseif $secBots.maxTroops < 100 && $SFSupportLevel >= 1>> + <br> + <<link "Refine the drone network with $securityForceName assistance">> + <<set $secBots.maxTroops += 10>> + <<set $cash -= 5000>> + <<goto "seeUnit">> + <</link>> + Utilize the technological developments made by $securityForceName to further improve the control matrix of the security drones. + <br>//Costs 5000 per upgrade and each will increase the max by 10// + <<elseif $SFSupportLevel < 1 && $securityForceCreate == 1>> + There's little left to improve in the matrix. However support from $securityForceName might give some more room from improvement. + <<else>> + There's little left to improve in the matrix. Your control systems are at top capacity and won't be able to handle bigger a drone unit. + <</if>> + <<if $secBots.equip < 3>> + <br> + <<link "Improve drone weaponry and armor">> + <<set $secBots.equip += 1>> + <<set $cash -= (($secBotsUpgradeCost * $secBots.maxTroops) + 1000)>> + <<goto "seeUnit">> + <</link>> + Invest in better equipment for your drones to increase their battle effectiveness. + <br>//Costs <<print (($secBotsUpgradeCost * $secBots.maxTroops) + 1000)>> and will increase attack and defense value of the unit by 15% for every upgrade.// + <<else>> + <br> + Your drones are equipped with top tier weaponry and armor. + <</if>> + <<if $showBattleStatistics == 1>> + <br> + <br>Security drones base attack: $secBotsBaseAttack <<if $droneUpgrades.attack > 0>> + 1 <</if>>(<<print Math.round($secBotsBaseAttack + $secBotsBaseAttack * $secBots.equip * 0.15)>>) + <br>Security drones base defense: $secBotsBaseDefense <<if $droneUpgrades.defense > 0>> + 1 <</if>>(<<print Math.round($secBotsBaseDefense + $secBotsBaseDefense * $secBots.equip * 0.15)>>) + <br>Equipment bonus: + <<print $secBots.equip * 15>>% + <br>Security drones base hp: $secBotsBaseHp <<if $droneUpgrades.hp > 0>> + 1 <</if>> + <br>Security drones base morale: $secBotsMorale + <</if>> +<<elseif $targetUnit == "militiaUnits">> + <<militiaUnitsDescription $militiaUnits[$targetIndex]>> + <br> + Rename unit <<textbox "$militiaUnits[$targetIndex].platoonName" $militiaUnits[$targetIndex].platoonName "seeUnit">> + <<if $militiaUnits[$targetIndex].maxTroops > $militiaUnits[$targetIndex].troops && $militiaFreeManpower > 0>> + <br> + <<link "Replenish unit">> + <<if $militiaFreeManpower >= $militiaUnits[$targetIndex].maxTroops - $militiaUnits[$targetIndex].troops>> + <<set $militiaFreeManpower -= $militiaUnits[$targetIndex].maxTroops - $militiaUnits[$targetIndex].troops>> + <<set $militiaEmployedManpower += $militiaUnits[$targetIndex].maxTroops - $militiaUnits[$targetIndex].troops>> + <<set _expLoss = ($militiaUnits[$targetIndex].maxTroops - $militiaUnits[$targetIndex].troops) / $militiaUnits[$targetIndex].troops>> + <<set $militiaUnits[$targetIndex].training -= $militiaUnits[$targetIndex].training * _expLoss>> + <<set $militiaUnits[$targetIndex].troops = $militiaUnits[$targetIndex].maxTroops>> + <<else>> + <<set $militiaEmployedManpower += $militiaFreeManpower>> + <<set _expLoss = $militiaFreeManpower / $militiaUnits[$targetIndex].troops>> + <<set $militiaUnits[$targetIndex].training -= $militiaUnits[$targetIndex].training * _expLoss>> + <<set $militiaUnits[$targetIndex].troops += $militiaFreeManpower>> + <<set $militiaFreeManpower = 0>> + <</if>> + <<goto "seeUnit">> + <</link>> + <</if>> + <br> + <<if $militiaUnits[$targetIndex].maxTroops < 50>> + <br> + <<link "Intensive officers training">> + <<set $militiaUnits[$targetIndex].maxTroops += 10>> + <<set $cash -= 5000>> + <<goto "seeUnit">> + <</link>> + Invest in the training of your officers to increase the maximum number of soldiers in the unit. + <br>//Costs 5000 per upgrade and each will increase the max by 10// + <<else>> + <br> + Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead. + <</if>> + <<if $militiaUnits[$targetIndex].equip < 3>> + <br> + <<link "Improve weaponry and equipment">> + <<set $militiaUnits[$targetIndex].equip += 1>> + <<set $cash -= ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> + <<goto "seeUnit">> + <</link>> + Invest in better equipment for your soldiers to increase their battle effectiveness. + <br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.// + <<else>> + <br> + The unit is equipped with state of the art weaponry and equipment. + <</if>> + <<if $militiaUnits[$targetIndex].commissars == 0>> + <br> + <<link "Attach commissars to the unit">> + <<set $militiaUnits[$targetIndex].commissars = 1>> + <<set $cash -= $equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of commissars to the unit. + <br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will slowly increase the loyalty of the unit.// + <<elseif $militiaUnits[$targetIndex].commissars < 2>> + <br> + <<link "Intensive loyalty training">> + <<set $militiaUnits[$targetIndex].commissars += 1>> + <<set $cash -= $equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Provide special training for the officers and the commissars of the unit. + <br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will increase the loyalty of the unit faster.// + <<elseif $militiaUnits[$targetIndex].commissars == 1>> + <br>The unit has a commissar detachment, keeping under control the ambitions of the unit's officers. + <<else>> + <br>The unit has a perfectly trained and loyal commissar detachment, keeping under control the ambitions of the unit's officers. + <</if>> + <<if $militiaUnits[$targetIndex].medics == 0>> + <br> + <<link "Attach trained medics to the unit">> + <<set $militiaUnits[$targetIndex].medics = 1>> + <<set $cash -= $equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of trained medics to the unit. + <br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will decrease the number of casualties suffered during battle.// + <<else>> + <br>The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers. + <</if>> + <<if $securityForceActive == 1>> + <<if $militiaUnits[$targetIndex].SF == 0>> + <br> + <<link "Attach Special Force advisors">> + <<set $militiaUnits[$targetIndex].SF = 1>> + <<set $cash -= ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 5000>> + <<goto "seeUnit">> + <</link>> + Attach $securityForceName advisors to the unit. + <br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.// + <<else>> + <br>The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <</if>> + + <<if $showBattleStatistics == 1>> + <<if $militiaUnits[$targetIndex].training <= 10>> + <<set _expBonus = 0>> + <<elseif $militiaUnits[$targetIndex].training <= 33>> + <<set _expBonus = 10>> + <<elseif $militiaUnits[$targetIndex].training <= 66>> + <<set _expBonus = 25>> + <<else>> + <<set _expBonus = 50>> + <</if>> + <<if $militiaUnits[$targetIndex].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $militiaUnits[$targetIndex].loyalty <= 33>> + <<set _loyaltyBonus = 10>> + <<elseif $militiaUnits[$targetIndex].loyalty <= 66>> + <<set _loyaltyBonus = 20>> + <<else>> + <<set _loyaltyBonus = 30>> + <</if>> + <br> + <br>Militia base attack: $militiaBaseAttack <<if $humanUpgrade.attack > 0>> + $humanUpgrade.attack <</if>>(<<print Math.round($militiaBaseAttack + $militiaBaseAttack * $militiaUnits[$targetIndex].equip * $equipMod + $militiaBaseAttack * _expBonus * 0.01 + $militiaBaseAttack * _loyaltyBonus * 0.01 + $militiaBaseAttack * $militiaUnits[$targetIndex].SF * 0.20)>>) + <br>Militia base defense: $militiaBaseDefense <<if $humanUpgrade.defense > 0>> + $humanUpgrade.defense <</if>>(<<print Math.round($militiaBaseDefense + $militiaBaseDefense * $militiaUnits[$targetIndex].equip * $equipMod + $militiaBaseDefense * _expBonus * 0.01 + $militiaBaseDefense * _loyaltyBonus * 0.01 + $militiaBaseDefense * $militiaUnits[$targetIndex].SF * 0.20)>>) + <br>Equipment bonus: + <<print $militiaUnits[$targetIndex].equip * 15>>% + <<if _expBonus > 0>> + <br>Experience bonus: +<<print _expBonus>>% + <</if>> + <<if _loyaltyBonus > 0>> + <br>Loyalty bonus: +<<print _loyaltyBonus>>% + <</if>> + <<if $militiaUnits[$targetIndex].SF > 0>> + <br>Special Force advisors bonus: +20% + <</if>> + <br>Militia base morale: $militiaBaseMorale <<if $humanUpgrade.morale > 0>> + $humanUpgrade.morale <</if>>(<<print Math.round($militiaBaseMorale + $militiaBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>) + <<if $secBarracksUpgrades.luxury > 0>> + <br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>% + <</if>> + <br>Militia base hp: $militiaBaseHp <<if $humanUpgrade.hp > 0>> + $humanUpgrade.hp <</if>>(<<print Math.round($militiaBaseHp + $militiaBaseHp * $militiaUnits[$targetIndex].medics * 0.25)>>) + <<if $militiaUnits[$targetIndex].medics > 0>> + <br>Medics detachment bonus: +25% + <</if>> + <</if>> +<<elseif $targetUnit == "slaveUnits">> + <<slaveUnitsDescription $slaveUnits[$targetIndex]>> + <br> + Rename unit <<textbox "$slaveUnits[$targetIndex].platoonName" $slaveUnits[$targetIndex].platoonName "seeUnit">> + <<if $slaveUnits[$targetIndex].maxTroops > $slaveUnits[$targetIndex].troops && $helots > 0>> + <br> + <<link "Replenish unit">> + <<if $helots >= $slaveUnits[$targetIndex].maxTroops - $slaveUnits[$targetIndex].troops>> + <<set $helots -= $slaveUnits[$targetIndex].maxTroops - $slaveUnits[$targetIndex].troops>> + <<set $slavesEmployedManpower += $slaveUnits[$targetIndex].maxTroops - $slaveUnits[$targetIndex].troops>> + <<set _expLoss = ($slaveUnits[$targetIndex].maxTroops - $slaveUnits[$targetIndex].troops) / $slaveUnits[$targetIndex].troops>> + <<set $slaveUnits[$targetIndex].training -= $slaveUnits[$targetIndex].training * _expLoss>> + <<set $slaveUnits[$targetIndex].troops = $slaveUnits[$targetIndex].maxTroops>> + <<else>> + <<set $slavesEmployedManpower += $helots>> + <<set _expLoss = $helots / $slaveUnits[$targetIndex].troops>> + <<set $slaveUnits[$targetIndex].training -= $slaveUnits[$targetIndex].training * _expLoss>> + <<set $slaveUnits[$targetIndex].troops += $helots>> + <<set $helots = 0>> + <</if>> + <<goto "seeUnit">> + <</link>> + <</if>> + <br> + <<if $slaveUnits[$targetIndex].maxTroops < 50>> + <br> + <<link "Intensive officers training">> + <<set $slaveUnits[$targetIndex].maxTroops += 10>> + <<set $cash -= 5000>> + <<goto "seeUnit">> + <</link>> + Invest in the training of your officers to increase the maximum number of soldiers in the unit. + <br>//Costs 5000 per upgrade and each will increase the max by 10// + <<else>> + <br>Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead. + <</if>> + <<if $slaveUnits[$targetIndex].equip < 3>> + <br> + <<link "Improve weaponry and equipment">> + <<set $slaveUnits[$targetIndex].equip += 1>> + <<set $cash -= ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> + <<goto "seeUnit">> + <</link>> + Invest in better equipment for your soldiers to increase their battle effectiveness. + <br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.// + <<else>> + <br>The unit is equipped with state of the art weaponry and equipment. + <</if>> + <<if $slaveUnits[$targetIndex].commissars == 0>> + <br> + <<link "Attach commissars to the unit">> + <<set $slaveUnits[$targetIndex].commissars = 1>> + <<set $cash -= $equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of commissars to the unit. + <br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will slowly increase the loyalty of the unit.// + <<elseif $slaveUnits[$targetIndex].commissars < 2>> + <br> + <<link "Intensive loyalty training">> + <<set $slaveUnits[$targetIndex].commissars += 1>> + <<set $cash -= $equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Provide special training for the officers and the commissars of the unit. + <br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will increase the loyalty of the unit faster.// + <<elseif $slaveUnits[$targetIndex].commissars == 1>> + <br>The unit has a commissar detachment, keeping under control the ambitions of the unit's officers. + <<else>> + <br>The unit has a perfectly trained and loyal commissar detachment, keeping under control the ambitions of the unit's officers. + <</if>> + <<if $slaveUnits[$targetIndex].medics == 0>> + <br> + <<link "Attach trained medics to the unit">> + <<set $slaveUnits[$targetIndex].medics = 1>> + <<set $cash -= $equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of trained medics to the unit. + <br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will decrease the number of casualties suffered during battle.// + <<else>> + <br>The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers. + <</if>> + <<if $securityForceActive == 1>> + <<if $slaveUnits[$targetIndex].SF == 0>> + <br> + <<link "Attach Special Force advisors">> + <<set $slaveUnits[$targetIndex].SF = 1>> + <<set $cash -= ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 5000>> + <<goto "seeUnit">> + <</link>> + Attach $securityForceName advisors to the unit. + <br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.// + <<else>> + <br>The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <</if>> + <<if $showBattleStatistics == 1>> + <<if $slaveUnits[$targetIndex].training <= 10>> + <<set _expBonus = 0>> + <<elseif $slaveUnits[$targetIndex].training <= 33>> + <<set _expBonus = 10>> + <<elseif $slaveUnits[$targetIndex].training <= 66>> + <<set _expBonus = 25>> + <<else>> + <<set _expBonus = 50>> + <</if>> + <<if $slaveUnits[$targetIndex].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $slaveUnits[$targetIndex].loyalty <= 33>> + <<set _loyaltyBonus = 10>> + <<elseif $slaveUnits[$targetIndex].loyalty <= 66>> + <<set _loyaltyBonus = 20>> + <<else>> + <<set _loyaltyBonus = 30>> + <</if>> + <br> + <br>Slaves base attack: $slaveBaseAttack <<if $humanUpgrade.attack > 0>> + $humanUpgrade.attack <</if>>(<<print Math.round($slaveBaseAttack + $slaveBaseAttack * $slaveUnits[$targetIndex].equip * $equipMod + $slaveBaseAttack * _expBonus * 0.01 + $slaveBaseAttack * _loyaltyBonus * 0.01 + $slaveBaseAttack * $slaveUnits[$targetIndex].SF * 0.20)>>) + <br>Slaves base defense: $slaveBaseDefense <<if $humanUpgrade.defense > 0>> + $humanUpgrade.defense <</if>>(<<print Math.round($slaveBaseDefense + $slaveBaseDefense * $slaveUnits[$targetIndex].equip * $equipMod + $slaveBaseDefense * _expBonus * 0.01 + $slaveBaseDefense * _loyaltyBonus * 0.01 + $slaveBaseDefense * $slaveUnits[$targetIndex].SF * 0.20)>>) + <br>Equipment bonus: + <<print $slaveUnits[$targetIndex].equip * 15>>% + <<if _expBonus > 0>> + <br>Experience bonus: +<<print _expBonus>>% + <</if>> + <<if _loyaltyBonus > 0>> + <br>Loyalty bonus: +<<print _loyaltyBonus>>% + <</if>> + <<if $slaveUnits[$targetIndex].SF > 0>> + <br>Special Force advisors bonus: +20% + <</if>> + <br>Slaves base morale: $slaveBaseMorale <<if $humanUpgrade.morale > 0>> + $humanUpgrade.morale <</if>>(<<print Math.round($slaveBaseMorale + $slaveBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>) + <<if $secBarracksUpgrades.luxury > 0>> + <br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>% + <</if>> + <br>Slaves base hp: $slaveBaseHp <<if $humanUpgrade.hp > 0>> + $humanUpgrade.hp <</if>>(<<print Math.round($slaveBaseHp + $slaveBaseHp * $slaveUnits[$targetIndex].medics * 0.25)>>) + <<if $slaveUnits[$targetIndex].medics > 0>> + <br>Medics detachment bonus: +25% + <</if>> + <</if>> +<<elseif $targetUnit == "mercUnits">> + <<mercUnitsDescription $mercUnits[$targetIndex]>> + <br> + Rename unit <<textbox "$mercUnits[$targetIndex].platoonName" $mercUnits[$targetIndex].platoonName "seeUnit">> + <<if $mercUnits[$targetIndex].troops < $mercUnits[$targetIndex].maxTroops && $mercFreeManpower > 0>> + <br> + <<link "Replenish unit">> + <<if $mercFreeManpower >= $mercUnits[$targetIndex].maxTroops - $mercUnits[$targetIndex].troops>> + <<set $mercFreeManpower -= $mercUnits[$targetIndex].maxTroops - $mercUnits[$targetIndex].troops>> + <<set $mercEmployedManpower += $mercUnits[$targetIndex].maxTroops - $mercUnits[$targetIndex].troops>> + <<set _expLoss = ($mercUnits[$targetIndex].maxTroops - $mercUnits[$targetIndex].troops) / $mercUnits[$targetIndex].troops>> + <<set $mercUnits[$targetIndex].training -= $mercUnits[$targetIndex].training * _expLoss>> + <<set $mercUnits[$targetIndex].troops = $mercUnits[$targetIndex].maxTroops>> + <<else>> + <<set $mercEmployedManpower += $mercFreeManpower>> + <<set _expLoss = $mercFreeManpower / $mercUnits[$targetIndex].troops>> + <<set $mercUnits[$targetIndex].training -= $mercUnits[$targetIndex].training * _expLoss>> + <<set $mercUnits[$targetIndex].troops += $mercFreeManpower>> + <<set $mercFreeManpower = 0>> + <</if>> + <<goto "seeUnit">> + <</link>> + <</if>> + <br> + <<if $mercUnits[$targetIndex].maxTroops < 50>> + <br> + <<link "Intensive officers training">> + <<set $mercUnits[$targetIndex].maxTroops += 10>> + <<set $cash -= 5000>> + <<goto "seeUnit">> + <</link>> + Invest in the training of your officers to increase the maximum number of soldiers in the unit. + <br>//Costs 5000 per upgrade and each will increase the max by 10// + <<else>> + <br>Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead. + <</if>> + <<if $mercUnits[$targetIndex].equip < 3>> + <br> + <<link "Improve weaponry and equipment">> + <<set $mercUnits[$targetIndex].equip += 1>> + <<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>> + <<goto "seeUnit">> + <</link>> + Invest in better equipment for your soldiers to increase their battle effectiveness. + <br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.// + <<else>> + <br>The unit is equipped with state of the art weaponry and equipment. + <</if>> + <<if $mercUnits[$targetIndex].commissars == 0>> + <br> + <<link "Attach commissars to the unit">> + <<set $mercUnits[$targetIndex].commissars = 1>> + <<set $cash -= $equipUpgradeCost * $mercUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of commissars to the unit. + <br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>> and will slowly increase the loyalty of the unit.// + <<elseif $mercUnits[$targetIndex].commissars < 2>> + <br> + <<link "Intensive loyalty training">> + <<set $mercUnits[$targetIndex].commissars += 1>> + <<set $cash -= $equipUpgradeCost * $mercUnits[$targetIndex].maxTroops + 1000>> + <<goto "seeUnit">> + <</link>> + Provide special training for the officers and the commissars of the unit. + <br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>> and will increase the loyalty of the unit faster.// + <<elseif $mercUnits[$targetIndex].commissars == 1>> + <br>The unit has a commissar detachment, keeping under control the ambitions of the unit's officers. + <<else>> + <br>The unit has a perfectly trained and loyal commissar detachment, keeping under control the ambitions of the unit's officers. + <</if>> + <<if $mercUnits[$targetIndex].medics == 0>> + <br> + <<link "Attach trained medics to the unit">> + <<set $mercUnits[$targetIndex].medics = 1>> + <<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> + <<goto "seeUnit">> + <</link>> + Attach a small squad of trained medics to the unit. + <br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> and will decrease the number of casualties suffered during battle.// + <<else>> + <br>The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers. + <</if>> + <<if $securityForceActive == 1>> + <<if $mercUnits[$targetIndex].SF == 0>> + <br> + <<link "Attach Special Force advisors">> + <<set $mercUnits[$targetIndex].SF = 1>> + <<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> + <<goto "seeUnit">> + <</link>> + Attach $securityForceName advisors to the unit. + <br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.// + <<else>> + <br>The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <</if>> + <<if $showBattleStatistics == 1>> + <<if $mercUnits[$targetIndex].training <= 10>> + <<set _expBonus = 0>> + <<elseif $mercUnits[$targetIndex].training <= 33>> + <<set _expBonus = 10>> + <<elseif $mercUnits[$targetIndex].training <= 66>> + <<set _expBonus = 25>> + <<else>> + <<set _expBonus = 50>> + <</if>> + <<if $mercUnits[$targetIndex].loyalty <= 10>> + <<set _loyaltyBonus = 0>> + <<elseif $mercUnits[$targetIndex].loyalty <= 33>> + <<set _loyaltyBonus = 10>> + <<elseif $mercUnits[$targetIndex].loyalty <= 66>> + <<set _loyaltyBonus = 20>> + <<else>> + <<set _loyaltyBonus = 30>> + <</if>> + <br> + <br>Mercenaries base attack: $mercBaseAttack <<if $humanUpgrade.attack > 0>> + $humanUpgrade.attack <</if>>(<<print Math.round($mercBaseAttack + $mercBaseAttack * $mercUnits[$targetIndex].equip * $equipMod + $mercBaseAttack * _expBonus * 0.01 + $mercBaseAttack * _loyaltyBonus * 0.01 + $mercBaseAttack * $mercUnits[$targetIndex].SF * 0.20)>>) + <br>Mercenaries base defense: $mercBaseDefense <<if $humanUpgrade.defense > 0>> + $humanUpgrade.defense <</if>>(<<print Math.round($mercBaseDefense + $mercBaseDefense * $mercUnits[$targetIndex].equip * $equipMod + $mercBaseDefense * _expBonus * 0.01 + $mercBaseDefense * _loyaltyBonus * 0.01 + $mercBaseDefense * $mercUnits[$targetIndex].SF * 0.20)>>) + <br>Equipment bonus: + <<print $mercUnits[$targetIndex].equip * 15>>% + <<if _expBonus > 0>> + <br>Experience bonus: +<<print _expBonus>>% + <</if>> + <<if _loyaltyBonus > 0>> + <br>Loyalty bonus: +<<print _loyaltyBonus>>% + <</if>> + <<if $mercUnits[$targetIndex].SF > 0>> + <br>Special Force advisors bonus: +20% + <</if>> + <br>Mercenaries base morale: $mercBaseMorale <<if $humanUpgrade.morale > 0>> + $humanUpgrade.morale <</if>>(<<print Math.round($mercBaseMorale + $mercBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>) + <<if $secBarracksUpgrades.luxury > 0>> + <br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>% + <</if>> + <br>Mercenaries base hp: $mercBaseHp <<if $humanUpgrade.hp > 0>> + $humanUpgrade.hp <</if>>(<<print Math.round($mercBaseHp + $mercBaseHp * $mercUnits[$targetIndex].medics * 0.25)>>) + <<if $mercUnits[$targetIndex].medics > 0>> + <br>Medics detachment bonus: +25% + <</if>> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/tradeReport.tw b/src/SecExp/tradeReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..d08c807307a1297fc93fa12e4af8b9ce10a5d2d5 --- /dev/null +++ b/src/SecExp/tradeReport.tw @@ -0,0 +1,126 @@ +:: tradeReport [nobr] + +<<if $week < 30>> + The world economy is in good enough shape to sustain economic growth. Trade flows liberally in all the globe.<<set _tradeChange += 1>> +<<elseif $week < 60>> + The world economy is deteriorating, but still in good enough shape to sustain economic growth.<<set _tradeChange += 0.5>> +<<elseif $week < 90>> + The world economy is deteriorating, but still in decent enough shape to sustain economic growth. +<<elseif $week < 120>> + The world economy is deteriorating and the slowing down of global growth is starting to have some effect on trade flow.<<set _tradeChange -= 1>> +<<else>> + The world economy is heavily deteriorated. The slowing down of global growth has a great engative effect on trade flow.<<set _tradeChange -= 2>> +<</if>> + +<<set _tradeChange = 0>> +<<if $lastAttackWeeks < 2 && $hasFoughtOnce == 1>> + The recent attack has a negative effect on the trade of the arcology.<<set _tradeChange -= 1>> +<<elseif $lastAttackWeeks < 4 && $hasFoughtOnce == 1>> + 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>> + The recent rebellion has a negative effect on the trade of the arcology.<<set _tradeChange -= 1>> +<<elseif $lastRebellionWeeks < 4 && $hasRebelledOnce == 1>> + 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>> + +<<if $terrain == "urban">> + Since your arcology is located in the heart of an urban area, its commerce is naturally vibrant. + <<set _tradeChange++>> +<</if>> +<<if $terrain == "ravine">> + Since your arcology is located in the heart of a ravine, its commerce is hindered by a lack of accessability. + <<set _tradeChange -= 0.5>> +<</if>> + +<<if $PC.career == "wealth" || $PC.career == "capitalist" || $PC.career == "celebrity">> + <<set _tradeChange += 1>> +<<elseif $PC.career == "escort" || $PC.career == "servant" || $PC.career == "gang">> + <<set _tradeChange -= 0.5>> +<</if>> + +<<if $rep > 18000>> + Your extremely high reputation attracts trade from all over the world. +<<elseif $rep > 12000>> + Your high reputation attracts trade from all over the world. +<</if>> + +<<if $assistantPower == 1>> + Thanks to the computing power available to her, $assistantName is able to guide the commercial development of the arcology to greater levels. <<set _tradeChange++>> +<<elseif $assistantPower == 2>> + Thanks to the incredible computing power available to her, $assistantName is able to guide the commercial development of the arcology to greater levels. <<set _tradeChange += 2>> +<</if>> + +<<if $tradeLegalAid == 1>> + Your support in legal matters for new businesses helps improve the economic dynamicity of your arcology, boosting commercial activities.<<set _tradeChange += 1>> +<</if>> + +<<if $taxTrade == 1>> + The fees imposed on transitioning goods do little to earn you the favor of the companies making use of your arcology.<<set _tradeChange -= 1>> +<</if>> + +<<if $weapManu == 1>> + The weapons manufacturing facility of the arcology attracts a significant amount of trade. + <<set _tradeChange += 0.5 * ($weapProductivity + $weapLab)>> +<</if>> +<<if $transportHub == 1>> + <<if $airport == 1>> + The arcology's airport, while small, helps facilitate the commercial development of the arcology.<<set _tradeChange += 1>> + <<elseif $airport == 2>> + The arcology's airport, while fairly small, helps facilitate the commercial development of the arcology.<<set _tradeChange += 1.5>> + <<elseif $airport == 3>> + The arcology's airport helps facilitate the commercial development of the arcology.<<set _tradeChange += 2>> + <<elseif $airport == 4>> + The arcology's airport is a great boon to the commercial development of the arcology.<<set _tradeChange += 2.5>> + <<else>> + The arcology's airport is an incredible boon to the commercial development of the arcology.<<set _tradeChange += 3>> + <</if>> + + <<if $terrain != "oceanic" || $terrain != "marine">> + <<if $railway == 1>> + The railway network's age and limited extension limit commercial activity. + <<elseif $railway == 2>> + The railway network is a great help to the commercial development of the arcology, but its limited extension hampers its potential.<<set _tradeChange += 1>> + <<elseif $railway == 3>> + The railway network is a great help to the commercial development of the arcology.<<set _tradeChange += 1.5>> + <<else>> + The railway network is a huge help to the commercial development of the arcology. Few in the world can boast such a modern and efficient transport system.<<set _tradeChange += 2>> + <</if>> + <<else>> + <<if $docks == 1>> + The docks' age and limited size limit commercial activity. + <<elseif $docks == 2>> + The docks are a great help to the commercial development of the arcology, but their limited size hampers its potential.<<set _tradeChange += 1>> + <<elseif $docks == 3>> + The docks are a great help to the commercial development of the arcology.<<set _tradeChange += 1.5>> + <<else>> + The docks are a huge help to the commercial development of the arcology. Few in the world can boast such a modern and efficient transport system.<<set _tradeChange += 2>> + <</if>> + <</if>> +<</if>> + +<<if _tradeChange > 0>> + This week @@.green;trade improved.@@ +<<elseif _tradeChange == 0>> + This week @@.yellow;trade did not change.@@ +<<else>> + This week @@.red;trade diminished.@@ +<</if>> + +<<if $trade <= 20>> + The almost non-existent trade crossing the arcology @@.yellow;does little to promote growth@@. +<<elseif $trade <= 40>> + The low level of trade crossing the arcology promotes a @@.green;slow yet steady growth@@ of its economy. + <<set _AWeekGrowth += 1.5>> +<<elseif $trade <= 60>> + With trade at positive levels, the @@.green;prosperity of the arcology grows more powerful@@. + <<set _AWeekGrowth += 2.5>> +<<elseif $trade <= 80>> + With trade at high levels, the @@.green;prosperity of the arcology grows quickly and violently@@. + <<set _AWeekGrowth += 3.5>> +<<else>> + With trade at extremely high levels, the @@.green;prosperity of the arcology grows with unprecedented speed@@. + <<set _AWeekGrowth += 4.5>> +<</if>> + +<<set $trade = Math.clamp($trade + _tradeChange,0,100)>> \ No newline at end of file diff --git a/src/SecExp/transportHub.tw b/src/SecExp/transportHub.tw new file mode 100644 index 0000000000000000000000000000000000000000..f83f9aeb0427f147179c0416bfe72e175877b2c2 --- /dev/null +++ b/src/SecExp/transportHub.tw @@ -0,0 +1,189 @@ +:: transportHub [nobr] + +<<set $nextButton = "Back", $nextLink = "Main">> + +<strong>The Transport Hub</strong> +<hr> +You quickly reach the transport hub, where a constant stream of vehicles, people and goods greets you. Part of the structure is dedicated to air travel and the other is mainly occupied by <<if $terrain != "oceanic" || $terrain != "marine">>the rail station.<<else>> the docks.<</if>> + +<<if $limitImmigration == 1 || $AntiImmigrationRep == 1>> + Due to your strict policies concerning immigration, very few new citizens arrive in the transport hub. +<<elseif $openBorders == 1 || $ProImmigrationCash == 1>> + Due to your liberal policies concerning immigration, the transport hub is filled with a flow of new citizens. +<</if>> + +<<if $airport == 1>> + The arcology's airport is relatively small and poorly equipped. It can handle some traffic, but nothing noteworthy. +<<elseif $airport == 2>> + The arcology's airport is relatively small, but well equipped. It can handle some traffic, but nothing too serious. +<<elseif $airport == 3>> + The arcology's airport is good sized and well equipped. It can handle a good amount of traffic. +<<elseif $airport == 4>> + The arcology's airport is good sized and very well equipped. It can handle a lot of traffic. +<<else>> + The arcology's airport is huge and very well equipped. It can handle an impressive amount of traffic. +<</if>> + +<<if $terrain != "oceanic" || $terrain != "marine">> + <<if $railway == 1>> + The railway network is old and limited. It can handle some traffic, but not sustain commercial activity. + <<elseif $railway == 2>> + The railway network is modern and efficient, but limited in reach. It can handle some traffic, but not sustain commercial activity of any significant size. + <<elseif $railway == 3>> + The railway network is modern, efficient and expansive. It can handle a significant amount of traffic. + <<else>> + The railway network is high tech and very far reaching. It can handle an enormous amount of traffic. + <</if>> +<<else>> + <<if $docks == 1>> + The docks are old and small. They can handle some traffic, but not sustain commercial activity. + <<elseif $docks == 2>> + The docks are modern and efficient, but limited in size. They can handle some traffic, but not sustain commercial activity of significant size. + <<elseif $docks == 3>> + The docks are modern, efficient and expansive. They can handle a significant amount of traffic. + <<else>> + The docks are huge in size and high tech. They can handle an enormous amount of traffic. + <</if>> +<</if>> + +<<if $hubSecurity == 1>> + The security of the hub is limited to a few cameras and the occasional guard. +<<elseif $hubSecurity == 2>> + The security of the hub is guaranteed by a powerful camera surveillance system. +<<elseif $hubSecurity == 3>> + The security of the hub is guaranteed by a powerful camera surveillance system and a rapid response team constantly patrolling the structure. +<<else>> + The security of the hub is guaranteed by a powerful camera surveillance system, a rapid response team constantly patrolling the building and additional security drones making the rounds around the exterior. +<</if>> + +<br> +<br> + +<<if $trade <= 20>> + Trade is almost non-existent. Outside the supplies for the arcology's domestic consumption little else crosses the territory of the free city. +<<elseif $trade <= 40>> + Trade is low. There's some but limited commercial activity crossing the territory of the free city. +<<elseif $trade <= 60>> + Trade is at positive levels. There's a good amount commercial activity outside the supplies for the arcology's domestic consumption. +<<elseif $trade <= 80>> + Trade is at high levels. There's a lot of commercial activity outside the supplies for the arcology's domestic consumption. +<<else>> + Trade is at extremely high levels. There's a constant stream of commercial activity crossing the arcology. +<</if>> + +<br> +/* airport */ +<<if $airport == 1>> + <br> + <<link "Modernize the airport">> + <<set $cash -= 5000>> + <<set $airport++>> + <<goto "transportHub">> + <</link>> //Will cost ¤5000 and will increase trade, but will affect security// +<<elseif $airport == 2>> + <br> + <<link "Enlarge the airport">> + <<set $cash -= 15000>> + <<set $airport++>> + <<goto "transportHub">> + <</link>> //Will cost ¤15000 and will increase trade, but will affect security// +<<elseif $airport == 3>> + <br> + <<link "Further modernize the airport">> + <<set $cash -= 45000>> + <<set $airport++>> + <<goto "transportHub">> + <</link>> //Will cost ¤45000 and will increase trade, but will affect security// +<<elseif $airport == 4>> + <br> + <<link "Further enlarge the airport">> + <<set $cash -= 85000>> + <<set $airport++>> + <<goto "transportHub">> + <</link>> //Will cost ¤85000 and will increase trade, but will affect security// +<<else>> + <br> + The airport is fully upgraded. +<</if>> +<br> +/* trainyard/dockyard */ +<<if $terrain != "oceanic" || $terrain != "marine">> + <<if $railway == 1>> + <br> + <<link "Modernize the railway">> + <<set $cash -= 10000>> + <<set $railway++>> + <<goto "transportHub">> + <</link>> //Will cost ¤10000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<elseif $railway == 2>> + <br> + <<link "Enlarge the railway">> + <<set $cash -= 25000>> + <<set $railway++>> + <<goto "transportHub">> + <</link>> //Will cost ¤25000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<elseif $railway == 3>> + <br> + <<link "Further modernize and enlarge the railway">> + <<set $cash -= 65000>> + <<set $railway++>> + <<goto "transportHub">> + <</link>> //Will cost ¤65000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<else>> + <br> + The railway is fully upgraded. + <</if>> +<<else>> + <<if $docks == 1>> + <br> + <<link "Modernize the docks">> + <<set $cash -= 10000>> + <<set $docks++>> + <<goto "transportHub">> + <</link>> //Will cost ¤10000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<elseif $docks == 2>> + <br> + <<link "Enlarge the docks">> + <<set $cash -= 25000>> + <<set $docks++>> + <<goto "transportHub">> + <</link>> //Will cost ¤25000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<elseif $docks == 3>> + <br> + <<link "Further modernize and enlarge the docks">> + <<set $cash -= 65000>> + <<set $docks++>> + <<goto "transportHub">> + <</link>> //Will cost ¤65000, will increase trade and slightly lower arcology's upkeep, but will affect security// + <<else>> + <br> + The docks are fully upgraded. + <</if>> +<</if>> +<br> +/* security */ +<<if $hubSecurity == 1>> + <br> + <<link "Expand and modernize the surveillance system">> + <<set $cash -= 15000>> + <<set $hubSecurity++>> + <<goto "transportHub">> + <</link>> //Will cost ¤15000 and lower the transport hub security modifiers// +<<elseif $hubSecurity == 2>> + <br> + <<link "Establish a rapid response team">> + <<set $cash -= 35000>> + <<set $hubSecurity++>> + <<goto "transportHub">> + <</link>> //Will cost ¤35000 and further lower the transport hub security modifiers// +<<elseif $hubSecurity == 3>> + <br> + <<link "Add additional security drones to the structure">> + <<set $cash -= 55000>> + <<set $hubSecurity++>> + <<goto "transportHub">> + <</link>> //Will cost ¤55000 and further lower the transport hub security modifiers// +<<else>> + <br> + The hub security is fully upgraded +<</if>> \ No newline at end of file diff --git a/src/SecExp/unitsBattleReport.tw b/src/SecExp/unitsBattleReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..03024cbadabef52d797c0bd9e8c91aed614e3c5d --- /dev/null +++ b/src/SecExp/unitsBattleReport.tw @@ -0,0 +1,263 @@ +:: unitsBattleReport [nobr] + +<<if $losses == 0>> + <<if $deployingBots == 1>> + Your squadron of security drones participated in the battle, dominating the airspace and providing vital intelligence to the rest of the army. + During the battle they suffered no casualties. + <</if>> + <<if $SFIntervention == 1>> + <<print $securityForcePersonnel>> soldiers from $securityForceName joined the battle aboard their <<if $securityForceVehiclePower >= 4>> armored <</if>> vehicles <<if $securityForceAC130 > 0>> and their AC130<</if>>. + Free cities armies are a rare sight, but their power is undeniable and your $securityForceName is living testament of this. + During the battle they suffered no casualties. + <</if>> + <<if $deployingMilitia == 1>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].isDeployed == 1>> + $militiaUnits[_j].platoonName participated in the battle, your proud citizens defending with their lives their arcology. + During the battle they suffered no casualties. + <</if>> + <</for>> + <</if>> + <<if $deployingSlaves == 1>> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].isDeployed == 1>> + $slaveUnits[_j].platoonName participated in the battle. While a rare sight, your slave soldiers show no less willingness to fight for their arcology than their free counterparts, be it because of fear or devotion to their owner. + During the battle they suffered no casualties. + <</if>> + <</for>> + <</if>> + <<if $deployingMercs == 1>> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].isDeployed == 1>> + $mercUnits[_j].platoonName participated in the battle. Mercenaries are a common sight on the modern battlefield and yours are proud to serve their generous contractor. + During the battle they suffered no casualties. + <</if>> + <</for>> + <</if>> + +<<elseif $losses > 0>> + /* if the losses are more than zero */ + /* generates a list of randomized losses, from which each unit picks one at random */ + <<set _losses = $losses>> + <<if $SFIntervention == 1>> + <<set $deployedUnits++>> + <</if>> + <<set _averageLosses = Math.trunc(_losses / $deployedUnits)>> + <<set _lossesList = []>> + <<set _validityCount = 0>> + <<for _i = 0; _i < $deployedUnits; _i++>> + <<set _assignedLosses = Math.trunc(Math.clamp(_averageLosses + random(-5,5), 0, 100))>> + <<if _assignedLosses > _losses>> + <<set _assignedLosses = _losses>> + <<set _losses = 0>> + <<else>> + <<set _losses -= _assignedLosses>> + <</if>> + <<set _lossesList.push(_assignedLosses)>> + <<set _validityCount += _assignedLosses>> + <</for>> + <<if _losses > 0>> + <<set _lossesList[random(_lossesList.length - 1)] += _losses>> + <</if>> + <<set _lossesList.shuffle()>> + + /* sanity check for losses */ + <<set _count = 0>> + <<for _i = 0; _i < _lossesList.length; _i++>> + <<if !isInt(_lossesList[_i])>> + <<set _lossesList[_i] = 0>> + <</if>> + <<set _count += _lossesList[_i]>> + <</for>> + <<if _count < $losses>> + <<set _lossesList[random(_lossesList.length - 1)] += $losses - _count>> + <<elseif _count > $losses>> + <br>@@.red;Error: assigned losses higher than actual losses@@ + <</if>> + + /* assigns the losses and notify the player */ + <<if $deployingBots == 1>> + <br> + <br> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$secBots.troops)>> + <<set $secBots.troops -= _loss>> + Your squadron of security drones participated in the battle, dominating the airspace and providing vital intelligence to the rest of the army. + During the battle they suffered + <<if _loss <= 0>> + no casualties. + <<elseif _loss <= 10>> + light casualties. + <<elseif _loss <= 30>> + moderate casualties. + <<elseif _loss <= 60>> + heavy casualties. + <<else>> + catastrofic casualties. + <</if>> + <<if $secBots.troops <= 0>> + <<set $secBots.active = 0>> + Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. It will take quite the investment to rebuild them. + <<elseif $secBots.troops <= 10>> + The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <<if $SFIntervention == 1>> + <br> + <br> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$securityForcePersonnel)>> + <<set $securityForcePersonnel -= _loss>> + <<print $securityForcePersonnel>> soldiers from the $securityForceName joined the battle aboard their <<if $securityForceVehiclePower >= 4>> armored <</if>> vehicles <<if $securityForceAC130 > 0>> and their AC130<</if>>. + Free cities armies are a rare sight, but their power is undeniable and your $securityForceName is living testament of this. + During the battle they suffered + <<if _loss <= 0>> + no casualties. + <<elseif _loss <= 10>> + light casualties. + <<elseif _loss <= 30>> + moderate casualties. + <<elseif _loss <= 60>> + heavy casualties. + <<else>> + catastrofic casualties. + <</if>> + <</if>> + <<if $deployingMilitia == 1>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].isDeployed == 1>> + <br> + <br> + <<set $militiaUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$militiaUnits[_j].troops)>> + $militiaUnits[_j].platoonName participated in the battle, your proud citizens defending with their lives their arcology. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $militiaUnits[_j].medics * 0.25,1,_loss))>> + <<if $militiaUnits[_j].medics == 1 && _loss > 0>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $militiaUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$militiaUnits[_j].maxTroops))>> + <<set $militiaEmployedManpower -= Math.trunc(_loss - _med)>> + <<set $militiaTotalCasualties += Math.trunc(_loss - _med)>> + <<if $militiaUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $militiaUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $militiaUnits[_j].troops <= 0>> + <<set $militiaUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The remnants will be sent home honored as veterans or reorganized in a new unit. + <<elseif $militiaUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> + <<if $deployingSlaves == 1>> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].isDeployed == 1>> + <br> + <br> + <<set $slaveUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$slaveUnits[_j].troops)>> + $slaveUnits[_j].platoonName participated in the battle. While a rare sight, your slave soldiers show no less willingness to fight for their arcology than their free counterparts, be it because of fear or devotion to their owner. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $slaveUnits[_j].medics * 0.25,1,_loss))>> + <<if $slaveUnits[_j].medics == 1 && _loss > 0>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $slaveUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$slaveUnits[_j].maxTroops))>> + <<set $slavesEmployedManpower -= Math.trunc(_loss - _med)>> + <<set $slavesTotalCasualties += Math.trunc(_loss - _med)>> + <<if $slaveUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $slaveUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $slaveUnits[_j].troops <= 0>> + <<set $slaveUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The sorvivors will be sent home honored as veterans or reorganized in a new unit. + <<elseif $slaveUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> + <<if $deployingMercs == 1>> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].isDeployed == 1>> + <br> + <br> + <<set $mercUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$mercUnits[_j].troops)>> + $mercUnits[_j].platoonName participated in the battle. Mercenaries are a common sight on the modern battlefield and yours are proud to serve their generous contractor. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $mercUnits[_j].medics * 0.25,1,_loss))>> + <<if $mercUnits[_j].medics == 1 && _loss > 0>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $mercUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$mercUnits[_j].maxTroops))>> + <<set $mercEmployedManpower -= Math.trunc(_loss - _med)>> + <<set $mercTotalCasualties += Math.trunc(_loss - _med)>> + <<if $mercUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $mercUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $mercUnits[_j].troops <= 0>> + <<set $mercUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The remnants will be sent home honored as veterans or reorganized in a new unit. + <<elseif $mercUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> +<<else>> + <br>@@.red;Error: losses are a negative number or NaN@@ +<</if>> /* closes check for more than zero casualties */ \ No newline at end of file diff --git a/src/SecExp/unitsRebellionReport.tw b/src/SecExp/unitsRebellionReport.tw new file mode 100644 index 0000000000000000000000000000000000000000..5f722c683e42006675d3bd332059353ef7c0f589 --- /dev/null +++ b/src/SecExp/unitsRebellionReport.tw @@ -0,0 +1,663 @@ +:: unitsRebellionReport [nobr] + +<<if $losses == 0>> + <<if $irregulars > 0>> + The volounteeing citizens were quickly organized into an irregular militia unit and deployed in the arcology. While without the discipline of your other instruments, they nonetheless provided precious extra firepower and standing strength. + During the battle they suffered no casualties. + <</if>> + <<if $deployingBots == 1>> + <br> + Your squadron of security drones participated in the battle, dominating the airspace and providing vital intelligence to the rest of the army. + During the battle they suffered no casualties. + <</if>> + <<if $securityForceCreate == 1>> + <br> + $securityForceName, $securityForcePersonnel strong, was called to join the battle aboard their<<if $securityForceVehiclePower >= 4>> armored<</if>> vehicles <<if $securityForceAC130 > 0>>and their AC130<</if>>. + They brought their unmatched strength to crush those that would want you deposed. + During the battle they suffered no casualties. + <</if>> + <<set _count = 0>> + <<if $loyalID.length > 0>> + <br> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && ($loyalID.includes($militiaUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $militiaUnits[_i].platoonName, + <<else>> + $militiaUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && ($loyalID.includes($slaveUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $slaveUnits[_i].platoonName, + <<else>> + $slaveUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && ($loyalID.includes($mercUnits[_i].ID))>> + <<set _count++>> + <<if _count < $loyalID.length>> + $mercUnits[_i].platoonName, + <<else>> + $mercUnits[_i].platoonName + <</if>> + <</if>> + <</for>> + participated in the battle without taking any casualties. They remained loyal until the end. + <</if>> + <<if $rebellingID.length > 0>> + <br> + <br> + /* militia */ + <<set _militiaRebelledID = []>> + <<set _militiaManpower = 0>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].active == 1 && $rebellingID.includes($militiaUnits[_j].ID)>> + $militiaUnits[_j].platoonName, + <<set _militiaRebelledID.push($militiaUnits[_j].ID)>> + <<set _militiaManpower += Math.clamp($militiaUnits[_j].troops - random(_averageLosses),0,$militiaUnits[_j].troops)>> + <</if>> + <</for>> + <<if _militiaRebelledID.length > 0>> + had the gall to betray you and join your enemies. + <span id="militiaResult"> + <br><<link "Dissolve the units">> + <<removeUnits _militiaRebelledID>> + <<set $militiaFreeManpower += _militiaManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1>> + <<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatvely influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _militiaRebelledID>> + <<set $militiaFreeManpower += _militiaManpower * 0.5>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _militiaRebelledID>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1>> + <<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + + /* slaves */ + <<set _slaveRebelledID = []>> + <<set _slaveManpower = 0>> + <br> + <br> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].active == 1 && $rebellingID.includes($slaveUnits[_j].ID)>> + $slaveUnits[_j].platoonName, + <<set _slaveRebelledID.push($slaveUnits[_j].ID)>> + <<set _slaveManpower += Math.clamp($slaveUnits[_j].troops - random(_averageLosses),0,$slaveUnits[_j].troops)>> + <</if>> + <</for>> + <<if _slaveRebelledID.length > 0>> + decided in their blind arrogance to betray you. + <span id="slaveResult"> + <br><<link "Dissolve the units">> + <<removeUnits _slaveRebelledID>> + <<set $helots += _slaveManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1>> + <<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatively influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _slaveRebelledID>> + <<set $helots += _slaveManpower * 0.5>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _slaveRebelledID>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1>> + <<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + + /* mercs */ + <<set _mercRebelledID = []>> + <<set _mercManpower = 0>> + <br> + <br> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].active == 1 && $rebellingID.includes($mercUnits[_j].ID)>> + $mercUnits[_j].platoonName, + <<set _mercRebelledID.push($mercUnits[_j].ID)>> + <<set _mercManpower += Math.clamp($mercUnits[_j].troops - random(_averageLosses),0,$mercUnits[_j].troops)>> + <</if>> + <</for>> + <<if _mercRebelledID.length > 0>> + made the grave mistake of betraying you. + <span id="mercResult"> + <br><<link "Dissolve the units">> + <<removeUnits _mercRebelledID>> + <<set $mercFreeManpower += _mercManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $mercUnits[_i].active == 1>> + <<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatively influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _mercRebelledID>> + <<set $mercFreeManpower += _mercManpower * 0.5>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _mercRebelledID>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1>> + <<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + <</if>> + +<<elseif $losses > 0>> + /* if the losses are more than zero */ + /* generates a list of randomized losses, from which each unit picks one at random */ + <<if $securityForceCreate == 1>> + <<set $deployedUnits++>> + <</if>> + <<if $irregulars > 0>> + <<set $deployedUnits++>> + <</if>> + <<set _averageLosses = Math.trunc($losses / $deployedUnits)>> + <<set _lossesList = []>> + <<for _i = 0; _i < $deployedUnits; _i++>> + <<set _assignedLosses = Math.trunc(Math.clamp(_averageLosses + random(-5,5), 0, 100))>> + <<if _assignedLosses > $losses>> + <<set _assignedLosses = $losses>> + <<set $losses = 0>> + <<else>> + <<set $losses -= _assignedLosses>> + <</if>> + <<set _lossesList.push(_assignedLosses)>> + <</for>> + <<if $losses > 0>> + <<set _lossesList[random(_lossesList.length - 1)] += $losses>> + <</if>> + <<set _lossesList.shuffle()>> + + /* assigns the losses and notify the player */ + <<if $irregulars > 0>> + <br> + <br> + <<set _loss = _lossesList.pluck()>> + <<if _loss < $ACitizens + 100>> + <<set $ACitizens -= _loss>> + <<else>> + <<set $ACitizens = 100>> + <</if>> + The volounteeing citizens were quickly organized into an irregular militia unit and deployed in the arcology. While without the discipline of your other instruments, they nonetheless provided precious extra firepower and standing strength. + During the battle they suffered + <<if _loss <= 0>> + no casualties. + <<elseif _loss <= 10>> + light casualties. + <<elseif _loss <= 30>> + moderate casualties. + <<elseif _loss <= 60>> + heavy casualties. + <<else>> + catastrofic casualties. + <</if>> + <</if>> + <<if $secBots.active == 1>> + <br> + <br> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$secBots.troops)>> + <<set $secBots.troops -= _loss>> + Your squadron of security drones participated in the battle, dominating the airspace and providing vital intelligence to the rest of the army. + During the battle they suffered + <<if _loss <= 0>> + no casualties. + <<elseif _loss <= 10>> + light casualties. + <<elseif _loss <= 30>> + moderate casualties. + <<elseif _loss <= 60>> + heavy casualties. + <<else>> + catastrofic casualties. + <</if>> + <<if $secBots.troops <= 0>> + <<set $secBots.active = 0>> + Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. It will take quite the investment to rebuild them. + <<elseif $secBots.troops <= 10>> + The unit has very few operatives left, it risks compelte annihilation if deployed again. + <</if>> + <</if>> + <<if $securityForceCreate == 1>> + <br> + <br> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$securityForcePersonnel)>> + <<set $securityForcePersonnel -= _loss>> + $securityForceName, $securityForcePersonnel strong, is called to join the battle aboard their<<if $securityForceVehiclePower >= 4>>armored<</if>>vehicles<<if $securityForceAC130 > 0>>and their AC130<</if>>. + They brought their unmatched strength to crush those that would want you deposed. + During the battle they suffered + <<if _loss <= 0>> + no casualties. + <<elseif _loss <= 10>> + light casualties. + <<elseif _loss <= 30>> + moderate casualties. + <<elseif _loss <= 60>> + heavy casualties. + <<else>> + catastrofic casualties. + <</if>> + <</if>> + <<if $deployingMilitia == 1>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].active == 1 && $loyalID.includes($militiaUnits[_j].ID)>> + <br> + <br> + <<set $militiaUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$militiaUnits[_j].troops)>> + $militiaUnits[_j].platoonName participated in the battle. They remained loyal to you to the end. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $militiaUnits[_j].medics * 0.25,1,_loss))>> + <<if $militiaUnits[_j].medics == 1>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $militiaUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$militiaUnits[_j].maxTroops))>> + <<set $militiaEmployedManpower -= Math.trunc(_loss - _med)>> + <<set $militiaTotalCasualties += Math.trunc(_loss - _med)>> + <<if $militiaUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $militiaUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $militiaUnits[_j].troops <= 0>> + <<set $militiaUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The remnants will be sent home honored as veterans or reorganized in a new unit. + <<elseif $militiaUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> + <<if $deployingSlaves == 1>> + <<set _med = 0>> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].active == 1 && $loyalID.includes($slaveUnits[_j].ID)>> + <br> + <br> + <<set $slaveUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<if !(Number.isInteger(_loss))>> + <br>@@.red;Error: failed to assign losses, input was negative or NaN@@ + <<break>> + <</if>> + <<set _loss = Math.clamp(_loss,0,$slaveUnits[_j].troops)>> + $slaveUnits[_j].platoonName participated in the battle. They remained loyal to you to the end. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $slaveUnits[_j].medics * 0.25,1,_loss))>> + <<if $slaveUnits[_j].medics == 1>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $slaveUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$slaveUnits[_j].maxTroops))>> + <<set $slavesEmployedManpower -= _loss - _med>> + <<set $slavesTotalCasualties += _loss - _med>> + <<if $slaveUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $slaveUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $slaveUnits[_j].troops <= 0>> + <<set $slaveUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The sorvivors will be sent home honored as veterans or reorganized in a new unit. + <<elseif $slaveUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> + <<if $deployingMercs == 1>> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].active == 1 && $loyalID.includes($mercUnits[_j].ID)>> + <br> + <br> + <<set $mercUnits[_j].battlesFought++>> + <<set _loss = _lossesList.pluck()>> + <<set _loss = Math.clamp(_loss,0,$mercUnits[_j].troops)>> + $mercUnits[_j].platoonName participated in the battle. Mercenaries are a common sight on the modern battlefield and yours are proud to serve their generous contractor. + During the battle they suffered + <<if _loss <= 0>> + no casualties + <<elseif _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> + <<set _med = Math.round(Math.clamp(_loss * $mercUnits[_j].medics * 0.25,1,_loss))>> + <<if $mercUnits[_j].medics == 1>> + , however some men were saved by the medics attached to this unit. + <<else>> + . + <</if>> + <<set $mercUnits[_j].troops -= Math.trunc(Math.clamp(_loss - _med,0,$mercUnits[_j].maxTroops))>> + <<set $mercEmployedManpower -= Math.trunc(_loss - _med)>> + <<set $mercTotalCasualties += Math.trunc(_loss - _med)>> + <<if $mercUnits[_j].training < 100>> + <<if random(1,100) > 60>> + Fighting in the field increased the experience of the unit, making it more effective in future fights. + <<set $mercUnits[_j].training += random(5,15) + $majorBattle * random(5,15)>> + <</if>> + <</if>> + <<if $mercUnits[_j].troops <= 0>> + <<set $mercUnits[_j].active = 0>> + <br>Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit. The remnants will be sent home honored as veterans or reorganized in a new unit. + <<elseif $mercUnits[_j].troops <= 10>> + <br>The unit has very few operatives left, it risks complete annihilation if deployed again. + <</if>> + <</if>> + <</for>> + <</if>> + <br> + <br> + <<if $rebellingID.length > 0 && $battleResult >= 2>> + /* win */ + /* militia */ + <<set _militiaRebelledID = []>> + <<set _militiaManpower = 0>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].active == 1 && $rebellingID.includes($militiaUnits[_j].ID)>> + $militiaUnits[_j].platoonName, + <<set _militiaRebelledID.push($militiaUnits[_j].ID)>> + <<set _militiaManpower += Math.clamp($militiaUnits[_j].troops - random(_averageLosses),0,$militiaUnits[_j].troops)>> + <</if>> + <</for>> + <<if _militiaRebelledID.length > 0>> + had the gall to betray you and join your enemies. + <span id="militiaResult"> + <br><<link "Dissolve the units">> + <<removeUnits _militiaRebelledID>> + <<set $militiaFreeManpower += _militiaManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1>> + <<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatvely influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _militiaRebelledID>> + <<set $militiaFreeManpower += _militiaManpower * 0.5>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _militiaRebelledID>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1>> + <<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#militiaResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + + /* slaves */ + <<set _slaveRebelledID = []>> + <<set _slaveManpower = 0>> + <br> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].active == 1 && $rebellingID.includes($slaveUnits[_j].ID)>> + $slaveUnits[_j].platoonName, + <<set _slaveRebelledID.push($slaveUnits[_j].ID)>> + <<set _slaveManpower += Math.clamp($slaveUnits[_j].troops - random(_averageLosses),0,$slaveUnits[_j].troops)>> + <</if>> + <</for>> + <<if _slaveRebelledID.length > 0>> + decided in their blind arrogance to betray you. + <span id="slaveResult"> + <br><<link "Dissolve the units">> + <<removeUnits _slaveRebelledID>> + <<set $helots += _slaveManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1>> + <<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatively influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _slaveRebelledID>> + <<set $helots += _slaveManpower * 0.5>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _slaveRebelledID>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1>> + <<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#slaveResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + + /* mercs */ + <<set _mercRebelledID = []>> + <<set _mercManpower = 0>> + <br> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].active == 1 && $rebellingID.includes($mercUnits[_j].ID)>> + $mercUnits[_j].platoonName, + <<set _mercRebelledID.push($mercUnits[_j].ID)>> + <<set _mercManpower += Math.clamp($mercUnits[_j].troops - random(_averageLosses),0,$mercUnits[_j].troops)>> + <</if>> + <</for>> + <<if _mercRebelledID.length > 0>> + made the grave mistake of betraying you. + <span id="mercResult"> + <br><<link "Dissolve the units">> + <<removeUnits _mercRebelledID>> + <<set $mercFreeManpower += _mercManpower>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $mercUnits[_i].active == 1>> + <<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty - random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Units dissolved. + <</replace>> + <</link>> + <br>//Manpower will be refunded, but will negatively influence the loyalty of the other units// + <br><<link "Purge the dissidents and dissolve the units">> + <<removeUnits _mercRebelledID>> + <<set $mercFreeManpower += _mercManpower * 0.5>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Dissidents purged and units dissolved. + <</replace>> + <</link>> + <br>//Will not influence the loyalty of the other units, but only half the manpower will be refunded.// + <br><<link "Execute them all">> + <<removeUnits _mercRebelledID>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1>> + <<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + random(10,40),0,100)>> + <</if>> + <</for>> + <<recalcManpower>> + <<replace "#mercResult">> + <br>Units executed. Dissent will not be tolerated. + <</replace>> + <</link>> + <br>//Will positively influence the loyalty of the other units, but no manpower will be refunded.// + </span> + <</if>> + + /* loss */ + <<elseif $rebellingID.length > 0>> + <<set _militiaRebelledID = []>> + <<for _j = 0; _j < $militiaUnits.length; _j++>> + <<if $militiaUnits[_j].active == 1 && $rebellingID.includes($militiaUnits[_j].ID)>> + <<set _militiaRebelledID.push($militiaUnits[_j].ID)>> + $militiaUnits[_j].platoonName, + <</if>> + <</for>> + <<if _militiaRebelledID.length > 0>> + had the gall to betray you and join your enemies. They participated in the looting following the battle, then vanished in the wastes. + <</if>> + <<set $cash -= 1000 * _militiaRebelledID.length>> + <br> + <<removeUnits _militiaRebelledID>> + <<set _slaveRebelledID = []>> + <<for _j = 0; _j < $slaveUnits.length; _j++>> + <<if $slaveUnits[_j].active == 1 && $rebellingID.includes($slaveUnits[_j].ID)>> + <<set _slaveRebelledID.push($slaveUnits[_j].ID)>> + $slaveUnits[_j].platoonName, + <</if>> + <</for>> + <<if _slaveRebelledID.length > 0>> + decided in their blind arrogance to betray you. They participated in the looting following the battle, then vanished in the wastes. + <</if>> + <<set $cash -= 1000 * _slaveRebelledID.length>> + <<removeUnits _slaveRebelledID>> + <br> + <<set _mercRebelledID = []>> + <<set _count = 0>> + <<for _j = 0; _j < $mercUnits.length; _j++>> + <<if $mercUnits[_j].active == 1 && $rebellingID.includes($mercUnits[_j].ID)>> + <<set _mercRebelledID.push($mercUnits[_j].ID)>> + <<set _count++>> + $mercUnits[_j].platoonName, + <</if>> + <</for>> + <<if _mercRebelledID.length > 0>> + made the grave mistake of betraying you. They participated in the looting following the battle, then vanished in the wastes. + <</if>> + <<set $cash -= 1000 * _mercRebelledID.length>> + <<removeUnits _mercRebelledID>> + <<recalcManpower>> + <</if>> +<<else>> + <br>@@.red;Error: losses are a negative number or NaN@@ +<</if>> \ No newline at end of file diff --git a/src/SecExp/weaponsManufacturing.tw b/src/SecExp/weaponsManufacturing.tw new file mode 100644 index 0000000000000000000000000000000000000000..d6625980af5554e4670c26a0e79f22df817366d0 --- /dev/null +++ b/src/SecExp/weaponsManufacturing.tw @@ -0,0 +1,455 @@ +:: weaponsManufacturing [nobr] + +<<set $nextButton = "Back", $nextLink = "Main">> + +This sector of the arcology has been dedicated to weapons manufacturing. These factories supply +<<if $militiaUnits.length > 0>> your militia and<</if>> +<<if $slaveUnits.length > 0>> your slave soldiers and<</if>> +<<if $mercenaries >0>> your mercenaries and<</if>> +many small old world nations as the advanced technology that free cities have available is hard to come by otherwise. +<br> +<<if $weapProductivity == 1>> + Production is completely manned by human workers. The complex has close to zero automation. +<<elseif $weapProductivity == 2>> + Production is mostly handled by human workers. A few of the most tiresome tasks are handled by robots. +<<elseif $weapProductivity == 3>> + A good part of production is handled by robots with humans handling the most complex tasks. +<<elseif $weapProductivity == 4>> + Almost all production is handled by robots, with humans acting as support for the machines. +<<else>> + All production here is handled by robots. The few humans working in the complex occupy themselves exclusively with management and quality assurance. +<</if>> +<br> +<<if $weapLab == 1>> + There's a very Spartan lab attached to the complex that occupies itself mainly with weapons testing and small adjustments to the manufacturing process. +<<elseif $weapLab == 2>> + There's a lab attached to the complex. It mainly test weapons effectiveness and manufacturing efficiency, but has enough equipment and personnel to develop new technology. +<<else>> + There's a large lab attached to the complex. The complement of equipment and personnel makes it a great beacon of military science in an otherwise ignorant world. +<</if>> +<br> +<<if $weapHelots> 0>>Assigned here are $weapHelots slaves working to produce as much equipment as possible<<else>>There are no assigned menial slaves here. The spaces is manned exclusively by low rank citizens.<</if>> +You own $helots free menial slaves. This manufacturing complex can house 500 at most, with <<print 500 - $weapHelots>> free slots. +<br> +<<silently>><<MenialPopCap>><</silently>> +<<set _menialPrice = Math.trunc(($slaveCostFactor*1000)/100)*100>> +<<set _menialPrice = Math.clamp(_menialPrice, 500, 1500)>> +<<if $PopCap > $helots+$fuckdolls+$menialBioreactors || $helots+$fuckdolls+$menialBioreactors == 0>> + <br> + [[Buy|weaponsManufacturing][$helots+=1,$menialDemandFactor+=1,$cash-=_menialPrice]] + <<if $cash > _menialPrice*10>> + [[(x10)|weaponsManufacturing][$helots+=10,$menialDemandFactor+=10,$cash-=_menialPrice*10]] + <</if>> + <<if $cash > _menialPrice*100>> + [[(x100)|weaponsManufacturing][$helots+=100,$menialDemandFactor+=100,$cash-=_menialPrice*100]] + <</if>> + <<if $cash > _menialPrice*2>> + [[(max)|weaponsManufacturing][$helots+=Math.trunc($cash/(_menialPrice)),$menialDemandFactor+=Math.trunc($cash/(_menialPrice)),$cash-=Math.trunc($cash/(_menialPrice))*(_menialPrice)]] + <</if>> +<</if>> +<br> +<<if $weapHelots < 500>> + <<if $helots >= 1>> + <<link "Transfer a menial slave">> + <<set $helots-->> + <<set $weapHelots++>> + <<goto "weaponsManufacturing">> + <</link>> + <</if>> + <<if $helots >= 10 && $weapHelots <= 490>> + | + <<link "Transfer 10 menial slaves">> + <<set $helots -= 10>> + <<set $weapHelots += 10>> + <<goto "weaponsManufacturing">> + <</link>> + <</if>> + <<if $helots > 0>> + | + <<link "Transfer all free menial slaves">> + <<if $helots > 500 - $weapHelots>> + <<set $helots -= 500 - $weapHelots>> + <<set $weapHelots = 500>> + <<else>> + <<set $weapHelots += $helots>> + <<set $helots = 0>> + <</if>> + <<goto "weaponsManufacturing">> + <</link>> + <</if>> + <<if $weapHelots > 0>> + <br> + <<link "Transfer out all menial slaves">> + <<set $helots += $weapHelots>> + <<set $weapHelots = 0>> + <<goto "weaponsManufacturing">> + <</link>> + <</if>> +<<else>> + The complex does not require more workers. +<</if>> +<br> +<br> +<<if $weapProductivity < 5>> + <<link "Invest in automating the complex">> + <<set $cash -= 10000 * $weapProductivity>> + <<set $weapProductivity++>> + <<if $currentUpgrade.time > 0>> + <<set _percentComplete = $currentUpgrade.time / ($baseUpgradeTime / ($weapProductivity - 1))>> + <<set _newTime = Math.ceil(_percentComplete * $baseUpgradeTime / $weapProductivity)>> + <<set $currentUpgrade.time = _newTime>> + <</if>> + <<goto "weaponsManufacturing">> + <</link>> + //Will cost <<print 10000 * $weapProductivity>> and will increase the facility income in addition to speeding up upgrade production.// +<<elseif $weapLab < 3>> + You have fully automated the complex. +<</if>> +<br> +<<if $weapLab < 3>> + <<link "Invest in research and development">> + <<set $cash -= 10000 * $weapLab>> + <<set $weapLab++>> + <<goto "weaponsManufacturing">> + <</link>> + //Will cost <<print 10000 * $weapLab>> and will increase the facility income as well as unlock upgrades for our troops// +<<elseif $weapProductivity < 5>> + You have fully upgraded and funded the R&D department +<</if>> +<<if $weapLab >= 3 && $weapProductivity >= 5>> + The facility is completely automated and its R&D department is fully upgraded and funded. +<</if>> +<br> +<br> +__Markets__: +<br> +<<if $sellTo.citizen == 1>> + We are currently selling our weapons to the domestic market of the arcology. + <<link "Forbid">> + <<set $sellTo.citizen = 0>> + <<goto "weaponsManufacturing">> + <</link>> +<<else>> + We are not selling our weaponry to our citizens. + <<link "Allow">> + <<set $sellTo.citizen = 1>> + <<goto "weaponsManufacturing">> + <</link>> +<</if>> +<br> +<<if $sellTo.raiders == 1>> + We are currently selling our weapons to various groups of outlaws, also known as raiders. + <<link "Forbid">> + <<set $sellTo.raiders = 0>> + <<goto "weaponsManufacturing">> + <</link>> +<<else>> + We are not selling our weaponry to raiders. + <<link "Allow">> + <<set $sellTo.raiders = 1>> + <<goto "weaponsManufacturing">> + <</link>> +<</if>> +<br> +<<if $sellTo.oldWorld == 1>> + We are currently selling our weapons to many old world nations. + <<link "Forbid">> + <<set $sellTo.oldWorld = 0>> + <<goto "weaponsManufacturing">> + <</link>> +<<else>> + We are not selling our weaponry to old world nations. + <<link "Allow">> + <<set $sellTo.oldWorld = 1>> + <<goto "weaponsManufacturing">> + <</link>> +<</if>> +<br> +<<if $sellTo.FC == 1>> + We are currently selling our weapons to other free cities. + <<link "Forbid">> + <<set $sellTo.FC = 0>> + <<goto "weaponsManufacturing">> + <</link>> +<<else>> + We are not selling our weaponry to other free cities. + <<link "Allow">> + <<set $sellTo.FC = 1>> + <<goto "weaponsManufacturing">> + <</link>> +<</if>> +<br>//You are free to sell to whoever you please, but expect hostile forces of a certain kind to be stronger if we'll ever meet in battle.// +<br> +<br> +<<set _time = $baseUpgradeTime / $weapProductivity>> +__Upgrades__: +<br>With our current industrial and research capabilities upgrades will be finished in <<print _time>> weeks. +<br> +<<if $currentUpgrade.time <= 0>> + <br>Security Drones: + <br> + /* Drones upgrades */ + <<if !$completedUpgrades.includes(-1)>> + <<link "Develop dynamic battle aware AI">> + <<set $currentUpgrade = { + ID: -1, + name: "dynamic battle aware AI", + unit: 0, + type: "attack", + time: _time}>> + <<set $cash -= 10000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤10000 and will increase the base attack value of the security drones.// + <<elseif !$completedUpgrades.includes(-2) && $weapLab >= 2>> + <<link "Develop adaptive armored frames">> + <<set $currentUpgrade = { + ID: -2, + name: "adaptive armored frames", + unit: 0, + type: "defense", + time: _time}>> + <<set $cash -= 10000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤10000 and will increase the base defense value of the security drones.// + <<elseif !$completedUpgrades.includes(-3) && $weapLab >= 3>> + <br> + <<link "Develop advanced synthetic alloys">> + <<set $currentUpgrade = { + ID: -3, + name: "advanced synthetic alloys", + unit: 0, + type: "hp", + time: _time}>> + <<set $cash -= 30000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤30000 and will increase the base hp value of the security drones.// + <<elseif $secBotsBaseDefense <= 3 || $droneUpgrades >= 3>> + Upgrade the research facility further to unlock more upgrades for the security drones. + <<else>> + You fully upgraded the security drones. + <</if>> + <br><br> + /* human troops upgrades */ + <br>Troops: + <br> + <<if !$completedUpgrades.includes(0)>> + <<link "Develop magnetic based ballistic weaponry">> + <<set $currentUpgrade = { + ID: 0, + name: "magnetic based ballistic weaponry", + unit: 1, + type: "attack", + time: _time}>> + <<set $cash -= 30000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤30000 and will increase the base attack value of human troops.// + <br> + <</if>> + <<if !$completedUpgrades.includes(1)>> + <<link "Develop ceramo-metallic alloys">> + <<set $currentUpgrade = { + ID: 1, + name: "ceramo-metallic alloys", + unit: 1, + type: "defense", + time: _time}>> + <<set $cash -= 30000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤30000 and will increase the base defense value of human troops.// + <</if>> + <<if !$completedUpgrades.includes(2) && $weapLab >= 2>> + <br> + <<link "Develop rapid action stimulants">> + <<set $currentUpgrade = { + ID: 2, + name: "rapid action stimulants", + unit: 1, + type: "hp", + time: _time}>> + <<set $cash -= 60000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤60000 and will increase the base hp value of human troops.// + <br> + <</if>> + <<if !$completedUpgrades.includes(3) && $weapLab >= 2>> + <<link "Develop fast response neural stimulant">> + <<set $currentUpgrade = { + ID: 3, + name: "fast response neural stimulant", + unit: 1, + type: "morale", + time: _time}>> + <<set $cash -= 60000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤60000 and will increase the base morale value of human troops.// + <</if>> + <<if !$completedUpgrades.includes(4) && $weapLab >= 3>> + <br> + <<link "Develop universal cyber enhancements">> + <<set $currentUpgrade = { + ID: 4, + name: "universal cyber enhancements", + unit: 1, + type: "attackAndDefense", + time: _time}>> + <<set $cash -= 120000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤120000 and will increase the base attack and "defense" values of human troops.// + <</if>> + <<if !$completedUpgrades.includes(5) && $weapLab >= 3>> + <br> + <<link "Develop remote neural links">> + <<set $currentUpgrade = { + ID: 5, + name: "remote neural links", + unit: 1, + type: "hpAndMorale", + time: _time}>> + <<set $cash -= 120000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤120000 and will increase the base hp and morale values of human troops.// + <</if>> + <br> + <<if $securityForceCreate == 1>> + <<if !$completedUpgrades.includes(6) && $weapLab >= 2 && $SFSupportLevel >= 2 && $securityForceArcologyUpgrades >= 7>> + <br> + <<link "Develop combined training regimens with $securityForceName">> + <<set $currentUpgrade = { + ID: 6, + name: "combined training regimens with the special force", + unit: 1, + type: "attackAndDefense", + time: _time}>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, and will increase the base attack and defense values of human troops.// + <</if>> + <<if !$completedUpgrades.includes(7) && $weapLab >= 2 && $SFSupportLevel >= 4 && $securityForceStimulantPower >= 8>> + <br> + <<link "Develop a variant of the stimulant cocktail that $securityForceName created">> + <<set $currentUpgrade = { + ID: 7, + name: "a variant of the stimulant cocktail that the special force created", + unit: 1, + type: "hpAndMorale", + time: _time}>> + <<set $cash -= 300000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤300000 and will increase the base morale and hp values of human troops.// + <</if>> + <<if !$completedUpgrades.includes(8) && $weapLab >= 3 && $SFSupportLevel >= 5>> + <br> + <<link "Create a mesh network based off the custom network of $securityForceName">> + <<set $currentUpgrade = { + ID: 8, + name: "a mesh network based off the custom network of the special force", + unit: 1, + type: "all", + time: _time}>> + <<set $cash -= 1000000>> + <<goto "weaponsManufacturing">> + <</link>> + <br>//Will take _time weeks, cost ¤1000000 and will increase all base stats of human troops.// + <</if>> + <</if>> + <<if $securityForceCreate == 1 && ($humanUpgrade.attack >= 4 || $humanUpgrade.hp >= 4 || $humanUpgrade.morale >= 40 || $humanUpgrade.defense >= 4)>> + You fully upgraded your human troops. + <<elseif $humanUpgrade.attack >= 2 || $humanUpgrade.hp >= 2 || $humanUpgrade.morale >= 20 || $humanUpgrade.defense >= 2>> + You fully upgraded your human troops. + <<if $securityForceCreate == 1 && ($humanUpgrade.attack < 4 || $humanUpgrade.hp < 4 || $humanUpgrade.morale < 40 || $humanUpgrade.defense < 4)>> + With support from $securityForceName, however, we may be able to further upgrade our troops. + <</if>> + <<elseif $weapLab < 3>> + Upgrade the research facility further to unlock more upgrades for human troops. + <</if>> +<<else>> + <br> + You are developing <<print $currentUpgrade.name>>. + It is for <<if $currentUpgrade.unit == 0>> the security drones<<else>> our troops<</if>>. It will enhance their + <<if $currentUpgrade.type == "attack">> + attack power. + <<elseif $currentUpgrade.type == "defense">> + defensive capabilities. + <<elseif $currentUpgrade.type == "hp">> + survivability. + <<elseif $currentUpgrade.type == "morale">> + standing power. + <<elseif $currentUpgrade.type == "attackAndDefense">> + offensive and defensive effectiveness. + <<elseif $currentUpgrade.type == "hpAndMorale">> + morale and survivability. + <<elseif $currentUpgrade.type == "all">> + offensive,defensive effectiveness in addition to morale and survivability. + <</if>> + Estimated completion time is <<print $currentUpgrade.time>> weeks. +<</if>> +<<if $completedUpgrades.length > 0>> + <br> + <br> + you completed: + <<for _i = 0; _i < $completedUpgrades.length; _i++>> + <<if _i < $completedUpgrades.length - 2>> + <<if $completedUpgrades[_i] == 0>> + magnetic based ballistic weaponry, + <<elseif $completedUpgrades[_i] == 1>> + ceramo-metallic alloys, + <<elseif $completedUpgrades[_i] == 2>> + rapid action stimulants, + <<elseif $completedUpgrades[_i] == 3>> + fast response neural stimulant, + <<elseif $completedUpgrades[_i] == 4>> + universal cyber enhancements, + <<elseif $completedUpgrades[_i] == 5>> + remote neural links, + <<elseif $completedUpgrades[_i] == 6>> + combined training regimens with the special force, + <<elseif $completedUpgrades[_i] == 7>> + a variant of the stimulant cocktail that the special force created, + <<elseif $completedUpgrades[_i] == 8>> + a mesh network based off the custom network of the special force, + <<elseif $completedUpgrades[_i] == -1>> + dynamic battle aware AI, + <<elseif $completedUpgrades[_i] == -2>> + adaptive armored frames, + <<elseif $completedUpgrades[_i] == -3>> + advanced synthetic alloys, + <</if>> + <<else>> + <<if $completedUpgrades[_i] == 0>> + magnetic based ballistic weaponry. + <<elseif $completedUpgrades[_i] == 1>> + ceramo-metallic alloys. + <<elseif $completedUpgrades[_i] == 2>> + rapid action stimulants. + <<elseif $completedUpgrades[_i] == 3>> + fast response neural stimulant. + <<elseif $completedUpgrades[_i] == 4>> + universal cyber enhancements. + <<elseif $completedUpgrades[_i] == 5>> + remote neural links. + <<elseif $completedUpgrades[_i] == 6>> + combined training regimens with the special force. + <<elseif $completedUpgrades[_i] == 7>> + a variant of the stimulant cocktail that the special force created. + <<elseif $completedUpgrades[_i] == 8>> + a mesh network based off the custom network of the special force. + <<elseif $completedUpgrades[_i] == -1>> + dynamic battle aware AI. + <<elseif $completedUpgrades[_i] == -2>> + adaptive armored frames. + <<elseif $completedUpgrades[_i] == -3>> + advanced synthetic alloys. + <</if>> + <</if>> + <</for>> +<</if>> \ No newline at end of file diff --git a/src/SecExp/widgets/battleWidgets.tw b/src/SecExp/widgets/battleWidgets.tw new file mode 100644 index 0000000000000000000000000000000000000000..7182c8a72575cef8f32020ec9e4ba46d477c01f2 --- /dev/null +++ b/src/SecExp/widgets/battleWidgets.tw @@ -0,0 +1,123 @@ +:: battleWidgets [widget nobr] + +<<widget "calcSFStatistics">> + <<if $slaveRebellion != 1 || $citizenRebellion != 1>> + /* atk, def */ + <<set _upgradesSum = $securityForceInfantryPower + $securityForceStimulantPower + $securityForceAircraftPower + $securityForceAircraftPower>> + <<if !isInt(_upgradesSum)>> + <<set _upgradesSum = random(10,15)>> + <</if>> + <<set $SFatk = Math.trunc(0.65 * _upgradesSum)>> + <<set $SFdef = Math.trunc(0.40 * _upgradesSum)>> + /* hp */ + <<set $carriableSoldiers = 125 * ($securityForceAC130 + $securityForceVehiclePower)>> + <<if !isInt($carriableSoldiers)>> + <<set $carriableSoldiers = $securityForcePersonnel / 10>> + <</if>> + <<if $securityForcePersonnel > $carriableSoldiers>> + <<set $SFhp = $carriableSoldiers * $SFBaseHp>> + <<else>> + <<set $carriableSoldiers = $securityForcePersonnel>> + <<set $SFhp = $carriableSoldiers * $SFBaseHp>> + <</if>> + <<else>> + /* atk, def */ + <<set _upgradesSum = $securityForceInfantryPower + $securityForceStimulantPower + $securityForceAircraftPower + $securityForceAircraftPower>> + <<if !isInt(_upgradesSum)>> + <<set _upgradesSum = random(10,15)>> + <</if>> + <<set $SFatk = Math.trunc(0.75 * _upgradesSum)>> + <<set $SFdef = Math.trunc(0.50 * _upgradesSum)>> + /* hp */ + <<set $SFhp = $securityForcePersonnel * $SFBaseHp>> + <</if>> +<</widget>> + +<<widget "removeUnits">> + /* args[0] is the array of IDs of units to be eliminated */ + + <<set _newMilitia = []>> + <<set _newSlave = []>> + <<set _newMerc = []>> + + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if !($args[0].includes($militiaUnits[_i].ID))>> + <<set _newMilitia.push($militiaUnits[_i])>> + <</if>> + <</for>> + <<set $militiaUnits = _newMilitia>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if !($args[0].includes($slaveUnits[_i].ID))>> + <<set _newSlave.push($slaveUnits[_i])>> + <</if>> + <</for>> + <<set $slaveUnits = _newSlave>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if !($args[0].includes($mercUnits[_i].ID))>> + <<set _newMerc.push($mercUnits[_i])>> + <</if>> + <</for>> + <<set $mercUnits = _newMerc>> +<</widget>> + +<<widget "calcTroopCount">> + <<set _troops = 0>> + <<if $attackThisWeek == 1>> + + <<if $deployingBots == 1>> + <<set _troops += $secBots.troops>> + <</if>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].isDeployed == 1>> + <<set _troops += $militiaUnits[_i].troops>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].isDeployed == 1>> + <<set _troops += $slaveUnits[_i].troops>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].isDeployed == 1>> + <<set _troops += $mercUnits[_i].troops>> + <</if>> + <</for>> + <<if $SFIntervention == 1>> + <<set _troops += $carriableSoldiers>> + <</if>> + <<set $troopCount = _troops>> + + <<elseif $slaveRebellion == 1 || $citizenRebellion == 1>> + + <<if $irregulars > 0>> + <<set _troops += $irregulars>> + <</if>> + <<if $secBots.active == 1>> + <<set _troops += $secBots.troops>> + <</if>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].active == 1 && $loyalID.includes($militiaUnits[_i].ID)>> + <<set _troops += $militiaUnits[_i].troops>> + <</if>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].active == 1 && $loyalID.includes($slaveUnits[_i].ID)>> + <<set _troops += $slaveUnits[_i].troops>> + <</if>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].active == 1 && $loyalID.includes($mercUnits[_i].ID)>> + <<set _troops += $mercUnits[_i].troops>> + <</if>> + <</for>> + <<if $securityForceCreate == 1>> + <<set _troops += $carriableSoldiers>> + <</if>> + <<set $troopCount = _troops>> + + <<else>> + <br>@@.red;Error: widget called outside battle@@ + <</if>> +<</widget>> \ No newline at end of file diff --git a/src/SecExp/widgets/miscSecExpWidgets.tw b/src/SecExp/widgets/miscSecExpWidgets.tw new file mode 100644 index 0000000000000000000000000000000000000000..38828140e79bafcd56c61fb5e91617aadd3243ab --- /dev/null +++ b/src/SecExp/widgets/miscSecExpWidgets.tw @@ -0,0 +1,545 @@ +:: miscSecExpWidgets [widget nobr] + + +<<widget "calcInitialTrade">> + <<set _initialTrade = random(20,30)>> + <<if $terrain == "urban">> + <<set _initialTrade += random(10)>> + <</if>> + <<if $terrain == "ravine">> + <<set _initialTrade -= random(5)>> + <</if>> + <<if $PC.career == "wealth" || $PC.career == "capitalist" || $PC.career == "celebrity">> + <<set _initialTrade += random(5)>> + <<elseif $PC.career == "escort" || $PC.career == "servant" || $PC.career == "gang">> + <<set _initialTrade -= random(5)>> + <</if>> + <<set $trade = _initialTrade>> +<</widget>> + +<<widget "recalcManpower">> + <<if $wasToggledBefore == 0>> + <<if $mercenaries == 1>> + <<set $mercFreeManpower = random(5,20)>> + <<elseif $mercenaries > 1>> + <<set $mercFreeManpower = random(10,30)>> + <</if>> + <</if>> + + <<set _correctEmployedMP = 0>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<set _correctEmployedMP += $slaveUnits[_i].troops>> + <</for>> + + <<if $slavesEmployedManpower != _correctEmployedMP>> + <<set $slavesEmployedManpower = _correctEmployedMP>> + <</if>> + + <<set _correctEmployedMP = 0>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<set _correctEmployedMP += $militiaUnits[_i].troops>> + <</for>> + + <<if $militiaEmployedManpower != _correctEmployedMP>> + <<set $militiaEmployedManpower = _correctEmployedMP>> + <</if>> + + <<set _correctEmployedMP = 0>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<set _correctEmployedMP += $mercUnits[_i].troops>> + <</for>> + + <<if $mercEmployedManpower != _correctEmployedMP>> + <<set $mercEmployedManpower = _correctEmployedMP>> + <</if>> + + <<set $militiaTotalManpower = $militiaEmployedManpower + $militiaFreeManpower>> + <<set $mercTotalManpower = $mercEmployedManpower + $mercFreeManpower>> +<</widget>> + +<<widget "recalcSecRestPoint">> + <<set _newRest = 0>> + <<set _baseRest = 30>> + <<if $secUpgrades.nanoCams == 1>> + <<set _newRest += 15>> + <</if>> + <<if $secUpgrades.cyberBots == 1>> + <<set _newRest += 15>> + <</if>> + <<if $secUpgrades.eyeScan == 1>> + <<set _newRest += 20>> + <</if>> + <<if $secUpgrades.cryptoAnalyzer == 1>> + <<set _newRest += 20>> + <</if>> + <<set _newRest += _baseRest>> + <<set $secRestPoint = _newRest>> +<</widget>> + +<<widget "recalcCrimeCap">> + <<set _baseCap = 100>> + <<set _newCap = _baseCap>> + <<if $crimeUpgrades.autoTrial == 1>> + <<set _newCap -= 10>> + <</if>> + <<if $crimeUpgrades.autoArchive == 1>> + <<set _newCap -= 10>> + <</if>> + <<if $crimeUpgrades.worldProfiler == 1>> + <<set _newCap -= 15>> + <</if>> + <<if $crimeUpgrades.advForensic == 1>> + <<set _newCap -= 15>> + <</if>> + <<set $crimeCap = _newCap>> +<</widget>> + +<<widget "recalcReqHelots">> + <<set _newReq = 0>> + <<set _baseReq = 20>> + <<if $secUpgrades.nanoCams == 1>> + <<set _newReq += 5>> + <</if>> + <<if $secUpgrades.cyberBots == 1>> + <<set _newReq += 5>> + <</if>> + <<if $secUpgrades.eyeScan == 1>> + <<set _newReq += 10>> + <</if>> + <<if $secUpgrades.cryptoAnalyzer == 1>> + <<set _newReq += 10>> + <</if>> + <<if $crimeUpgrades.autoTrial == 1>> + <<set _newReq += 5>> + <</if>> + <<if $crimeUpgrades.autoArchive == 1>> + <<set _newReq += 5>> + <</if>> + <<if $crimeUpgrades.worldProfiler == 1>> + <<set _newReq += 10>> + <</if>> + <<if $crimeUpgrades.advForensic == 1>> + <<set _newReq += 10>> + <</if>> + <<if $intelUpgrades.sensors == 1>> + <<set _newReq += 5>> + <</if>> + <<if $intelUpgrades.signalIntercept == 1>> + <<set _newReq += 5>> + <</if>> + <<if $intelUpgrades.radar == 1>> + <<set _newReq += 10>> + <</if>> + <<if $readinessUpgrades.rapidVehicles == 1>> + <<set _newReq += 5>> + <</if>> + <<if $readinessUpgrades.rapidPlatforms == 1>> + <<set _newReq += 10>> + <</if>> + <<if $readinessUpgrades.earlyWarn == 1>> + <<set _newReq += 10>> + <</if>> + <<if $SFSupportLevel >= 1>> + <<set _newReq -= 5 * $SFSupportLevel>> + <</if>> + <<if $secUpgrades.coldstorage >= 1>> + <<set _newReq -= 10 * $secUpgrades.coldstorage>> + <</if>> + <<set _newReq += _baseReq>> + <<set $reqHelots = _newReq>> +<</widget>> + +<<widget "recalcEdictsUpkeep">> + /* authority cost */ + <<set _newAuthUpkeep = 0>> + + <<if $sellData == 1>> + <<set _newAuthUpkeep += 10>> + <</if>> + + <<if $slaveSoldierPrivilege == 1>> + <<set _newAuthUpkeep += 10>> + <</if>> + + <<if $weaponsLaw == 0>> + <<set _newAuthUpkeep += 30>> + <<elseif $weaponsLaw == 2>> + <<set _newAuthUpkeep += 10>> + <<elseif $weaponsLaw == 1>> + <<set _newAuthUpkeep += 20>> + <</if>> + + <<if $slavesOfficers == 1>> + <<set _newAuthUpkeep += 10>> + <</if>> + + /* cash cost */ + <<set _newUpkeep = 0>> + + <<if $slaveWatch == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $subsidyChurch == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $martialSchool == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $legionTradition == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $pharaonTradition == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $eagleWarriors == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $ronin == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $mamluks == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $sunTzu == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<if $tradeLegalAid == 1>> + <<set _newUpkeep += 1000>> + <</if>> + + <<set $edictsUpkeep = _newUpkeep>> + <<set $edictsAuthUpkeep = _newAuthUpkeep>> +<</widget>> + +<<widget "recalcUnits">> + <<set $maxUnits = 6 + $secBarracksUpgrades.size * 2>> + <<set $activeUnits = $militiaUnits.length + $slaveUnits.length + $mercUnits.length>> +<</widget>> + +<<widget "fixBrokenUnits">> + <<if $secBots.maxTroops < 30>> + <br>Fixed security bots wrong max troop count. + <<set $secBots.maxTroops = 30>> + <</if>> + <<if !isInt($secBots.troops)>> + <br>Fixed security bots wrong max troop count. + <<set $secBots.troops = $secBots.maxTroops>> + <</if>> + <<if $secBots.troops > 0 && $secBots.active != 1>> + <br>Fixed security bots wrong "active" flag. + <<set $secBots.active = 1>> + <</if>> + + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if ndef $militiaUnits[_i].SF>> + <br>Set militia missing flag + <<set $militiaUnits[_i].SF = 0>> + <</if>> + <<if ndef $militiaUnits[_i].ID>> + <br>Set militia missing ID + <<generateUnitID $militiaUnits[_i]>> + <</if>> + <<if ndef $militiaUnits[_i].commissars>> + <br>Set militia missing flag + <<set $militiaUnits[_i].commissars = 0>> + <</if>> + <<if $militiaUnits[_i].maxTroops < 30>> + <br>Fixed militia unit wrong max troop count. + <<set $militiaUnits[_i].maxTroops = 30>> + <</if>> + <<if !isInt($militiaUnits[_i].troops)>> + <<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>> + <br>Fixed militia unit wrong troop count. + <</if>> + <<if $militiaUnits[_i].troops > 0 && $militiaUnits[_i].active != 1>> + <br>Fixed militia unit wrong "active" flag. + <<set $militiaUnits[_i].active = 1>> + <</if>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if ndef $slaveUnits[_i].SF>> + <br>Set slave missing flag + <<set $slaveUnits[_i].SF = 0>> + <</if>> + <<if ndef $slaveUnits[_i].ID>> + <br>Set slave missing ID + <<generateUnitID $slaveUnits[_i]>> + <</if>> + <<if ndef $slaveUnits[_i].commissars>> + <br>Set slave missing flag + <<set $slaveUnits[_i].commissars = 0>> + <</if>> + <<if $slaveUnits[_i].maxTroops < 30>> + <br>Fixed slave unit wrong max troop count. + <<set $slaveUnits[_i].maxTroops = 30>> + <</if>> + <<if !isInt($slaveUnits[_i].troops)>> + <<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>> + <br>Fixed slave unit wrong troop count. + <</if>> + <<if $slaveUnits[_i].troops > 0 && $slaveUnits[_i].active != 1>> + <br>Fixed slave unit wrong "active" flag. + <<set $slaveUnits[_i].active = 1>> + <</if>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if ndef $mercUnits[_i].SF>> + <br>Set merc missing flag + <<set $mercUnits[_i].SF = 0>> + <</if>> + <<if ndef $mercUnits[_i].ID>> + <br>Set slave missing ID + <<generateUnitID $mercUnits[_i]>> + <</if>> + <<if ndef $mercUnits[_i].commissars>> + <br>Set merc missing flag + <<set $mercUnits[_i].commissars = 0>> + <</if>> + <<if $mercUnits[_i].maxTroops < 30>> + <br>Fixed merc unit wrong max troop count. + <<set $mercUnits[_i].maxTroops = 30>> + <</if>> + <<if !isInt($mercUnits[_i].troops)>> + <<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>> + <br>Fixed merc unit wrong troop count. + <</if>> + <<if $mercUnits[_i].troops > 0 && $mercUnits[_i].active != 1>> + <br>Fixed merc unit wrong "active" flag. + <<set $mercUnits[_i].active = 1>> + <</if>> + <</for>> +<</widget>> + +<<widget "fixBrokenStats">> + <<if !isInt($totalKills)>> + <<set $totalKills = 0>> + <</if>> + <<if !isInt($mercTotalCasualties)>> + <<set $mercTotalCasualties = 0>> + <</if>> + <<if !isInt($mercEmployedManpower)>> + <<set $mercEmployedManpower = 0>> + <</if>> + <<if !isInt($mercTotalManpower)>> + <<set $mercTotalManpower = 0>> + <</if>> + <<if !isInt($slavesTotalCasualties)>> + <<set $slavesTotalCasualties = 0>> + <</if>> + <<if !isInt($slavesEmployedManpower)>> + <<set $slavesEmployedManpower = 0>> + <</if>> + <<if !isInt($militiaTotalCasualties)>> + <<set $militiaTotalCasualties = 0>> + <</if>> + <<if !isInt($militiaEmployedManpower)>> + <<set $militiaEmployedManpower = 0>> + <</if>> + <<if !isInt($militiaFreeManpower)>> + <<set $militiaFreeManpower = 0>> + <</if>> + <<if !isInt($militiaTotalManpower)>> + <<set $militiaTotalManpower = 0>> + <</if>> + <<if !isInt($battlesCount)>> + <<set $battlesCount = 0>> + <</if>> +<</widget>> + +<<widget "fixBrokenFS">> + <<if $arcologies[0].FSSubjugationist != "unset" && !(isInt($arcologies[0].FSSubjugationist) || isFloat($arcologies[0].FSSubjugationist))>> + <<set $arcologies[0].FSSubjugationist = 0>> + <<FSChange "Subjugationist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSGenderRadicalist != "unset" && !(isInt($arcologies[0].FSGenderRadicalist) || isFloat($arcologies[0].FSGenderRadicalist))>> + <br>Debug: FSGenderRadicalist = $arcologies[0].FSGenderRadicalist + <<set $arcologies[0].FSGenderRadicalist = 0>> + <<FSChange "GenderRadicalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSRestart != "unset" && !(isInt($arcologies[0].FSRestart) || isFloat($arcologies[0].FSRestart))>> + <<set $arcologies[0].FSRestart = 0>> + <<FSChange "Eugenics" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSRepopulationFocus != "unset" && !(isInt($arcologies[0].FSRepopulationFocus) || isFloat($arcologies[0].FSRepopulationFocus))>> + <<set $arcologies[0].FSRepopulationFocus = 0>> + <<FSChange "Repopulationist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSSupremacist != "unset" && !(isInt($arcologies[0].FSSupremacist) || isFloat($arcologies[0].FSSupremacist))>> + <<set $arcologies[0].FSSupremacist = 0>> + <<FSChange "Supremacist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSBodyPurist != "unset" && !(isInt($arcologies[0].FSBodyPurist) || isFloat($arcologies[0].FSBodyPurist))>> + <<set $arcologies[0].FSBodyPurist = 0>> + <<FSChange "BodyPurist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSPaternalist != "unset" && !(isInt($arcologies[0].FSPaternalist) || isFloat($arcologies[0].FSPaternalist))>> + <<set $arcologies[0].FSPaternalist = 0>> + <<FSChange "Paternalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSSlimnessEnthusiast != "unset" && !(isInt($arcologies[0].FSSlimnessEnthusiast) || isFloat($arcologies[0].FSSlimnessEnthusiast))>> + <<set $arcologies[0].FSSlimnessEnthusiast = 0>> + <<FSChange "SlimnessEnthusiast" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSGenderFundamentalist != "unset" && !(isInt($arcologies[0].FSGenderFundamentalist) || isFloat($arcologies[0].FSGenderFundamentalist))>> + <<set $arcologies[0].FSGenderFundamentalist = 0>> + <<FSChange "GenderFundamentalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSMaturityPreferentialist != "unset" && !(isInt($arcologies[0].FSMaturityPreferentialist) || isFloat($arcologies[0].FSMaturityPreferentialist))>> + <<set $arcologies[0].FSMaturityPreferentialist = 0>> + <<FSChange "MaturityPreferentialist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSYouthPreferentialist != "unset" && !(isInt($arcologies[0].FSYouthPreferentialist) || isFloat($arcologies[0].FSYouthPreferentialist))>> + <<set $arcologies[0].FSYouthPreferentialist = 0>> + <<FSChange "YouthPreferentialist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSTransformationFetishist != "unset" && !(isInt($arcologies[0].FSTransformationFetishist) || isFloat($arcologies[0].FSTransformationFetishist))>> + <<set $arcologies[0].FSTransformationFetishist = 0>> + <<FSChange "TransformationFetishist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSHedonisticDecadence != "unset" && !(isInt($arcologies[0].FSHedonisticDecadence) || isFloat($arcologies[0].FSHedonisticDecadence))>> + <<set $arcologies[0].FSHedonisticDecadence = 0>> + <<FSChange "Hedonism" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSPhysicalIdealist != "unset" && !(isInt($arcologies[0].FSPhysicalIdealist) || isFloat($arcologies[0].FSPhysicalIdealist))>> + <<set $arcologies[0].FSPhysicalIdealist = 0>> + <<FSChange "PhysicalIdealist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSPastoralist != "unset" && !(isInt($arcologies[0].FSPastoralist) || isFloat($arcologies[0].FSPastoralist))>> + <<set $arcologies[0].FSPastoralist = 0>> + <<FSChange "Pastoralist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSAssetExpansionist != "unset" && !(isInt($arcologies[0].FSAssetExpansionist) || isFloat($arcologies[0].FSAssetExpansionist))>> + <<set $arcologies[0].FSAssetExpansionist = 0>> + <<FSChange "AssetExpansionist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSDegradationist != "unset" && !(isInt($arcologies[0].FSDegradationist) || isFloat($arcologies[0].FSDegradationist))>> + <<set $arcologies[0].FSDegradationist = 0>> + <<FSChange "Degradationist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSRomanRevivalist != "unset" && !(isInt($arcologies[0].FSRomanRevivalist) || isFloat($arcologies[0].FSRomanRevivalist))>> + <<set $arcologies[0].FSRomanRevivalist = 0>> + <<FSChange "RomanRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSChattelReligionist != "unset" && !(isInt($arcologies[0].FSChattelReligionist) || isFloat($arcologies[0].FSChattelReligionist))>> + <<set $arcologies[0].FSChattelReligionist = 0>> + <<FSChange "ChattelReligionist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSChineseRevivalist != "unset" && !(isInt($arcologies[0].FSChineseRevivalist) || isFloat($arcologies[0].FSChineseRevivalist))>> + <<set $arcologies[0].FSChineseRevivalist = 0>> + <<FSChange "ChineseRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSArabianRevivalist != "unset" && !(isInt($arcologies[0].FSArabianRevivalist) || isFloat($arcologies[0].FSArabianRevivalist))>> + <<set $arcologies[0].FSArabianRevivalist = 0>> + <<FSChange "ArabianRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSEdoRevivalist != "unset" && !(isInt($arcologies[0].FSEdoRevivalist) || isFloat($arcologies[0].FSEdoRevivalist))>> + <<set $arcologies[0].FSEdoRevivalist = 0>> + <<FSChange "EdoRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSEgyptianRevivalist != "unset" && !(isInt($arcologies[0].FSEgyptianRevivalist) || isFloat($arcologies[0].FSEgyptianRevivalist))>> + <<set $arcologies[0].FSEgyptianRevivalist = 0>> + <<FSChange "EgyptianRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> + <<if $arcologies[0].FSAztecRevivalist != "unset" && !(isInt($arcologies[0].FSAztecRevivalist) || isFloat($arcologies[0].FSAztecRevivalist))>> + <<set $arcologies[0].FSAztecRevivalist = 0>> + <<FSChange "AztecRevivalist" 10>> + <br>Fixed NaN FS value + <</if>> +<</widget>> + +<<widget "recalcBaseStats">> + <<if $secBotsBaseAttack != 7 + $droneUpgrades.attack>> + <<set $secBotsBaseAttack = 7 + $droneUpgrades.attack>> + <</if>> + <<if $secBotsBaseDefense != 3 + $droneUpgrades.defense>> + <<set $secBotsBaseDefense = 3 + $droneUpgrades.defense>> + <</if>> + <<if $secBotsMorale != 200>> + <<set $secBotsMorale = 200>> + <</if>> + <<if $secBotsBaseHp != 3 + $droneUpgrades.hp>> + <<set $secBotsBaseHp = 3 + $droneUpgrades.hp>> + <</if>> + <<if $militiaBaseAttack != 7 + $humanUpgrade.attack>> + <<set $militiaBaseAttack = 7 + $humanUpgrade.attack>> + <</if>> + <<if $militiaBaseDefense != 5 + $humanUpgrade.defense>> + <<set $militiaBaseDefense = 5 + $humanUpgrade.defense>> + <</if>> + <<if $militiaBaseMorale != 140 + $humanUpgrade.morale>> + <<set $militiaBaseMorale = 140 + $humanUpgrade.morale>> + <</if>> + <<if $militiaBaseHp != 3 + $humanUpgrade.hp>> + <<set $militiaBaseHp = 3 + $humanUpgrade.hp>> + <</if>> + <<if $slaveBaseAttack != 8 + $humanUpgrade.attack>> + <<set $slaveBaseAttack = 8 + $humanUpgrade.attack>> + <</if>> + <<if $slaveBaseDefense != 3 + $humanUpgrade.defense>> + <<set $slaveBaseDefense = 3 + $humanUpgrade.defense>> + <</if>> + <<if $slaveBaseMorale != 110 + $humanUpgrade.morale>> + <<set $slaveBaseMorale = 110 + $humanUpgrade.morale>> + <</if>> + <<if $slaveBaseHp != 3 + $humanUpgrade.hp>> + <<set $slaveBaseHp = 3 + $humanUpgrade.hp>> + <</if>> + <<if $mercBaseAttack != 8 + $humanUpgrade.attack>> + <<set $mercBaseAttack = 8 + $humanUpgrade.attack>> + <</if>> + <<if $mercBaseDefense != 4 + $humanUpgrade.defense>> + <<set $mercBaseDefense = 4 + $humanUpgrade.defense>> + <</if>> + <<if $mercBaseMorale != 125 + $humanUpgrade.morale>> + <<set $mercBaseMorale = 125 + $humanUpgrade.morale>> + <</if>> + <<if $mercBaseHp != 4 + $humanUpgrade.hp>> + <<set $mercBaseHp = 4 + $humanUpgrade.hp>> + <</if>> + <<if $SFBaseAttack != 8 + $humanUpgrade.attack>> + <<set $SFBaseAttack = 8 + $humanUpgrade.attack>> + <</if>> + <<if $SFBaseDefense != 4 + $humanUpgrade.defense>> + <<set $SFBaseDefense = 4 + $humanUpgrade.defense>> + <</if>> + <<if $SFBaseMorale != 140 + $humanUpgrade.morale>> + <<set $SFBaseMorale = 140 + $humanUpgrade.morale>> + <</if>> + <<if $SFBaseHp != 4 + $humanUpgrade.hp>> + <<set $SFBaseHp = 4 + $humanUpgrade.hp>> + <</if>> +<</widget>> \ No newline at end of file diff --git a/src/SecExp/widgets/unitsWidgets.tw b/src/SecExp/widgets/unitsWidgets.tw new file mode 100644 index 0000000000000000000000000000000000000000..96de0c3a8993cb4c733cf9976b8ac3f618aefe2a --- /dev/null +++ b/src/SecExp/widgets/unitsWidgets.tw @@ -0,0 +1,171 @@ +:: unitsWidgets [widget nobr] + +<<widget "militiaUnitsDescription">> + <<if $args[0].active == 1>> + <strong>$args[0].platoonName</strong> <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>> + Its $args[0].troops men and women are all proud citizens of your arcology, willing to put their lives on the line to protect their home. + <<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>> + <<if $args[0].equip == 0>> + They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more. + <<elseif $args[0].equip == 1>> + They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor. + <<elseif $args[0].equip == 2>> + They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like might visions and portable radars. + <<else>> + They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment. + <</if>> + <<if $args[0].training <= 33>> + They lack the experience to be considered consumed professionals, but their eagerness to defend the arcology makes up for it. + <<elseif $args[0].training <= 66>> + They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield. + <<else>> + They are consumed veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything. + <</if>> + <<if $args[0].loyalty < 10>> + The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented. + <<elseif $args[0].loyalty < 33>> + Their loyalty is low. Careful monitoring of their activities and relationships is advised. + <<elseif $args[0].loyalty < 66>> + Their loyalty is not as high as it can be, but they are not actively working against their arcology owner. + <<elseif $args[0].loyalty < 90>> + Their loyalty is high and strong. The likelyhood of this unit betraying the arcology is low to non-existent. + <<else>> + The unit is fanatically loyal. They would prefer death over betrayal. + <</if>> + <<if $args[0].medics == 1>> + The unit has a dedicated squad of medics that will follow them in battle. + <</if>> + <<if $args[0].SF == 1>> + The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <<else>> + $args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all. + <</if>> +<</widget>> + +<<widget "slaveUnitsDescription">> + <<if $args[0].active == 1>> + <strong>$args[0].platoonName</strong> <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>> + Its $args[0].troops men and women are slaves in your possession, tasked with the protection of their owner and their arcology. + <<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>> + <<if $args[0].equip == 0>> + They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more. + <<elseif $args[0].equip == 1>> + They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor. + <<elseif $args[0].equip == 2>> + They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like might visions and portable radars. + <<else>> + They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment. + <</if>> + <<if $args[0].training <= 33>> + They lack the experience to be considered professionals, but their eagerness to prove themselves makes up for it. + <<elseif $args[0].training <= 66>> + They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield. + <<else>> + They are consumed veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything. + <</if>> + <<if $args[0].loyalty < 10>> + The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented. + <<elseif $args[0].loyalty < 33>> + Their loyalty is low. Careful monitoring of their activities and relationships is advised. + <<elseif $args[0].loyalty < 66>> + Their loyalty is not as high as it can be, but they are not actively working against their arcology owner. + <<elseif $args[0].loyalty < 90>> + Their loyalty is high and strong. The likelyhood of this unit betraying the arcology is low to non-existent. + <<else>> + The unit is fanatically loyal. They would prefer death over betrayal. + <</if>> + <<if $args[0].medics == 1>> + The unit has a dedicated squad of medics that will follow them in battle. + <</if>> + <<if $args[0].SF == 1>> + The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <<else>> + $args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all. + <</if>> +<</widget>> + +<<widget "mercUnitsDescription">> + <<if $args[0].active == 1>> + <strong>$args[0].platoonName</strong> <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>> + Its $args[0].troops men and women are mercenaries contracted to defend the arcology against external threats. + <<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>> + <<if $args[0].equip == 0>> + They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more. + <<elseif $args[0].equip == 1>> + They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor. + <<elseif $args[0].equip == 2>> + They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like might visions and portable radars. + <<else>> + They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment. + <</if>> + <<if $args[0].training <= 33>> + They lack the experience to be considered professionals, but they're trained more than enough to still be an effective unit. + <<elseif $args[0].training <= 66>> + They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield. + <<else>> + They are consumed veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything. + <</if>> + <<if $args[0].loyalty < 10>> + The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented. + <<elseif $args[0].loyalty < 33>> + Their loyalty is low. Careful monitoring of their activities and relationships is advised. + <<elseif $args[0].loyalty < 66>> + Their loyalty is not as high as it can be, but they are not actively working against their arcology owner. + <<elseif $args[0].loyalty < 90>> + Their loyalty is high and strong. The likelyhood of this unit betraying the arcology is low to non-existent. + <<else>> + The unit is fanatically loyal. They would prefer death over betrayal. + <</if>> + <<if $args[0].medics == 1>> + The unit has a dedicated squad of medics that will follow them in battle. + <</if>> + <<if $args[0].SF == 1>> + The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active. + <</if>> + <<else>> + $args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all. + <</if>> +<</widget>> + +<<widget "secBotsDescription">> + <<if $secBots.active == 1>> + <strong>The security drones</strong> assemble in an ordered line in front of you, ready to receive their orders. All <<print $secBots.troops>> stand before you in absolute silence. + <<if $secBots.troops < $secBots.maxTroops>> The unit is not at its full strength of $secBots.maxTroops drones.<</if>> + <<if $secBots.equip == 0>> + They are equipped with light weaponry, mainly anti-riot non lethal weapons. Not particularly effective in battle. + <<elseif $secBots.equip == 1>> + They are equipped with light firearms, not an overwhelming amount of firepower, but with their mobility good enough to be effective. + <<elseif $secBots.equip == 2>> + They are equipped with powerful, modern firearms and simple armor mounted around their frames. They do not make for a pretty sight, but on the battlefield they are a dangerous weapon. + <<else>> + They are equipped with high energy railguns and adaptive armor. They are a formidable force on the battlefield, even for experienced soldiers. + <</if>> + <<else>> + There are too few security drones left to be able to deploy them on the battlefield. + <</if>> +<</widget>> + +<<widget "generateUnitID">> + <<set _newID = 0>> + + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <<if $militiaUnits[_i].ID >= _newID>> + <<set _newID = $militiaUnits[_i].ID + 1>> + <</if>> + <</for>> + + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <<if $slaveUnits[_i].ID >= _newID>> + <<set _newID = $slaveUnits[_i].ID + 1>> + <</if>> + <</for>> + + <<for _i = 0; _i < $mercUnits.length; _i++>> + <<if $mercUnits[_i].ID >= _newID>> + <<set _newID = $mercUnits[_i].ID + 1>> + <</if>> + <</for>> + <<set $args[0].ID = _newID>> +<</widget>> \ No newline at end of file diff --git a/src/events/gameover.tw b/src/events/gameover.tw index 5e484bdc1e49d58b379bfa28b7be2d1dfb12e72b..f2b21b5515e874689541d00188808ff240ad64f1 100644 --- a/src/events/gameover.tw +++ b/src/events/gameover.tw @@ -48,6 +48,36 @@ <<elseif $gameover == "you failed">> <<goto "eliteTakeOver">> +<<elseif $gameover == "major battle defeat">> + <<set $ui = "start">> + <<if $attackType == "raiders">> + As the horde of raiders breaks the battlelines and enter the arcology, all hell break loose. You citizens are raped, your slaves captured and abused, your penthouse burned. + As for you, you are quickly captured and brought in front of the warlord himself. With a satisfied smile he aims his pistol to your forehead and squeezes the trigger. + <<elseif $attackType == "old world">> + As the interminable column of old world puppets breaks the battlines and enters the arcology, all hell breaks loose. Properties are seized and wealth stolen and distributed between the victorious soldiers. + You are stripped of everything you possessed and left to rot in a corner of your once glorious arcology. + <<elseif $attackType == "freedom fighters">> + As the army of freedom fighters invades the arcology, all hell break loose. Their righteous fury torches everything you held dear, while the streets of the arcology run red with the blood of the masters. + You are reserved a special death: crucified in front of the arcology's entrance. Your corpse a grim reminder of your legacy. + <<elseif $attackType == "free city">> + As the mercenaries break the battlelines and enter the arcology all hell break loose. The sectors are pillaged one by one, systematically an thoroughly. When they break in the penthouse they quickly capture and send you to their employers as proof of their success. + Your personal story may continue, but that part of it worthy of retelling has now ended. + <</if>> + + <br><br> + ''GAME OVER'' +<<elseif $gameover == "Rebellion defeat">> + <<set $ui = "start">> + <<if $slaveRebellion == 1>> + As the furious horde of slaves invade your penthouse you are left a few precious seconds to decide your fate. You embrace for the last time your faithful revolver and just as the rebels break through your doors you squeeze the trigger. + The end of your story has come and your arcology is now in the hands of whoever will take control of the vermins that dared rise up this day. + <<else>> + As the furious horde of citizens invade your penthouse you are left a few precious seconds to decide your fate. You embrace for the last time your faithful revolver and just as the rebels break through your doors you squeeze the trigger. + The end of your story has come and your arcology is now in the hands of whoever will take control of the vermins that dared rise up this day. + <</if>> + + <br><br> + ''GAME OVER'' <<else>> <<set $ui = "start">> Since you are without slaves, Free Cities society no longer considers you a citizen of the first rank. Your personal story may continue, but that part of it worthy of retelling has now ended. diff --git a/src/events/intro/pcExperienceIntro.tw b/src/events/intro/pcExperienceIntro.tw index cbad7a3f91369af775fe172cf3d86e0f4ad6739f..33e2006fef9dfc5dd4b2cf57a4616c96b299001a 100644 --- a/src/events/intro/pcExperienceIntro.tw +++ b/src/events/intro/pcExperienceIntro.tw @@ -8,13 +8,13 @@ You're a relative unknown in the Free Cities, but it's clear you're already acco <br> <br>[[Idle wealth|PC Rumor Intro][$PC.career = "wealth"]] -<br> //Start with extra money. Your starting slaves will have two free levels of sex skills available.// +<br> //Start with extra money<<if $showSecExp == 1>>, but you will find harder to maintain authority<</if>>. Your starting slaves will have two free levels of sex skills available.// <br>[[Venture capitalism|PC Rumor Intro][$PC.career = "capitalist"]] <br> //You will be more effective at business pursuits. Your starting slaves will have a free level of prostitution skill available.// <br>[[Private military work|PC Rumor Intro][$PC.career = "mercenary"]] -<br> //You retain mercenary contacts and security skills. Your starting slaves will have free trust available.// +<br> //You retain mercenary contacts<<if $showSecExp == 1>> and your security skills will make it easier to keep the arcology safe<<else>> and security skills<</if>>. Your starting slaves will have free trust available.// <br>[[Slaving|PC Rumor Intro][$PC.career = "slaver"]] -<br> //Your slave breaking experience will be useful. Your starting slaves will have free devotion available.// +<br> //Your slave breaking experience will be useful<<if $showSecExp == 1>> and authority will be easier to maintain<</if>>. Your starting slaves will have free devotion available.// <br>[[Arcology engineering|PC Rumor Intro][$PC.career = "engineer"]] <br> //Upgrading the arcology will be cheaper. Also, the arcology will start with basic economic upgrades already installed.// <br>[[Slave surgery|PC Rumor Intro][$PC.career = "medicine"]] @@ -22,10 +22,24 @@ You're a relative unknown in the Free Cities, but it's clear you're already acco <br>[[Minor celebrity|PC Rumor Intro][$PC.career = "celebrity"]] <br> //Start with extra reputation. Your starting slaves will have a free level of entertainment skill available.// <br>[[High class escort|PC Rumor Intro][$PC.career = "escort"]] -<br> //As an ex-whore, you will find it hard to maintain reputation. Your starting slaves will have a free level of sex skills available, along with a free level of entertainment and prostitution.// +<br> //As an ex-whore, you will find it hard to maintain reputation<<if $showSecExp == 1>> and authority<</if>>. Your starting slaves will have a free level of sex skills available, along with a free level of entertainment and prostitution.// <br>[[Servant|PC Rumor Intro][$PC.career = "servant"]] -<br> //As an ex-servant, you will find it hard to maintain reputation. You know how to lower your upkeep, but not conduct business. Your starting slaves will have free trust and devotion.// +<br> //As an ex-servant, you will find it hard to maintain reputation<<if $showSecExp == 1>> and authority<</if>>. You know how to lower your upkeep, but not conduct business. Your starting slaves will have free trust and devotion.// <br>[[Gang Leader|PC Rumor Intro][$PC.career = "gang"]] -<br> //As a gang leader, you know how to haggle slaves, but you will find reputation quite hard to maintain. Your starting slaves will be fitter and posses a free level of combat skill.// +<br> //As a gang leader, you know how to haggle slaves<<if $showSecExp == 1>> and assert your authority<</if>>, but you will find reputation quite hard to maintain. Your starting slaves will be fitter and posses a free level of combat skill.// <</if>> + +<br><br> + +<<if $showSecExp == 0>> + <<link "Show Security Expansion changes">> + <<set $showSecExp = 1>> + <<goto "PC Experience Intro">> + <</link>> +<<else>> + <<link "Hide Security Expansion changes">> + <<set $showSecExp = 0>> + <<goto "PC Experience Intro">> + <</link>> +<</if>> \ No newline at end of file diff --git a/src/events/intro/terrainIntro.tw b/src/events/intro/terrainIntro.tw index ec172d767576c29b833f27e8d95a169b57c6b84f..932217461ab5f3cf53ba1c1e05cfd649798a05fe 100644 --- a/src/events/intro/terrainIntro.tw +++ b/src/events/intro/terrainIntro.tw @@ -60,5 +60,22 @@ Finally, a few Free Cities have been carved out from old world cities. Urban dec <br> @@.red;Very low@@ access to refugees and other desperate people. <br> @@.green;Very high@@ cultural independence. <br> Ensures access to slaves from all over the world and will not associate the arcology with a continent. +<<if $showSecExp == 1>> +<br>Oceanic arcologies will not be subjects of attacks. +<</if>> <</if>> + +<br><br> + +<<if $showSecExp == 0>> + <<link "Show Security Expansion changes">> + <<set $showSecExp = 1>> + <<goto "Terrain Intro">> + <</link>> +<<else>> + <<link "Hide Security Expansion changes">> + <<set $showSecExp = 0>> + <<goto "Terrain Intro">> + <</link>> +<</if>> \ No newline at end of file diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw index 8c99d145070a2d61e5b86b4e23d6667d6cf85180..6975e9dcf93f5f3e008d6f7d92108b35a3d6c8c9 100644 --- a/src/gui/Encyclopedia/encyclopedia.tw +++ b/src/gui/Encyclopedia/encyclopedia.tw @@ -2773,13 +2773,11 @@ While nearly indistinguishable from a standard satellite antenna, the satellite <<case "Repopulationist Breeding School">> With the sheer number of children being brought into the world in the average Repopulationist society, society had to come up with a way to rear them all. Breeding schools are publicly funded institutions devoted to raising children into future breeders. Their hormone levels are carefully managed both to encourage early puberty and to maximize fertility. Once a class has become sexual active, boys and girls are encouraged to pair off and explore eachother's bodies. Virginities are quickly lost, and more often than not, girls find themselves pregnant, usually with multiples. The pairings, or groups should females outnumber males, are encouraged to stay together and form caring family-like units. In addition, girls are taught to enjoy and idolize motherhood, while boys are taught that it is their duty to mount and fuck any non-gravid slave girls they see until pregnancy is assured. Free women are encouraged to avoid the schools, lest they get pinned and gang raped by horny adolescents. While administration respects rape fetishests and their desire to have a rape baby, doing this sets a poor example to the impressionable youths and may lead to the rape and impregnation of other free women later on it their lives. -<<if $secExp == 1>> <<case "Security Expansion">> <<include "encyclopediaSecExpMain">> <<case "Battles">> <<include "encyclopediaSecExpBattles">> -<</if>> <<default>> Error: bad title. diff --git a/src/init/setupVars.tw b/src/init/setupVars.tw index 684555b8439546a4cb8cf4a2a5d2325d361ad89a..d62dd36ec77f026352825e965bccc1a1b4deec1c 100644 --- a/src/init/setupVars.tw +++ b/src/init/setupVars.tw @@ -5,7 +5,6 @@ */ - /*** pregmod exclusive start ***/ <<set setup.filterRaces = ["Amerindian", "Asian", "Black", "Indo-Aryan", "Latina", "Malay", "Middle Eastern", "Pacific Islander", "Semitic", "Southern European", "White"]>> diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index e787f930959262323d557fc2ca60cc7990ddae2a..ebaf3a7f0ee59c10a7616151c2de2c1093df654e 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -1086,6 +1086,8 @@ FertilityAge($fertilityAge) <<set $pubertyLength = 5>> <<set $maxGrowthAge = 24>> + + /% Begin mod section: toggle whether slaves lisp. %/ <<set $disableLisping = 0>> /% End mod section: toggle whether slaves lisp. %/ @@ -1253,6 +1255,5 @@ erectileImplant: 0 <<set $wasToggledBefore = 0>> /* <<include "secInit">> -*/ <<goto "Alpha disclaimer">> diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 8bd1f9693e94f85ac03c920ac9c76bc79955efeb..034ff72a8bfa455fcb35e96a79cc1562a63630e3 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -26,6 +26,8 @@ window.getCost = function(array) { + (State.variables.club * facilityCost) + (State.variables.dairy * facilityCost) + (State.variables.incubator * facilityCost * 10); + var secExpCost = 0; + var soldierMod = 0; //facility expenses costs += (0.1 * State.variables.brothelUpgradeDrugs * brothel * facilityCost) @@ -61,6 +63,58 @@ window.getCost = function(array) { costs += 1000; } + //security expansion + if(State.variables.secExp == 1) { + if(State.variables.edictsUpkeep > 0) { + secExpCost += State.variables.edictsUpkeep; + } + if(State.variables.SFSupportUpkeep > 0) { + secExpCost += State.variables.SFSupportUpkeep; + } + if(State.variables.propHub > 0) { + secExpCost += State.variables.propHubUpkeep; + } + if(State.variables.secHQ > 0) { + secExpCost += State.variables.secHQUpkeep + 20 * state.variables.secHelots; + } + if(State.variables.secBarracks > 0) { + secExpCost += State.variables.secBarracksUpkeep; + } + if(State.variables.riotCenter > 0) { + secExpCost += State.variables.riotUpkeep; + } + if(State.variables.soldierWages == 0) { + soldierMod = 1; + } + else if(State.variables.soldierWages == 1) { + soldierMod = 1.5; + } + else { + soldierMod = 2; + } + if (State.variables.militiaUnits != null) { + for (var i = 0; i < State.variables.militiaUnits.length; i++) { + if( !(State.variables.militiaUnits[i] === null) ){ + secExpCost += State.variables.militiaUnits[i].troops * State.variables.soldierUpkeep * soldierMod; + } + } + } + if (State.variables.slaveUnits != null) { + for (var i = 0; i < State.variables.slaveUnits.length; i++) { + if( !( State.variables.slaveUnits[i] === null) ){ + secExpCost += State.variables.slaveUnits[i].troops * State.variables.soldierUpkeep * 0.5 * soldierMod; + } + } + } + if (State.variables.mercUnits != null) { + for (var i = 0; i < State.variables.mercUnits.length; i++) { + if( !(State.variables.mercUnits[i] === null) ){ + secExpCost += State.variables.mercUnits[i].troops * State.variables.soldierUpkeep * 1.5 * soldierMod; + } + } + } + } + //general arcology costs costs += (State.variables.girls * (250 + (economy * 500))); @@ -230,6 +284,15 @@ window.getCost = function(array) { } } + if(State.variables.secExp == 1) { + if(State.variables.terrain === 'oceanic' || State.variables.terrain === 'marine') { + if(State.variables.docks > 0) { + costs *= (1 - State.variables.docks * 0.05); + } + } else if(State.variables.railway > 0) { + costs *= (1 - State.variables.railway * 0.05); + } + } // clean up if(costs < 0) { diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw index 858a5d50fc51df6382123ea7765f35378aecde08..d02f0d9e964f9d22eaa673415b38ae85563d2808 100644 --- a/src/js/storyJS.tw +++ b/src/js/storyJS.tw @@ -143,7 +143,21 @@ Mousetrap.bind("x", function () { Mousetrap.bind("z", function () { $("#story-caption #SFMButton a.macro-link").trigger("click"); }); - +Mousetrap.bind("d", function () { + $("#story-caption #edictButton a.macro-link").trigger("click"); +}); +Mousetrap.bind("shift+s", function () { + $("#story-caption #securityHQ a.macro-link").trigger("click"); +}); +Mousetrap.bind("shift+a", function () { + $("#story-caption #secBarracks a.macro-link").trigger("click"); +}); +Mousetrap.bind("shift+h", function () { + $("#story-caption #propHub a.macro-link").trigger("click"); +}); +Mousetrap.bind("shift+r", function () { + $("#story-caption #riotCenter a.macro-link").trigger("click"); +}); /** * BoobGenerator namespace. */ diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index 14cee2c462ceda5817cc0d2887e4eba3240e04ff..c16237401ef9dd17237d55afe119340211c4e9dc 100644 --- a/src/uncategorized/arcmgmt.tw +++ b/src/uncategorized/arcmgmt.tw @@ -44,6 +44,12 @@ You @@.green;make friends@@ by tacitly supporting enslavement of upstart citizens. <<set _flux += 10, $rep += 100>> <</if>> +<<if $enslavementRights == 1>> + As the only legal entity in the arcology able to declare the status of a person as enslaved, you are able to @@.yellowgreen;collect fees@@ over enslavement of your citizens. Many, however, cosndier this move an intromission in private affairs, @@.red;damaging your authority.@@ + <<set $authority -= 10>> + <<set $cash += _flux * 100>> +<</if>> +<<set $oldFlux = _flux>> <<set $ACitizens -= _flux, $ASlaves += _flux>> This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name's citizens fell into slavery. @@ -62,31 +68,75 @@ This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name <</if>> <</if>> +<<set $oldACitizens = $ACitizens>> + <<set _immigrants = 0>> <<if $ACitizens >= $ACitizenLimit>> <<set $ACitizens = $ACitizenLimit>> Your arcology is currently home to as many citizens as it can house; unless the living areas are reconfigured, the citizen population will not increase. <<else>> - <<set $ACitizens += random(-10,10)>> + <<set _immigrants += random(-10,10)>> + <<if $crime > 80>> + Crime is a widespread phenomenon in your arcology, many potential immigrants are scared away. + <<set _immigrants -= random(5,10)>> + <<elseif $crime < 20>> + Crime is a distant issue within the walls of your arcology, many immigrants are attracted to such safe shores. + <<set _immigrants += random(5,10)>> + <</if>> <<if $ProImmigrationRep == 1>> Your welcome program for new citizens helps encourage wealthy people from the old world to immigrate, but @@.red;annoys some longstanding citizens.@@ - <<set $ACitizens += random(10,20), $rep -= 100>> + <<set _immigrants += random(10,20), $rep -= 100>> <</if>> <<if $ProImmigrationCash == 1>> The rent promotion for new immigrants brings new citizens to the arcology. - <<set $ACitizens += random(10,20)>> + <<set _immigrants += random(10,20)>> <</if>> <<if $arcologies[0].FSRepopulationFocusLaw == 1>> The rent promotion for pregnant women attracts several gravid ladies and a few girls eager to become mothers to enroll as citizens in your arcology. - <<set $ACitizens += random(5,10)>> + <<set _immigrants += random(5,10)>> <</if>> <<if $ACitizens < $ACitizenLimit*0.6>> The availability of a large number of apartments encourages many new citizens to immigrate. - <<set $ACitizens += random(10,20)>> + <<set _immigrants += random(10,20)>> <</if>> - <<if $ACitizens <= 100>> + <<if $secExp == 1>> + <<if $limitSubhumans == 1>> + Subhumans are stopped and turned away as soon as they dare petition for citizenship in your arcology, slightly lowering immigrants numbers. + <<set _immigrants -= random(5,10)>> + <</if>> + <<if $openBorders == 1>> + The very liberal attituted towards immigration calls many hopeful immigrants to your arcology. + <<set _immigrants += random(10,20)>> + <</if>> + <<if $propCampaign >= 1 && $propFocus == "immigration">> + Your advertisement campaign outside the free city brings more people to the gates of your arcology. + <<if $propCampaignBoost == 0>> + <<set _immigrants += random(1,2) * $propCampaign>> + <<else>> + <<set _immigrants += random(1,4) * $propCampaign>> + <</if>> + <</if>> + <<if $limitImmigration == 1>> + The strict limits on immigration keep the number of people coming in the arcology limited. + <<if _immigrants > 40>> + <<set _immigrants = 40>> + <</if>> + <</if>> + <<if $garrison.waterwayTime > 0>> + The damage caused to the water supply of the arcology discourages immigration and causes the death of some of the poorest residents. + It will still take <<if $garrison.waterwayTime > 1>>$garrison.waterwayTime weeks<<else>>a week<</if>> to finish repair works. + <<set _immigrants = Math.clamp(_immigrants - random(40,60), 0 , _immigrants)>> + <<set $ACitizens -= random(10,20), $ASlaves -= random(10,20)>> + <<set $garrison.waterwayTime-->> + <</if>> + <</if>> +<</if>> +<<if !isInt(_immigrants)>> + <br>@@.red;Error: immigrants is outside accepted range, please report this issue@@ +<</if>> +<<set $ACitizens += _immigrants>> +<<if $ACitizens <= 100>> Your arcology is home to an extremely small number of very wealthy citizens; wealth is as concentrated as possible and the citizen population will not decrease further. <<set $ACitizens = 100>> - <</if>> <</if>> <<if $ASlaves >= $ASlaveLimit>> @@ -113,9 +163,20 @@ This week, <<if _flux > 0>>few to none<<else>>many<</if>> of $arcologies[0].name $arcologies[0].name is quite prosperous, and they can afford to buy many pretty slaves. <</if>> <</if>> + <<if $liveTargets == 1>> + Disobedient slaves are used as live targets in the shooting ranges of the arcology<<if $secBarracks != 0>> and the barracks.<<else>>.<</if>> + <<set $ASlaves -= random(10,20)>> + <</if>> <<if $ASlaves <= 1000>><<set $ASlaves = 1000>><</if>> <</if>> +<<if !isInt($ACitizens)>> + <br>@@.red;Error: ACitizens is outside accepted range, please report this issue@@ +<</if>> +<<if !isInt($ASlaves)>> + <br>@@.red;Error: ASlaves is outside accepted range, please report this issue@@ +<</if>> + $ACitizens citizens and <<print $ASlaves+$helots+$slaves.length>> slaves now live in your arcology. <<if $arcologies[0].FSSupremacistLawME == 1>>The citizenry is entirely $arcologies[0].FSSupremacistRace.<</if>> <<if $arcologies[0].FSRomanRevivalistLaw == 1>>The citizens take pride in their martial duties, preferring to wear utilitarian clothing even when off duty.<</if>> @@ -161,6 +222,7 @@ $ACitizens citizens and <<print $ASlaves+$helots+$slaves.length>> slaves now liv <<if $sectors[_i].type != "Sweatshops">> <<if $sectors[_i].type != "Pens">> <<if $sectors[_i].type != "Barracks">> + <<if $sectors[_i].type != "weapManu">> <<set $rents += $arcologies[0].prosperity*10>> <</if>> <</if>> @@ -170,6 +232,7 @@ $ACitizens citizens and <<print $ASlaves+$helots+$slaves.length>> slaves now liv <</if>> <</if>> <</if>> + <</if>> <</if>> <</for>> <<set $rentalMultiplier = 1>> @@ -196,12 +259,27 @@ $ACitizens citizens and <<print $ASlaves+$helots+$slaves.length>> slaves now liv <<set $rentalMultiplier -= 0.1>> Food vendors are offered subsidized rent and operating expenses to set up shop in your arcology. <</if>> +<<if $alternativeRents == 1>> + Your citizens are allowed to pay their rents in slaves rather than cash and a few financially challenged individuals make use of this. + <<set $rentalMultiplier -= 0.1>> + <<set $helots += random(0,3)>> +<</if>> +<<if $discountMercenaries == 1>> + Mercenaries willing to come to your arcology are given a discount on rent. + <<set $rentalMultiplier -= 0.05>> +<</if>> +<<if $militiaSoldierPrivilege == 1>> + Citizens in the militia are exempt from rent payment. + <<set $rentalMultiplier -= 0.05>> +<</if>> <<if $arcologies[0].FSArabianRevivalistLaw == 1>> <<set $rentalMultiplier += 0.1>> Those of your citizens who have not yet subscribed to the society you are building are permitted to live and do business here, but must pay a moderate jizya tax for the privilege as part of their rent. <</if>> <<set $rents = Math.trunc($rents*$rentalMultiplier)>> - +<<if !isInt($rents)>> + <br>@@.red;Error: rents is outside accepted range, please report this issue@@ +<</if>> <<set $cash += $rents>> This week, rents from $arcologies[0].name came to @@ -247,6 +325,7 @@ You own <<if $fuckdolls > 1>>$fuckdolls standard fuckdolls,<<else>>one fuckdoll,<</if>> <</if>> <<set _earnings += random(1,10)>> + <<set $cash += _earnings>> earning you @@.yellowgreen;¤_earnings.@@ <</if>> @@ -268,7 +347,16 @@ earning you @@.yellowgreen;¤_earnings.@@ <</if>> <</for>> <<if _refugees > 0>> - Some desperate people filtered into the arcology during the week: as owner, you were able to enslave _refugees of them. + Some desperate people filtered into the arcology during the week + <<if $propCampaign >= 1 && $propFocus == "enslavement">> + , many attracted by your advertisement campaigns + <<if $propCampaignBoost == 0>> + <<set _refugees += random(0,2)>> + <<else>> + <<set _refugees += random(0,4)>> + <</if>> + <</if>>. + As owner, you were able to enslave _refugees of them. <<set $helots += _refugees>> <</if>> @@ -297,6 +385,24 @@ earning you @@.yellowgreen;¤_earnings.@@ Your unimpressive reputation relative to $arcologies[0].name's prosperity @@.yellow;slows business growth.@@ <<set _AWeekGrowth-->> <</if>> + <<if $secExp == 1>> + <<if $trade <= 20>> + <<set _AWeekGrowth += 1>> + <<elseif $trade <= 40>> + <<set _AWeekGrowth += 2>> + <<elseif $trade <= 60>> + <<set _AWeekGrowth += 3>> + <<elseif $trade <= 80>> + <<set _AWeekGrowth += 4>> + <<else>> + <<set _AWeekGrowth += 5>> + <</if>> + + <<if $smilingManFate == 0>> + The ex-criminal known to the world as The Smiling Man puts her impressive skills to work, improving the financial situation of the arcology with ease. + <<set _AWeekGrowth++>> + <</if>> + <</if>> <<if $personalAttention == "business">> <<if ($PC.trading >= 100) || ($PC.career == "arcology owner")>> Your @@.springgreen;business focus and your experience@@ allow you to greatly assist in advancing the arcology's prosperity. @@ -381,18 +487,24 @@ earning you @@.yellowgreen;¤_earnings.@@ Your slave market regulations slow the flow of chattel through the arcology. <<set _AWeekGrowth-->> <</if>> - <<if $terrain == "urban">> - Since your arcology is located in the heart of an urban area, its commerce is naturally vibrant. - <<set _AWeekGrowth++>> - <</if>> - <<if $terrain == "ravine">> - Since your arcology is located in the heart of a ravine, its commerce is hindered by a lack of accessability. - <<set _AWeekGrowth-->> + + /* deactivated with sec Exp as they are modifiers for the trade mechanic */ + <<if $secExp == 0>> + <<if $terrain == "urban">> + Since your arcology is located in the heart of an urban area, its commerce is naturally vibrant. + <<set _AWeekGrowth++>> + <</if>> + <<if $terrain == "ravine">> + Since your arcology is located in the heart of a ravine, its commerce is hindered by a lack of accessability. + <<set _AWeekGrowth-->> + <</if>> <</if>> + <<if def $arcologies[0].embargoTarget && $arcologies[0].embargoTarget != -1>> The local economy is hurt by the double edged sword of your economic warfare. <<set _AWeekGrowth -= $arcologies[0].embargo*2>> <</if>> + <<set $desc = []>> <<set $descNeg = []>> <<for $i = 1; $i < $arcologies.length; $i++>> @@ -446,6 +558,44 @@ earning you @@.yellowgreen;¤_earnings.@@ Growth was subsidized as planned. <<set _AWeekGrowth++>> <</if>> + <<if $secExp == 1>> + <<if $authority > 18000>> + Your authority is so high it discourages new business, slowing down the economic growth of the arcology. + <<set _AWeekGrowth-->> + <</if>> + <<if $security > 80>> + Your arcology is extremely safe and stable. Many businesses are attracted to it because of this. + <<set _AWeekGrowth++>> + <<elseif $security < 20>> + Your arcology low security is an instability factor simply too dangerous to be ignored. Many businesses avoid your arcology because of this. + <<set _AWeekGrowth-->> + <</if>> + <<if $weaponsLaw == 3>> + The free flow of weapons in your arcology has a positive impact on its economy. + <<set _AWeekGrowth++>> + <<elseif $weaponsLaw == 2>> + The fairly liberal flow of weapons in your arcology has a positive impact on its economy. + <<set _AWeekGrowth++>> + <</if>> + <<if $controlLeaks == 1>> + The authenticity department prepares extremely accurate, but false financial reports, misleading many of your competitors, allowing your arcology more space to grow undisturbed. + <<set _AWeekGrowth++>> + <</if>> + <<if $globalCrisisWeeks > 0>> + The great global crisis ignited by The Smiling Man plan is a great weight on the shoulders of everyone, causing great harm to the prosperity of the arcology. + <<set _AWeekGrowth -= random(2,4)>> + <<set $globalCrisisWeeks-->> + <<elseif $smilingManProgress >= 3>> + With the global economy recovering from the great crisis unleashed by the Smiling Man, there is plenty of room to grow. Your arcology's prosperity benefits from this greatly. + <<set _AWeekGrowth++>> + <</if>> + <<if $garrison.reactorTime > 0>> + The damage to the reactor caused by the last rebellion is extensive. Businesses and private citizens struggle to operate with the unreliable and limited energy production offered by the auxiliary generators. + It will still take <<if $garrison.reactorTime> 1>>$garrison.reactorTime weeks<<else>>a week<</if>> to finish repair works. + <<set _AWeekGrowth -= random(1,2)>> + <<set $garrison.reactorTime-->> + <</if>> + <</if>> <<set _AWeekGrowth = Math.trunc(0.5*_AWeekGrowth)>> <<if _AWeekGrowth > 0>> Since $arcologies[0].name can support more citizens and more activity, @@.green;its prosperity improved this week.@@ @@ -454,9 +604,20 @@ earning you @@.yellowgreen;¤_earnings.@@ <<else>> Though $arcologies[0].name can support more citizens and more activity, @@.red;it lost prosperity this week.@@ <</if>> - <<set $arcologies[0].prosperity += _AWeekGrowth>> + <<if isNaN(_AWeekGrowth)>> + <br>@@.red;Error: AWeekGrowth is NaN + <<else>> + <<set $arcologies[0].prosperity += _AWeekGrowth>> + <</if>> <</if>> +<<if $secExp == 1>> + <br> + <br> + <<include "tradeReport">> +<</if>> + + <<if $TSS.schoolPresent+$GRI.schoolPresent+$SCP.schoolPresent+$LDE.schoolPresent+$TGA.schoolPresent+$TFS.schoolPresent+$TCR.schoolPresent > 0>> <br> diff --git a/src/uncategorized/arcologyDescription.tw b/src/uncategorized/arcologyDescription.tw index b919aca4415c7df28eec1f5ddc39d81b4dbf8708..de570a28c5f87905b7c05775ee9c2479f0f285f9 100644 --- a/src/uncategorized/arcologyDescription.tw +++ b/src/uncategorized/arcologyDescription.tw @@ -366,6 +366,28 @@ Its<<if $weatherCladding == 2>> glorious<<elseif $weatherCladding > 0>> dull<<el <</if>> <</if>> +<<if $secExp == 1>> + <br> + <<if $propHub == 1>> + A small street hides a surprisingly inconspicuous building, whose task is to manage your public image, protection and population control. + <</if>> + <<if $secHQ == 1>> + In a secure corner of the penthouse, the Security HQ silently works to build a safe and prosperous arcology. + <</if>> + <<if $secBarracks == 1>> + At the center of the structure the barracks can be found filling the halls with the noise of ballistic weapons and training troops. + <</if>> + <<if $weapManu == 1>> + Down in the lower levels of the arcology the weapons manufacturing facility dominates the environment, here armaments of all kind are produced and shipped away. + <</if>> + <<if $riotCenter == 1>> + Near the penthouse the riot control centre can be found. Here dissidents and dangerous political forces of $arcologies[0].name are carefully monitored and managed. + <</if>> + <<if $transportHub == 1>> + The transport hub, in the commercial section of the arcology, deals with new arrivals to $arcologies[0].name via <<if $railway == 1>>land<<elseif $docks == 1>>,sea<</if>><<if $airport == 1>> and air<</if>>. + <</if>> +<</if>> + <<if ($arcologies[0].FSSupremacistDecoration >= 60) || ($arcologies[0].FSSubjugationistDecoration >= 60) || ($arcologies[0].FSGenderRadicalistDecoration >= 60) || ($arcologies[0].FSGenderFundamentalistDecoration >= 60) || ($arcologies[0].FSPaternalistDecoration >= 60) || ($arcologies[0].FSDegradationistDecoration >= 60) || ($arcologies[0].FSBodyPuristDecoration >= 60) || ($arcologies[0].FSTransformationFetishistDecoration >= 60) || ($arcologies[0].FSYouthPreferentialistDecoration >= 60) || ($arcologies[0].FSMaturityPreferentialistDecoration >= 60) || ($arcologies[0].FSSlimnessEnthusiastDecoration >= 60) || ($arcologies[0].FSAssetExpansionistDecoration >= 60) || ($arcologies[0].FSPastoralistDecoration >= 60) || ($arcologies[0].FSPhysicalIdealistDecoration >= 60) || ($arcologies[0].FSChattelReligionistDecoration >= 60) || ($arcologies[0].FSRomanRevivalistDecoration >= 60) || ($arcologies[0].FSAztecRevivalistDecoration >= 60) || ($arcologies[0].FSEgyptianRevivalistDecoration >= 60) || ($arcologies[0].FSEdoRevivalistDecoration >= 60) || ($arcologies[0].FSArabianRevivalistDecoration >= 60) || ($arcologies[0].FSChineseRevivalistDecoration >= 60) || ($arcologies[0].FSRepopulationFocusDecoration >= 60) || ($arcologies[0].FSRestartDecoration >= 60) || ($arcologies[0].FSHedonisticDecadenceDecoration >= 60)>> <br> The central plaza is a large open atrium lined with banners. diff --git a/src/uncategorized/barracks.tw b/src/uncategorized/barracks.tw index 2262b56d5706f025fef6be7cb6edb33d3c990e06..70e421db9049dd757ea57a3c69703a1e24202c78 100644 --- a/src/uncategorized/barracks.tw +++ b/src/uncategorized/barracks.tw @@ -2,13 +2,13 @@ <<set $nextButton = "Back", $nextLink = "Main">> -The mercenaries you retain to protect $arcologies[0].name are housed in this sector of the arcology, which is fitted out as a modern barracks. It's much less expensive to house them here than to let them live at free quarters in the living areas of the arcology. They live somewhat apart from the society they protect, down here, but +The mercenaries you retain to protect $arcologies[0].name are housed in this sector of the arcology, which is fitted out as a modern military facility. It's much less expensive to house them here than to let them live at free quarters in the living areas of the arcology. They live somewhat apart from the society they protect, down here, but <<if $personalArms > 0 && $invasionVictory > 0>> you're always welcome here. You're their employer, but what's more important to them is that you also fought alongside them in victorious battle. <<else>> they don't resent an unannounced visit from their employer. <</if>> -As you enter the main bay of the barracks, lined with modern arms and armor and a few muscular, scarred men and women looking after their gear or suiting up to stand post, you're greeted respectfully, with<<if $personalArms > 0 && $invasionVictory > 0>> jaunty salutes and<</if>> formal <<if $PC.title == 1>>"Sir"s.<<else>>"Ma'am"s<</if>><<if $personalArms > 0 && $invasionVictory > 0>>, but also with smiles and nods<</if>>. +As you enter the main bay of the armory, lined with modern arms and armor and a few muscular, scarred men and women looking after their gear or suiting up to stand post, you're greeted respectfully, with<<if $personalArms > 0 && $invasionVictory > 0>> jaunty salutes and<</if>> formal <<if $PC.title == 1>>"Sir"s.<<else>>"Ma'am"s<</if>><<if $personalArms > 0 && $invasionVictory > 0>>, but also with smiles and nods<</if>>. <<if $mercenaries >= 3>> Though few of the mercenaries are visible, <<if $mercenaries >= 5>> @@ -139,7 +139,7 @@ You head up a deck, to the staff area, and up one more, to look into the living <br><br> -<<link "Decommission the barracks and return this sector to manufacturing">> +<<link "Decommission the armory and return this sector to manufacturing">> <<set $barracks = 0>> <<for _i = 0; _i < $sectors.length; _i++>> <<if $sectors[_i].type == "Barracks">><<set $sectors[_i].type = "Manufacturing">><<break>><</if>> diff --git a/src/uncategorized/buildingWidgets.tw b/src/uncategorized/buildingWidgets.tw index 75c11cadd022a84c32f6ba2ed0451735c60774ee..3d2a637e2b31ddb5fbcf5f644731055b2deccdd2 100644 --- a/src/uncategorized/buildingWidgets.tw +++ b/src/uncategorized/buildingWidgets.tw @@ -47,6 +47,8 @@ Yes, I am aware this is horrible. If anyone can figure out how to get widgets to td#Pens { border-color: goldenrod; } td#Pit { border-color: orangered; } td#Manufacturing { border-color: slategray; } + td#transportHub { border-color: magenta; } + td#weapManu { border-color: springgreen; } td#Sweatshops { border-color: gray; } td#Barracks { border-color: olivedrab; } td#Penthouse { border-color: teal; } @@ -76,7 +78,9 @@ if(!Macro.has('sectorblock')) { Arcade: { extra: ' ($arcadeSlaves/<<print $arcade>>)'}, Dairy: { extra: '<<set _SCapT9 = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> ($dairySlaves<<if _SCapT9>>+_SCapT9<</if>>/<<print $dairy>><<if $Milkmaid>>,L<</if>>)' }, Sweatshops: { base: 'Manufacturing' }, - Barracks: { base: 'Barracks' }, + weapManu: { base: 'weaponsManufacturing', name: 'Weapons manufacturing', cls: 'weapManu' }, + transportHub: { base: 'transportHub', name: 'Transport Hub', cls: 'transportHub' }, + Barracks: { base: 'Barracks', name: 'Armory' }, /* speciality shop types */ 'Subjugationist': { base: 'Shops', name: 'Subjugationist Shops', cls: 'FSShops' }, 'Supremacist': { base: 'Shops', name: 'Supremacist Shops', cls: 'FSShops' }, diff --git a/src/uncategorized/costs.tw b/src/uncategorized/costs.tw index 129146db73d129a981defee0344e1f15c6ed95e9..9546aa35df7072220dcd2e3eda057f81e187eb9a 100644 --- a/src/uncategorized/costs.tw +++ b/src/uncategorized/costs.tw @@ -32,6 +32,45 @@ <<set $costs -= 500>> <</if>> +/* security expansion */ +<<if $secExp == 1>> + <<set $costs += ($edictsUpkeep + $SFSupportUpkeep)>> + + <<if $propHub != 0>> + <<set $costs += $propHubUpkeep>> + <</if>> + <<if $secHQ != 0>> + <<set $costs += ($secHQUpkeep)+(20*$secHelots)>> + <</if>> + <<if $secBarracks != 0>> + <<set $costs += $secBarracksUpkeep>> + <</if>> + <<if $riotCenter != 0>> + <<set $costs += $riotUpkeep>> + <</if>> + + <<if $soldierWages == 0>> + <<set _soldierMod = 1>> + <<elseif $soldierWages == 1>> + <<set _soldierMod = 1.5>> + <<else>> + <<set _soldierMod = 2>> + <</if>> + + <<set _mL = $militiaUnits.length>> + <<for _i = 0; _i < _mL; _i++>> + <<set $costs += $militiaUnits[_i].troops*$soldierUpkeep * _soldierMod>> + <</for>> + <<set _sL = $slaveUnits.length>> + <<for _i = 0; _i < _sL; _i++>> + <<set $costs += $militiaUnits[_i].troops*$soldierUpkeep * 0.5 * _soldierMod>> + <</for>> + <<set _meL = $mercUnits.length>> + <<for _i = 0; _i < _meL; _i++>> + <<set $costs += $militiaUnits[_i].troops*$soldierUpkeep * 1.5 * _soldierMod>> + <</for>> +<</if>> + <<set $costs += $citizenOrphanageTotal*100>> <<set $costs += $privateOrphanageTotal*500>> <<if $breederOrphanageTotal > 0>> @@ -404,6 +443,18 @@ <</if>> <</if>> +<<if $secExp == 1>> + <<if $terrain == "oceanic" || $terrain == "marine">> + <<if $docks > 0>> + <<set $costs *= 1 - $docks * 0.05>> + <</if>> + <<else>> + <<if $railway > 0>> + <<set $costs *= 1 - $railway * 0.05>> + <</if>> + <</if>> +<</if>> + <<if $costs < 0>> <<set $costs = 0>> <<else>> diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw index 0ffbe5551e60e32413c9f8318d7637c6d8c05cb9..76e781c9adf000bca7b11f987e0e7c86ed64d53b 100644 --- a/src/uncategorized/costsReport.tw +++ b/src/uncategorized/costsReport.tw @@ -51,6 +51,7 @@ <<if $barracks>><<else>>//@@.red;Increased by the lack of a barracks.@@//<</if>> <<if ($PC.warfare >= 100) || ($PC.career == "arcology owner")>>//Reduced by your @@.springgreen;mercenary contacts.@@//<</if>> <</if>> + <<if $brothel > 0>> <<set _advertising = 0>> <<if $brothel > 0>> @@ -58,6 +59,7 @@ <</if>> <br>__Brothel__ maintenance: ¤<<print ($brothel*$facilityCost)+(0.1*$brothelUpgradeDrugs*$brothel*$facilityCost)+_advertising>> <</if>> + <<if $club > 0>> <<set _advertising= 0>> <<if $club > 0>> @@ -93,6 +95,44 @@ <<if $researchLab.menials != 0>> __Menial slaves__: ¤<<print (100*$researchLab.menials)>><</if>> <</if>> <</if>> + +/* security expansion */ +<<if $secExp == 1>> + <br> + <<if $edictsUpkeep + $SFSupportUpkeep > 0>> + __Edicts Upkeep__: ¤<<print $edictsUpkeep + $SFSupportUpkeep>> + <</if>> + <<if $propHub != 0>> + <br>__Propaganda Hub__ maintenance: ¤<<print $propHubUpkeep>> + <</if>> + <<if $secHQ != 0>> + <br>__Security Headquarters__ maintenance: ¤<<print ($secHQUpkeep)+(20*$secHelots)>> + <</if>> + <<if $secBarracks != 0>> + <br>__Barracks__ maintenance: ¤<<print $secBarracksUpkeep>> + <</if>> + <<if $riotCenter != 0>> + <br>__Riot Control Center__ maintenance: ¤<<print $riotUpkeep>> + <</if>> + + <<if $soldierWages == 0>> + <<set _soldierMod = 1>> + <<elseif $soldierWages == 0>> + <<set _soldierMod = 1.5>> + <<else>> + <<set _soldierMod = 2>> + <</if>> + <<for _i = 0; _i < $militiaUnits.length; _i++>> + <br>__<<print $militiaUnits[_i].platoonName>>__ upkeep: ¤<<print $militiaUnits[_i].troops*$soldierUpkeep * _soldierMod>> + <</for>> + <<for _i = 0; _i < $slaveUnits.length; _i++>> + <br>__<<print $slaveUnits[_i].platoonName>>__ upkeep: ¤<<print $slaveUnits[_i].troops*$soldierUpkeep * 0.5 * _soldierMod>> + <</for>> + <<for _i = 0; _i < $mercUnits.length; _i++>> + <br>__<<print $mercUnits[_i].platoonName>>__ upkeep: ¤<<print $mercUnits[_i].troops*$soldierUpkeep * 1.5 * _soldierMod>> + <</for>> +<</if>> + <<if $FSSpending != 0>> <br>__Society Shaping__ expenses: ¤$FSSpending <</if>> @@ -430,3 +470,14 @@ <br>Using your prior experience, you managed to lower your home's upkeep by <<if $personalAttention == "upkeep">><<if $PC.belly >= 5000>>20%<<else>>25%<</if>><<else>>10%<</if>>. <</if>> +<<if $secExp == 1>> + <<if $terrain == "oceanic" || $terrain == "marine">> + <<if $docks > 0>> + <br>The infrastructure you've built eases the transportation and safe handling of the supplies required by the arcology. Upkeep is lowered by <<print $docks * 5>>% + <</if>> + <<else>> + <<if $railway > 0>> + <br>The infrastructure you've built eases the transportation and safe handling of the supplies required by the arcology. Upkeep is lowered by <<print $railway * 5>>% + <</if>> + <</if>> +<</if>> \ No newline at end of file diff --git a/src/uncategorized/economics.tw b/src/uncategorized/economics.tw index ff4181106c00543943ffb36376bf54d62d95a72e..2e8c45da1dc8ee4af520bbf5b887dae2c36e15f1 100644 --- a/src/uncategorized/economics.tw +++ b/src/uncategorized/economics.tw @@ -37,6 +37,11 @@ <</if>> <<include "Reputation">> +<<if $secExp == 1>> +<br><br> +<<include "authorityReport">> +<</if>> + <br><br> <<include "Arcology Management">> @@ -50,6 +55,12 @@ <br><br> <<include "FS Developments">> <</if>> + +<br><br> +<<if $secExp == 1>> +<<include "securityReport">> +<</if>> + <<else>> <<CreateSimpleTabs>> <body> @@ -61,6 +72,9 @@ <button class="tablinks" onclick="opentab(event, 'Corporation')">Corporation</button> <</if>> <button class="tablinks" onclick="opentab(event, 'Reputation')">Reputation</button> + <<if $secExp == 1>> + <button class="tablinks" onclick="opentab(event, 'Authority')">Authority</button> + <</if>> <button class="tablinks" onclick="opentab(event, 'Management')">Arcology Management</button> <<if ($PC.boobs == 1 && $PC.boobsBonus > 0) || $PC.pregKnown == 1 || $playerAging != 0>> <button class="tablinks" onclick="opentab(event, 'Personal')">Personal Notes</button> @@ -68,6 +82,9 @@ <<if $FSAnnounced > 0>> <button class="tablinks" onclick="opentab(event, 'Societies')">Society Development</button> <</if>> + <<if $secExp == 1>> + <button class="tablinks" onclick="opentab(event, 'securityReport')">Security</button> + <</if>> </div> <div id="Arcologies" class="tabcontent"> @@ -102,6 +119,12 @@ You have not yet committed funds to create a publicly traded slave trading corpo </div> </div> +<div id="Authority" class="tabcontent"> +<div class="content"> +<<include "authorityReport">> +</div> +</div> + <div id="Management" class="tabcontent"> <div class="content"> <<include "Arcology Management">> @@ -124,6 +147,12 @@ You have not yet committed funds to create a publicly traded slave trading corpo </div> <</if>> +<div id="securityReport" class="tabcontent"> +<div class="content"> +<<include "securityReport">> +</div> +</div> + <script> function opentab(evt, tabName) { var i, tabcontent, tablinks; diff --git a/src/uncategorized/fsDevelopments.tw b/src/uncategorized/fsDevelopments.tw index 06dbdfc822e896d83826772fdae90721f9697c51..9df3f0ce8ba7916503e9199ef7d4523a9f8e5106 100644 --- a/src/uncategorized/fsDevelopments.tw +++ b/src/uncategorized/fsDevelopments.tw @@ -234,6 +234,16 @@ <<set _broadProgress += 1>> <</if>> <</if>> +<<if $secExp == 1>> + <<if $propCampaign == 1 && $propFocus == "social engineering">> + Your propaganda campaign helps further your societal engineering efforts. + <<if $propCampaignBoost == 1>> + <<set _broadProgress += 2>> + <<else>> + <<set _broadProgress += 1>> + <</if>> + <</if>> +<</if>> <<if $terrain == "urban">> The @@.yellow;urban location@@ of the arcology naturally promotes cultural interchange, holding back $arcologies[0].name's cultural independence. <<set _broadProgress -= 3>> @@ -368,6 +378,33 @@ <</if>> <</if>> +<<if $secExp == 1>> + <<if $slaveWatch == 1>> + The Slave Mistreatment Watch helps many slaves, easing your citizens into the paternalist ideals it represents. + <<set $arcologies[0].FSPaternalist += 2>> + <</if>> + + <<if $noSubhumansInArmy == 1>> + Your army is free of subhumans, further cementing their lower status in the eyes of your citizens. + <<set $arcologies[0].FSSubjugationist += 2>> + <</if>> + + <<if $pregExemption == 1>> + Pregnant citizens are allowed and encouraged to avoid military service, making their value evident to all citizens. + <<set $arcologies[0].FSRepopulationFocus += 2>> + <</if>> + + <<if $eliteOfficers == 1>> + Purity in leadership is fundamental in your army, helping eugenics ideals spread in the populace. + <<set $arcologies[0].FSRestart += 2>> + <</if>> + + <<if $liveTargets == 1>> + Disobedient slaves are used in shooting ranges and military drills as live targets, furthering degradationist ideals. + <<set $arcologies[0].FSDegradationist += 2>> + <</if>> +<</if>> + /* Promenade effects */ <<for _i = 5; _i <= 7; _i++>> <<if $sectors[_i].type != "Shops">> diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index f9b5c69b31b2e1a14e3ac79929839247f65e5385..3af0398604a8d40dfe1799ac9277c05002ddbe96 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -35,7 +35,15 @@ __Construction__ <br> <<if $arcologyUpgrade.drones != 1>> - //The first major upgrade needed is the installation of a drone security system so higher-class citizens will feel safe and protected should they choose to immigrate. This upgrade will cost ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// [[Install drone security system|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $arcologyUpgrade.drones = 1]] + //The first major upgrade needed is the installation of a drone security system so higher-class citizens will feel safe and protected should they choose to immigrate. This upgrade will cost ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// + <<link "Install drone security system">> + <<set $cash -= Math.trunc(5000*$upgradeMultiplierArcology)>> + <<set $arcologyUpgrade.drones = 1>> + <<set $secBots.active = 1>> + <<set $secBots.troops = 30>> + <<set $secBots.maxTroops = 30>> + <<goto "Manage Arcology">> + <</link>> <<elseif $arcologyUpgrade.hydro != 1>> //The next major upgrade needed is the installation of a better water reclamation system so your residents will have access to cheaper water and hydroponically grown food. This upgrade will cost ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>.// [[Upgrade water reclamation system|Manage Arcology][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $arcologyUpgrade.hydro = 1]] <<elseif $arcologyUpgrade.apron != 1>> @@ -79,6 +87,51 @@ __Construction__ You have installed the FCTV receiver and have access to the full range of FCTV's programs. Low viewership rates amongst your citizens limits the impact of FCTV on your societal goals. <</if>> +<<if $secExp == 1>> + <br> + <br> + __Security__ + <<if $propHub == 0>> + <br> + [[Set up the propaganda Hub|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $propHub = 1]] + //Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// + <br>//Building specialized in the management of authority.// + <<else>> + <br> + The [[Propaganda Hub|propagandaHub]] is ready to manipulate reality on your command. + <</if>> + <<if $secHQ == 0>> + <br> + [[Set up the security headquarters|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $secHQ = 1]] + //Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// + <br>//Building specialized in the management of security and crime.// + <<else>> + <br> + The [[security HQ|securityHQ]] is constantly working to protect your arcology. + <</if>> + + <<if $secBarracks == 0>> + <br> + [[Set up the barracks|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $secBarracks = 1]] + //Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>// + <br>//Building specialized in the management of armed forces.// + <<else>> + <br> + The [[barracks|secBarracks]] patiently await your orders. + <</if>> + + <<if $riotCenter == 0 && $rebellionsEnabled == 1>> + <br> + [[Set up the riot control center|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $riotCenter = 1]] + //Costs ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>// + <br>//Building specialized in the management and suppression of rebellions.// + <<elseif $rebellionsEnabled == 1>> + <br> + The [[Riot Control Center|riotControlCenter]] stands ready for action. + <</if>> +<</if>> + + <br><br> __Language__ @@ -124,6 +177,23 @@ Your slaves have participated in approximately <<print $oralTotal+$vaginalTotal+ <<if $pitKillsTotal > 0>>$pitKillsTotal slaves have died in your fighting pit.<</if>> <<if $fuckdollsSold > 0>>$fuckdollsSold mindbroken arcade slaves have been converted into Fuckdolls and sold.<</if>> +<<if $secExp == 1 && $battlesEnabled == 1>> +<br><br> +<<if $securityForceCreate == 0>> + Your army counts <<print $militiaEmployedManpower + $slavesEmployedManpower + $mercEmployedManpower>> total soldiers. +<<else>> + Your army counts <<print $militiaEmployedManpower + $slavesEmployedManpower + $mercEmployedManpower + $securityForcePersonnel>> total soldiers of which $securityForcePersonnel under the security force command and the rest under your direct control. +<</if>> +<<if $hasFoughtOnce == 1>> + Your troops were involved in <<print $battlesCount>> battles of which <<print $majorBattlesCount>> major engagements. You won <<print $PCvictories>> of them, while the enemy managed to gain the upper hand in the other <<print $PClosses>>. +<</if>> + +<<if $rebellionsCount >= 1>> + Your arcology was involved in <<print $rebellionsCount>> rebellions. You won <<print $PCrebWon>> of them, while the rebels defeated your forces in <<print $PCrebLoss>>. +<</if>> + +During all battles you lost a total of <<print $militiaTotalCasualties + $slavesTotalCasualties + $mercTotalCasualties>> men, while scoring a total of <<print $totalKills>> kills. +<</if>> <br><br> Your arcology is named <<textbox "$arcologies[0].name" $arcologies[0].name "Manage Arcology">> diff --git a/src/uncategorized/managePenthouse.tw b/src/uncategorized/managePenthouse.tw index 8e6ca20b7d48ac40c7fc91d9154ddac4a5f4c652..083b7677d86f1aa5a0463f08d9e4255fb8770b2d 100644 --- a/src/uncategorized/managePenthouse.tw +++ b/src/uncategorized/managePenthouse.tw @@ -242,7 +242,7 @@ __Penthouse Upgrades__ <<elseif $dairyPiping == 1>> Various taps around the penthouse supply product from $dairyName for use in enema play and force-feeding. With no dairy to draw from, they are currently unused. <</if>> - + <br> <<if $studio == 0>> @@ -292,6 +292,8 @@ __Penthouse Upgrades__ <br> + + <<if $cyberMod == 0>> <<switch $prostheticsUpgrade>> <<case 1>> diff --git a/src/uncategorized/manufacturing.tw b/src/uncategorized/manufacturing.tw index 3a546da3e9757a96a0f6c80a67105c355203e1df..5c49e85641d261efbfb22cb9f887452eb7cda742 100644 --- a/src/uncategorized/manufacturing.tw +++ b/src/uncategorized/manufacturing.tw @@ -36,11 +36,21 @@ This is a space in the arcology's service areas, <<if $mercenaries>> <<if $barracks != 1>> <br> - [[Build a barracks to properly house your mercenaries|Main][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $barracks = 1, $sectors[$AS].type = "Barracks"]] + [[Build an armoury to properly house your mercenaries|Main][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $barracks = 1, $sectors[$AS].type = "Barracks"]] //Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>> but will reduce mercenary upkeep// <</if>> <</if>> +<br> + +<<if $secExp == 1>> +<<if $weapManu != 1>> + <br> + [[Convert this sector to weapons manufacturing|Main][$cash -= Math.trunc(30000*$upgradeMultiplierArcology), $weapManu = 1, $sectors[$AS].type = "weapManu"]] + //Costs ¤<<print Math.trunc(30000*$upgradeMultiplierArcology)>> but will provide a weekly income and will unlock upgrades for our troops// +<</if>> +<</if>> + <br> [[Convert to pens to increase the number of menial slaves you can house|Main][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $sectors[$AS].type = "Pens"]] //Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>// diff --git a/src/uncategorized/markets.tw b/src/uncategorized/markets.tw index f8cbdb59eb3502dd12c1aff112305d195d172118..86ce91ea4b2191f17219418cf23ef718ca256733 100644 --- a/src/uncategorized/markets.tw +++ b/src/uncategorized/markets.tw @@ -18,6 +18,12 @@ This is an area of the concourse occupied by large stores and markets, many of w //Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>// <</if>> +<<if $secExp == 1 && $transportHub == 0>> + <br> + [[Centralize and modernize the transport hub|Main][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $transportHub = 1, $sectors[$AS].type = "transportHub", $docks = 1, $railway = 1, $airport = 1]] + //Costs ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>// +<</if>> + <<if $corpMarket == 0 && $corpIncorporated == 1>> <br> [[Create a flagship slave market for your corporation here|Main][$corpCash -= Math.trunc(10000*$upgradeMultiplierArcology), $corpMarket = 1, $sectors[$AS].type = "CorporateMarket"]] diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index 189a2d57ac053c4bb0a8bbb6c6fa5da7f2b985ed..10123123580ad11d10522c11f34efafc9687750f 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -186,6 +186,18 @@ <<set $playerSurgery-->> <</if>> +<<if $foughtThisWeek == 1>> + <<set $foughtThisWeek = 0>> +<</if>> + +<<if $sentUnitCooldown > 0>> + <<set $sentUnitCooldown-->> +<</if>> + +<<if $proclamationsCooldown > 0>> + <<set $proclamationsCooldown-->> +<</if>> + <<set _seed = random(1,10)>> <<if $week < 25>> <<if _seed > 4>> diff --git a/src/uncategorized/nonRandomEvent.tw b/src/uncategorized/nonRandomEvent.tw index e485559b4d2c39ba27186b17987763f98539df85..5aa6c8025d741429d9746204213845b1e07e05fb 100644 --- a/src/uncategorized/nonRandomEvent.tw +++ b/src/uncategorized/nonRandomEvent.tw @@ -148,6 +148,14 @@ <<goto "P slave medic">> <<elseif ($PPit == 1) && ($Bodyguard != 0)>> <<goto "PE pit fight">> +<<elseif $rivalOwner == 0 && $smilingManProgress == 0 && _effectiveWeek >= 74 && $secExp == 1>> + <<goto "secExpSmilingMan">> +<<elseif $rivalOwner == 0 && $smilingManProgress == 1 && _effectiveWeek >= 77 && $secExp == 1>> + <<goto "secExpSmilingMan">> +<<elseif $rivalOwner == 0 && $smilingManProgress == 2 && _effectiveWeek >= 82 && $secExp == 1>> + <<goto "secExpSmilingMan">> +<<elseif $rivalOwner == 0 && $smilingManProgress == 3 && $secExp == 1>> + <<goto "secExpSmilingMan">> <<else>> <<if random(1,100) > _effectiveWeek+25>> <<goto "RIE Eligibility Check">> diff --git a/src/uncategorized/pMercenaries.tw b/src/uncategorized/pMercenaries.tw index 222b683c8dab5f4fad236e44c9d26af82f70f71e..3d63cfdf5f6635c49c24a712a4aea358e1a92418 100644 --- a/src/uncategorized/pMercenaries.tw +++ b/src/uncategorized/pMercenaries.tw @@ -29,6 +29,8 @@ The budgetary difficulty many old world countries are in has resulted in unemplo <<set $rep -= 500>> <<set $cash -= _price>> <<set $mercenaries = 1>> + <<set $mercTotalManpower = 15>> + <<set $mercFreeManpower = 15>> <</replace>> <</link>> <<if ($PC.warfare >= 50) || ($PC.career == "arcology owner")>>//This will cost ¤<<print _price>> and some upkeep, @@.springgreen;reduced by your mercenary contacts@@//<<else>>//This will cost ¤5000 and incur significant upkeep costs//<</if>> <br><<link "Install a full platoon">> @@ -37,6 +39,8 @@ The budgetary difficulty many old world countries are in has resulted in unemplo <<set $rep -= 1000>> <<set $cash -= (_price*2)>> <<set $mercenaries = 3>> + <<set $mercTotalManpower = 30>> + <<set $mercFreeManpower = 30>> <</replace>> <</link>> <<if ($PC.warfare >= 50) || ($PC.career == "arcology owner")>>//This will cost ¤<<print (_price*2)>> and some upkeep, @@.springgreen;reduced by your mercenary contacts@@//<<else>>//This will cost ¤10000 and incur significant upkeep costs//<</if>> <br><<link "Do not quarter troops in your arcology">> diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw index 97e73abbbb3db062cb099cac41031f67def82a07..03084657858ce93f02d654402624bbdb903f22a3 100644 --- a/src/uncategorized/persBusiness.tw +++ b/src/uncategorized/persBusiness.tw @@ -2,6 +2,22 @@ <<if $useTabs == 0>>__Personal Business__<</if>> <br> +<<if $secExp == 1>> + <<if $PCWounded == 1>> + <<set $PCWoundCooldown-->> + <<if $PCWoundCooldown > 0>> + The injuries received in the recent battle prevents you from engaging in tiring endeavours. + <</if>> + <<if $PCWoundCooldown == 1>> + You are starting to feel better. It's very likely you will be back to full working order within the next week. + <<elseif $PCWoundCooldown == 0>> + <<set $PCWounded = 0>> + You finally recovered from your injuries. + <<else>> + Your trusted physician believes it will still take a few weeks to fully recover. + <</if>> + <</if>> +<</if>> <<if $cash < 0>> @@.red;You are in debt.@@ This week, interest came to ¤<<print (1+Math.trunc(Math.abs($cash)/100))>>. @@ -22,6 +38,8 @@ <<set $gameover = "debt">><<goto "Gameover">> <</if>> <</if>> +<<elseif $PCWounded == 1 && $secExp == 1>> + /* does nothing for this week */ <<elseif ($personalAttention == "whoring")>> <<if $PC.belly >= 1500>> <<if $arcologies[0].FSRepopulationFocus != "unset">> @@ -71,6 +89,8 @@ <<else>> You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 25%. <<if $PC.vagina == 1>>This is much easier to do without a big baby bump in the way.<</if>> <</if>> +<<elseif ($personalAttention == "proclamation")>> + /* handled after this if chain */ <<elseif ($personalAttention == "smuggling")>> <<set $qualifiedFS to []>> <<if $arcologies[0].FSDegradationistDecoration >= 80>> @@ -356,7 +376,35 @@ You have enough cash to manage your affairs, but not enough to do much business. <</if>> -<<if ($personalAttention == "trading")>> +<<if ($personalAttention == "proclamation")>> + After several days of preparation you are ready to issue the proclamation. You announce to the arcology your plans and in short order you use <<if $proclamationCurrency == "authority">>control over the arcology<<elseif $proclamationCurrency == "reputation">>great influence<<elseif $proclamationCurrency == "cash">> vast financial means<</if>> to + <<if $proclamationType == "security">> + gather crucial information for your security department. In just a few many hours holes are plugged and most moles are eliminated. @@.green;Your security greatly increased@@. + <<set $security = Math.clamp($security + 25,0,100)>> + <<if $proclamationCurrency == "authority">> + <<set $authority = Math.clamp($authority - 2000,0,20000)>> + <<elseif $proclamationCurrency == "reputation">> + <<set $rep = Math.clamp($rep - 4000,0,20000)>> + <<else>> + <<set $cash = Math.clamp($cash - 8000,0,20000)>> + <</if>> + <<elseif $proclamationType == "crime">> + force the arrest of many suspected citizens. Their personal power allowed them to avoid justice for a long time, but this day is their end. @@.green;Your crime greatly decreased@@. + <<set $crime = Math.clamp($crime - 25,0,100)>> + <<if $proclamationCurrency == "authority">> + <<set $authority = Math.clamp($authority - 2000,0,20000)>> + <<elseif $proclamationCurrency == "reputation">> + <<set $rep = Math.clamp($rep - 4000,0,20000)>> + <<else>> + <<set $cash = Math.clamp($cash - 8000,0,20000)>> + <</if>> + <</if>> + <<set $proclamationsCooldown = 4, $personalAttention = "business">> +<</if>> + +<<if $PCWounded == 1 && $secExp == 1>> + /* does nothing this week */ +<<elseif ($personalAttention == "trading")>> <<set _oldSkill = $PC.trading>> <<set $PC.trading += random(1,3)>> <<if _oldSkill <= 10>> @@ -531,6 +579,70 @@ <</if>> <</if>> +<<if $secExp == 1>> + <<if $smilingManFate == 0 && random(1,100) >= 85>> + This week one of the offside adventures of The Smiling Man produced a copious amount of money, of which @@.yellowgreen;you receive your share@@. + <<set $cash += random(10,20) * 1000>> + <</if>> + + <<if $sellData == 1>> + <<set _upgradeCount = 0>> + <<if $secUpgrades.nanoCams == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $secUpgrades.cyberBots == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $secUpgrades.eyeScan == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $secUpgrades.cryptoAnalyzer == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $crimeUpgrades.autoTrial == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $crimeUpgrades.autoArchive == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $crimeUpgrades.worldProfiler == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $crimeUpgrades.advForensic == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $intelUpgrades.sensors == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $intelUpgrades.radar == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<if $intelUpgrades.signalIntercept == 1>> + <<set _upgradeCount += 1>> + <</if>> + <<set _dataGain = _upgradeCount * 200>> + You are selling the data collected by your security department, making @@.yellowgreen;¤a discreet sum@@. + <<if !isInt(_dataGain)>> + <br>@@.red;Error, dataGain is NaN@@ + <</if>> + <<set $cash += _dataGain>> + Many of your citizens are not enthusiastic of this however, @@.red;damaging your authority@@. + <<set $authority -= 50>> + <</if>> + + <<if $marketInfiltration == 1>> + Your secret service makes use of black markets and illegal streams of goods to make a profit, making you @@.yellowgreen;¤a discreet sum@@. This however allows @@.red;crime to flourish@@ in the underbelly of the arcology. + <<set $cash += 1000 * random(4,8)>> + <<set $crime += random(0,2)>> + <</if>> + + <<if $arcRepairTime > 0>> + The recent rebellion left the arcology wounded and it falls to its owner to fix it. It will still take <<if $arcRepairTime > 1>>$arcRepairTime weeks<<else>>a week<</if>> to finish repair works. + <<set $cash -= 5000>> + <<set $arcRepairTime-->> + <</if>> +<</if>> + Routine upkeep of your demesne costs @@.yellow;¤$costs.@@ <<if $plot == 1>> <<if $week > 10>> @@ -575,8 +687,67 @@ Routine upkeep of your demesne costs @@.yellow;¤$costs.@@ <</if>> <</if>> <</if>> +<<if !isInt($costs)>> + <br>@@.red;Error, costs is NaN@@ +<</if>> <<set $cash -= $costs>> +<<if $secExp == 1>> + <br> + <br> + <<if $weapManu == 1>> + The weapons manufactoring complex produces armaments + <<if $weapProductivity <= 2>> + at a steady pace. + <<else>> + with great efficiency. + <</if>> + <<set _income = 0>> + <<set _price = Math.trunc(Math.clamp(random(1,2) + ($arcologies[0].prosperity / 15) - ($week / 30), 2, 8))>> + <<set _factoryMod = Math.round(1 + ($weapProductivity + $weapLab) / 2 + ($weapHelots / 100))>> + <<if $sellTo.citizen == 1>> + <<if $weaponsLaw == 3>> + Your lax regulations regarding weapons allows your citizens to buy much of what you are capable of producing. + <<set _income += Math.round(($ACitizens * 0.1) * _price * _factoryMod)>> + <<elseif $weaponsLaw >= 1>> + Your policies allow your citizen to buy your weaponry and they buy much of what you are capable of producing. + <<set _income += Math.round((($ACitizens * 0.1) * _price * _factoryMod) / (3 - $weaponsLaw))>> + <<else>> + Your policies do allow your citizen to buy weaponry, meaning all your income will come from exports. + <</if>> + <</if>> + <<if $sellTo.raiders == 1>> + Some weapons are sold to the various raider gangs infesting the wastelands. + <<set _income += Math.round($week / 3 * (_price / 2) * 10 * _factoryMod)>> + <</if>> + <<if $sellTo.oldWorld == 1>> + Part of our production is sold to some old world nations. + <<set _income += Math.round($week / 3 * _price * 10 * _factoryMod)>> + <</if>> + <<if $sellTo.raiders == 1>> + A share of our weapons production is sold to other free cities. + <<set _income += Math.round($week / 3 * _price * 10 * _factoryMod)>> + <</if>> + <<if $peacekeepers.strength >= 50>> + The peacekeeping force is always in need of new armaments and is happy to be supplied by their ally. + <<set _income += Math.round($peacekeepers.strength * _price * 10 * _factoryMod)>> + <</if>> + <<set _income = Math.trunc(_income * 0.5)>> + This week we made @@.yellowgreen;¤<<print _income>>@@ + <<if !isInt(_income)>> + <br>@@.red;Error failed to calculate income@@ + <<else>> + <<set $cash += _income>> + <</if>> + <</if>> + + <<if $taxTrade == 1>> + <br>Fees on transitioning goods this week made @@.yellowgreen;¤<<print $trade * random(80,120)>>@@ + <<set $cash += $trade * 100>> + <</if>> +<</if>> + +<br> <br> <<set $seed = random(1,100)>> diff --git a/src/uncategorized/personalAttentionSelect.tw b/src/uncategorized/personalAttentionSelect.tw index 745292e8b37d74bb56b937571047ffacacefd97e..209b182ac7cc37e0aa88926d10482d43c734e066 100644 --- a/src/uncategorized/personalAttentionSelect.tw +++ b/src/uncategorized/personalAttentionSelect.tw @@ -15,7 +15,21 @@ <<if $HeadGirl != 0>> <br>[[Support your Head Girl|Main][$personalAttention = "HG", $personalAttentionChanged = 1]] <</if>> -<br>[[Have as much sex with your slaves as possible|Main][$personalAttention = "sex", $personalAttentionChanged = 1]]<br><br> +<br>[[Have as much sex with your slaves as possible|Main][$personalAttention = "sex", $personalAttentionChanged = 1]] +<<if $proclamationsCooldown == 0 && $secExp == 1>> + <br>[[Issue a proclamation|proclamations]] + <br> + <br> +<<elseif $secExp == 1>> + <br>It's too early to issue another proclamation. Another will be available in <<if $proclamationsCooldown == 1>> one week.<<else>> $proclamationsCooldown weeks.<</if>> + <br> + <br> +<<else>> + <br> + <br> +<</if>> + + <<if $PC.trading >= 100>> //You are a master trader.// diff --git a/src/uncategorized/reputation.tw b/src/uncategorized/reputation.tw index 36a494576e421edde380fccaa343b3c5fb816262..d27fc591c51fd7f298b2fc35e19077011a02f20d 100644 --- a/src/uncategorized/reputation.tw +++ b/src/uncategorized/reputation.tw @@ -198,6 +198,18 @@ On formal occasions, you are announced as $PCTitle. <</if>> <</if>> +<<if $secExp == 1>> + <<if $smilingManFate == 1>> + The grim statue of the Smiling Man outside your arcology @@.green;reminds the world of who managed to eliminate such a threat@@. + <<set $rep += 100>> + <</if>> + + <<if $weaponsLaw == 3>> + The absence of any kind of restriction on weaponry within your arcology is @@.green;welcomed by your citizens@@ as sign of your respect for the ideals the Free Cities stand for. + <<set $rep += 20>> + <</if>> +<</if>> + <<if $arcologies[0].FSSupremacist != "unset">> <<if ($PC.race == $arcologies[0].FSSupremacistRace)>> Since you are a member of the $PC.race, society @@.green;strongly approves@@ of your ownership of the arcology. @@ -580,15 +592,34 @@ On formal occasions, you are announced as $PCTitle. <</if>> <</if>> +<<if $secExp == 1>> + <<if $fakeNews == 1>> + The authenticity department produces and distributes copious amounts of plausible enough news and reports, @@.green;increasing your reputation@@ + <<set $repGain += 10 * $miniTruth>> + <</if>> +<</if>> + <<set $rep -= $repLoss>> <<set $rep += $repGain>> +<br> + <<if $repGain > $repLoss>> @@.green;Your reputation increased this week.@@ <<elseif $repGain < $repLoss>> @@.red;Your reputation decreased this week.@@ <</if>> +<<if isNaN($repGain)>> + <br>@@.red;Error: repGain is outside accepted range, please report this issue@@ +<</if>> +<<if isNaN($repLoss)>> + <br>@@.red;Error: repLoss is outside accepted range, please report this issue@@ +<</if>> +<<if isNaN($rep)>> + <br>@@.red;Error: rep is outside accepted range, please report this issue@@ +<</if>> + <<if $rep > 19000>> Your reputation is capped. <<set $rep = 20000>> @@ -663,4 +694,4 @@ On formal occasions, you are announced as $PCTitle. <<elseif $failedElite > 50>> The Societal Elite @@.red;mutter about you@@. <</if>> -<</if>> +<</if>> \ No newline at end of file diff --git a/src/uncategorized/scheduledEvent.tw b/src/uncategorized/scheduledEvent.tw index fc8544edd9deacfdc071571e940e4f4250ec8362..20c7ba299586c7dc7dca78107bb6a96448b508b9 100644 --- a/src/uncategorized/scheduledEvent.tw +++ b/src/uncategorized/scheduledEvent.tw @@ -90,8 +90,18 @@ <<set $fcnn = ["FCNN service has been temporarily suspended. Please stand by."]>> <</if>> +<<if $secExp == 1>> + <<include "attackGenerator">> +<</if>> + <<if $rivalOwner == -1>> <<goto "P rival initiation">> +<<elseif $slaveRebellion == 1 && $secExp == 1>> + <<goto "rebellionOptions">> +<<elseif $citizenRebellion == 1 && $secExp == 1>> + <<goto "rebellionOptions">> +<<elseif $attackThisWeek == 1 && $secExp == 1>> + <<goto "attackOptions">> <<elseif $PC.labor == 1>> <<goto "SE Player Birth">> <<elseif ($independenceDay == 1) && (Math.trunc(($week-23)/52) == ($week-23)/52)>> diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw index e60b765e68412fe251eb5a9989a00930983fdb1c..5965d4a3d8d1c760e655e2533efdea31b61c6361 100644 --- a/src/uncategorized/storyCaption.tw +++ b/src/uncategorized/storyCaption.tw @@ -196,6 +196,56 @@ <</if>> ($rep) </span> +<<if $secExp == 1>> +<br>@@.darkviolet;Auth@@ | +<<set $authority = Math.clamp(Math.trunc($authority), 0, 20000)>> +<span id="auth"> +<<if $authority > 19500>> + @@color:rgb(148, 0, 211);divine will@@ +<<elseif $authority > 19000>> + @@color:rgb(148, 0, 211);sovereign@@ +<<elseif $authority > 18000>> + @@color:rgb(148, 0, 211);monarch@@ +<<elseif $authority > 17000>> + @@color:rgb(148, 0, 211);tyrant@@ +<<elseif $authority > 15000>> + @@color:rgb(148, 0, 211);dictator@@ +<<elseif $authority > 14000>> + @@color:rgb(148, 0, 211);prince@@ +<<elseif $authority > 13000>> + @@color:rgb(183, 0, 211);master@@ +<<elseif $authority > 12000>> + @@color:rgb(183, 0, 211);leader@@ +<<elseif $authority > 11000>> + @@color:rgb(183, 0, 211);director@@ +<<elseif $authority > 10000>> + @@color:rgb(183, 0, 211);overseer@@ +<<elseif $authority > 9000>> + @@color:rgb(183, 0, 211);chief@@ +<<elseif $authority > 8000>> + @@color:rgb(183, 0, 211);manager@@ +<<elseif $authority > 7000>> + @@color:rgb(211,0,204);principal@@ +<<elseif $authority > 6000>> + @@color:rgb(211,0,204);auxiliary@@ +<<elseif $authority > 5000>> + @@color:rgb(211,0,204);subordinate@@ +<<elseif $authority > 4000>> + @@color:rgb(211,0,204);follower@@ +<<elseif $authority > 3000>> + @@color:rgb(211,0,204);powerless@@ +<<elseif $authority > 2000>> + @@color:rgb(211,0,204);toothless@@ +<<elseif $authority > 1000>> + @@color:rgb(211,0,204);mostly harmless@@ +<<else>> + @@color:rgb(211,0,204);harmless@@ +<</if>> +(<<print $authority>>) +</span> +<br>@@.deepskyblue;Security@@ | @@.deepskyblue;<<print Math.trunc($security)>>%@@ +<br>@@.orangered;Crime@@ | @@.orangered;<<print Math.trunc($crime)>>%@@ +<</if>> <<if (_Pass == "Main")>> <<if ($cheatMode) && ($cheatModeM)>> <<set _TRep = $rep>> @@ -372,42 +422,73 @@ <br><span id="manageArcology"><<link "Manage Arcology">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Arcology">><</link>></span> @@.cyan;[C]@@ <br><span id="managePenthouse"><<link "Manage Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>></span> @@.cyan;[P]@@ <br><span id="managePerson"><<link "Manage Personal Affairs">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Personal Affairs">><</link>></span> @@.cyan;[X]@@ + <br><span id="PAOButton"><<link [[Personal Assistant|Personal assistant options]]>><</link>></span> @@.cyan;[T]@@ + <br><span id="policyButton"><<link [[Policies]]>><</link>></span> @@.cyan;[Y]@@ + <<if $FSAnnounced>> + <br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@ + <</if>> + <br><span id="URButton"><<link [[Universal Rules]]>><</link>></span> @@.cyan;[V]@@ + <br><span id="optionsButton"><<link "Game Options">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Options">><</link>></span> @@.cyan;[O]@@ + + <<if $secExp == 1>> + <<if $propHub == 1>> + <br><span id="propHub"><<link "Manage PR">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "propagandaHub">><</link>></span> @@.cyan;[Shift+H]@@ + <</if>> + <<if $secHQ == 1>> + <br><span id="securityHQ"><<link "Manage Security">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "securityHQ">><</link>></span> @@.cyan;[Shift+S]@@ + <</if>> + <<if $secBarracks == 1>> + <br><span id="secBarracks"><<link "Manage Military">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "secBarracks">><</link>></span> @@.cyan;[Shift+A]@@ + <</if>> + <<if $riotCenter == 1>> + <br><span id="riotCenter"><<link "Manage Rebels">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "riotControlCenter">><</link>></span> @@.cyan;[Shift+R]@@ + <</if>> + <span id="edictButton"><<link [[Edicts|edicts]]>><</link>></span> @@.cyan;[D]@@ + <</if>> + <<if $cyberMod != 0 && $researchLab.built == "true">> <br>[[Manage Research Lab|Research Lab][$temp = 0]] <</if>> <<if ($securityForceActive)>> <br><span id="SFMButton"><<link [[SF Barracks|SFM Barracks]]>><</link>></span> @@.cyan;[Z]@@ <</if>> - <br><span id="PAOButton"><<link [[Personal Assistant|Personal assistant options]]>><</link>></span> @@.cyan;[T]@@ - <br><span id="policyButton"><<link [[Policies]]>><</link>></span> @@.cyan;[Y]@@ - <<if $FSAnnounced>> - <br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@ - <</if>> - <br><span id="URButton"><<link [[Universal Rules]]>><</link>></span> @@.cyan;[V]@@ <</if>> - <br><span id="optionsButton"><<link "Game Options">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Options">><</link>></span> @@.cyan;[O]@@ <br> - + <<elseif _Pass == "Manage Arcology">> - <br><br> + <br> <br><span id="managePenthouse"><<link "Manage Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>></span> @@.cyan;[P]@@ <br><span id="managePerson"><<link "Manage Personal Affairs">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Personal Affairs">><</link>></span> @@.cyan;[X]@@ - <<if $cyberMod != 0 && $researchLab.built == "true">> - <br>[[Manage Research Lab|Research Lab][$temp = 0]] - <</if>> - <<if ($securityForceActive)>> - <br><span id="SFMButton"><<link [[SF Barracks|SFM Barracks]]>><</link>></span> @@.cyan;[Z]@@ - <</if>> <br><span id="PAOButton"><<link [[Personal Assistant|Personal assistant options]]>><</link>></span> @@.cyan;[T]@@ - <br> <br><span id="policyButton"><<link [[Policies]]>><</link>></span> @@.cyan;[Y]@@ <<if $FSAnnounced>> - <br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@ + <br><span id="FSButton"><<link [[Future Societies|Future Society]]>><</link>></span> @@.cyan;[F]@@ <</if>> <br><span id="URButton"><<link [[Universal Rules]]>><</link>></span> @@.cyan;[V]@@ - <br> <br><span id="optionsButton"><<link "Game Options">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Options">><</link>></span> @@.cyan;[O]@@ - <br> + + <<if $secExp == 1>> + <<if $propHub == 1>> + <br><span id="propHub"><<link "Manage PR">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "propagandaHub">><</link>></span> @@.cyan;[Shift+H]@@ + <</if>> + <<if $secHQ == 1>> + <br><span id="securityHQ"><<link "Manage Security">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "securityHQ">><</link>></span> @@.cyan;[Shift+S]@@ + <</if>> + <<if $secBarracks == 1>> + <br><span id="secBarracks"><<link "Manage Military">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "secBarracks">><</link>></span> @@.cyan;[Shift+A]@@ + <</if>> + <<if $riotCenter == 1>> + <br><span id="riotCenter"><<link "Manage Rebels">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "riotControlCenter">><</link>></span> @@.cyan;[Shift+R]@@ + <</if>> + <span id="edictButton"><<link [[Edicts|edicts]]>><</link>></span> @@.cyan;[D]@@ + <</if>> + + <<if $cyberMod != 0 && $researchLab.built == "true">> + <br>[[Manage Research Lab|Research Lab][$temp = 0]] + <</if>> + <<if ($securityForceActive)>> + <br><span id="SFMButton"><<link [[SF Barracks|SFM Barracks]]>><</link>></span> @@.cyan;[Z]@@ + <</if>> <<elseif _Pass == "Manage Penthouse">> <br> <br><<link [[Wardrobe]]>><</link>> diff --git a/src/utility/descriptionWidgets.tw b/src/utility/descriptionWidgets.tw index 37f2b92c77ad69edd2746ec99cc0dc7d6094c4b4..b85b60c3292cd1ae070eb00229ce2a3dbf1904c6 100644 --- a/src/utility/descriptionWidgets.tw +++ b/src/utility/descriptionWidgets.tw @@ -3,6 +3,9 @@ <<widget "MainLinks">> <center> +<<if $PCWounded == 1>> + The injuries received in the recent battle prevent you from undertaking tiring efforts. +<<else>> <<switch $personalAttention>> <<case "business">>You plan to focus on business this week. <<case "whoring">>You plan to focus on earning extra money this week. @@ -15,6 +18,7 @@ <<case "slaving">>This week you will learn slaving. <<case "engineering">>This week you will learn engineering. <<case "medicine">>This week you will learn medicine. +<<case "proclamation">>This week you plan to issue a proclamation about $proclamationType. <<default>> <<if _PA > -1>> You plan to train ''__@@.pink;<<SlaveFullName $slaves[_PA]>>@@__'' to $trainingRegimen this week. @@ -200,6 +204,7 @@ <br>@@.yellow;For your first purchase, @@<strong>[[The Futanari Sisters][$slavesSeen += 1]]</strong>@@.yellow; will sell at half price this week.@@ <</if>> <</if>> +<</if>> /* closes wound check */ </center> <</widget>>