Permalink
Browse files

Improve campaign scripts some more.

-cam1-1s: Use a ten minute timer for building the power module. Once completed, the timer is reset to fifteen minutes for the away mission.
-cam2-6: Fix factory activation taking too long and group management for the NW attackers. Cyborgs repair again.
-Remove unnecessary true argument being passed with a few hackRemoveMessage() calls.
-libcampaign: Fix repair behavior for groups. Do not explode base walls because the player can not see them upon saveload.
-Make several Beta enemy factories produce faster.
-cam1-3: Video only plays when the New Paradigm is attacked and the commander has a bigger defense zone.
-Fix most mission script factories to use repair/regroup/count correctly.
-cam1-7: Force return to LZ and show game over only when New Paradigm transport leaves map.
-cam2-end: Reduced reinforcement timers and increase the amount of enemy
units for each queue.
-cam1-d: Victory happens when all bases are destroyed and all enemy
units are destroyed.

--Rework campaign power--
The AI player now has a huge amount of power so as to likely never run out of resources.

Power capacity and modifiers are more harsh for hard and insane. Easy gets a bigger modifier. Extra oil bonus for finishing missions faster has been reduced to 10%.
  • Loading branch information...
KJeff01 committed Oct 8, 2017
1 parent c83236b commit 1b60377d1e84e155200fd1c0b34e770353927a54
Showing with 613 additions and 384 deletions.
  1. +5 −4 data/base/script/campaign/cam1-1.js
  2. +3 −2 data/base/script/campaign/cam1-1s.js
  3. +1 −1 data/base/script/campaign/cam1-2.js
  4. +19 −14 data/base/script/campaign/cam1-3.js
  5. +2 −4 data/base/script/campaign/cam1-4a.js
  6. +43 −17 data/base/script/campaign/cam1-5.js
  7. +33 −19 data/base/script/campaign/cam1-7.js
  8. +41 −16 data/base/script/campaign/cam1-d.js
  9. +1 −1 data/base/script/campaign/cam1a-c.js
  10. +2 −3 data/base/script/campaign/cam1a.js
  11. +2 −2 data/base/script/campaign/cam1b.js
  12. +13 −7 data/base/script/campaign/cam1c.js
  13. +1 −0 data/base/script/campaign/cam1ca.js
  14. +2 −1 data/base/script/campaign/cam2-1x.js
  15. +20 −8 data/base/script/campaign/cam2-2.js
  16. +23 −14 data/base/script/campaign/cam2-5.js
  17. +44 −43 data/base/script/campaign/cam2-6.js
  18. +39 −22 data/base/script/campaign/cam2-7.js
  19. +24 −13 data/base/script/campaign/cam2-8.js
  20. +1 −2 data/base/script/campaign/cam2-a.js
  21. +37 −19 data/base/script/campaign/cam2-b.js
  22. +36 −20 data/base/script/campaign/cam2-c.js
  23. +14 −8 data/base/script/campaign/cam2-d.js
  24. +12 −15 data/base/script/campaign/cam2-end.js
  25. +19 −12 data/base/script/campaign/cam3-1.js
  26. +1 −2 data/base/script/campaign/cam3-2.js
  27. +27 −20 data/base/script/campaign/cam3-a.js
  28. +2 −2 data/base/script/campaign/cam3-ab.js
  29. +12 −8 data/base/script/campaign/cam3-b.js
  30. +21 −13 data/base/script/campaign/cam3-c.js
  31. +100 −67 data/base/script/campaign/libcampaign.js
  32. +13 −5 data/base/script/rules.js
@@ -2,12 +2,12 @@
include("script/campaign/libcampaign.js");
include("script/campaign/templates.js");
const scavs = 7; //Scav player number
const SCAVS = 7; //Scav player number
//Ambush player from scav base - triggered from middle path
camAreaEvent("scavBaseTrigger", function()
{
var ambushGroup = camMakeGroup(enumArea("eastScavs", scavs, false));
var ambushGroup = camMakeGroup(enumArea("eastScavs", SCAVS, false));
camManageGroup(ambushGroup, CAM_ORDER_DEFEND, {
pos: camMakePos("artifactLocation")
});
@@ -16,7 +16,7 @@ camAreaEvent("scavBaseTrigger", function()
//Moves west scavs units closer to the base - triggered from right path
camAreaEvent("ambush1Trigger", function()
{
var ambushGroup = camMakeGroup(enumArea("westScavs", scavs, false));
var ambushGroup = camMakeGroup(enumArea("westScavs", SCAVS, false));
camManageGroup(ambushGroup, CAM_ORDER_DEFEND, {
pos: camMakePos("ambush1")
});
@@ -25,7 +25,7 @@ camAreaEvent("ambush1Trigger", function()
//Sends some units towards player LZ - triggered from left path
camAreaEvent("ambush2Trigger", function()
{
var ambushGroup = camMakeGroup(enumArea("northWestScavs", scavs, false));
var ambushGroup = camMakeGroup(enumArea("northWestScavs", SCAVS, false));
camManageGroup(ambushGroup, CAM_ORDER_DEFEND, {
pos: camMakePos("ambush2")
});
@@ -57,6 +57,7 @@ function eventStartLevel()
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
setPower(AI_POWER, SCAVS);
//Get rid of the already existing crate and replace with another
camSafeRemoveObject("artifact1", false);
@@ -26,7 +26,7 @@ function secondVideo()
function powerModuleBuilt()
{
var gens = enumStruct(CAM_HUMAN_PLAYER, "A0PowerGenerator", false);
for (var x = 0; x < gens.length; ++x)
for (var x = 0, l = gens.length; x < l; ++x)
{
if ((gens[x].modules > 0) && (gens[x].status === BUILT))
{
@@ -42,6 +42,7 @@ function checkForPowerModule()
if (cheat || powerModuleBuilt())
{
camSetupTransporter(11, 52, 1, 32);
setMissionTime(camChangeOnDiff(900)); // 15 min for offworld
secondVideo();
}
else
@@ -54,7 +55,7 @@ function eventStartLevel()
{
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(900)); // 15 min
setMissionTime(camChangeOnDiff(600)); // 10 min for building module.
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_1");
cheat = false;
@@ -80,7 +80,7 @@ function eventStartLevel()
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
setPower(camChangeOnDiff(800, true), 7);
setPower(AI_POWER, 7);
camSetEnemyBases({
"NorthGroup": {
@@ -31,11 +31,14 @@ camAreaEvent("NorthConvoyTrigger", function(droid)
camAreaEvent("SouthConvoyTrigger", function(droid)
{
camEnableFactory("ScavFactory");
camManageGroup(camMakeGroup("SouthConvoyForce"), CAM_ORDER_DEFEND, {
pos: camMakePos("SouthConvoyLoc")
pos: camMakePos("SouthConvoyLoc"),
radius: 6,
});
var scout = getObject("ScoutDroid");
if (camDef(scout) && scout) {
if (camDef(scout) && scout)
{
camTrace("New Paradigm sensor scout retreating");
var pos = camMakePos("ScoutDroidTarget");
orderDroidLoc(scout, DORDER_MOVE, pos.x, pos.y);
@@ -45,7 +48,8 @@ camAreaEvent("SouthConvoyTrigger", function(droid)
camAreaEvent("WestConvoyTrigger", function(droid)
{
camManageGroup(camMakeGroup("WestConvoyForce"), CAM_ORDER_DEFEND, {
pos: camMakePos("WestConvoyLoc")
pos: camMakePos("WestConvoyLoc"),
radius: 6,
});
});
@@ -54,17 +58,18 @@ function playYouAreInContraventionOfTheNewParadigm()
hackAddMessage("SB1_3_MSG4", MISS_MSG, CAM_HUMAN_PLAYER, true);
camManageGroup(NPScoutGroup, CAM_ORDER_COMPROMISE, {
pos: camMakePos("RTLZ"),
repair: 30,
repair: 66,
regroup: true,
});
camManageGroup(NPDefenseGroup, CAM_ORDER_FOLLOW, {
droid: "NPCommander",
order: CAM_ORDER_ATTACK,
order: CAM_ORDER_DEFEND,
data: {
pos: camMakePos("LandingZone"),
repair: 30,
pos: camMakePos("NPCommander"),
radius: 22,
repair: 66,
},
repair: 30
repair: 66,
});
}
@@ -90,7 +95,6 @@ camAreaEvent("ScavTrigger", function(droid)
camAreaEvent("NPTrigger", function(droid)
{
camCallOnce("enableReinforcements");
camCallOnce("enableNP");
});
function eventAttacked(victim, attacker) {
@@ -177,8 +181,8 @@ function eventStartLevel()
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
setPower(camChangeOnDiff(50000, true), NEW_PARADIGM);
setPower(camChangeOnDiff(400, true), 7);
setPower(AI_POWER, NEW_PARADIGM);
setPower(AI_POWER, 7);
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
camCompleteRequiredResearch(SCAVENGER_RES, 7);
setAlliance(1, 7, true);
@@ -218,18 +222,19 @@ function eventStartLevel()
},
groupSize: 4,
maxSize: 10,
throttle: camChangeOnDiff(40000),
throttle: camChangeOnDiff(25000),
templates: [ rbuggy, bloke, rbjeep, buggy ]
},
"NPFactory": {
assembly: "NPAssembly",
order: CAM_ORDER_ATTACK,
data: {
regroup: true,
regroup: false,
repair: 30,
},
groupSize: 4, // sic! scouts, at most
maxSize: 20,
throttle: camChangeOnDiff(60000),
throttle: camChangeOnDiff(40000),
templates: [ nppod, nphmg, npsmc, npsmc ]
},
});
@@ -115,8 +115,6 @@ function eventStartLevel()
retlz: true
});
const NP_POWER = camChangeOnDiff(10000, true);
const SCAV_POWER = camChangeOnDiff(400, true);
const SCAVS = 7;
var startpos = getObject("StartPosition");
var lz = getObject("LandingZone1"); // will override later
@@ -128,8 +126,8 @@ function eventStartLevel()
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
setPower(NP_POWER, NEW_PARADIGM);
setPower(SCAV_POWER, SCAVS);
setPower(AI_POWER, NEW_PARADIGM);
setPower(AI_POWER, SCAVS);
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
camCompleteRequiredResearch(SCAVENGER_RES, SCAVS);
setAlliance(NEW_PARADIGM, SCAVS, true);
@@ -80,7 +80,12 @@ function sendNPTransport()
entry: { x: 1, y: 42 },
exit: { x: 1, y: 42 },
order: CAM_ORDER_ATTACK,
data: { regroup: true, count: -1, pos: camMakePos("NPBase") }
data: {
regroup: true,
count: -1,
pos: camMakePos("NPBase"),
repair: 66,
},
});
queue("sendNPTransport", camChangeOnDiff(180000)); //3 min
@@ -106,8 +111,8 @@ function enableNPFactories()
camEnableFactory("NPRightFactory");
}
//Destroying the NEW_PARADIGM base will activate all scav factories
//And make any unfound SCAVS attack the player
//Destroying the New Paradigm base will activate all scav factories
//And make any unfound scavs attack the player
function camEnemyBaseEliminated_NPBaseGroup()
{
//Enable all scav factories
@@ -147,8 +152,8 @@ function eventStartLevel()
//Make sure the New Paradigm and Scavs are allies
setAlliance(NEW_PARADIGM, SCAVS, true);
setPower(camChangeOnDiff(15000, true), NEW_PARADIGM);
setPower(camChangeOnDiff(800, true), SCAVS);
setPower(AI_POWER, NEW_PARADIGM);
setPower(AI_POWER, SCAVS);
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
camCompleteRequiredResearch(SCAVENGER_RES, SCAVS);
@@ -195,48 +200,69 @@ function eventStartLevel()
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(50000),
templates: [ npmrl, npmmct, npsbb, nphmg ]
templates: [ npmrl, npmmct, npsbb, nphmg ],
data: {
regroup: false,
repair: 40,
count: -1,
},
},
"NPRightFactory": {
//assembly: "NPRightAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(60000),
templates: [ npmor, npsens, npsbb, nphmg ]
templates: [ npmor, npsens, npsbb, nphmg ],
data: {
regroup: false,
repair: 40,
count: -1,
},
},
"NPCyborgFactory": {
//assembly: "NPCyborgAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(40000),
templates: [ npcybc, npcybf, npcybm ]
templates: [ npcybc, npcybf, npcybm ],
data: {
regroup: false,
repair: 40,
count: -1,
},
},
"ScavSouthWestFactory": {
assembly: "ScavSouthWestAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(15000),
regroup: true,
repair: 40,
templates: [ firecan, rbjeep, rbuggy, bloke ]
templates: [ firecan, rbjeep, rbuggy, bloke ],
data: {
regroup: false,
count: -1,
},
},
"ScavSouthEastFactory": {
assembly: "ScavSouthEastAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(15000),
regroup: true,
repair: 40,
templates: [ firecan, rbjeep, rbuggy, bloke ]
templates: [ firecan, rbjeep, rbuggy, bloke ],
data: {
regroup: false,
count: -1,
},
},
"ScavNorthFactory": {
assembly: "ScavNorthAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
throttle: camChangeOnDiff(15000),
regroup: true,
repair: 40,
templates: [ firecan, rbjeep, rbuggy, bloke ]
templates: [ firecan, rbjeep, rbuggy, bloke ],
data: {
regroup: false,
count: -1,
},
},
});
Oops, something went wrong.

0 comments on commit 1b60377

Please sign in to comment.