Skip to content
Snippets Groups Projects
Commit 335a50e9 authored by brickode's avatar brickode
Browse files

Merge branch 'pregmod-master' of https://gitgud.io/pregmodfan/fc-pregmod into farmyard-dev

parents 76d89743 1a7162a7
No related branches found
No related tags found
1 merge request!7465Farmyard animals DOMification
@echo off @echo off
:: Concatenates files from dir %1 specified with wildcard %2 and outputs result to %3 :: Concatenates files from dir %1 specified with wildcard %2 and outputs result to %3
:: temporary codepage change to avoid mojibake
FOR /f "tokens=2 delims=:." %%x IN ('CHCP') DO SET _CP=%%x
CHCP 65001 > NUL
:: TODO Proper temp file instead of bin\list.txt :: TODO Proper temp file instead of bin\list.txt
IF EXIST %3 DEL %3 IF EXIST %3 DEL %3
SET _LISTFILE="bin\list.txt" SET _LISTFILE="bin\list.txt"
:: Collect sorted list of files
>%_LISTFILE% (FOR /R "%~1" %%F IN (%2) DO echo "%%F") >%_LISTFILE% (FOR /R "%~1" %%F IN (%2) DO echo "%%F")
sort /O %_LISTFILE% %_LISTFILE% sort /O %_LISTFILE% %_LISTFILE%
:: If we have powershell available, strip the absolute path information
:: If not, fail silently (which is fine, but will leak path information into the built file)
powershell -command "" 2> NUL
IF %ERRORLEVEL% EQU 0 powershell -command "(get-content -path %_LISTFILE% -raw -encoding utf8) -replace [regex]::escape('%CD%'),'' -replace '\"','' ^| set-content -encoding utf8 -path %_LISTFILE%"
:: Append the files
(FOR /F "usebackq delims=" %%F IN (`type "%_LISTFILE%"`) DO ( (FOR /F "usebackq delims=" %%F IN (`type "%_LISTFILE%"`) DO (
echo /* %%F */ >> %3 echo /* %%F */ >> %3
copy /b %3+"%CD%%%F" %3 1>NUL copy /b %3+%%F %3 1>NUL
) )
) )
DEL %_LISTFILE% DEL %_LISTFILE%
CHCP %_CP% > NUL
\ No newline at end of file
...@@ -252,9 +252,7 @@ App.SecExp.upkeep = (function() { ...@@ -252,9 +252,7 @@ App.SecExp.upkeep = (function() {
value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.crime).reduce((a, b) => a + b); value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.crime).reduce((a, b) => a + b);
value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.readiness).reduce((a, b) => a + b); value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.readiness).reduce((a, b) => a + b);
value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.intel).reduce((a, b) => a + b); value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.intel).reduce((a, b) => a + b);
if (V.SecExp.edicts.SFSupportLevel >= 5) { value += V.SecExp.edicts.SFSupportLevel >= 5 ? 1000 : 0;
value += 1000;
}
} }
if (V.SecExp.buildings.barracks) { if (V.SecExp.buildings.barracks) {
value += base + upgrade* Object.values(V.SecExp.buildings.barracks).reduce((a, b) => a + b); value += base + upgrade* Object.values(V.SecExp.buildings.barracks).reduce((a, b) => a + b);
...@@ -296,7 +294,7 @@ App.SecExp.battle = (function() { ...@@ -296,7 +294,7 @@ App.SecExp.battle = (function() {
function deployedUnits(input = '') { function deployedUnits(input = '') {
let bots = 0, militiaC = 0, slavesC = 0, mercsC = 0, init = 0; let bots = 0, militiaC = 0, slavesC = 0, mercsC = 0, init = 0;
if (V.slaveRebellion !== 1 && V.citizenRebellion !== 1) { // attack if (V.slaveRebellion !== 1 && V.citizenRebellion !== 1) { // attack
if(V.secBots.isDeployed > 0) { if (V.secBots.isDeployed > 0) {
bots++; bots++;
} }
if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) { if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) {
...@@ -307,13 +305,13 @@ App.SecExp.battle = (function() { ...@@ -307,13 +305,13 @@ App.SecExp.battle = (function() {
slavesC += V.slaveUnits.filter((u) => u.isDeployed === 1).length; slavesC += V.slaveUnits.filter((u) => u.isDeployed === 1).length;
mercsC += V.mercUnits.filter((u) => u.isDeployed === 1).length; mercsC += V.mercUnits.filter((u) => u.isDeployed === 1).length;
} else { // rebellion } else { // rebellion
if(V.secBots.active > 0) { if (V.secBots.active > 0) {
bots++; bots++;
} }
if (V.SF.Toggle && V.SF.Active >= 1) { if (V.SF.Toggle && V.SF.Active >= 1) {
init++; init++;
} }
if(V.irregulars > 0) { if (V.irregulars > 0) {
militiaC++; militiaC++;
} }
...@@ -324,13 +322,13 @@ App.SecExp.battle = (function() { ...@@ -324,13 +322,13 @@ App.SecExp.battle = (function() {
if(input === '') { if(input === '') {
return bots+militiaC+slavesC+mercsC+init; return bots+militiaC+slavesC+mercsC+init;
} else if(input === 'bots') { } else if (input === 'bots') {
return bots; return bots;
} else if(input === 'militia') { } else if (input === 'militia') {
return militiaC; return militiaC;
} else if(input === 'slaves') { } else if (input === 'slaves') {
return slavesC; return slavesC;
} else if(input === 'mercs') { } else if (input === 'mercs') {
return mercsC; return mercsC;
} }
} }
...@@ -406,35 +404,32 @@ App.SecExp.battle = (function() { ...@@ -406,35 +404,32 @@ App.SecExp.battle = (function() {
*/ */
function deployableUnits() { function deployableUnits() {
let init = 2 * App.SecExp.battle.deploySpeed(); let init = 2 * App.SecExp.battle.deploySpeed();
if(V.secBots.isDeployed > 0) { if (V.secBots.isDeployed > 0) {
init--; init--;
} }
const Militia = V.militiaUnits.length; const Militia = V.militiaUnits.length;
for(let i = 0; i < Militia; i++) { for (let i = 0; i < Militia; i++) {
if(V.militiaUnits[i].isDeployed > 0) { if (V.militiaUnits[i].isDeployed > 0) {
init--; init--;
} }
} }
const Slaves = V.slaveUnits.length; const Slaves = V.slaveUnits.length;
for(let i = 0; i < Slaves; i++) { for (let i = 0; i < Slaves; i++) {
if(V.slaveUnits[i].isDeployed > 0) { if (V.slaveUnits[i].isDeployed > 0) {
init--; init--;
} }
} }
const Mercs = V.mercUnits.length; const Mercs = V.mercUnits.length;
for(let i = 0; i < Mercs; i++) { for (let i = 0; i < Mercs; i++) {
if(V.mercUnits[i].isDeployed > 0) { if (V.mercUnits[i].isDeployed > 0) {
init--; init--;
} }
} }
if(init < 0) { return Math.max(0, init);
init = 0;
}
return init;
} }
/** Get total active units /** Get total active units
...@@ -448,15 +443,14 @@ App.SecExp.battle = (function() { ...@@ -448,15 +443,14 @@ App.SecExp.battle = (function() {
* @returns {number} * @returns {number}
*/ */
function maxUnits() { function maxUnits() {
let max = 0;
if (V.SecExp.buildings.barracks) { if (V.SecExp.buildings.barracks) {
let max = 8 + (V.SecExp.buildings.barracks.size * 2); max = 8 + (V.SecExp.buildings.barracks.size * 2);
if(App.SecExp.battle.deploySpeed() === 10) { if(App.SecExp.battle.deploySpeed() === 10) {
max += 2; max += 2;
} }
return max;
} else {
return 0;
} }
return max;
} }
/** Get recon score (scale 0-3) /** Get recon score (scale 0-3)
...@@ -484,11 +478,8 @@ App.SecExp.battle = (function() { ...@@ -484,11 +478,8 @@ App.SecExp.battle = (function() {
} else { } else {
cost = 30000 + baseBribePerAttacker * V.attackTroops; cost = 30000 + baseBribePerAttacker * V.attackTroops;
} }
if (V.majorBattle > 0) { cost *= V.majorBattle > 0 ? 3 : 1;
cost *= 3; return Math.trunc(Math.clamp(cost, 0, 1000000));
}
cost = Math.trunc(Math.clamp(cost, 0, 1000000));
return cost;
} }
})(); })();
...@@ -583,12 +574,8 @@ App.SecExp.Check = (function() { ...@@ -583,12 +574,8 @@ App.SecExp.Check = (function() {
if (V.SecExp.buildings.secHub.upgrades.readiness.earlyWarn === 1) { if (V.SecExp.buildings.secHub.upgrades.readiness.earlyWarn === 1) {
Req += 10; Req += 10;
} }
if (V.SecExp.edicts.SFSupportLevel >= 1) { Req -= 5 * V.SecExp.edicts.SFSupportLevel;
Req -= 5 * V.SecExp.edicts.SFSupportLevel; Req -= 10 * V.SecExp.buildings.secHub.coldstorage;
}
if (V.SecExp.buildings.secHub.coldstorage >= 1) {
Req -= 10 * V.SecExp.buildings.secHub.coldstorage;
}
} }
return Req; return Req;
} }
......
...@@ -186,16 +186,12 @@ ...@@ -186,16 +186,12 @@
<<if $SecExp.edicts.SFSupportLevel >= 1>> <<if $SecExp.edicts.SFSupportLevel >= 1>>
Providing your Security Department with equipment from $SF.Lower slightly boosts the security of your arcology. Providing your Security Department with equipment from $SF.Lower slightly boosts the security of your arcology.
<</if>> <</if>>
<<if $SecExp.edicts.SFSupportLevel >= 1>> <<set _secGrowth *= 1+($SecExp.edicts.SFSupportLevel/10)>>
<<set _secGrowth *= 1+($SecExp.edicts.SFSupportLevel/10)>>
<</if>>
<</if>> <</if>>
/* resting point */ /* resting point */
<<set _secRest = App.SecExp.Check.secRestPoint() * $SecExp.buildings.secHub ? (Math.clamp($SecExp.buildings.secHub.menials,0,App.SecExp.Check.reqMenials()) / App.SecExp.Check.reqMenials()) : 1>> <<set _secRest = App.SecExp.Check.secRestPoint() * (Math.clamp($SecExp.buildings.secHub ? $SecExp.buildings.secHub.menials : 0 ,0 , App.SecExp.Check.reqMenials()) / App.SecExp.Check.reqMenials())>>
<<if _secRest < 0>> <<if _secRest < 0>> <<set _secRest = 20>> <</if>>
<<set _secRest = 20>>
<</if>>
<<if _secRest < App.SecExp.Check.reqMenials() && $SecExp.buildings.secHub>> <<if _secRest < App.SecExp.Check.reqMenials() && $SecExp.buildings.secHub>>
The limited staff assigned to the HQ hampered the improvements to security achieved this week. The limited staff assigned to the HQ hampered the improvements to security achieved this week.
<<elseif _secRest < App.SecExp.Check.reqMenials()>> <<elseif _secRest < App.SecExp.Check.reqMenials()>>
...@@ -214,9 +210,7 @@ The security level of the arcology is ...@@ -214,9 +210,7 @@ The security level of the arcology is
<<set _secGrowth *= 0.3>> <<set _secGrowth *= 0.3>>
<<else>> <<else>>
near its effective resting point, this severely limits the influence of external factors on the change achievable this week. near its effective resting point, this severely limits the influence of external factors on the change achievable this week.
<<if _secGrowth < 0>> <<if _secGrowth < 0>> <<set _secGrowth *= 0.3>> </if>>
<<set _secGrowth *= 0.3>>
<</if>>
<</if>> <</if>>
<<set _restGrowth = (_secRest - $SecExp.core.security) * 0.2>> <<set _restGrowth = (_secRest - $SecExp.core.security) * 0.2>>
<<set _newSec = Math.trunc($SecExp.core.security + _secGrowth + _restGrowth)>> <<set _newSec = Math.trunc($SecExp.core.security + _secGrowth + _restGrowth)>>
...@@ -318,7 +312,7 @@ Due to the deterioration of the old world countries, organized crime focuses mor ...@@ -318,7 +312,7 @@ Due to the deterioration of the old world countries, organized crime focuses mor
<</if>> <</if>>
/* crime cap */ /* crime cap */
<<set _crimeCap = Math.trunc(Math.clamp(App.SecExp.Check.crimeCap() + (App.SecExp.Check.crimeCap() - App.SecExp.Check.crimeCap() * $SecExp.buildings.secHub ? ($SecExp.buildings.secHub.menials / App.SecExp.Check.reqMenials()) : 0),0,100))>> <<set _crimeCap = Math.trunc(Math.clamp(App.SecExp.Check.crimeCap() + (App.SecExp.Check.crimeCap() - App.SecExp.Check.crimeCap() * ($SecExp.buildings.secHub ? $SecExp.buildings.secHub.menials : 0 / App.SecExp.Check.reqMenials())), 0, 100))>>
<<if _crimeCap > App.SecExp.Check.crimeCap() && $SecExp.buildings.secHub>> <<if _crimeCap > App.SecExp.Check.crimeCap() && $SecExp.buildings.secHub>>
The limited staff assigned to the HQ allows more space for criminals to act. The limited staff assigned to the HQ allows more space for criminals to act.
<</if>> <</if>>
......
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