warzone2100/data/script/text/cam1b.slo

497 lines
13 KiB
Plaintext

/* Script file for Cam1B */
/* General Values */
public int player;
public int enemy1;
public int enemy2;
private int numart; //keep track of number of artifacts collected
/* structure limit stuff */
public STRUCTURESTAT factory, research, oilDerrick, powerGen;
//public STRUCTURESTAT powerModuleHack;
public STRUCTURESTAT command;
public INT numPow, numExt, numFac, numRes;
/* Briefing stuff */
public INTMESSAGE MissionBrief;
public INTMESSAGE endMsg; //, winMsg;
/* Base Under Attack Stuff */
private STRUCTURE hitStruc;
private BASEOBJ attackerObj;
private int t;
public SOUND attackSnd1;
/* Proximity: Resources */
/* Proximity: Artifacts */
public FEATURESTAT crate;
public int art1X, art1Y;
public STRUCTURE art1Get;
public SOUND art1Snd2;
//public INTMESSAGE art1Msg;
public RESEARCHSTAT art1Comp; //Heavy Machine Gun
private FEATURE art1ID;
public int art2X, art2Y;
public STRUCTURE art2Get;
public SOUND art2Snd2;
//public INTMESSAGE art2Msg;
public RESEARCHSTAT art2Comp; //Power Module
private FEATURE art2ID;
// added by Keith for Sensor Tower Artefact
public int art3X, art3Y;
public STRUCTURE art3Get;
public SOUND art3Snd2;
//public INTMESSAGE art3Msg;
public RESEARCHSTAT art3Comp; //Sensor Tower
private FEATURE art3ID;
public int art4X, art4Y;
public STRUCTURE art4Get;
public SOUND art4Snd2;
//public INTMESSAGE art4Msg;
public RESEARCHSTAT art4Comp; //Power Module
private FEATURE art4ID;
/* 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 INTMESSAGE enm0Msg;
public SOUND enm0Snd1;
public SOUND enm0Snd2;
public STRUCTURE enm1;
public STRUCTUREID enm1ID;
public INTMESSAGE enm1Msg;
public SOUND enm1Snd1;
public SOUND enm1Snd2;
public STRUCTURE obj1;
public INTMESSAGE obj1Msg;
public SOUND obj1Snd1;
private BOOL obj1Flag;
public STRUCTURE enm2;
public STRUCTUREID enm2ID;
public INTMESSAGE enm2Msg;
public SOUND enm2Snd1;
public SOUND enm2Snd2;
/* Win or lose */
public SOUND lostSnd;
public LEVEL NextLev;
public TEMPLATE transporter;
public INT timeLimit;
/* Enemy Tactics */
public TEMPLATE trike;
public TEMPLATE buggy;
public TEMPLATE bloke;
public TEMPLATE jeep;
/* enemy1 ** Done in AI script! ***
public int enm1Ass1X, enm1Ass1Y;
private int enm1Fact1State;
private bool enm1Fact1Destroyed;
public int enm2Ass1X, enm2Ass1Y;
private int enm2Fact1State;
private bool enm2Fact1Destroyed;
*/
/* Triggers: Briefing */
trigger vidEndTrig(CALL_VIDEO_QUIT);
/* Triggers: Resource */
/* Triggers: Artifacts */
//trigger art1SeenTrig(droidHasSeen(art1ID, player), 5);
trigger art1TakeTrig(droidInRange(player, art1X, art1Y, 171), 5);
trigger art1PlaceTrig((art1Get==NULLOBJECT), 5);
//trigger art2SeenTrig(droidHasSeen(art2ID, player), 5);
trigger art2TakeTrig(droidInRange(player, art2X, art2Y, 171), 5);
trigger art2PlaceTrig((art2Get==NULLOBJECT), 5);
// added for Sensor Artefact
//trigger art3SeenTrig(droidHasSeen(art3ID, player), 5);
trigger art3TakeTrig(droidInRange(player, art3X, art3Y, 171), 5);
trigger art3PlaceTrig((art3Get==NULLOBJECT), 5);
//trigger art4SeenTrig(droidHasSeen(art4ID, player), 5);
trigger art4TakeTrig(droidInRange(player, art4X, art4Y, 171), 5);
trigger art4PlaceTrig((art4Get==NULLOBJECT), 5);
/* Triggers: Enemy */
trigger enm0SeenTrig(seenStructInArea(player, enemy2, FALSE, 704, 8896, 2496, 10688), 10);
trigger enm0DeadTrig((numStructsButNotWallsInArea(enemy2, 704, 8896, 2496, 10688) == 0), 20);
trigger enm1SeenTrig(droidHasSeen(enm1, player), 10); //enmWait
//trigger enm1DeadTrig(every, 10); //enmWait
trigger enm1DeadTrig((numStructsButNotWallsInArea(enemy1, 2112, 8768, 5696, 10560) == 0), 20);
trigger obj1SeenTrig(droidHasSeen(obj1, player), 10);
//trigger obj1DeadTrig((obj1==NULLOBJECT), 10); //enmWait
trigger obj1DeadTrig((numStructsButNotWallsInArea(enemy2, 2368, 10688, 4416, 12224) == 0), 20);
trigger enm2SeenTrig(droidHasSeen(enm2, player), 10); //enmWait
//trigger enm2DeadTrig(every, 10); //enmWait
trigger enm2DeadTrig((numStructsButNotWallsInArea(enemy2, 2240, 12864, 5312, 14400) == 0), 20);
/* Triggers: Win or Lose */
trigger winLoseTrig(every, 5);
trigger gameLostTrig(every, 20);
/* Triggers: Enemy Tactics */
trigger enm1Start1Trig(droidInRange(player, enm1.x, enm1.y, 2816),10);
trigger enm1Fact1Trig(every,150);
trigger enm2Start1Trig(droidInRange(player, enm2.x, enm2.y, 2000),10);
trigger enm2Fact1Trig(every,100);
/* Events: Initialise */
event enm2DeadEvnt;
event wonYetEvnt;
event timeUp;
/* Events: Start */
event startEvnt(CALL_GAMEINIT)
{
//set scroll limits
// setScrollParams(0, 0, 64, 128); //limit scroll
centreViewPos(1728, 6720); //centre near transport
//set zoom Level 128x128
setRadarZoom(0);
//stop player building on LZ
setLandingZone(10, 51, 12, 53);
//allow to build stuff
setStructureLimits (powerGen,numPow,0);
setStructureLimits (oilDerrick,numExt,0);
setStructureLimits (research,numRes,0);
setStructureLimits (factory,numFac,0);
setStructureLimits(command, 1, player);
enableStructure(command, player);
enableStructure(powerGen,0);
enableStructure(oilDerrick,0);
enableStructure(research,0);
enableStructure(factory,0);
//set no time limits (can carry over from previous missions if not set!)
setReinforcementTime(-1);
setMissionTime(timeLimit); //set Mission time limit
//Give blip at start
addMessage(enm2Msg, PROX_MSG, player, false);
//give player briefing
//setEventTrigger(start2Evnt, vidEndTrig); //flag next stuff after briefing over
addMessage(MissionBrief, MISS_MSG, 0, true);
setEventTrigger(startEvnt, inactive);
}
/* Events: Resources */
/* Events: Artifacts */
event art1TakeEvnt(inactive)
{
numart=numart+1;
//playSound(art1Snd2, player);
playSoundPos(art1Snd2, player, art1ID.x, art1ID.y, art1ID.z);
destroyFeature(art1ID);
//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;
destroyFeature(art3ID);
//playSound(art3Snd2, player);
playSoundPos(art3Snd2, player, art3ID.x, art3ID.y, art3ID.z);
//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);
}
event art4TakeEvnt(inactive)
{
numart=numart+1;
destroyFeature(art4ID);
//playSound(art4Snd2, player);
playSoundPos(art4Snd2, player, art4ID.x, art4ID.y, art4ID.z);
//removeMessage(art4Msg, PROX_MSG, player);
enableResearch(art4Comp, player);
setEventTrigger(art4TakeEvnt, inactive);
}
event art4PlaceEvnt(art4PlaceTrig)
{
//place artifact crate, and allow check for prox
art4ID=addFeature(crate, art4X, art4Y);
//setEventTrigger(art4SeenEvnt, art4SeenTrig);
setEventTrigger(art4TakeEvnt, art4TakeTrig);
setEventTrigger(art4PlaceEvnt, inactive);
}
/* Events: Enemies */
event enm0DeadEvnt(inactive)
{
killStructsInArea(enemy2, REF_WALL, 704, 8896, 2496, 10688, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy2, REF_WALLCORNER, 704, 8896, 2496, 10688, TRUE, FALSE); //remove corner walls in base
removeMessage(enm0Msg, PROX_MSG, player);
//playSound(enm0Snd2, player);
playSoundPos(enm0Snd2, player, 2112, 9280, 0);
setEventTrigger(enm0DeadEvnt, inactive);
}
event enm0SeenEvnt(enm0SeenTrig)
{
addMessage(enm0Msg, PROX_MSG, player, false);
//playSound(enm0Snd1, player);
playSoundPos(enm0Snd1, player, 2112, 9280, 0);
setEventTrigger(enm0DeadEvnt, enm0DeadTrig);
setEventTrigger(enm0SeenEvnt, inactive);
}
event enm1DeadEvnt(inactive)
{
killStructsInArea(enemy1, REF_WALL, 2112, 8768, 5696, 10560, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy1, REF_WALLCORNER, 2112, 8768, 5696, 10560, TRUE, FALSE); //remove corner walls in base
removeMessage(enm1Msg, PROX_MSG, player);
//playSound(enm1Snd2, player);
playSoundPos(enm1Snd1, player, 4370, 9872, 0);
setEventTrigger(enm1DeadEvnt, inactive);
}
event enm1SeenEvnt(enm1SeenTrig)
{
addMessage(enm1Msg, PROX_MSG, player, false);
//playSound(enm1Snd1, player);
playSoundPos(enm1Snd1, player, 4370, 9872, 0);
setEventTrigger(enm1DeadEvnt, enm1DeadTrig);
setEventTrigger(enm1SeenEvnt, inactive);
}
event obj1DeadEvnt(inactive)
{
removeMessage(obj1Msg, PROX_MSG, player);
//playSound(enm1Snd2, player);
setEventTrigger(obj1DeadEvnt, inactive);
}
event obj1SeenEvnt(obj1SeenTrig)
{
obj1Flag = TRUE;
addMessage(obj1Msg, PROX_MSG, player, false);
//playSound(obj1Snd1, player);
playSoundPos(obj1Snd1, player, 3776, 11328, 0);
setEventTrigger(obj1DeadEvnt, obj1DeadTrig);
setEventTrigger(obj1SeenEvnt, inactive);
}
event enm2DeadEvnt(enm2DeadTrig)
{
killStructsInArea(enemy2, REF_WALL, 2240, 12864, 5312, 14400, TRUE, TRUE); //remove walls and features in base
killStructsInArea(enemy2, REF_WALLCORNER, 2240, 12864, 5312, 14400, TRUE, FALSE); //remove corner walls in base
removeMessage(enm2Msg, PROX_MSG, player);
//playSound(enm2Snd2, player);
playSoundPos(enm2Snd2, player, 3193, 13806, 0);
if (not obj1Flag) //show radar tower if missed somehow!
{
obj1Flag = TRUE;
addMessage(obj1Msg, PROX_MSG, player, false);
//playSound(obj1Snd1, player);
playSoundPos(obj1Snd1, player, 3776, 11328, 0);
setEventTrigger(obj1DeadEvnt, enm1DeadTrig);
setEventTrigger(obj1SeenEvnt, inactive);
}
setEventTrigger(enm2DeadEvnt, inactive);
}
/* Now given as objective
event enm2SeenEvnt(enm2SeenTrig) //base 2 seen
{
addMessage(enm2Msg, PROX_MSG, player, false);
playSound(enm2Snd1, player);
setEventTrigger(enm2DeadEvnt, enm2DeadTrig);
setEventTrigger(enm2SeenEvnt, inactive);
}
*/
/* Events: Win or Lose */
event nextLevEvnt(inactive) //assumes victory already checked
{
pause(20); //increased to allow all audio before won
// 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
//removeMessage(MissionBrief, MISS_MSG, player);
startMission(BETWEEN, NextLev);
//End game here for now! (don't try next mission)
//gameOver(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(gameLost, gameLostTrig); //waits 2 seconds before ending
setEventTrigger(lostYetEvnt, inactive);
setEventTrigger(timeUp, inactive);
}
}
}
event wonYetEvnt(winLoseTrig) // have all enemies lost yet?
{
if (not anyDroidsLeft(enemy2))
{
if (not anyStructButWallsLeft(enemy2))
{
if (not anyDroidsLeft(enemy1))
{
if (not anyStructButWallsLeft(enemy1))
{
if (numart==4)
{
setEventTrigger(lostYetEvnt, inactive);
setEventTrigger(nextLevEvnt, winLoseTrig);
setEventTrigger(wonYetEvnt, inactive);
setEventTrigger(timeUp, 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;
if (hitStruc != NULLOBJECT)
{
playSoundPos(attackSnd1, selectedPlayer, hitStruc.x, hitStruc.y, hitStruc.z); //show position if still alive
}
else
{
playSound(attackSnd1, selectedPlayer);
}
}
}
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!
}
}
event timeUp(CALL_MISSION_TIME)
{
setEventTrigger(wonYetEvnt,inactive);
setEventTrigger(lostYetEvnt,inactive);
setEventTrigger(gameLost, gameLostTrig);
setEventTrigger(timeUp, inactive);
}