home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 24
/
PCGamer24_23Demos.iso
/
Vigilance
/
vigilance.exe
/
data1.cab
/
Assets
/
scripts
/
endtimed.e
< prev
next >
Wrap
Text File
|
1998-09-21
|
2KB
|
113 lines
int Initialize(string dummy)
{
global int gState;
global real gStartTime;
global real gEndTime ;
global string gNextLevel;
global string gSameLevel;
global int gStartSound = 45;
global int gProgressSound = 36;
global int gEndSound = 45;
Reset("dummy");
}
int Reset(string dummy)
{
gState = 0;
gEndTime = -1.0;
SetCollidableProperties(thisObject,0,0);
SetStyle(thisObject,1);
IgnoreCollision(thisObject);
wakeupTime = -1.0;
gStartTime = GetTime(thisObject);
}
int startsound(string soundname)
{
gStartSound = GetSoundIndex(soundname);
}
int endsound(string soundname)
{
gEndSound = GetSoundIndex(soundname);
}
int progresssound(string soundname)
{
gProgressSound = GetSoundIndex(soundname);
}
int nextlevel(string level)
{
gNextLevel = level;
}
int maxtime(string str) {
print("hello - maxtime");
real time = GetTime(thisObject);
gEndTime = Str2Real(str);;
wakeupTime = time + gEndTime;
}
int setendtime(string str)
{
real time = GetTime(thisObject);
gEndTime = Str2Real(str);;
wakeupTime = time + gEndTime;
}
int MyEndGame(string cmd,string level)
{
EndGame(thisObject,cmd,level);
PlaySound(thisObject,gStartSound);
}
int Colliders(int size)
{
if (gState == 1)
MyEndGame("intermission",gNextLevel);
else
MyEndGame("intermission",gNextLevel);
IgnoreCollision(thisObject);
}
int Collidants(int size)
{
if (gState == 1)
MyEndGame("intermission",gNextLevel);
else
MyEndGame("intermission",gNextLevel);
IgnoreCollision(thisObject);
}
int TimedEvent(int input)
{
if (gState == 1)
MyEndGame("intermission",gNextLevel);
else
MyEndGame("intermission",gSameLevel);
wakeupTime = -1.0;
}
int start(string msg)
{
if (gState == 0)
{
if (StringCompare(msg,"success") == 0)
{
gState = 1;
}
else if (StringCompare(msg,"failure") == 0)
{
gState = 2;
MyEndGame("intermission",gSameLevel);
}
}
}