From 6da6c1304f44d64f39cfebae2093a68dfea60a67 Mon Sep 17 00:00:00 2001 From: hexall90 <hexall90@gmail.com> Date: Sat, 23 Sep 2017 17:16:01 +0200 Subject: [PATCH] working --- src/SecExp/attackHandler.tw | 65 +++++++---- src/SecExp/attackReport.tw | 219 ++++++++++++++++++++++++++++++++---- 2 files changed, 239 insertions(+), 45 deletions(-) diff --git a/src/SecExp/attackHandler.tw b/src/SecExp/attackHandler.tw index cb54d65c803..989d1643bb3 100644 --- a/src/SecExp/attackHandler.tw +++ b/src/SecExp/attackHandler.tw @@ -107,21 +107,33 @@ <<set _militiaMod += 0.10>> <<set _mercMod += 0.10>> <</if>> - <<if !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -2>> + <<if (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 3>> + <<set _atkMod += 0.25>> + <<set _defMod += 0.25>> + <<elseif $Bodyguard.intelligence == 3>> + <<set _atkMod += 0.20>> + <<set _defMod += 0.15>> + <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 2>> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<elseif $Bodyguard.intelligence == 2>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<elseif setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career) && $Bodyguard.intelligence >= 1>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -2>> <<set _atkMod -= 0.15>> <<set _defMod -= 0.15>> + <<elseif $Bodyguard.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.10>> <<elseif !(setup.bodyguardCareers.includes($Bodyguard.career) && setup.HGCareers.includes($Bodyguard.career)) || $Bodyguard.intelligence <= -1>> <<set _atkMod -= 0.10>> <<set _defMod -= 0.10>> - <<elseif setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career) || $Bodyguard.intelligence == 2>> - <<set _atkMod += 0.10>> - <<set _defMod += 0.10>> - <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 2>> - <<set _atkMod += 0.15>> - <<set _defMod += 0.10>> - <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 3>> - <<set _atkMod += 0.20>> - <<set _defMod += 0.15>> + <<elseif $Bodyguard.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> <</if>> <<elseif $leadingTroops == "headGirl">> <<if $HeadGirl.devotion < -20>> @@ -136,21 +148,33 @@ <<set _militiaMod += 0.10>> <<set _mercMod += 0.10>> <</if>> - <<if !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -2>> + <<<<if (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 3>> + <<set _atkMod += 0.25>> + <<set _defMod += 0.25>> + <<elseif $HeadGirl.intelligence == 3>> + <<set _atkMod += 0.20>> + <<set _defMod += 0.15>> + <<elseif (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 2>> + <<set _atkMod += 0.15>> + <<set _defMod += 0.10>> + <<elseif $HeadGirl.intelligence == 2>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.10>> + <<elseif setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career) && $HeadGirl.intelligence >= 1>> + <<set _atkMod += 0.10>> + <<set _defMod += 0.05>> + <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -2>> <<set _atkMod -= 0.15>> <<set _defMod -= 0.15>> + <<elseif $HeadGirl.intelligence <= -2>> + <<set _atkMod -= 0.15>> + <<set _defMod -= 0.10>> <<elseif !(setup.bodyguardCareers.includes($HeadGirl.career) && setup.HGCareers.includes($HeadGirl.career)) || $HeadGirl.intelligence <= -1>> <<set _atkMod -= 0.10>> <<set _defMod -= 0.10>> - <<elseif setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career) || $HeadGirl.intelligence == 2>> - <<set _atkMod += 0.10>> - <<set _defMod += 0.10>> - <<elseif (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 2>> - <<set _atkMod += 0.15>> - <<set _defMod += 0.10>> - <<elseif (setup.bodyguardCareers.includes($HeadGirl.career) || setup.HGCareers.includes($HeadGirl.career)) && $HeadGirl.intelligence == 3>> - <<set _atkMod += 0.20>> - <<set _defMod += 0.15>> + <<elseif $HeadGirl.intelligence <= -1>> + <<set _atkMod -= 0.10>> + <<set _defMod -= 0.05>> <</if>> <<elseif $leadingTroops == "citizen">> <<if $arcologies[0].FSDegradationist == "unset" && $arcologies[0].FSPaternalist == "unset">> @@ -171,6 +195,7 @@ <<set _atkMod += either(-1,1) * random(10) * 0.1>> <<set _defMod += either(-1,1) * random(10) * 0.1>> <<elseif $leadingTroops == "mercenary">> + <<set _mercMod += 0.10>> <<if $arcologies[0].FSRomanRevivalist != "unset">> <<set _militiaMod += 0.10>> <<else>> diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw index f43aa81526b..2a7ff9e1952 100644 --- a/src/SecExp/attackReport.tw +++ b/src/SecExp/attackReport.tw @@ -573,7 +573,7 @@ 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 $deployingMilitia == 1>> + <<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>> @@ -599,7 +599,7 @@ . 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>> + <<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>> @@ -687,36 +687,152 @@ Your mercenaries <<if $deployingMilitia == 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 <= -2>> - <<if setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)>> - Despite the experience she accumulated during her past career, h - <<else>> - H - <</if>> - er very low intelligence is a great boon for your enemy. + <<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 greatly effective. + <<elseif $Bodyguard.intelligence == 3>> + While she lacks experience, her great intellect allows her to seize and exploit any tactical advantage the battlefied 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>> - <<if setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)>> - Despite the experience she accumulated during her past career, s - <<else>> - S + 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>> +<<elseif $leadingTroops == "headGirl">> + You 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>> - he unfortunately lacks the intelligence to be an effective commander, which means your troops performed worse than they would be able otherwise. - <<elseif setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career) || $Bodyguard.intelligence == 2>> - <<if setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)>> - Thanks to the experience she accumulated during her past career, she performs well as a commander. Her competence increases the efficacy of your troops. - <<else>> - Despite not having a lot of experience as a leader, she is intelligent enough to still be a decent commander. Her competence increases the efficacy of your troops. + <</if>> + <<if _oldRep < 10000 && _oldAuth < 10000 || $HeadGirl.prestige < 1>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingMilitia == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1>> + and neither are your mercenaries. + <<else>> + . + <</if>> + <<elseif $deployingMercs == 1>> + Your mercenaries <<if $deployingMilitia == 1>>however<</if>> are not enthusiastic to have a slave as a commander. <</if>> - <<elseif (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 2>> + <<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>> + <<else>> + <<if $deployingMilitia == 1>> + Your volunteers <<if $deployingMilitia == 1>>however<</if>> are not enthusiastic to have a slave as a commander + <<if $deployingMercs == 1>> + and neither are your mercenaries, 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>> + Your mercenaries <<if $deployingMilitia == 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 battlefied 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 (setup.bodyguardCareers.includes($Bodyguard.career) || setup.HGCareers.includes($Bodyguard.career)) && $Bodyguard.intelligence == 3>> - With her experience and her great intellect, there's little + <<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>> -<<elseif $leadingTroops == "headGirl">> - <<elseif $leadingTroops == "citizen">> - + You 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 byt 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">> + Since you decided to revive old Rome, many of your citizens took on themselves to educate themselves in amrtial matters, because of this your mercenaries feel safe enough in the hands of one of your volunteers. + <<else>> + You mercenaries are not thrilled to be lead by a civilian without any formal martial training or education. + <</if>> <<elseif $leadingTroops == "mercenary">> + <<if $deployingMercs == 1>> + Your mercenaries of course approve 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 mercenaries as their leader. + <<elseif $deployingMilitia == 1>> + Your volunteers are not enthusiastic at the prospect of being commanded around by agun 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>> + +<br> + +/* tactics and terrain */ +<<if $chosenTactic == "Bait and Bleed">> + +<<elseif $chosenTactic == "Guerrilla">> + +<<elseif $chosenTactic == "Choke Points">> + +<<elseif $chosenTactic == "Interior Lines">> + +<<elseif $chosenTactic == "Pincer Manouver">> + +<<elseif $chosenTactic == "Defense In Depth">> + +<<elseif $chosenTactic == "Blitzkrieg">> + +<<elseif $chosenTactic == "Human Wave">> <</if>> @@ -729,9 +845,21 @@ <br> Your squadron of security drones participated in the battle, dominating the airspace and providing vital intelligence to the rest of the army. <<set $secBots.troops -= _loss>> + During the battle they suffered + <<if _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 $deployingMilitia == 1>> @@ -740,13 +868,28 @@ <<if $militiaUnits[_i].isDeployed == 1>> <br> $militiaUnits[_i].platoonName participated in the battle, your proud citizens defending with their lives their arcology. + During the battle they suffered + <<if _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> <<if $militiaUnits[_i].medics == 1>> + , however <<print math.trunc(_loss * $militiaUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit. <<set $militiaUnits[_i].troops -= Math.trunc(_loss - _loss * $militiaUnits[_i].medics * 0.25)>> + <<else>> + . <</if>> <<if $militiaUnits[_i].troops <= 0>> <<set $militiaUnits[_i].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. The remnants will be sent home honored as veterans or reorganized in a new unit. + <<elseif $militiaUnits[_i].troops <= 10>> + The unit has very few operatives left, it risks compelte annihilation if deployed again. <</if>> <</if>> <</for>> @@ -757,9 +900,22 @@ <<if $slaveUnits[_i].isDeployed == 1>> <br> $slaveUnits[_i].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 <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> <<if $slaveUnits[_i].medics == 1>> + , however <<print math.trunc(_loss * $slaveUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit. <<set $slaveUnits[_i].troops -= Math.trunc(_loss - _loss * $slaveUnits[_i].medics * 0.25)>> + <<else>> + . <</if>> <<if $slaveUnits.troops <= 0>> <<set $slaveUnits[_i].active = 0>> @@ -774,9 +930,22 @@ <<if $mercUnits[_i].isDeployed == 1>> <br> $mercUnits[_i].platoonName participated in the battle. Mercenaries are a comon sight on the modern battlefield and yours are proud to serve their generous contractor. + During the battle they suffered + <<if _loss <= 10>> + light casualties + <<elseif _loss <= 30>> + moderate casualties + <<elseif _loss <= 60>> + heavy casualties + <<else>> + catastrofic casualties + <</if>> <<if $mercUnits[_i].medics == 1>> + , however <<print math.trunc(_loss * $mercUnits[_i].medics * 0.25)>> men were saved by the medics attached to this unit. <<set $mercUnits[_i].troops -= Math.trunc(_loss - _loss * $mercUnits[_i].medics * 0.25)>> + <<else>> + . <</if>> <<if $mercUnits.troops <= 0>> <<set $mercUnits[_i].active = 0>> -- GitLab