home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_00_t_light.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
3KB
|
114 lines
#
# Droids Cog Script
#
# 00_lightswitch.cog
#
# Light with Lightswitch cog
#
# Desc:
# When switched on, will turn the various lights connected to it
# on. Kind of like those things is rooms, you know, lightswitches?
#
# 11/26/97 [DGS] Created
#
# --------------------------------------------------------------------------------
symbols
message activate
message startup
surface switch0
surface switch1
sector darkroom
thing light0
thing light1
thing light2
thing light3
thing light4
float brightness=1.00
int onoff=0 local
sector darkroom2
sector darkroom3
sector darkroom4
sector darkroom5
sector darkroom6
sector darkroom7
sector darkroom8
sector darkroom1
sound light=amb04pulse.wav local
sound switch=swt00ltswch1.wav local
end
## Code Section
code
startup:
setthinglight(light0, 0 , 0.0);
if (light1 != 0) setthinglight(light1, 0, 0.0);
if (light2 != 0) setthinglight(light2, 0, 0.0);
if (light3 != 0) setthinglight(light3, 0, 0.0);
if (light4 != 0) setthinglight(light4, 0, 0.0);
return;
activate:
if (onoff == 0)
{
// Turn the light on
setthinglight(light0, brightness, 0.0);
if (light1 != 0) setthinglight(light1, brightness, 0.0);
if (light2 != 0) setthinglight(light2, brightness, 0.0);
if (light3 != 0) setthinglight(light3, brightness, 0.0);
if (light4 != 0) setthinglight(light4, brightness, 0.0);
onoff = 1;
setwallcel(switch0,1);
setwallcel(switch1,1);
SetSectorLight(darkroom, 0.9, 1);
SetSectorLight(darkroom2, 0.8, 1);
SetSectorLight(darkroom3, 0.9, 1);
SetSectorLight(darkroom4, 0.9, 1);
SetSectorLight(darkroom5, 0.8, 1);
SetSectorLight(darkroom6, 0.5, 1); //secretway
SetSectorLight(darkroom7, 0.6, 1);
SetSectorLight(darkroom8, 0.5, 1);
SetSectorLight(darkroom1, 0.9, 1);
lighti=playsoundpos(light, SurfaceCenter(switch0), 1.0, -1, -1, 0x1);
playsoundlocal(switch, 1, 0, 0);
}
else
{
// Turn the light off
setthinglight(light0, brightness, 0.0);
if (light1 != 0) setthinglight(light1, 0, 0.0);
if (light2 != 0) setthinglight(light2, 0, 0.0);
if (light3 != 0) setthinglight(light3, 0, 0.0);
if (light4 != 0) setthinglight(light4, 0, 0.0);
onoff = 0;
setwallcel(switch0,0);
setwallcel(switch1,0);
SetSectorLight(darkroom, 0.0, 1);
SetSectorLight(darkroom2, 0.0, 1);
SetSectorLight(darkroom3, 0.0, 1);
SetSectorLight(darkroom4, 0.0, 1);
SetSectorLight(darkroom5, 0.0, 1);
SetSectorLight(darkroom6, 0.0, 1);
SetSectorLight(darkroom7, 0.0, 1);
SetSectorLight(darkroom8, 0.0, 1);
SetSectorLight(darkroom1, 0.0, 1);
playsoundlocal(switch, 1, 0, 0);
stopsound(lighti, 0.5);
}
return;
end