Permalink
Browse files

Update campaign scripts.

cam2-b/3-a/3-1: Remove old VTOL related function calls that no longer exist.
Make the style format more consistent.
  • Loading branch information...
KJeff01 committed Sep 1, 2017
1 parent 449b08c commit a46b9dda5abcf70601cd92bd38caa84e0bf27ebc
Showing with 229 additions and 226 deletions.
  1. +3 −3 data/base/script/campaign/cam1-1.js
  2. +5 −5 data/base/script/campaign/cam1-1s.js
  3. +5 −4 data/base/script/campaign/cam1-2.js
  4. +4 −3 data/base/script/campaign/cam1-3.js
  5. +4 −4 data/base/script/campaign/cam1-5.js
  6. +12 −12 data/base/script/campaign/cam1-7.js
  7. +2 −2 data/base/script/campaign/cam1-7s.js
  8. +4 −4 data/base/script/campaign/cam1-d.js
  9. +2 −2 data/base/script/campaign/cam1-ds.js
  10. +4 −4 data/base/script/campaign/cam1a-c.js
  11. +2 −0 data/base/script/campaign/cam1ca.js
  12. +2 −2 data/base/script/campaign/cam1end.js
  13. +2 −2 data/base/script/campaign/cam2-1s.js
  14. +8 −8 data/base/script/campaign/cam2-1x.js
  15. +8 −8 data/base/script/campaign/cam2-2.js
  16. +4 −4 data/base/script/campaign/cam2-2s.js
  17. +5 −5 data/base/script/campaign/cam2-5.js
  18. +4 −4 data/base/script/campaign/cam2-5s.js
  19. +5 −5 data/base/script/campaign/cam2-6.js
  20. +4 −4 data/base/script/campaign/cam2-6s.js
  21. +5 −7 data/base/script/campaign/cam2-7.js
  22. +4 −4 data/base/script/campaign/cam2-7s.js
  23. +5 −5 data/base/script/campaign/cam2-8.js
  24. +4 −4 data/base/script/campaign/cam2-8s.js
  25. +14 −12 data/base/script/campaign/cam2-a.js
  26. +5 −6 data/base/script/campaign/cam2-b.js
  27. +26 −26 data/base/script/campaign/cam2-c.js
  28. +6 −6 data/base/script/campaign/cam2-d.js
  29. +4 −4 data/base/script/campaign/cam2-ds.js
  30. +8 −8 data/base/script/campaign/cam2-end.js
  31. +16 −17 data/base/script/campaign/cam3-1.js
  32. +2 −2 data/base/script/campaign/cam3-1s.js
  33. +14 −14 data/base/script/campaign/cam3-2.js
  34. +2 −2 data/base/script/campaign/cam3-2s.js
  35. +15 −14 data/base/script/campaign/cam3-a.js
  36. +2 −2 data/base/script/campaign/cam3-ab.js
  37. +6 −6 data/base/script/campaign/cam3-b.js
  38. +2 −2 data/base/script/campaign/cam3-c.js
@@ -41,12 +41,12 @@ function eventStartLevel()
});
var startpos = getObject("startPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("landingZone"); //player lz
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("transporterEntry");
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("transporterExit");
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);
//Get rid of the already existing crate and replace with another
@@ -4,7 +4,7 @@ var cheat;
function eventChat(from, to, message)
{
if(isCheating() && message === "let me win")
if (isCheating() && message === "let me win")
{
cheat = true;
}
@@ -26,9 +26,9 @@ function secondVideo()
function powerModuleBuilt()
{
var gens = enumStruct(CAM_HUMAN_PLAYER, "A0PowerGenerator", false);
for(var x = 0; x < gens.length; ++x)
for (var x = 0; x < gens.length; ++x)
{
if((gens[x].modules > 0) && (gens[x].status === BUILT))
if ((gens[x].modules > 0) && (gens[x].status === BUILT))
{
return true;
}
@@ -39,7 +39,7 @@ function powerModuleBuilt()
//Only way to pass this mission is to build a power module or be in cheat mode.
function checkForPowerModule()
{
if(cheat || powerModuleBuilt())
if (cheat || powerModuleBuilt())
{
camSetupTransporter(11, 52, 1, 32);
secondVideo();
@@ -58,7 +58,7 @@ function eventStartLevel()
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_1");
cheat = false;
if(!powerModuleBuilt())
if (!powerModuleBuilt())
{
resPowModVideo();
}
@@ -68,13 +68,14 @@ function eventStartLevel()
message: "C1-2_LZ",
reinforcements: -1
});
var startpos = getObject("StartPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("LandingZone");
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("TransporterExit");
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(camChangeOnDiff(800, true), 7);
@@ -140,7 +141,7 @@ function eventStartLevel()
templates: [ trike, bloke, buggy, bjeep ]
},
});
queue("enableReinforcements", 10000);
queue("enableWestFactory", 30000);
}
@@ -166,13 +166,14 @@ function eventStartLevel()
message: "C1-3_LZ",
reinforcements: -1 // will override later
});
var startpos = getObject("StartPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("LandingZone");
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("TransporterExit");
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(camChangeOnDiff(50000, true), NEW_PARADIGM);
@@ -73,7 +73,7 @@ function sendNPTransport()
var tPos = getObject("NPTransportPos");
var nearbyDefense = enumRange(tPos.x, tPos.y, 6, NEW_PARADIGM, false);
if(nearbyDefense.length)
if (nearbyDefense.length)
{
var list = getDroidsForNPLZ();
camSendReinforcement(NEW_PARADIGM, camMakePos("NPTransportPos"), list, CAM_REINFORCE_TRANSPORT, {
@@ -130,12 +130,12 @@ function eventStartLevel()
});
var lz = getObject("LandingZone1"); //player lz
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var lz2 = getObject("LandingZone2"); //new paradigm lz
setNoGoArea(lz2.x, lz2.y, lz2.x2, lz2.y2, NEW_PARADIGM);
var tent = getObject("TransporterEntry");
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("TransporterExit");
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
setNoGoArea(lz2.x, lz2.y, lz2.x2, lz2.y2, NEW_PARADIGM);
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
setTransporterExit(text.x, text.y, CAM_HUMAN_PLAYER);
//Transporter is the only droid of the player's on the map
@@ -49,10 +49,10 @@ camAreaEvent("NPWayPointTrigger", function()
//Land New Paradigm transport if the New Paradigm have the artifact.
camAreaEvent("NPTransportTrigger", function()
{
if(enemyHasArtifact)
if (enemyHasArtifact)
{
var list = [];
with(camTemplates) list = [npmrl, npmrl];
with (camTemplates) list = [npmrl, npmrl];
camSendReinforcement(NEW_PARADIGM, camMakePos("NPTransportPos"), list, CAM_REINFORCE_TRANSPORT, {
entry: { x: 39, y: 0 },
exit: { x: 32, y: 62 }
@@ -80,9 +80,9 @@ camAreaEvent("artifactCheckNP", function()
//by the time it lands.
function eventTransporterLanded(transport)
{
if((transport.player === NEW_PARADIGM) && enemyHasArtifact)
if ((transport.player === NEW_PARADIGM) && enemyHasArtifact)
{
for(var s = 0; s < 5; ++s)
for (var s = 0; s < 5; ++s)
{
var crew = enumRange(transport.x, transport.y, 5, ALL_PLAYERS, false);
crew = crew.filter(function(obj) {
@@ -94,7 +94,7 @@ function eventTransporterLanded(transport)
);
});
for(var i = 0, l = crew.length; i < l; ++i)
for (var i = 0, l = crew.length; i < l; ++i)
{
camSafeRemoveObject(crew[i], false);
}
@@ -107,7 +107,7 @@ function eventTransporterLanded(transport)
//Check if the artifact group member are still alive and drop the artifact if needed.
function eventGroupLoss(obj, group, newsize)
{
if((group === artiGroup) && !newsize && enemyHasArtifact && !enemyStoleArtifact)
if ((group === artiGroup) && !newsize && enemyHasArtifact && !enemyStoleArtifact)
{
var acrate = addFeature("Crate", obj.x, obj.y);
addLabel(acrate, "newArtiPos");
@@ -132,7 +132,7 @@ function getArtifact()
//New Paradigm truck builds six lancer hardpoints around LZ
function buildLancers()
{
for(var i = 1; i <= 6; ++i)
for (var i = 1; i <= 6; ++i)
{
camQueueBuilding(NEW_PARADIGM, "WallTower06", "hardPoint" + i);
}
@@ -141,12 +141,12 @@ function buildLancers()
//Must destroy all of the New Paradigm droids and make sure the artifact is safe.
function extraVictory()
{
if(camDef(enemyStoleArtifact) && enemyStoleArtifact)
if (camDef(enemyStoleArtifact) && enemyStoleArtifact)
{
return false;
}
if(!enumDroid(NEW_PARADIGM).length)
if (!enumDroid(NEW_PARADIGM).length)
{
return true;
}
@@ -171,11 +171,11 @@ function removeCanyonBlip()
function eventPickup(feature, droid)
{
if(feature.stattype === ARTIFACT)
if (feature.stattype === ARTIFACT)
{
if(droid.player === CAM_HUMAN_PLAYER)
if (droid.player === CAM_HUMAN_PLAYER)
{
if(enemyHasArtifact)
if (enemyHasArtifact)
{
hackRemoveMessage("C1-7_LZ2", PROX_MSG, CAM_HUMAN_PLAYER);
}
@@ -5,12 +5,12 @@ var index;
function eventVideoDone()
{
const VIDEOS = ["SB1_7_MSG", "SB1_7_MSG2"];
if(!camDef(index))
if (!camDef(index))
{
index = 0;
}
if(index < VIDEOS.length)
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
@@ -55,7 +55,7 @@ function sendNPTransporter()
var tPos = getObject("NPTransportPos");
var nearbyDefense = enumRange(tPos.x, tPos.y, 8, NEW_PARADIGM, false);
if(nearbyDefense.length)
if (nearbyDefense.length)
{
var list = getDroidsForNPLZ();
camSendReinforcement(NEW_PARADIGM, camMakePos("NPTransportPos"), list,
@@ -167,12 +167,12 @@ function eventStartLevel()
});
var startpos = getObject("startPosition");
centreView(startpos.x, startpos.y);
var lz = getObject("landingZone"); //player lz
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, CAM_HUMAN_PLAYER);
var tent = getObject("transporterEntry");
startTransporterEntry(tent.x, tent.y, CAM_HUMAN_PLAYER);
var text = getObject("transporterExit");
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);
//Get rid of the already existing crate and replace with another
@@ -5,12 +5,12 @@ var index;
function eventVideoDone()
{
const VIDEOS = ["MB1D_MSG", "MB1D_MSG2"];
if(!camDef(index))
if (!camDef(index))
{
index = 0;
}
if(index < VIDEOS.length)
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
@@ -28,12 +28,12 @@ var videoIndex;
function eventVideoDone()
{
const VIDEOS = ["MB1A-C_MSG", "MB1A-C_MSG2"];
if(!camDef(videoIndex))
if (!camDef(videoIndex))
{
videoIndex = 0;
}
if(videoIndex < VIDEOS.length)
if (videoIndex < VIDEOS.length)
{
hackAddMessage(VIDEOS[videoIndex], MISS_MSG, CAM_HUMAN_PLAYER, true);
videoIndex = videoIndex + 1;
@@ -51,7 +51,7 @@ function extraVictoryCondition()
//Makes a large group of ground units appear on map
function checkForGroundForces()
{
if(index < 2 && switchLZ === 3)
if (index < 2 && switchLZ === 3)
{
//Amounts for the ground force
const maxTanks = 16;
@@ -132,7 +132,7 @@ function sendTransport()
switchLZ = 0;
}
if(index === 5)
if (index === 5)
return;
else
queue("sendTransport", camChangeOnDiff(60000)); //1 min
@@ -16,11 +16,13 @@ function countStructuresInBuildArea()
var list = enumArea("buildArea", CAM_HUMAN_PLAYER, false);
var ret = 0;
for (var i = 0; i < list.length; ++i)
{
if (list[i].type === STRUCTURE && list[i].stattype !== WALL
&& list[i].status === BUILT)
{
++ret;
}
}
return ret;
}
@@ -5,12 +5,12 @@ var index;
function eventVideoDone()
{
const VIDEOS = ["CAM1_OUT", "CAM1_OUT2", "CAM2_BRIEF"];
if(!camDef(index))
if (!camDef(index))
{
index = 0;
}
if(index < VIDEOS.length)
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
@@ -8,12 +8,12 @@ var index;
function eventVideoDone()
{
const VIDEOS = ["MB2_1_MSG", "MB2_1_MSG2"];
if(!camDef(index))
if (!camDef(index))
{
index = 0;
}
if(index < VIDEOS.length)
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
@@ -20,7 +20,7 @@ const COLLECTIVE_RES = [
camAreaEvent("crashSite", function(droid)
{
//Unlikely to happen.
if(enumDroid(TRANSPORT_TEAM).length === 0)
if (!enumDroid(TRANSPORT_TEAM).length)
{
gameOverMessage(false);
return;
@@ -34,7 +34,7 @@ camAreaEvent("crashSite", function(droid)
hackRemoveMessage("C21_OBJECTIVE", PROX_MSG, CAM_HUMAN_PLAYER, true);
var downedTransportUnits = enumDroid(TRANSPORT_TEAM);
for(var i = 0; i < downedTransportUnits.length; i++)
for (var i = 0; i < downedTransportUnits.length; i++)
{
donateObject(downedTransportUnits[i], CAM_HUMAN_PLAYER);
}
@@ -87,12 +87,12 @@ function setupCyborgGroups()
function updateTransportUnits()
{
var downedTransportUnits = enumDroid(TRANSPORT_TEAM);
for(var i = 0; i < downedTransportUnits.length; i++)
for (var i = 0; i < downedTransportUnits.length; i++)
{
if(camDef(downedTransportUnits[i]))
if (camDef(downedTransportUnits[i]))
{
var temp = downedTransportUnits[i];
if(camDef(temp.weapons[0]))
if (camDef(temp.weapons[0]))
{
addDroid(TRANSPORT_TEAM, temp.x, temp.y, "Team Alpha unit",
temp.body, temp.propulsion, "", "", temp.weapons[0].name);
@@ -108,7 +108,7 @@ function updateTransportUnits()
//Remove the old droids.
for(var i = 0; i < downedTransportUnits.length; i++)
{
if(camDef(downedTransportUnits[i]))
if (camDef(downedTransportUnits[i]))
{
camSafeRemoveObject(downedTransportUnits[i], false);
}
@@ -121,14 +121,14 @@ function updateTransportUnits()
//likely will never happen as with the WZ Script version.
function checkCrashedTeam()
{
if(getObject("transporter") === null)
if (getObject("transporter") === null)
{
const BADSND = "pcv622.ogg";
playSound(BADSND);
return false;
}
if(camDef(victoryFlag) && (victoryFlag === true))
if (camDef(victoryFlag) && victoryFlag)
{
return true;
}
Oops, something went wrong.

0 comments on commit a46b9dd

Please sign in to comment.