Skip to content

Commit

Permalink
Finish cam3-A and add dynamic difficulty
Browse files Browse the repository at this point in the history
Finishes campaign 3-A script.
Updates research to get everything correctly in Gamma.
Fix enemy VTOL units being stuck in campaign.
The enemy players actually are given research benefits instead of nothing.
Add insane difficulty option for campaign.
Make campaign more dynamic with difficulty.
Certain values such as timers, power, and transport times now change with campaign difficulty.

Fix enemy base elimination sounds

Apply the changes made to the old campaign research files in b1cb129 to the new file.

Fix enemy research in campaign.
The same research item could be continuously researched over and over again and could possibly be used for unfair advantages.
  • Loading branch information
KJeff01 committed Aug 1, 2017
1 parent 01145a4 commit cb19c76
Show file tree
Hide file tree
Showing 47 changed files with 836 additions and 717 deletions.
2 changes: 1 addition & 1 deletion data/base/script/campaign/cam1-1s.js
Expand Up @@ -42,7 +42,7 @@ function checkForPowerModule()
if(cheat || powerModuleBuilt())
{
camSetupTransporter(11, 52, 1, 32);
setMissionTime(900); // 15 min
setMissionTime(camChangeOnDiff(900)); // 15 min
secondVideo();
}
else
Expand Down
20 changes: 10 additions & 10 deletions data/base/script/campaign/cam1-2.js
Expand Up @@ -5,7 +5,7 @@ include("script/campaign/templates.js");
function exposeNorthBase()
{
camDetectEnemyBase("NorthGroup"); // no problem if already detected
hackAddMessage("SB1_2_MSG2", MISS_MSG, 0, true); // that's what it was for
hackAddMessage("SB1_2_MSG2", MISS_MSG, CAM_HUMAN_PLAYER, true); // that's what it was for
}

function camArtifactPickup_ScavLab()
Expand All @@ -24,7 +24,7 @@ function camArtifactPickup_ScavLab()
},
groupSize: 5,
maxSize: 9,
throttle: 10000,
throttle: camChangeOnDiff(10000),
templates: [ trike, bloke, buggy, bjeep ]
});
camEnableFactory("WestFactory");
Expand Down Expand Up @@ -56,17 +56,17 @@ function eventStartLevel()
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "SUB_1_3S", {
area: "RTLZ",
message: "C1-2_LZ",
reinforcements: 60
reinforcements: camChangeOnDiff(60, true)
});
var startpos = getObject("StartPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("LandingZone");
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, 0);
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, 0);
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("TransporterExit");
setTransporterExit(text.x, text.y, 0);
setPower(400, 7);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
setPower(camChangeOnDiff(400, true), 7);

camSetEnemyBases({
"NorthGroup": {
Expand All @@ -86,7 +86,7 @@ function eventStartLevel()
},
});

hackAddMessage("SB1_2_MSG", MISS_MSG, 0, false);
hackAddMessage("SB1_2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);
camDetectEnemyBase("ScavLabGroup");

camSetArtifacts({
Expand All @@ -108,7 +108,7 @@ function eventStartLevel()
},
groupSize: 5,
maxSize: 9,
throttle: 15000,
throttle: camChangeOnDiff(15000),
group: camMakeGroup("NorthTankGroup"),
templates: [ trike, bloke, buggy, bjeep ]
},
Expand All @@ -125,7 +125,7 @@ function eventStartLevel()
},
groupSize: 5,
maxSize: 9,
throttle: 10000,
throttle: camChangeOnDiff(10000),
templates: [ trike, bloke, buggy, bjeep ]
},
});
Expand Down
6 changes: 3 additions & 3 deletions data/base/script/campaign/cam1-2s.js
Expand Up @@ -5,8 +5,8 @@ function eventStartLevel()
{
camSetupTransporter(11, 52, 39, 1);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, 0);
setMissionTime(1800);
hackAddMessage("SB1_2_MSG", MISS_MSG, 0, true);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(1800));
hackAddMessage("SB1_2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_2");
}
32 changes: 16 additions & 16 deletions data/base/script/campaign/cam1-3.js
Expand Up @@ -13,7 +13,7 @@ var NPDefenseGroup, NPScoutGroup, NPFactory;

camAreaEvent("RemoveBeacon", function(droid)
{
hackRemoveMessage("C1-3_OBJ1", PROX_MSG, 0);
hackRemoveMessage("C1-3_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER);
});

camAreaEvent("NorthConvoyTrigger", function(droid)
Expand Down Expand Up @@ -45,7 +45,7 @@ camAreaEvent("WestConvoyTrigger", function(droid)

function playYouAreInContraventionOfTheNewParadigm()
{
hackAddMessage("SB1_3_MSG4", MISS_MSG, 0, true);
hackAddMessage("SB1_3_MSG4", MISS_MSG, CAM_HUMAN_PLAYER, true);
camManageGroup(NPScoutGroup, CAM_ORDER_COMPROMISE, {
pos: camMakePos("RTLZ"),
repair: 30,
Expand Down Expand Up @@ -89,9 +89,9 @@ camAreaEvent("NPTrigger", function(droid)
});

function eventAttacked(victim, attacker) {
if (!camDef(victim) || !victim || victim.player === 0)
if (!camDef(victim) || !victim || victim.player === CAM_HUMAN_PLAYER)
return;
if (victim.player === 1)
if (victim.player === NEW_PARADIGM)
{
camCallOnce("enableNP");
var commander = getObject("NPCommander");
Expand All @@ -109,7 +109,7 @@ function enableReinforcements()
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "CAM_1C", {
area: "RTLZ",
message: "C1-3_LZ",
reinforcements: 120 // changes!
reinforcements: camChangeOnDiff(120, true) // changes!
});
}

Expand All @@ -129,7 +129,7 @@ function camEnemyBaseEliminated_ScavBaseGroup()

function playNPWarningMessage()
{
hackAddMessage("SB1_3_MSG3", MISS_MSG, 0, true);
hackAddMessage("SB1_3_MSG3", MISS_MSG, CAM_HUMAN_PLAYER, true);
}

function playNPWarningSound()
Expand Down Expand Up @@ -164,15 +164,15 @@ function eventStartLevel()
var startpos = getObject("StartPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("LandingZone");
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, 0);
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, 0);
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("TransporterExit");
setTransporterExit(text.x, text.y, 0);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);

setPower(50000, 1);
setPower(200, 7);
camCompleteRequiredResearch(NEW_PARADIGM_RES, 1);
setPower(camChangeOnDiff(50000, true), NEW_PARADIGM);
setPower(camChangeOnDiff(200, true), 7);
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
camCompleteRequiredResearch(SCAVENGER_RES, 7);
setAlliance(1, 7, true);

Expand All @@ -191,8 +191,8 @@ function eventStartLevel()
},
});

hackAddMessage("SB1_3_MSG", MISS_MSG, 0, false);
hackAddMessage("C1-3_OBJ1", PROX_MSG, 0, false); // south-west beacon
hackAddMessage("SB1_3_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);
hackAddMessage("C1-3_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false); // south-west beacon

camSetArtifacts({
"ScavFactory": { tech: "R-Wpn-Cannon1Mk1" },
Expand All @@ -211,7 +211,7 @@ function eventStartLevel()
},
groupSize: 4,
maxSize: 10,
throttle: 40000,
throttle: camChangeOnDiff(40000),
templates: [ rbuggy, bloke, rbjeep, buggy ]
},
"NPFactory": {
Expand All @@ -222,7 +222,7 @@ function eventStartLevel()
},
groupSize: 4, // sic! scouts, at most
maxSize: 20,
throttle: 60000,
throttle: camChangeOnDiff(60000),
templates: [ nppod, nphmg, npsmc, npsmc ]
},
});
Expand Down
6 changes: 3 additions & 3 deletions data/base/script/campaign/cam1-3s.js
Expand Up @@ -5,8 +5,8 @@ function eventStartLevel()
{
camSetupTransporter(11, 52, 39, 126);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, 0);
setMissionTime(3600);
hackAddMessage("SB1_3_UPDATE", MISS_MSG, 0, true);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(3600));
hackAddMessage("SB1_3_UPDATE", MISS_MSG, CAM_HUMAN_PLAYER, true);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_3");
}
65 changes: 34 additions & 31 deletions data/base/script/campaign/cam1-4a.js
Expand Up @@ -14,24 +14,24 @@ const NEW_PARADIGM_RES = [
];

const SCAVENGER_RES = [
"R-Wpn-MG-Damage03", "R-Wpn-Rocket-Damage02"
"R-Wpn-MG-Damage03", "R-Wpn-Rocket-Damage02",
];

function camEnemyBaseDetected_NPBaseGroup()
{
// First wave of trucks
camQueueBuilding(1, "GuardTower6", "BuildTower0");
camQueueBuilding(1, "PillBox3", "BuildTower3");
camQueueBuilding(1, "PillBox3", "BuildTower6");
camQueueBuilding(NEW_PARADIGM, "GuardTower6", "BuildTower0");
camQueueBuilding(NEW_PARADIGM, "PillBox3", "BuildTower3");
camQueueBuilding(NEW_PARADIGM, "PillBox3", "BuildTower6");

// Second wave of trucks
camQueueBuilding(1, "GuardTower3", "BuildTower1");
camQueueBuilding(1, "GuardTower6", "BuildTower2");
camQueueBuilding(1, "GuardTower6", "BuildTower4");
camQueueBuilding(NEW_PARADIGM, "GuardTower3", "BuildTower1");
camQueueBuilding(NEW_PARADIGM, "GuardTower6", "BuildTower2");
camQueueBuilding(NEW_PARADIGM, "GuardTower6", "BuildTower4");

// Third wave of trucks
camQueueBuilding(1, "GuardTower3", "BuildTower5");
camQueueBuilding(1, "GuardTower6", "BuildTower7");
camQueueBuilding(NEW_PARADIGM, "GuardTower3", "BuildTower5");
camQueueBuilding(NEW_PARADIGM, "GuardTower6", "BuildTower7");

// Send tanks
camManageGroup(camMakeGroup("AttackGroupLight"), CAM_ORDER_COMPROMISE, {
Expand Down Expand Up @@ -67,21 +67,21 @@ camAreaEvent("MediumNPFactoryTrigger", function()
camAreaEvent("LandingZoneTrigger", function()
{
var lz = getObject("LandingZone2"); // will override later
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, 0);
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
playSound("pcv456.ogg");
// continue after 4 seconds
queue("moreLandingZoneTrigger", 4000);
});

function moreLandingZoneTrigger()
{
hackAddMessage("SB1_4_B", MISS_MSG, 0, true);
hackAddMessage("SB1_4_B", MISS_MSG, CAM_HUMAN_PLAYER, true);
// Give extra 30 minutes.
setMissionTime(1800 + getMissionTime());
setMissionTime(camChangeOnDiff(1800) + getMissionTime());
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "SUB_1_5S", {
area: "RTLZ",
message: "C1-4_LZ",
reinforcements: 90 // changes!
reinforcements: camChangeOnDiff(90, true) // changes!
});
// enables all factories
camEnableFactory("SouthScavFactory");
Expand All @@ -97,22 +97,25 @@ function eventStartLevel()
message: "C1-4_LZ",
reinforcements: -1 // will override later
});

const NP_POWER = camChangeOnDiff(5000, true);
const SCAV_POWER = camChangeOnDiff(200, true);
const SCAVS = 7;
var startpos = getObject("StartPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("LandingZone1"); // will override later
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, 0);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, 0);
var text = getObject("TransporterExit");
setTransporterExit(text.x, text.y, 0);

// Hmm, these tech lists are getting pretty long.
// But there isn't much we can do to reduce duplication.
setPower(5000, 1);
setPower(200, 7);
camCompleteRequiredResearch(NEW_PARADIGM_RES, 1);
camCompleteRequiredResearch(SCAVENGER_RES, 7);
setAlliance(1, 7, true);
centreView(startpos.x, startpos.y);
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(NP_POWER, NEW_PARADIGM);
setPower(SCAV_POWER, SCAVS);
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
camCompleteRequiredResearch(SCAVENGER_RES, SCAVS);
setAlliance(NEW_PARADIGM, SCAVS, true);

camSetEnemyBases({
"SouthScavBaseGroup": {
Expand All @@ -137,8 +140,8 @@ function eventStartLevel()

// These seem to be in a different order this time,
// first PROX then MISS, not sure if matters.
hackAddMessage("C1-4_OBJ1", PROX_MSG, 0, false);
hackAddMessage("SB1_4_MSG", MISS_MSG, 0, false);
hackAddMessage("C1-4_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false);
hackAddMessage("SB1_4_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);

camSetArtifacts({
"NPCommandCenter": { tech: "R-Vehicle-Metals01" },
Expand All @@ -152,7 +155,7 @@ function eventStartLevel()
order: CAM_ORDER_ATTACK,
groupSize: 4,
maxSize: 6,
throttle: 35000,
throttle: camChangeOnDiff(35000),
templates: [ rbuggy, bjeep, buscan, trike ]
},
"NorthScavFactory": {
Expand All @@ -164,30 +167,30 @@ function eventStartLevel()
},
groupSize: 4,
maxSize: 6,
throttle: 35000,
throttle: camChangeOnDiff(35000),
templates: [ firecan, rbjeep, bloke, buggy ]
},
"HeavyNPFactory": {
assembly: "HeavyNPFactoryAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
maxSize: 6, // this one was exclusively producing trucks
throttle: 40000, // but we simplify this out
throttle: camChangeOnDiff(40000), // but we simplify this out
templates: [ npmmct, npsmct, npsmc ]
},
"MediumNPFactory": {
assembly: "MediumNPFactoryAssembly",
order: CAM_ORDER_ATTACK,
groupSize: 4,
maxSize: 6,
throttle: 40000,
throttle: camChangeOnDiff(40000),
templates: [ npmrl, nphmg, npsbb, npmor ]
},
});

// To be able to use camEnqueueBuilding() later,
// and also to rebuild dead trucks.
camManageTrucks(1);
camManageTrucks(NEW_PARADIGM);

queue("enableSouthScavFactory", 10000);
}
6 changes: 3 additions & 3 deletions data/base/script/campaign/cam1-4as.js
Expand Up @@ -5,8 +5,8 @@ function eventStartLevel()
{
camSetupTransporter(11, 52, 80, 1);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, 0);
setMissionTime(1800);
hackAddMessage("SB1_4_MSG", MISS_MSG, 0, true);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(1800));
hackAddMessage("SB1_4_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_4A");
}

0 comments on commit cb19c76

Please sign in to comment.