Skip to content
Snippets Groups Projects
Commit 1eeef274 authored by Blank's avatar Blank Committed by Pregmodder
Browse files

Changes

parent 77ee48cb
No related branches found
No related tags found
No related merge requests found
......@@ -128,32 +128,31 @@
<<set $battleTerrain = "error">>
<</if>>
<<set _L0=3,_L1=45>>
<<if $attackType == "raiders">> <<set $attackTroops = random(40,80)>>
<<set _L=0>>
<<if $attackType == "raiders">> <<set $attackTroops = random(40,80),_L=1>>
<<elseif $attackType == "free city">> <<set $attackTroops = random(20,40)>>
<<elseif $attackType == "old world">> <<set $attackTroops = random(25,50)>>
<<elseif $attackType == "freedom fighters">>
<<set $attackTroops = random(30,60),_L0=1,_L1=60>>
<<elseif $attackType == "freedom fighters">> <<set $attackTroops = random(30,60)>>
<</if>>
<<if $week < 30>>
<<set $attackTroops *= Math.ceil(random( (1*(1.15+($week/203))), (2*(1+($week/149))) ))>>
<<set $attackTroops *= Math.trunc(random( (1*(1.01+($week/100))), (2*(1.01+($week/100))) ))>> /*<<set $attackTroops *= random(1,2)>>*/
<<elseif $week < 60>>
<<set $attackTroops *= Math.ceil(random( (1*(1.25+($week/135))), (3*(1.5+($week/99))) ))>>
<<set $attackTroops *= Math.trunc(random( (1*(1.01+($week/200))), (3*(1.01+($week/200))) ))>> /*<<set $attackTroops *= random(1,3)>>*/
<<elseif $week < 90>>
<<set $attackTroops *= Math.ceil(random( (2*(1.35+($week/90))), (3*(2+($week/66))) ))>>
<<set $attackTroops *= Math.trunc(random( (2*(1.01+($week/300))), (3*(1.01+($week/300))) ))>> /*<<set $attackTroops *= random(2,3)>>*/
<<elseif $week < 120>>
<<set $attackTroops *= Math.ceil(random( (2*(1.5+($week/60))), (4*(3+($week/45))) ))>>
<<set $attackTroops *= Math.trunc(random( (2*(1.01+($week/400))), (4*(1.01+($week/400))) ))>> /*<<set $attackTroops *= random(2,4)>>*/
<<else>>
<<set $attackTroops *= Math.ceil(random( (3*(2+($week/40))), (5*(4+($week/30))) ))>>
<<set $attackTroops *= random(3,5)>>
<</if>>
<<if $week < 60>>
<<set $attackEquip = Math.ceil(random( (0, (1*(1.5+($week/99))) ))>>
<<set $attackEquip = random(0,1)>>
<<elseif $week < 90>>
<<set $attackEquip = Math.ceil(random( (0, (3*(2+($week/66))) ))>>
<<set $attackEquip = random(0,3-_L)>> /*"raiders" <<set $attackEquip = random(0,2)>>*/
<<elseif $week < 120>>
<<set $attackEquip = Math.ceil(random( (0, (_L0*(_L0+($week/_L1))) ))>>
<<set $attackEquip = random(1-_L,3)>> /*"raiders" <<set $attackEquip = random(0,3)>>*/
<<else>>
<<set $attackEquip = Math.ceil(random( (2*(2+($week/40))), (4*(4+($week/30))) ))>>
<<set $attackEquip = random(2-_L,4-_L)>> /*"raiders" <<set $attackEquip = random(1,3)>>*/
<</if>>
/* major battles have a 50% chance of firing after week 120 */
......
......@@ -130,7 +130,7 @@
<hr>
<<if $attackType == "raiders">>
Today, the _day of _month _year, our arcology was attacked by a band of wild raiders, <<print commaNum($attackTroops)>> men strong.
Today, the _day of _month _year, our arcology was attacked by a band of wild raiders, <<print commaNum(Math.trunc($attackTroops))>> men strong.
<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
Our defense forces, <<print commaNum(Math.trunc($troopCount))>> strong, clashed with them
<<if $battleTerrain == "urban">>
......@@ -156,7 +156,7 @@
<</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<<if $PCvictoryStreak >= 2 || $PClossStreak >= 2>>,<<else>>.<</if>>
The fight was quick and one sided, our men easily stopped the disorganized horde's futile attempt at raiding your arcology<<if $PCvictoryStreak >= 2 || $PClossStreak >= 2>>,<<else>>.<</if>>
<<elseif $battleTurns <= 7>>
The fight was hard, but in the end our men stopped the disorganized horde attempt at raiding your arcology<<if $PCvictoryStreak >= 2 || $PClossStreak >= 2>>,<<else>>.<</if>>
<<else>>
......@@ -192,9 +192,9 @@
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, <<print commaNum($attackTroops)>> men strong.
Today, the _day of _month _year, our arcology was attacked by a contingent of mercenaries hired by a competing free city, <<print commaNum(Math.trunc($attackTroops))>> men strong.
<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
Our defense forces, $troopCount strong, clashed with them
Our defense forces, <<print commaNum(Math.trunc($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">>
......@@ -254,9 +254,9 @@
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, <<print commaNum($attackTroops)>> men strong.
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, <<print commaNum(Math.trunc($attackTroops))>> men strong.
<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
Our defense forces, $troopCount strong, clashed with them
Our defense forces, <<print commaNum(Math.trunc($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">>
......@@ -316,9 +316,9 @@
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, <<print commaNum($attackTroops)>> men strong.
Today, the _day of _month _year, our arcology was attacked by an old world nation boasting a misplaced sense of superiority, <<print commaNum(Math.trunc($attackTroops))>> men strong.
<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
Our defense forces, $troopCount strong, clashed with them
Our defense forces, <<print commaNum(Math.trunc($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">>
......
......@@ -235,15 +235,15 @@
<<set _weekMod = 0.50>>
<<if $week <= 30>>
<<set _weekMod = 0.75 * Math.round(1+$week/10)>>
<<set _weekMod = 0.75 + (0.01+($week/200))>>
<<elseif $week <= 60>>
<<set _weekMod = 1 * Math.round(1+$week/10)>>
<<set _weekMod = 1 + (0.01+($week/300))>>
<<elseif $week <= 90>>
<<set _weekMod = 1.25 * Math.round(1+$week/10)>>
<<set _weekMod = 1.25 + (0.01+($week/400))>>
<<elseif $week <= 120>>
<<set _weekMod = 1.50 * Math.round(1+$week/10)>>
<<set _weekMod = 1.50 + (0.01+($week/500))>>
<<else>>
<<set _weekMod = 1.75 * Math.round(1+$week/10)>>
<<set _weekMod = 1.75>>
<</if>>
/* resetting ID list */
......
......@@ -253,21 +253,22 @@ window.SFBC = function() {
};
window.SFReport = function() {
"use strict";
const V=State.variables,T=State.temporary,S=V.SF.Squad;
var target=50000,baseLine=5000,profit=0,upkeep=0,income=0;
var Multiplier={action:1,troop:1,unit:1,depravity:1},SFD=V.SF.Depravity;
var FNG=10,unitCap=2500,Trade=0.025,deaths=0,r=``; Count();
var cost={a:0.01,b:2.5};var NO=1+(V.SF.Size/10);var N1=1+(V.SF.Size/10);
let target=50000,baseLine=5000,profit=0,upkeep=0,income=0;
let Multiplier={action:1,troop:1,unit:1,depravity:1},SFD=V.SF.Depravity;
let FNG=10,unitCap=2500,Trade=0.025,deaths=0,r=``; Count();
let cost={a:0.01,b:2.5};let NO=1+(V.SF.Size/5);let N1=1+(V.SF.Size/5);
V.SFUC=0; if (profit < 1) cost.a=10; cost.b=0.1;NO=1;N1=0.1;
if (S.Troops > unitCap) S.Troops=unitCap;
if (S.Troops < 100) { S.Troops += Math.ceil(jsRandom(2,5));
} else {
if (V.SF.Target === "recruit") {
S.Troops += Math.ceil(jsRandom(-1*S.Troops/100,0));
S.Troops += Math.ceil(jsRandom(-1*S.Troops/1000,0));
} else if (V.SF.Target === "raiding") {
S.Troops += Math.ceil(jsRandom(-3*S.Troops/100,-4*S.Troops/100));
} else { S.Troops += Math.ceil(jsRandom(-2*S.Troops/100,-3*S.Troops/100)); }
S.Troops += Math.ceil(jsRandom(-1.15*S.Troops/1000,-1.20*S.Troops/1000));
} else { S.Troops += Math.ceil(jsRandom(-1.10*S.Troops/1000,-1.15*S.Troops/1000)); }
}
if (V.SF.UC.Assign > 0) {
if (V.SF.UC.Assign < 2) { V.SFUC=Math.ceil(S.Troops*0.1);
......@@ -364,14 +365,14 @@ window.SFReport = function() {
V.arcologies[0].prosperity=Math.ceil(V.arcologies[0].prosperity+(Trade/10)*0.25);}
if (V.secExp > 0) V.authority += V.SF.Size*10; V.authority=Math.clamp(V.authority, 0, 20000);
income += Math.ceil( (baseLine* (0.09+Multiplier.troop/NO).toFixed(2) * (0.09+Multiplier.unit/NO).toFixed(2) * (0.09+Multiplier.action/NO).toFixed(2) * (0.09+Multiplier.depravity/NO).toFixed(2) )-(upkeep*N1).toFixed(2) ); S.Troops += Math.round(FNG/2);
r += `income:${commaNum(income)}, troop:${commaNum((0.09+Multiplier.troop/NO).toFixed(2))}, unit:${commaNum((0.09+Multiplier.unit/NO).toFixed(2))}, action:${commaNum((0.09+Multiplier.action/NO).toFixed(2))}, depravity:${commaNum((0.09+Multiplier.depravity/NO).toFixed(2))}, upkeep:${commaNum((upkeep*N1).toFixed(2))}`;
//if (V.economy < 100) income=Math.ceil(income*(1+(V.week/100))); //Remove line if hard mode ever gets fixed.
income += Math.ceil( ( (baseLine* (0.09+Multiplier.troop/NO).toFixed(2) * (0.09+Multiplier.unit/NO).toFixed(2) * (0.09+Multiplier.action/NO).toFixed(2) * (0.09+Multiplier.depravity/NO).toFixed(2) ) - (upkeep*N1).toFixed(2) )/V.SF.Size/5+S.Troops/1000 ); S.Troops += Math.round(FNG/2);
if (V.debugMode > 0) r += `<br>income:${commaNum(income)}, troop:${commaNum((0.09+Multiplier.troop/NO).toFixed(2))}, unit:${commaNum((0.09+Multiplier.unit/NO).toFixed(2))}, action:${commaNum((0.09+Multiplier.action/NO).toFixed(2))}, depravity:${commaNum((0.09+Multiplier.depravity/NO).toFixed(2))}, upkeep:${commaNum((upkeep*N1).toFixed(2))}`;
if (V.economy < 100) if (V.SF.Target === "raiding") { income=Math.ceil(income*14) } else if (V.SF.Target === "secure") { income=Math.ceil(income*20) } else { income=Math.ceil(income*50) }; //Remove line if hard mode ever gets fixed.
if (income >= target) profit=1; delete V.SF.Subsidy; cashX(income, "specialForces");
if (S.Troops > unitCap) S.Troops=unitCap;
if (V.arcologies[0].prosperity > V.ProsperityCap) V.arcologies[0].prosperity=V.ProsperityCap;
if (S.Drugs >= 8 || S.Drugs >= 10) { var survivalChance=50;
if (S.Drugs >= 8 || S.Drugs >= 10) { let survivalChance=50;
if (S.Drugs >= 8) {survivalChance -= 5;} else if (S.Drugs >= 10) {survivalChance += 5;}
if (jsRandom(0,100) > survivalChance) deaths=jsRandom(0,((S.Drugs*2)+4));
if (deaths > 0) S.Troops -= deaths;
......@@ -400,6 +401,7 @@ window.SFReport = function() {
r+= ` The goods procured by ${V.SF.Lower} after accounting for the spoils retained by individual soldiers were `;
if (profit > 0) {
r += `<span class='green'>more than sufficient to cover expenses</span>. Excess material and human assets totaling <span class='yellowgreen'>${cashFormat(income)}</span> (after liquidation) were transferred to your accounts.`;
if (V.economy < 100) r += `The rapiddly degrading global economy has one upside,<span class='green'> ${V.SF.Caps} was able to more easily use more 'persuasive' technciques thus leading to an increase in profit</span>.`;
} else {
r += `<span class='red'>barely enough to cover expenses.</span> More growth will be needed to ensure profitability, <span class='yellow'>hopefully purchasing more upgrades will help</span>.`;
r += ` Per the estimates that ${SFC()} provides, an additional <span class='yellowgreen'>${cashFormat(target-income)}</span> is required for sufficient cover.`;
......@@ -417,9 +419,9 @@ window.SFReport = function() {
r += `<<link "Strict Accountability">> <<set $SF.Regs="strict">> <<replace "#accountability">>''Strict Accountability''<</replace>> <</link>> | <<link "Some Accountability">> <<set $SF.Regs="some">> <<replace "#accountability">>''Some Accountability''<</replace>> <</link>> | <<link "No Accountability">> <<set $SF.Regs="none">> <<replace "#accountability">>''No Accountability''<</replace>> <</link>>`;
if (V.SF.MercCon.View > 0 && V.SF.MercCon.CanAttend === 1) {
V.SF.MercCon.Income=0; V.SF.MercCon.Menials=0;
var tradeShowAttendes=200, menialGiftsPerAttendee=5, NewMercs=0;
var menialGifts=Math.ceil(jsRandom(1,((tradeShowAttendes*menialGiftsPerAttendee)/10)));
var TSProfit=Math.ceil(500000*(1+(V.SF.Size/1000))*(1+(V.arcologies[0].prosperity/1000))*T.Env);
let tradeShowAttendes=200, menialGiftsPerAttendee=5, NewMercs=0;
let menialGifts=Math.ceil(jsRandom(1,((tradeShowAttendes*menialGiftsPerAttendee)/10)));
let TSProfit=Math.ceil(500000*(1+(V.SF.Size/1000))*(1+(V.arcologies[0].prosperity/1000))*T.Env);
V.menials += menialGifts; V.SF.MercCon.History += 1;
V.SF.MercCon.Menials += menialGifts; V.SF.MercCon.TotalMenials += menialGifts;
V.SF.MercCon.Income += TSProfit; V.SF.MercCon.Revenue += TSProfit;
......@@ -443,7 +445,7 @@ window.SFUpgradeCost = function(cost,unit) {
const V=State.variables,T=State.temporary,S=V.SF.Squad; var value=0;
//return Math.ceil(cost*T.Env*(1.15+(V.SF.Size/10))*(1.15+(unit/100))*HSM());
value=cost*T.Env*(1.15+(V.SF.Size/10))*(1.15+(unit/100));
if ([S.Sub,S.AircraftCarrier,S.MissileSilo,S.GiantRobot,S.Satellite.lv,S.GunS,S.SpacePlane,S.Drones].includes(unit)) value *= V.HackingSkillMultiplier;
if ([S.Sub,S.AircraftCarrier,S.MissileSilo,S.GiantRobot,S.Satellite.lv,S.GunS,S.SpacePlane,S.Drones].includes(unit)) value *= HSM();
return Math.ceil(value);
};
......
......@@ -21,7 +21,7 @@ Despite your direct elevator, interaction with the majority of your security for
<br>//You lack the necessary funds to attend.//
<<else>> /* cash >= 500000 */
<br><<link "Attend the trick shot night">>
<<link "Attend the trick shot night">>
<<replace "#result">> <<set $PC.warfare += 1>>
You instruct $assistantName to inform $SF.Lower that you will be attending their trick shot night, and after settling your affairs in the penthouse you head down to the firebase. The atmosphere in the firebase is casual, especially in comparison to the usual situations you meet them, though your security force still maintain some measure of decorum towards you as their employer. Eventually, you settle in at the table with a handful of $SF.Lower officers and cash in your @@.yellowgreen;<<print cashFormat(500000)>>@@ into bullets. All that remains is to decide your strategy for the night.
<br><br> <span id="bountyresult">
......@@ -111,6 +111,6 @@ Despite your direct elevator, interaction with the majority of your security for
</span>
<</replace>>
<</link>> // It will cost @@.yellowgreen;<<print cashFormat(500000)>>@@ to participate in the trick shot night.//
<</link>> // It will cost @@.red;<<print cashFormat(500000)>>@@ to participate in the trick shot night.//
<</if>>
</span>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment