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

93 lines
2.5 KiB
Plaintext

/* Script file for s-demos (to start off world map) */
/* Simply place transporter and show briefing */
/* General Values */
public int player;
/* 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;
/* Win or lose */
public LEVEL NextLev;
public TEMPLATE transporter;
public SOUND lostSnd;
public INT timeLimit;
/* Landing Zone coords for Map to follow */
public INT LZ_X1, LZ_Y1, LZ_X2, LZ_Y2;
public int exitX, exitY;
/* Triggers: Briefing */
trigger vidEndTrig(CALL_VIDEO_QUIT);
trigger gameLostTrig (every, 20);
event nextLevEvnt;
event startEvnt(CALL_GAMEINIT)
{
//set scroll limits
setScrollParams(0, 0, 64, 64); //limit scroll
centreViewPos(1088, 6592); //centre near transport
addDroid(transporter, 704, 6976, player); //place transporter!!!
setTransporterExit(player, exitX, exitY);
//set zoom Level 128x128
setRadarZoom(1);
//stop player building on LZ
setLandingZone(4, 53, 6, 55);
//set Mission time limit
setMissionTime(timeLimit);
//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);
//enableStructure(powerModuleHack, 0);
//give player briefing
//setEventTrigger(nextLevEvnt, vidEndTrig); //flag next stuff after briefing over
addMessage(MissionBrief, MISS_MSG, 0, true);
setEventTrigger(startEvnt, inactive);
}
event nextLevEvnt(CALL_LAUNCH_TRANSPORTER) //click LAUNCH Button
{
removeMessage(MissionBrief, MISS_MSG, 0);
setLandingZone(LZ_X1, LZ_Y1, LZ_X2, LZ_Y2);
startMission(OFF_KEEP, NextLev);
setEventTrigger(nextLevEvnt, inactive);
}
event gameLost(inactive)
{
// addMessage(endMsg, MISS_MSG, 0, true);
// gameOver(false);
gameOverMessage(endMsg, MISS_MSG, 0, false);
setEventTrigger(gameLost, inactive);
}
//out of time?
event lostYetEvnt(CALL_MISSION_TIME)
{
setEventTrigger(nextLevEvnt,inactive);
setEventTrigger(lostYetEvnt, inactive);
//playSound(lostSnd,0);
//pause(20);
//gameOver(false);
setEventTrigger(gameLost, gameLostTrig); //waits 2 seconds before ending
}