Skip to content

Commit

Permalink
Change win condition for Gamma 7
Browse files Browse the repository at this point in the history
Force the player to bring a truck or factory into the Gamma 8 area of the map before winning.
  • Loading branch information
KJeff01 committed Jul 14, 2023
1 parent 5d4634a commit 5a5270b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions data/base/script/campaign/cam3-ad1.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,15 @@ function checkMissileSilos()

if (capturedSilos)
{
return true;
const Y_SCROLL_LIMIT = 140; // About the same number as the one in the Gamma 8 script.
let safeToWinObjs = enumArea(0, Y_SCROLL_LIMIT, mapWidth, mapHeight, CAM_HUMAN_PLAYER, false).filter((obj) => (
((obj.type === DROID && obj.droidType === DROID_CONSTRUCT) || (obj.type === STRUCTURE && obj.stattype === FACTORY && obj.status === BUILT))
));

if (safeToWinObjs.length > 0)
{
return true;
}
}

var siloArea = camMakePos(getObject("missileSilos"));
Expand All @@ -246,7 +254,7 @@ function checkMissileSilos()

function eventStartLevel()
{
camSetExtraObjectiveMessage(_("Secure a missile silo"));
camSetExtraObjectiveMessage(_("Build a forward base at the silos"));

var siloZone = getObject("missileSilos");
var startpos = getObject("startPosition");
Expand Down

0 comments on commit 5a5270b

Please sign in to comment.