Permalink
Browse files

Update a couple of Gamma missions.

Cam3-2:
- Nexus VTOL units spawn after entering the phantomFacTrigger area.
- Only donate Alpha team to the player once they reach the rescueTrigger
area.
- Increase minimum size of Nexus land reinforcements by two.
- Cyborg phantom factories start immediately.
- SE phantom factory starts as soon as the phantomFacTrigger is entered.
- Reduce timers for the phantom factories.

Cam3-ab:
- Let Nexus say "synaptic links activated" before absorbing stuff.
- Faster Nexus reinforcement spawners. Land unit density is 16-20.
- Require all three resistence research to win.
- At least fifteen land reinforcement runs from Nexus are needed to win.
  • Loading branch information...
KJeff01 committed Jan 9, 2018
1 parent 21ca83b commit 493bf7e6fe5b23bd8f2c7de8b7e00ecb5d2ccf58
Showing with 80 additions and 56 deletions.
  1. +48 −35 data/base/script/campaign/cam3-2.js
  2. +24 −19 data/base/script/campaign/cam3-ab.js
  3. +8 −2 data/base/script/campaign/libcampaign.js
@@ -16,6 +16,7 @@ const NEXUS_RES = [
];
var edgeMapIndex;
var alphaUnitIDs;
var startExtraLoss;
//Remove Nexus VTOL droids.
camAreaEvent("vtolRemoveZone", function(droid)
@@ -35,49 +36,41 @@ camAreaEvent("vtolRemoveZone", function(droid)
//groups that are hidden farther south.
camAreaEvent("rescueTrigger", function(droid)
{
hackRemoveMessage("C3-2_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER);
camManageGroup(camMakeGroup("laserTankGroup"), CAM_ORDER_ATTACK, {
regroup: true,
count: -1,
morale: 90,
fallback: camMakePos("healthRetreatPos")
});
//Donate All of alpha to the player.
setAlliance(ALPHA, NEXUS, false);
camAbsorbPlayer(ALPHA, CAM_HUMAN_PLAYER);
queue("getAlphaUnitIDs", 2000);
camPlayVideos("MB3_2_MSG4");
});
function playVideos()
//Warn about VTOLs.
function playVtolWarningVideo()
{
camPlayVideos(["MB3_2_MSG3", "MB3_2_MSG4"]);
camPlayVideos("MB3_2_MSG3");
}
//Activate edge map queues and play videos, donate alpha to the player, setup reinforcements.
camAreaEvent("phantomFacTrigger", function(droid)
{
queue("phantomFactoryNE", camChangeOnDiff(180000)); //3 min;
queue("phantomFactorySW", camChangeOnDiff(240000)); //4 min;
queue("phantomFactorySE", camChangeOnDiff(360000)); //6 min;
setAlliance(ALPHA, NEXUS, false);
vtolAttack();
phantomFactorySE();
playSound("pcv456.ogg"); //Incoming transmission...
queue("playVideos", 2000);
//Donate All of alpha to the player.
camAbsorbPlayer(ALPHA, CAM_HUMAN_PLAYER);
hackRemoveMessage("C3-2_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER);
queue("getAlphaUnitIDs", 3000);
queue("playVtolWarningVideo", 2500);
queue("enableReinforcements", 5000);
});
//Get the IDs of Alpha units after they were donated to the player. Set Experience
//while we are at it.
function getAlphaUnitIDs()
function setAlphaExp()
{
const DROID_EXP = 512; //Hero rank.
if (!camDef(alphaUnitIDs))
{
alphaUnitIDs = [];
}
var alphaDroids = enumArea("alphaPit", CAM_HUMAN_PLAYER, false).filter(function(obj) {
return (obj.type === DROID);
var alphaDroids = enumArea("alphaPit", ALPHA, false).filter(function(obj) {
return obj.type === DROID;
});
for (var i = 0, l = alphaDroids.length; i < l; ++i)
@@ -87,29 +80,44 @@ function getAlphaUnitIDs()
{
setDroidExperience(dr, DROID_EXP);
}
}
}
//Get the IDs of Alpha units after they were donated to the player.
function getAlphaUnitIDs()
{
alphaUnitIDs = [];
var alphaDroids = enumArea("alphaPit", CAM_HUMAN_PLAYER, false).filter(function(obj) {
return obj.type === DROID && obj.experience === 512;
});
for (var i = 0, l = alphaDroids.length; i < l; ++i)
{
var dr = alphaDroids[i];
alphaUnitIDs.push(dr.id);
}
startExtraLoss = true;
}
function phantomFactoryNE()
{
var list; with (camTemplates) list = [nxcyrail, nxcyscou, nxcylas, nxlflash];
sendEdgeMapDroids(4, "NE-PhantomFactory", list);
queue("phantomFactoryNE", camChangeOnDiff(180000)); //3 min;
var list; with (camTemplates) list = [nxcyrail, nxcyscou, nxcylas];
sendEdgeMapDroids(6, "NE-PhantomFactory", list);
queue("phantomFactoryNE", camChangeOnDiff(120000)); //2 min
}
function phantomFactorySW()
{
var list; with (camTemplates) list = [nxcyrail, nxcyscou, nxcylas, nxlflash];
sendEdgeMapDroids(6, "SW-PhantomFactory", list);
queue("phantomFactorySW", camChangeOnDiff(240000)); //4 min;
var list; with (camTemplates) list = [nxcyrail, nxcyscou, nxcylas];
sendEdgeMapDroids(8, "SW-PhantomFactory", list);
queue("phantomFactorySW", camChangeOnDiff(180000)); //3 min
}
function phantomFactorySE()
{
var list; with (camTemplates) list = [nxcyrail, nxcyscou, nxcylas, nxlflash, nxmrailh, nxmlinkh];
sendEdgeMapDroids(8 + camRand(5), "SE-PhantomFactory", list);
queue("phantomFactorySE", camChangeOnDiff(360000)); //6 min;
sendEdgeMapDroids(10 + camRand(6), "SE-PhantomFactory", list); //10-15 units
queue("phantomFactorySE", camChangeOnDiff(240000)); //4 min
}
function sendEdgeMapDroids(droidCount, location, list)
@@ -222,14 +230,14 @@ function enableReinforcements()
function alphaTeamAlive()
{
if (camDef(alphaUnitIDs))
if (camDef(alphaUnitIDs) && startExtraLoss)
{
var alphaAlive = false;
var alive = enumArea(0, 0, mapWidth, mapHeight, CAM_HUMAN_PLAYER, false).filter(function(obj) {
return (obj.type === DROID);
return obj.type === DROID;
});
var allDroidsAtLZ = enumArea("RTLZ", CAM_HUMAN_PLAYER, false).filter(function(obj) {
return (obj.type === DROID);
return obj.type === DROID;
});
for (var i = 0, l = alive.length; i < l; ++i)
@@ -265,6 +273,7 @@ function eventStartLevel()
var lz = getObject("landingZone");
var tent = getObject("transporterEntry");
var text = getObject("transporterExit");
startExtraLoss = false;
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "CAM3A-B", {
area: "RTLZ",
@@ -283,8 +292,12 @@ function eventStartLevel()
camCompleteRequiredResearch(GAMMA_ALLY_RES, ALPHA);
setAlliance(ALPHA, NEXUS, true);
setAlliance(ALPHA, CAM_HUMAN_PLAYER, true);
changePlayerColour(ALPHA, 0);
phantomFactoryNE();
phantomFactorySW();
hackAddMessage("C3-2_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER);
queue("setAlphaExp", 1500);
queue("setupPatrolGroups", 15000);
queue("vtolAttack", camChangeOnDiff(300000)); //5 min
}
@@ -13,7 +13,7 @@ const NEXUS_RES = [
"R-Sys-NEXUSrepair", "R-Wpn-Flamer-Damage06",
];
var edgeMapIndex;
var edgeMapCounter;
var edgeMapCounter; //how many Nexus reinforcement runs have happened.
var winFlag;
//Remove Nexus VTOL droids.
@@ -32,7 +32,7 @@ camAreaEvent("vtolRemoveZone", function(droid)
function sendEdgeMapDroids()
{
const COUNT = 10 + camRand(6); // 10 - 15.
const COUNT = 16 + camRand(5); // 16 - 20.
const EDGE = ["SWPhantomFactory", "NWPhantomFactory"];
var list; with (camTemplates) list = [
nxcyrail, nxcyscou, nxcylas, nxlflash, nxmrailh, nxmlinkh, nxmscouh,
@@ -51,32 +51,32 @@ function sendEdgeMapDroids()
droids.push(list[camRand(list.length)]);
}
camSendReinforcement(NEXUS, camMakePos(EDGE[edgeMapIndex]), list,
camSendReinforcement(NEXUS, camMakePos(EDGE[edgeMapIndex]), droids,
CAM_REINFORCE_GROUND, {
data: {regroup: true, count: -1}
data: {regroup: false, count: -1}
}
);
edgeMapIndex += 1;
edgeMapCounter += 1;
if (edgeMapIndex === EDGE.length)
{
edgeMapIndex = 0;
}
edgeMapCounter += 1;
if (edgeMapCounter === EDGE.length)
{
edgeMapCounter = 0;
}
queue("sendEdgeMapDroids", camChangeOnDiff(240000)); // 4 min.
queue("sendEdgeMapDroids", camChangeOnDiff(180000)); // 3 min.
}
//Setup Nexus VTOL hit and runners. NOTE: These do not go away in this mission.
function vtolAttack()
{
var list; with (camTemplates) list = [nxlscouv, nxmtherv, nxmheapv];
camSetVtolData(NEXUS, "vtolAppearPos", "vtolRemovePos", list, camChangeOnDiff(240000)); //4 min
var list; with (camTemplates) list = [nxlscouv, nxmtherv, nxlscouv, nxmheapv];
var ext = {
limit: [2, 4, 2, 4],
alternate: true,
altIdx: 0
};
camSetVtolData(NEXUS, "vtolAppearPos", "vtolRemovePos", list, camChangeOnDiff(120000), undefined, ext); //2 min
}
function powerTransfer()
@@ -88,6 +88,10 @@ function powerTransfer()
function eventResearched(research, structure, player)
{
if (research.name === "R-Sys-Resistance-Upgrade01")
{
camSetNexusState(false);
}
if (research.name === "R-Sys-Resistance-Upgrade03")
{
winFlag = true;
}
@@ -98,21 +102,23 @@ function hackPlayer()
camHackIntoPlayer(CAM_HUMAN_PLAYER, NEXUS);
if (camGetNexusState())
{
queue("hackPlayer", 6000);
queue("hackPlayer", 5000);
}
}
function synapticsSound()
{
playSound(SYNAPTICS_ACTIVATED);
camHackIntoPlayer(CAM_HUMAN_PLAYER, NEXUS);
}
//winFlag is set in eventResearched.
function resistanceResearched()
{
if (winFlag)
const MIN_EDGE_COUNT = 15;
if (winFlag && edgeMapCounter >= MIN_EDGE_COUNT)
{
camSetNexusState(false);
return true; //Set in eventResearched().
return true;
}
}
@@ -140,10 +146,9 @@ function eventStartLevel()
winFlag = false;
vtolAttack();
camHackIntoPlayer(CAM_HUMAN_PLAYER, NEXUS, true);
queue("powerTransfer", 800);
queue("synapticsSound", 5000);
queue("synapticsSound", 2500);
queue("hackPlayer", 8000);
queue("sendEdgeMapDroids", 15000); // 15 sec
}
@@ -3014,7 +3014,10 @@ function camHackIntoPlayer(player, to)
camTrace("stealing object: " + obj.name);
if (obj.type === STRUCTURE && obj.stattype === HQ)
{
camSafeRemoveObject(obj, false);
if (!donateObject(obj, to))
{
camSafeRemoveObject(obj, false);
}
if (player === CAM_HUMAN_PLAYER)
{
setMiniMap(false);
@@ -3023,7 +3026,10 @@ function camHackIntoPlayer(player, to)
}
else
{
donateObject(obj, to);
if (!donateObject(obj, to))
{
camSafeRemoveObject(obj, true); //Explode it then.
}
}
}
}

0 comments on commit 493bf7e

Please sign in to comment.