Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jscam: Convert cam1-2.{vlo,slo} into cam1-2.js.
In the process: - Add a new scripted cheat, "ascend <level>". - Add a new pre-defined victory condition, CAM_VICTORY_OFFWORLD. - Add a new campaign group order, CAM_ORDER_COMPROMISE. - Allow CAM_ORDER_ATTACK to take list of positions. - Implement artifact pickup callbacks. - Don't cause victory until all enemies are defeated. - Throw all enemies into last attack when all bases are destroyed, which fixes previous missions as well. refs ticket:4234
- Loading branch information
Showing
11 changed files
with
390 additions
and
1,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
include("script/campaign/libcampaign.js"); | ||
include("script/campaign/templates.js"); | ||
|
||
var northSeen = false; | ||
|
||
function exposeNorthBase() { | ||
if (northSeen) | ||
return; | ||
northSeen = true; | ||
camDetectEnemyBase("NorthGroup"); // no problem if already detected | ||
hackAddMessage("SB1_2_MSG2", MISS_MSG, 0, true); // that's what it was for | ||
} | ||
|
||
function camArtifactPickup_ScavLab() { | ||
exposeNorthBase(); | ||
} | ||
|
||
function camEnemyBaseDetected_NorthGroup() { | ||
exposeNorthBase(); | ||
} | ||
|
||
camAreaEvent("NorthBaseTrigger", 0, function(droid) | ||
{ | ||
// frankly, this one happens silently | ||
camEnableFactory("NorthFactory"); | ||
}); | ||
|
||
function eventStartLevel() | ||
{ | ||
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "SUB_1_3S", { | ||
area: "RTLZ", | ||
message: "C1-2_LZ", | ||
reinforcements: 60 | ||
}); | ||
var startpos = getObject("StartPosition"); | ||
centreView(startpos.x, startpos.y); | ||
var lz = getObject("LandingZone"); | ||
setNoGoArea(lz.x, lz.y, lz.x2, lz.y2, 0); | ||
var tent = getObject("TransporterEntry"); | ||
startTransporterEntry(62, 58, 0); | ||
var text = getObject("TransporterExit"); | ||
setTransporterExit(58, 62, 0); | ||
setPower(200, 7); | ||
|
||
camSetEnemyBases({ | ||
"NorthGroup": { | ||
cleanup: "NorthBase", | ||
detectMsg: "C1-2_BASE1", | ||
detectSnd: "pcv374.ogg", | ||
eliminateSnd: "pcv392.ogg" | ||
}, | ||
"WestGroup": { | ||
cleanup: "WestBase", | ||
detectMsg: "C1-2_BASE2", | ||
detectSnd: "pcv374.ogg", | ||
eliminateSnd: "pcv392.ogg" | ||
}, | ||
"ScavLabGroup": { | ||
detectMsg: "C1-2_OBJ1", | ||
}, | ||
}); | ||
|
||
hackAddMessage("SB1_2_MSG", MISS_MSG, 0, false); | ||
camDetectEnemyBase("ScavLabGroup"); | ||
|
||
camSetArtifacts({ | ||
"ScavLab": { tech: "R-Wpn-Mortar01Lt" }, | ||
"NorthFactory": { tech: "R-Vehicle-Prop-Halftracks" }, | ||
}); | ||
|
||
with (camTemplates) camSetFactories({ | ||
"NorthFactory": { | ||
assembly: "NorthAssembly", | ||
order: CAM_ORDER_COMPROMISE, | ||
data: { | ||
pos: [ | ||
camMakePos("NorthAssembly"), | ||
camMakePos("GatesPos"), | ||
camMakePos("ScavLabPos"), | ||
camMakePos("RTLZ"), | ||
], | ||
radius: 8 | ||
}, | ||
groupSize: 5, | ||
maxSize: 8, | ||
throttle: 15000, | ||
group: camMakeGroup("NorthTankGroup"), | ||
templates: [ trike, bloke, buggy, bjeep ] | ||
}, | ||
"WestFactory": { | ||
assembly: "WestAssembly", | ||
order: CAM_ORDER_COMPROMISE, | ||
data: { | ||
pos: [ | ||
camMakePos("WestAssembly"), | ||
camMakePos("GatesPos"), | ||
camMakePos("ScavLabPos"), | ||
camMakePos("RTLZ"), | ||
], | ||
radius: 8 | ||
}, | ||
groupSize: 5, | ||
maxSize: 8, | ||
throttle: 10000, | ||
group: camMakeGroup("WestTankGroup"), | ||
templates: [ trike, bloke, buggy, bjeep ] | ||
}, | ||
}); | ||
|
||
queue("camEnableFactory", 30000, "WestFactory"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.