warzone2100/data/script/fastplay/s-demo.slo

559 lines
15 KiB
Plaintext

// SCRIPT file for Cam 1-2
/* General Values */
public int player;
public int enemy1;
public int enemy2;
private int numart;
public int pow1, pow2;
/* structure limit stuff */
public STRUCTURESTAT factory, research, oilDerrick, powerGen;
//public STRUCTURESTAT powerModuleHack;
public STRUCTURESTAT command;
public INT numPow, numExt, numFac, numRes;
/* Win or lose */
public SOUND wonSnd;
public SOUND lostSnd;
public LEVEL NextLev;
private GROUP allPlayer, nearLZ;
private int totDroids;
/* Starting Technology */
public int numtecE1;
public RESEARCHSTAT tecE1[3];
private int tecCount;
/* Base Under Attack Stuff */
private STRUCTURE hitStruc;
private BASEOBJ attackerObj;
private int t;
public SOUND attackSnd1;
public SOUND LZSnd;
/* LZ Message */
public INTMESSAGE LZ_MSG;
public SOUND LZComp, LZClear, reinfSnd;
public INTMESSAGE obj1;
public TEXTSTRING RetLZMsg;
public INT ReinforceTime;
/* Transport Entry/Exit coords */
public int entryX, entryY, exitX, exitY;
/* Briefing stuff */
public INTMESSAGE endMsg, winMsg;
public INTMESSAGE InFlight;
public INTMESSAGE MissionBrief; //, MissionBrief2;
public SOUND incomingSnd;
private BOOL brief2Flag;
/* Proximity: Resources */
/*
public FEATURE res1;
public INTMESSAGE res1Msg;
public SOUND res1Snd;
public STRUCTURESTAT derrick;
private int res1x,res1y; //temp values to cope with oil disappearing!
*/
/* Proximity: Artifacts */
public FEATURESTAT crate;
public int art1X, art1Y;
public STRUCTURE art1Get;
public SOUND art1Snd1, art1Snd2;
//public INTMESSAGE art1Msg;
public RESEARCHSTAT art1Comp;
private FEATURE art1ID;
public int art2X, art2Y;
public STRUCTURE art2Get;
public SOUND art2Snd1, art2Snd2;
//public INTMESSAGE art2Msg;
public RESEARCHSTAT art2Comp;
private FEATURE art2ID;
public int art3X, art3Y;
public STRUCTURE art3Get;
public SOUND art3Snd1, art3Snd2;
//public INTMESSAGE art3Msg;
public RESEARCHSTAT art3Comp;
private FEATURE art3ID;
/* player Bonus Research topics given at end of mission */
public int numResP0;
public RESEARCHSTAT resP0[20]; //need to be declared with value >= numResP0, numResP1, etc.
private INT count;
/* Proximity: Enemy */
public STRUCTURE enm1;
public STRUCTUREID enm1ID;
public INTMESSAGE enm1Msg;
public SOUND enm1Snd1;
public SOUND enm1Snd2;
public STRUCTURE enm2;
public STRUCTUREID enm2ID;
public INTMESSAGE enm2Msg;
public SOUND enm2Snd1;
public SOUND enm2Snd2;
//extra blips for guard entrances
public INTMESSAGE guard1Msg, guard2Msg;
public SOUND guard1Snd1, guard2Snd1, guard1Snd2, guard2Snd2;
/* Triggers: Win or Lose */
trigger winLoseTrig(every, 5);
/* Triggers: Briefing */
trigger vidEndTrig(CALL_VIDEO_QUIT);
/* Triggers: Resource */
/*
trigger res1SeenTrig(droidHasSeen(res1, player), 10);
trigger res1UsedTrig(every, 10);
*/
/* Triggers: Artifacts */
//trigger art1SeenTrig(droidHasSeen(art1ID, player), 5);
trigger art1TakeTrig(droidInRange(player, art1X, art1Y, 200), 5);
trigger art1PlaceTrig((art1Get==NULLOBJECT), 5);
//trigger art2SeenTrig(droidHasSeen(art2ID, player), 5);
trigger art2TakeTrig(droidInRange(player, art2X, art2Y, 200), 5);
trigger art2PlaceTrig((art2Get==NULLOBJECT), 5);
trigger art3TakeTrig(droidInRange(player, art3X, art3Y, 200), 5);
trigger art3PlaceTrig((art3Get==NULLOBJECT), 5);
/* Triggers: Enemy */
trigger enm1SeenTrig(seenStructInArea(player, enemy1, FALSE, 3136, 1728, 5440, 2624), 10);
trigger enm1DeadTrig(numStructsButNotWallsInArea(enemy1, 3136, 1728, 5440, 2624) == 0, 20);
trigger enm2SeenTrig(seenStructInArea(player, enemy1, FALSE, 1600, 6464, 2368, 7232), 10);
trigger enm2DeadTrig(numStructsButNotWallsInArea(enemy1, 1600, 6464, 2368, 7232) == 0, 20);
trigger guard1SeenTrig(seenStructInArea(player, enemy1, FALSE, 2368, 5568, 3392, 6592), 10);
trigger guard1DeadTrig(numStructsButNotWallsInArea(enemy1, 2368, 5568, 3392, 6592) == 0, 20);
trigger guard2SeenTrig(seenStructInArea(player, enemy1, FALSE, 4544, 2880, 5924, 4928), 10);
trigger guard2DeadTrig(numStructsButNotWallsInArea(enemy1, 4544, 2880, 5924, 4928) == 0, 20);
/* part 2 briefing */
trigger brief2Trig(brief2Flag, 15);
trigger retLZTrig(numart == 3, 20);
//LZ contains enemies?
//trigger LZNoGoTrig((objectInArea(enemy1, 6000, 7000, 7000, 8000)), 35);
//LZ clear of enemies?
//trigger LZ_OKTrig((not objectInArea(enemy1, 6000, 7000, 7000, 8000)), 35);
trigger gameLostTrig (every, 20);
trigger researchTrig(every, 1200); //2 minute delay between topics completed
event startEvnt(CALL_VIDEO_QUIT) //(CALL_GAMEINIT)
{
//setLandingZone(LZ_X1, LZ_Y1, LZ_X2, LZ_Y2);
//centreView(enm1); //temporary solution for thin maps
removeMessage(InFlight, MISS_MSG, 0);
centreViewPos(52*128, 55*128);
//set scroll limits
setScrollParams(0, 0, 64, 64); //limit scroll
//set zoom Level 64x64
setRadarZoom(1);
//call in transport
flyTransporterIn(player, entryX, entryY, false);
setTransporterExit(player, exitX, exitY);
//make sure all buttons available/unavailable
//removeReticuleButton(DESIGN);
//removeReticuleButton(BUILD);
//set starting power
setPowerLevel(pow1, enemy1);
setPowerLevel(pow2, enemy2);
addMessage(MissionBrief, MISS_MSG, 0, false);
flashOff(INTELMAP);
//Blip Given at start
addMessage(obj1, PROX_MSG, player, false);
//allow to build stuff
setStructureLimits (powerGen,numPow,0);
setStructureLimits (oilDerrick,numExt,0);
setStructureLimits (research,numRes,0);
setStructureLimits (factory,numFac,0);
setStructureLimits(command, 0, player);
enableStructure(command, player);
enableStructure(powerGen,0);
enableStructure(oilDerrick,0);
enableStructure(research,0);
enableStructure(factory,0);
//enableStructure(powerModuleHack, 0);
//give first topic for enemy
completeResearch(tecE1[tecCount], enemy1);
tecCount = tecCount + 1;
//set transport time
setReinforcementTime(ReinforceTime);
//set up resource coords (since oil pools diappear when built on!!!)
//res1x=res1.x;
//res1y=res1.y;
setEventTrigger(startEvnt, inactive);
}
event flightEvnt(CALL_GAMEINIT)
{
addMessage(InFlight, MISS_MSG, 0, true);
setEventTrigger(flightEvnt, inactive);
}
/*Events: */
/* Events: Artifacts */
event art1TakeEvnt(inactive)
{
numart=numart+1;
brief2Flag = TRUE;
//playSound(art1Snd2, player);
playSoundPos(art1Snd2, player, art1ID.x, art1ID.y, art1ID.z);
destroyFeature(art1ID);
removeMessage(obj1, PROX_MSG, player);
//removeMessage(art1Msg, PROX_MSG, player);
enableResearch(art1Comp, player);
setEventTrigger(art1TakeEvnt, inactive);
}
event art1PlaceEvnt(art1PlaceTrig)
{
//place artifact crate, and allow check for prox
art1ID=addFeature(crate, art1X, art1Y);
//setEventTrigger(art1SeenEvnt, art1SeenTrig);
setEventTrigger(art1TakeEvnt, art1TakeTrig);
setEventTrigger(art1PlaceEvnt, inactive);
}
event art2TakeEvnt(inactive)
{
numart=numart+1;
//playSound(art2Snd2, player);
playSoundPos(art2Snd2, player, art2ID.x, art2ID.y, art2ID.z);
destroyFeature(art2ID);
//removeMessage(art2Msg, PROX_MSG, player);
enableResearch(art2Comp, player);
setEventTrigger(art2TakeEvnt, inactive);
}
event art2PlaceEvnt(art2PlaceTrig)
{
//place artifact crate, and allow check for prox
art2ID=addFeature(crate, art2X, art2Y);
//setEventTrigger(art2SeenEvnt, art2SeenTrig);
setEventTrigger(art2TakeEvnt, art2TakeTrig);
setEventTrigger(art2PlaceEvnt, inactive);
}
event art3TakeEvnt(inactive)
{
numart=numart+1;
//playSound(art3Snd2, player);
playSoundPos(art3Snd2, player, art3ID.x, art3ID.y, art3ID.z);
destroyFeature(art3ID);
//removeMessage(art3Msg, PROX_MSG, player);
enableResearch(art3Comp, player);
setEventTrigger(art3TakeEvnt, inactive);
}
event art3PlaceEvnt(art3PlaceTrig)
{
//place artifact crate, and allow check for prox
art3ID=addFeature(crate, art3X, art3Y);
//setEventTrigger(art3SeenEvnt, art3SeenTrig);
setEventTrigger(art3TakeEvnt, art3TakeTrig);
setEventTrigger(art3PlaceEvnt, inactive);
}
/* Events: Enemies */
event enm1DeadEvnt(inactive)
{
killStructsInArea(enemy1, REF_WALL, 3136, 1728, 5440, 2624, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy1, REF_WALLCORNER, 3136, 1728, 5440, 2624, TRUE, FALSE); //remove corner walls in base
removeMessage(enm1Msg, PROX_MSG, player);
//playSound(enm1Snd2, player);
playSoundPos(enm1Snd2, player, 4160, 2112, 0);
setEventTrigger(enm1DeadEvnt, inactive);
}
event enm1SeenEvnt(enm1SeenTrig)
{
brief2Flag = TRUE;
pause(20);
addMessage(enm1Msg, PROX_MSG, player, false);
//playSound(enm1Snd1, player);
playSoundPos(enm1Snd1, player, 4160, 2112, 0);
setEventTrigger(enm1DeadEvnt, enm1DeadTrig);
setEventTrigger(enm1SeenEvnt, inactive);
}
event enm2DeadEvnt(inactive)
{
killStructsInArea(enemy2, REF_WALL, 1600, 6464, 2368, 7232, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy2, REF_WALLCORNER, 1600, 6464, 2368, 7232, TRUE, FALSE); //remove corner walls in base
removeMessage(enm2Msg, PROX_MSG, player);
//playSound(enm2Snd2, player);
playSoundPos(enm2Snd2, player, 1984, 7000, 0);
setEventTrigger(enm2DeadEvnt, inactive);
}
event enm2SeenEvnt(enm2SeenTrig) //base 2 seen
{
addMessage(enm2Msg, PROX_MSG, player, false);
//playSound(enm2Snd1, player);
playSoundPos(enm2Snd1, player, 1984, 7000, 0);
setEventTrigger(enm2DeadEvnt, enm2DeadTrig);
setEventTrigger(enm2SeenEvnt, inactive);
}
//Extra blips for guard entrances
event guard1DeadEvnt(inactive)
{
killStructsInArea(enemy1, REF_WALL, 2368, 5568, 3392, 6592, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy1, REF_WALLCORNER, 2368, 5568, 3392, 6592, TRUE, FALSE); //remove corner walls in base
removeMessage(guard1Msg, PROX_MSG, player);
//playSound(guard1Snd2, player);
setEventTrigger(guard1DeadEvnt, inactive);
}
event guard1SeenEvnt(guard1SeenTrig)
{
addMessage(guard1Msg, PROX_MSG, player, false);
//playSound(guard1Snd1, player);
playSoundPos(guard1Snd1, player, 2880, 5824, 0);
setEventTrigger(guard1DeadEvnt, guard1DeadTrig);
setEventTrigger(guard1SeenEvnt, inactive);
}
event guard2DeadEvnt(inactive)
{
killStructsInArea(enemy2, REF_WALL, 4544, 3392, 5924, 4928, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy2, REF_WALLCORNER, 4544, 3392, 5924, 4928, TRUE, FALSE); //remove corner walls in base
removeMessage(guard2Msg, PROX_MSG, player);
//playSound(guard2Snd2, player);
setEventTrigger(guard2DeadEvnt, inactive);
}
event guard2SeenEvnt(guard2SeenTrig) //base 2 seen
{
addMessage(guard2Msg, PROX_MSG, player, false);
//playSound(guard2Snd1, player);
playSoundPos(guard2Snd1, player, 5312, 4160, 0);
setEventTrigger(guard2DeadEvnt, guard2DeadTrig);
setEventTrigger(guard2SeenEvnt, inactive);
}
/* Disabled for demo
event brief2Evnt(brief2Trig)
{
playSound(incomingSnd, player);
pause(20);
addMessage(MissionBrief2, MISS_MSG, 0, true);
setEventTrigger(brief2Evnt, inactive);
}
*/
event giveLZmess(inactive) //don't use for demo!
//(retLZTrig)
{
//add LZ blip and WAV message
addMessage(LZ_MSG, PROX_MSG, player, false);
addConsoleText(RetLZMsg, player);
//playSound(LZSnd, player);
playSoundPos(LZSnd, player, 6848, 7104, 0);
setEventTrigger(giveLZmess, inactive);
}
//event wonYetEvnt;
event wonYetLZEvnt;
event timeUp;
/* Events: Win or Lose */
event nextLevEvnt(inactive) //assumes victory already checked
{
//playSound(wonSnd,0);
//pause(20);
// give bonus research (if req'd)
count = 0;
while (count < numResP0)
{
enableResearch(resP0[count], 0);
count = count +1;
}
gameLevel=gameLevel+1; //flag next part of map
setLandingZone(10, 51, 12, 53);
//enable research
enableResearch(art1Comp, player);
removeMessage(MissionBrief, MISS_MSG, player);
//startMission(BETWEEN, NextLev);
//End game here for now! (don't try next mission)
// addMessage(winMsg, MISS_MSG, 0, true);
// pause(10);
// gameOver(true);
gameOverMessage(winMsg, MISS_MSG, 0, true);
setEventTrigger(nextLevEvnt, inactive);
}
event gameLost(inactive)
{
// addMessage(endMsg, MISS_MSG, 0, true);
// pause(10);
// gameOver(false);
gameOverMessage(endMsg, MISS_MSG, 0, false);
setEventTrigger(gameLost, inactive);
}
event lostYetEvnt(winLoseTrig)
{
if (not anyDroidsLeft(player))
{
if (not anyStructButWallsLeft(player))
{
//setEventTrigger(wonYetEvnt,inactive);
setEventTrigger(wonYetLZEvnt, inactive);
setEventTrigger(timeUp, inactive);
//playSound(lostSnd,0);
//pause(20);
//addMessage(endMsg, MISS_MSG, 0, true);
//gameOver(false);
setEventTrigger(gameLost, gameLostTrig); //waits 2 seconds before ending
setEventTrigger(lostYetEvnt, inactive);
}
}
}
//out of time?
event timeUp(CALL_MISSION_TIME)
{
//setEventTrigger(wonYetEvnt,inactive);
setEventTrigger(lostYetEvnt,inactive);
setEventTrigger(wonYetLZEvnt, inactive);
//playSound(lostSnd,0);
//pause(20);
//gameOver(false);
setEventTrigger(gameLost, gameLostTrig); //waits 2 seconds before ending
setEventTrigger(timeUp, inactive);
}
event wonYetLZEvnt(retLZTrig) //triggered when all artifacts picked up
// have all enemies lost yet? FOR DEMO ONLY!
{
if (not anyDroidsLeft(enemy1))
{
if (not anyStructButWallsLeft(enemy1))
{
setEventTrigger(lostYetEvnt, inactive);
setEventTrigger(timeUp, inactive);
setEventTrigger(nextLevEvnt, winLoseTrig);
//setEventTrigger(wonYetEvnt, inactive);
setEventTrigger(wonYetLZEvnt, inactive);
}
}
}
/* not used for demo (need to kill everything!)
event wonYetLZEvnt(winLoseTrig) //alternate victory condition, got artifact(s) and back at LZ
{
totDroids = numDroidsInArea(player, 0, 0, 64*128, 64*128);
if (totDroids == numDroidsInArea(player, 6080, 6464, 7616, 7616))
{
if (totDroids!=0)
{
if (numart==3)
{
setEventTrigger(lostYetEvnt, inactive);
setEventTrigger(timeUp, inactive);
setEventTrigger(nextLevEvnt, winLoseTrig);
//setEventTrigger(wonYetEvnt, inactive);
setEventTrigger(wonYetLZEvnt, inactive);
}
}
}
}
*/
event cheatEvnt(CALL_MISSION_START) //cheat button ctrl M
{
setEventTrigger(nextLevEvnt, winLoseTrig);
setEventTrigger(cheatEvnt, inactive);
}
/* base under attack */
event baseHit(CALL_STRUCT_ATTACKED, selectedPlayer, ref hitStruc, ref attackerObj)
{
if (t>=20)
{
t=0;
playSoundPos(attackSnd1, player, hitStruc.x, hitStruc.y, hitStruc.z);
}
}
event everySec(every, 10)
{
t=t+1;
}
event seeBaseHit(CALL_MISSION_END)
{
//go to where the structure being attacked is on CTRL B
if (hitStruc!=NULLOBJECT)
{
centreView(hitStruc);
t=0; //flag known about!
}
}
/* LZ Compromised DISABLED!
event LZ_OK;
event LZNoGo(LZNoGoTrig)
{
//check LZ area for enemy structures and/or vehicles (in Trigger)
//playSound(LZComp, player); //"LZ Compromised"
playSoundPos(LZComp, player, 6848, 7104, 0);
//disallow reinforcements
setReinforcementTime(18000); //(set to mission time)
//allow check for clear!
setEventTrigger(LZ_OK,LZ_OKTrig);
setEventTrigger(LZNoGo, inactive);
}
event LZ_OK(inactive)
{
//check LZ area clear of enemy structures and/or vehicles (in Trigger)
//playSound(LZClear, player); //"LZ Clear"
playSoundPos(LZClear, player, 6848, 7104, 0);
//allow reinforcements now base found
setReinforcementTime(ReinforceTime); //(set back to normal)
setEventTrigger(LZNoGo, LZNoGoTrig);
setEventTrigger(LZ_OK, inactive);
}
*/
/* Disabled for difficulty check
event researchEvnt(researchTrig)
{
// player specific technology startups
if (tecCount >= numtecE1)
{
setEventTrigger(researchEvnt, inactive);
}
else
{
completeResearch(tecE1[tecCount], enemy1);
tecCount = tecCount + 1;
}
}
*/