home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_cap_corrosion.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
2KB
|
90 lines
# DroidWorks
# Corrosion capability cog
#
# Corrosion ability is in inventory bin 12
# Power is in inventory bin 20
symbols
thing player
int effectHandle=-1
message activated
message pulse
message shutdown
sound goggleActivate=NRGt8InfraOn.wav
sound goggleDeactivate=NRGt8InfraOff.wav
end
# ========================================================================================
code
shutdown:
if(effectHandle!=-1)
freeColorEffect(effectHandle);
return;
activated:
player = GetSourceRef();
if(GetInv(player, 12))
{
if(IsInvActivated(player, 12) == 0)
{
if(GetInv(player, 20) > 0)
{
# Print("Infrared activated");
SetInvActivated(player, 12, 1);
PlaySoundThing(goggleActivate, player, 1.0, -1, -1, 0x80);
effectHandle = newColorEffect(1, 0, 0, 0, 0, 0, 0, 0, 0, 1.0);
EnableIRMode(0.3, 1);
SetPulse(1.5);
}
else
{
# Print("No power for Infrared");
PlaySoundThing(goggleDeactivate, player, 1.0, -1, -1, 0x80);
}
}
else
{
# Print("Infrared deactivated");
SetInvActivated(player, 12, 0);
DisableIRMode();
PlaySoundThing(goggleDeactivate, player, 1.0, -1, -1, 0x80);
if(effectHandle!=-1)
{
freeColorEffect(effectHandle);
effectHandle = -1;
}
SetPulse(0);
}
}
return;
# ........................................................................................
pulse:
ChangeInv(player, 20, -5);
if(GetInv(player, 20) == 0)
{
# Print("No power for Infrared");
SetInvActivated(player, 12, 0);
PlaySoundThing(goggleDeactivate, player, 1.0, -1, -1, 0x80);
DisableIRMode();
if(effectHandle!=-1)
{
freeColorEffect(effectHandle);
effectHandle = -1;
}
SetPulse(0);
}
return;
end