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 authored and pull[bot] committed Sep 28, 2023
1 parent fc88290 commit 10794ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions data/base/script/campaign/cam3-ad1.js
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 10794ac

Please sign in to comment.