Skip to content

Commit

Permalink
Mission script updates for new Insane
Browse files Browse the repository at this point in the history
  • Loading branch information
KJeff01 committed Aug 17, 2024
1 parent f87d9d4 commit c84f96c
Show file tree
Hide file tree
Showing 54 changed files with 1,408 additions and 633 deletions.
29 changes: 8 additions & 21 deletions script/campaign/cam1-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function enableNP(args)

if (difficulty === INSANE)
{
queue("NPReinforce", camSecondsToMilliseconds(10));
queue("insaneReinforcementSpawn", camSecondsToMilliseconds(10));
setTimer("insaneReinforcementSpawn", camSecondsToMilliseconds(180));
}

camManageGroup(NPScoutGroup, CAM_ORDER_COMPROMISE, {
Expand All @@ -90,27 +91,13 @@ function enableNP(args)
camPlayVideos([cam_sounds.incoming.incomingTransmission, {video: "SB1_3_MSG4", type: MISS_MSG}]);
}

function NPReinforce()
function insaneReinforcementSpawn()
{
if (getObject("NPHQ") !== null)
{
const list = [];
const COUNT = 5 + camRand(5);
const scouts = [cTempl.nphmg, cTempl.npblc, cTempl.nppod, cTempl.nphmg, cTempl.npblc];

for (let i = 0; i < COUNT; ++i)
{
list.push(scouts[camRand(scouts.length)]);
}
camSendReinforcement(CAM_NEW_PARADIGM, camMakePos("NPReinforcementPos"), list, CAM_REINFORCE_GROUND, {
data: {
regroup: false,
repair: 66,
count: -1,
},
});
queue("NPReinforce", camSecondsToMilliseconds(180));
}
const units = [cTempl.nphmg, cTempl.npblc, cTempl.nppod, cTempl.nphmg, cTempl.npblc];
const limits = {minimum: 5, maxRandom: 5};
const condition = {condition: CAM_REINFORCE_CONDITION_OBJECT, object: "NPHQ"};
const location = camMakePos("NPReinforcementPos");
camSendGenericSpawn(CAM_REINFORCE_GROUND, CAM_NEW_PARADIGM, condition, location, units, limits.minimum, limits.maxRandom);
}

function sendScouts()
Expand Down
23 changes: 23 additions & 0 deletions script/campaign/cam1-4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,31 @@ camAreaEvent("LandingZoneTrigger", function()
camEnableFactory("HeavyNPFactory");
camEnableFactory("MediumNPFactory");
buildDefenses();

if (difficulty >= INSANE)
{
setTimer("insaneTransporterAttack", camMinutesToMilliseconds(4));
setTimer("insaneReinforcementSpawn", camMinutesToMilliseconds(5));
}
});

function insaneReinforcementSpawn()
{
const units = [cTempl.nppod, cTempl.npltat, cTempl.npsmct, cTempl.npsmct, cTempl.npmmct];
const limits = {minimum: 6, maxRandom: 4};
const location = ["insaneSpawnPos1", "insaneSpawnPos2", "insaneSpawnPos3", "insaneSpawnPos4"];
camSendGenericSpawn(CAM_REINFORCE_GROUND, CAM_NEW_PARADIGM, CAM_REINFORCE_CONDITION_BASES, location, units, limits.minimum, limits.maxRandom);
}

function insaneTransporterAttack()
{
const DISTANCE_FROM_POS = 5;
const units = [cTempl.npmorb, cTempl.npmorb, cTempl.npmorb, cTempl.npsmct];
const limits = {minimum: 6, maxRandom: 4};
const location = camGenerateRandomMapCoordinate(getObject("StartPosition"), CAM_GENERIC_LAND_STAT, DISTANCE_FROM_POS);
camSendGenericSpawn(CAM_REINFORCE_TRANSPORT, CAM_NEW_PARADIGM, CAM_REINFORCE_CONDITION_BASES, location, units, limits.minimum, limits.maxRandom);
}

function NPBaseDetect()
{
// Send tanks
Expand Down
18 changes: 18 additions & 0 deletions script/campaign/cam1-5.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ function getDroidsForNPLZ(args)
return list;
}

function insaneReinforcementSpawn()
{
const units = [cTempl.npcybc, cTempl.npcybr];
const limits = {minimum: 6, maxRandom: 4};
const location = ["insaneSpawnPos1", "insaneSpawnPos2", "insaneSpawnPos3", "insaneSpawnPos4"];
camSendGenericSpawn(CAM_REINFORCE_GROUND, CAM_NEW_PARADIGM, CAM_REINFORCE_CONDITION_ARTIFACTS, location, units, limits.minimum, limits.maxRandom);
}

function insaneSetupSpawns()
{
if (difficulty >= INSANE)
{
setTimer("insaneReinforcementSpawn", camMinutesToMilliseconds(2.5));
}
}

//These enable Scav and NP factories when close enough
camAreaEvent("NorthScavFactoryTrigger", function(droid)
{
Expand All @@ -114,6 +130,7 @@ camAreaEvent("NPFactoryTrigger", function(droid)
camEnableFactory("NPCyborgFactory");
camEnableFactory("NPLeftFactory");
camEnableFactory("NPRightFactory");
camCallOnce("insaneSetupSpawns");
}
else
{
Expand Down Expand Up @@ -170,6 +187,7 @@ function enableNPFactories()
camEnableFactory("NPCyborgFactory");
camEnableFactory("NPLeftFactory");
camEnableFactory("NPRightFactory");
camCallOnce("insaneSetupSpawns");
}

//Destroying the New Paradigm base will activate all scav factories
Expand Down
14 changes: 13 additions & 1 deletion script/campaign/cam1-7.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const mis_scavengerRes = [
"R-Wpn-Flamer-Damage03", "R-Wpn-Flamer-Range01", "R-Wpn-Flamer-ROF01",
"R-Wpn-MG-Damage04", "R-Wpn-MG-ROF01", "R-Wpn-Rocket-Damage03",
"R-Wpn-Cannon-Damage03", "R-Wpn-Mortar-Damage03", "R-Wpn-Mortar-ROF01",
"R-Wpn-Rocket-Accuracy02", "R-Wpn-Rocket-ROF03", "R-Vehicle-Metals02",
"R-Wpn-Rocket-Accuracy02", "R-Wpn-Rocket-ROF03", "R-Vehicle-Metals03",
"R-Defense-WallUpgrade03", "R-Struc-Materials03", "R-Wpn-Cannon-Accuracy01",
"R-Wpn-Mortar-Acc01",
];
Expand Down Expand Up @@ -79,6 +79,14 @@ camAreaEvent("NPTransportTrigger", function(droid)
}
});

function insaneReinforcementSpawn()
{
const units = [cTempl.npcybr, cTempl.npmrl, cTempl.npcybc];
const limits = {minimum: 4, maxRandom: 2};
const location = camMakePos("westSpawnPos");
camSendGenericSpawn(CAM_REINFORCE_GROUND, CAM_NEW_PARADIGM, CAM_REINFORCE_CONDITION_UNITS, location, units, limits.minimum, limits.maxRandom);
}

//Only called once when the New Paradigm takes the artifact for the first time.
function artifactVideoSetup()
{
Expand Down Expand Up @@ -380,4 +388,8 @@ function eventStartLevel()

hackAddMessage("C1-7_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false); //Canyon
queue("startArtifactCollection", camChangeOnDiff(camMinutesToMilliseconds(1.5)));
if (difficulty >= INSANE)
{
setTimer("insaneReinforcementSpawn", camMinutesToMilliseconds(4.5));
}
}
13 changes: 13 additions & 0 deletions script/campaign/cam1-d.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ function transportBaseSetup()
});
}

function insaneReinforcementSpawn()
{
const DISTANCE_FROM_POS = 30;
const units = [cTempl.nphmgh, cTempl.npltath, cTempl.nphch];
const limits = {minimum: 6, maxRandom: 4};
const location = camGenerateRandomMapEdgeCoordinate(getObject("startPosition"), CAM_GENERIC_WATER_STAT, DISTANCE_FROM_POS);
camSendGenericSpawn(CAM_REINFORCE_GROUND, CAM_NEW_PARADIGM, CAM_REINFORCE_CONDITION_BASES, location, units, limits.minimum, limits.maxRandom);
}

function getDroidsForNPLZ()
{
let lim = 8;
Expand Down Expand Up @@ -301,4 +310,8 @@ function eventStartLevel()
hackAddMessage("C1D_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false);

queue("setupPatrols", camMinutesToMilliseconds(2.5));
if (difficulty >= INSANE)
{
setTimer("insaneReinforcementSpawn", camMinutesToMilliseconds(7.5));
}
}
66 changes: 43 additions & 23 deletions script/campaign/cam1a-c.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,54 @@ function extraVictoryCondition()
//Makes a large group of ground units appear on map
function checkForGroundForces()
{
if (index < 2 && switchLZ === 3)
if (((index < 2) || (difficulty >= INSANE)) && (switchLZ === 3))
{
//Amounts for the ground force
const MAX_TANKS = 16;
const FIRST_AMOUNT = 10;
const MAX_CANNON_TANKS = 10;
const MAX_ARTILLERY_TANKS = 6;
const MAX_INSANE_ADDITIONAL_UNITS = 2 + camRand(3);

const droidGroup1 = []; //Heavy cannon mantis track units
const droidGroup2 = []; //Sensor and heavy mortar units
const templates = [ cTempl.nphct, cTempl.npmsens, cTempl.npmorb ];
const droids = [];
const insaneTemplates = [ cTempl.npcybr, cTempl.nphct, cTempl.nphmgt ];
if (index >= 3)
{
insaneTemplates.push(cTempl.npsbb); //Bring in BBs
}

for (let i = 0; i <= MAX_TANKS; ++i)
for (let i = 0; i < MAX_CANNON_TANKS; ++i)
{
if (i <= FIRST_AMOUNT)
{
droidGroup1[i] = templates[0];
}
if (i === FIRST_AMOUNT + 1)
{
droidGroup2[i - 1 - FIRST_AMOUNT] = templates[1];
}
else
droids.push(cTempl.nphct);
}
for (let i = 0; i < MAX_ARTILLERY_TANKS; ++i)
{
droids.push(cTempl.npmorb);
}
if (difficulty >= INSANE)
{
for (let i = 0; i < MAX_INSANE_ADDITIONAL_UNITS; ++i)
{
droidGroup2[i - 1 - FIRST_AMOUNT] = templates[2];
droids.push(insaneTemplates[camRand(insaneTemplates.length)]);
}
}
droids.push(cTempl.npsens);

//What part of map to appear at
const pos = (index === 0) ? camMakePos("reinforceSouthEast") : camMakePos("reinforceNorth");
camSendReinforcement(CAM_NEW_PARADIGM, pos, droidGroup1, CAM_REINFORCE_GROUND, {
data: {regroup: false, count: -1,},
});
camSendReinforcement(CAM_NEW_PARADIGM, pos, droidGroup2, CAM_REINFORCE_GROUND);
//What part of the map to appear at
let pos;
if (index === 0)
{
pos = camMakePos("reinforceSouthEast");
}
else if (index === 1)
{
pos = camMakePos("reinforceNorth");
}
else if (difficulty >= INSANE)
{
const positions = ["reinforceSouthEast", "reinforceNorth", "reinforceNorthEast"];
pos = positions[camRand(positions.length)];
}

camSendReinforcement(CAM_NEW_PARADIGM, pos, droids, CAM_REINFORCE_GROUND);
}
}

Expand All @@ -93,6 +109,10 @@ function sendTransport()
const COUNT = unitDistribution[camRand(unitDistribution.length)];

const templates = [ cTempl.npcybc, cTempl.npcybf, cTempl.npcybm ];
if (difficulty >= INSANE)
{
templates.push(cTempl.npcybr);
}

const droids = [];
for (let i = 0; i < COUNT; ++i)
Expand Down
Loading

0 comments on commit c84f96c

Please sign in to comment.