Permalink
Browse files

Campaign script updates.

- Libcampaign: All available non player trucks take orders rather than one at a time.
- Cam1-4a: Only the north pass that is south of the main base will cause an early base detection like in v1.10.
- Cam2-1x: Set the transport team to be green color right away.
- Cam3-1, Cam3-2: Use less code or simply remove unnecessary evaluation logic.
- Cam2-c: scavengers use the civilian texture again.
  • Loading branch information...
KJeff01 committed Nov 26, 2017
1 parent 25de299 commit fa6e0cb16c7d2a1b08c3a94e25dcc191eb3e3c8d
@@ -20,18 +20,7 @@ const SCAVENGER_RES = [
//Pursue player when nearby but do not go too far away from defense zone.
function camEnemyBaseDetected_NPBaseGroup()
{
// Send tanks
camManageGroup(camMakeGroup("AttackGroupLight"), CAM_ORDER_DEFEND, {
pos: camMakePos("nearSensor"),
radius: 10,
regroup: true
});
camManageGroup(camMakeGroup("AttackGroupMedium"), CAM_ORDER_DEFEND, {
pos: camMakePos("nearSensor"),
radius: 10,
regroup: true
});
camCallOnce("NPBaseDetect");
}
function enableSouthScavFactory()
@@ -47,8 +36,6 @@ camAreaEvent("NorthScavFactoryTrigger", function()
camAreaEvent("NPBaseDetectTrigger", function()
{
camDetectEnemyBase("NPBaseGroup");
camEnableFactory("HeavyNPFactory");
camEnableFactory("MediumNPFactory");
});
camAreaEvent("removeRedObjectiveBlip", function()
@@ -71,6 +58,25 @@ camAreaEvent("LandingZoneTrigger", function()
queue("moreLandingZoneTrigger", 4000);
});
function NPBaseDetect()
{
// Send tanks
camManageGroup(camMakeGroup("AttackGroupLight"), CAM_ORDER_DEFEND, {
pos: camMakePos("nearSensor"),
radius: 10,
regroup: true
});
camManageGroup(camMakeGroup("AttackGroupMedium"), CAM_ORDER_DEFEND, {
pos: camMakePos("nearSensor"),
radius: 10,
regroup: true
});
camEnableFactory("HeavyNPFactory");
camEnableFactory("MediumNPFactory");
}
function moreLandingZoneTrigger()
{
camPlayVideos("SB1_4_B");
@@ -154,7 +160,7 @@ function eventStartLevel()
});
hackAddMessage("C1-4_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false);
camSetArtifacts({
"NPCommandCenter": { tech: "R-Vehicle-Metals01" },
"NPResearchFacility": { tech: "R-Vehicle-Body04" },
@@ -29,8 +29,6 @@ camAreaEvent("crashSite", function(droid)
const GOODSND = "pcv615.ogg";
playSound(GOODSND);
//set downed transport team colour to be Project Green.
changePlayerColour(TRANSPORT_TEAM, 0);
hackRemoveMessage("C21_OBJECTIVE", PROX_MSG, CAM_HUMAN_PLAYER);
var downedTransportUnits = enumDroid(TRANSPORT_TEAM);
@@ -156,6 +154,9 @@ function eventStartLevel()
setAlliance(CAM_HUMAN_PLAYER, TRANSPORT_TEAM, true);
setPower(AI_POWER, THE_COLLECTIVE);
//set downed transport team colour to be Project Green.
changePlayerColour(TRANSPORT_TEAM, 0);
camCompleteRequiredResearch(COLLECTIVE_RES, THE_COLLECTIVE);
camSetEnemyBases({
@@ -112,7 +112,7 @@ function missileSilosDestroyed()
destroyed += (getObject(SILO_ALIAS + (i + 1)) === null) ? 1 : 0;
}
return destroyed === SILO_COUNT ? true : false;
return destroyed === SILO_COUNT;
}
//Nuclear missile destroys everything not in safe zone.
@@ -175,7 +175,7 @@ function setupNextMission()
//Play countdown sounds. Elements are shifted out of the sound arrays as they play.
function getCountdown()
{
var missilesDead = missileSilosDestroyed() ? true : false;
var missilesDead = missileSilosDestroyed();
var times = missilesDead ? detTimes : launchTimes;
var sounds = missilesDead ? detSounds : launchSounds;
var skip = false;
@@ -57,11 +57,7 @@ camAreaEvent("phantomFacTrigger", function(droid)
playSound("pcv456.ogg"); //Incoming transmission...
queue("playVideos", 2000);
//Donate All of alpha to the player.
var alphaStuff = enumArea(0, 0, mapWidth, mapHeight, ALPHA, false);
for (var i = 0, l = alphaStuff.length; i < l; ++i)
{
donateObject(alphaStuff[i], CAM_HUMAN_PLAYER);
}
camAbsorbPlayer(ALPHA, CAM_HUMAN_PLAYER);
hackRemoveMessage("C3-2_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER);
queue("getAlphaUnitIDs", 3000);
@@ -1925,7 +1925,7 @@ function __camTruckTick()
var ti = __camTruckInfo[player];
// First, build things that were explicitly ordered.
if (ti.queue.length > 0)
while (ti.queue.length > 0)
{
var qi = ti.queue[0];
var pos = qi.pos;
@@ -1935,38 +1935,43 @@ function __camTruckTick()
// Find the truck most suitable for the job.
truck = __camGetClosestTruck(player, pos);
if (!camDef(truck))
continue;
{
break;
}
}
else
{
// Build near any truck if pos was not specified.
var droids = __camEnumFreeTrucks(player);
if (droids.length <= 0)
continue;
{
break;
}
truck = droids[0];
pos = truck;
}
enableStructure(qi.stat, player);
var loc = pickStructLocation(truck, qi.stat, pos.x, pos.y);
if (camDef(loc) && camDef(truck) && (truck.id !== 0))
if (camDef(loc) && camDef(truck))
{
if (orderDroidBuild(truck, DORDER_BUILD,
qi.stat, loc.x, loc.y))
{
ti.queue.shift(); // consider it handled
continue;
}
}
}
// Then, capture free oils.
var oils = enumFeature(-1, "OilResource");
if (oils.length === 0)
{
continue;
}
var oil = oils[0];
var truck = __camGetClosestTruck(player, oil);
if (camDef(truck) && (truck.id !== 0))
if (camDef(truck))
{
enableStructure("A0ResourceExtractor", player);
orderDroidBuild(truck, DORDER_BUILD, "A0ResourceExtractor",
@@ -2839,18 +2844,18 @@ function camNexusLaugh()
}
}
function camAbsorbPlayer(playerNumber, to)
function camAbsorbPlayer(who, to)
{
if (!camDef(playerNumber))
if (!camDef(who))
{
playerNumber = CAM_HUMAN_PLAYER;
who = CAM_HUMAN_PLAYER;
}
if (!camDef(to))
{
to = NEXUS;
}
var units = enumDroid(playerNumber);
var units = enumDroid(who);
for (var i = 0, l = units.length; i < l; i++)
{
if (!donateObject(units[i], to))
@@ -2859,7 +2864,7 @@ function camAbsorbPlayer(playerNumber, to)
}
}
var structs = enumStruct(playerNumber);
var structs = enumStruct(who);
for (var i = 0, l = structs.length; i < l; i++)
{
if (!donateObject(structs[i], to))
@@ -2868,8 +2873,8 @@ function camAbsorbPlayer(playerNumber, to)
}
}
camTrace("Player " + playerNumber + " has been absorbed by player" + to);
changePlayerColour(playerNumber, to); // Black painting.
camTrace("Player " + who + " has been absorbed by player" + to);
changePlayerColour(who, to);
}
//Steal a droid or structure from a player.
@@ -3280,7 +3285,7 @@ function cam_eventGameLoaded()
isReceivingAllEvents = true;
const SCAV_KEVLAR_MISSIONS = [
"CAM_1CA", "SUB_1_4AS", "SUB_1_4A", "SUB_1_5S", "SUB_1_5",
"CAM_1A-C", "SUB_1_7S", "SUB_1_7", "SUB_1_DS", "CAM_1END"
"CAM_1A-C", "SUB_1_7S", "SUB_1_7", "SUB_1_DS", "CAM_1END", "SUB_2_5S"
];
//Need to set the scavenger kevlar vests when loading a save from later Alpha
@@ -3289,8 +3294,16 @@ function cam_eventGameLoaded()
{
if (__camNextLevel === SCAV_KEVLAR_MISSIONS[i])
{
replaceTexture("page-7-barbarians-arizona.png",
"page-7-barbarians-kevlar.png");
if (tilesetType === "ARIZONA")
{
replaceTexture("page-7-barbarians-arizona.png",
"page-7-barbarians-kevlar.png");
}
else if (tilesetType === "URBAN")
{
replaceTexture("page-7-barbarians-arizona.png",
"page-7-barbarians-urban.png");
}
break;
}
}
@@ -7,6 +7,7 @@ function setupGame()
{
if (tilesetType == "URBAN")
{
replaceTexture("page-7-barbarians-arizona.png", "page-7-barbarians-urban.png");
replaceTexture("page-8-player-buildings-bases.png", "page-8-player-buildings-bases-urban.png");
replaceTexture("page-9-player-buildings-bases.png", "page-9-player-buildings-bases-urban.png");
}
@@ -111,6 +111,12 @@
"pos1": [7232, 4416],
"pos2": [7744, 4928]
},
"area_9": {
"label": "NPBaseDetectTrigger",
"subscriber": 0,
"pos1": [3500, 4480],
"pos2": [5120, 5376]
},
"object_0": {
"label": "SouthScavFactory",
@@ -156,18 +162,12 @@
"radius": 1280
},
"radius_1": {
"label": "NPBaseDetectTrigger",
"subscriber": 0,
"pos": [3840, 5504],
"radius": 800
},
"radius_2": {
"label": "removeRedObjectiveBlip",
"subscriber": 0,
"pos": [4096, 3640],
"radius": 700
},
"radius_3": {
"radius_2": {
"label": "triggerLZ2Blip",
"subscriber": 0,
"pos": [6160, 3840],

0 comments on commit fa6e0cb

Please sign in to comment.