home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_03_corrosion.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
5KB
|
172 lines
#
# Droids Cog Script
#
# 00_corrosion.cog
#
#
# Desc:
# When activated at the corrosion surfaces, the welder will weld it.
#
#
# 1/22/98 [JP] Created
#
# <C> 1998 LucasLearningLimited. All Rights Reserved--------------------------------------------------------------------------------
symbols
message activate
message startup
message pulse
message timer
message user1
message user2
surface corrosion0
thing light0 //dynamic lights that go on when you weld.
sounds welding //welding .wav
float brightness=1.00
int onoff=0 local
int bzzt=0
int fixed=0 local
int head_on=0 local
cog spark
cog rdroid
sound weld=nrg03weld.wav local
sound weldbad=nrg03weldbad.wav local
message welded
end
## Code Section
code
startup:
player=getlocalplayerthing();
check = (getthingsector(player));
return;
user1:
head_on = 1;
if ( fixed == 0)
{
setwallcel(corrosion0,1);
}
else
{
setwallcel(corrosion0,6);
}
return;
user2:
if (fixed == 0)
{
setwallcel(corrosion0,0);
}
else
{
setwallcel(corrosion0, 6);
}
head_on = 0;
return;
welded:
//activate:
// if (onoff == 0)
// if ( (dwCheckDroidCaps(256)) && (dwCheckDroidCaps(131072)) ) //droid has corrosion head & welder
if(GetInv(player, 12)==0) return;
check=(getthingsector(player));
print("yo");
printint(getsectorflags(check));
if ( (getsectorflags(check) == 20486) || (getsectorflags(check) == 16390) )
{
print("this is underwater");
// setwallcel(corrosion0, );
dwplaycammyspeech(16011, "M3CA013.wav", 5, 2); //corrosion don't work!
playsoundlocal(weldbad, 1, 0, 0);
settimer(10);
print("underwater");
}
else if ( (getsectorflags(check) != 20486) || (getsectorflags(check) != 16390) )
{
if (getwallcel(corrosion0) == 6)
{
setwallcel(corrosion0, 6);
//dwsetmissiontext(16012); //you weld like a pro!
//settimer(10);
//pulse(0.1);
}
else if ( (dwCheckDroidCaps(256)) && (dwCheckDroidCaps(131072)) )
{
//Turn the dyn light on
print("on!");
setwallcel(corrosion0, 2);
settimer(0.1);
setthinglight(light0, brightness, 0.0);
setpulse(0.01);
if (light1 != 0) setthinglight(light1, brightness, 0.0);
fixed=1;
//onoff = 1;
}
else
{
// Turn the light off
setthinglight(light0, brightness, 0.0);
if (light1 != 0) setthinglight(light1, 0, 0.0);
//onoff = 0;
//setwallcel(corrosion0, 0);
}
}
return;
pulse:
counter = counter + 1;
if ((counter == 2) && (head_on = 1)) //counter was 4
{
sendmessage(spark, user4);
playsoundlocal(weld, 1, 0, 0);
sendmessage(rdroid, user6);
setwallcel(corrosion0, getwallcel(corrosion0) + 1);
counter = 0;
if (getwallcel(corrosion0) == 6)
{
setwallcel(corrosion, 6);
randx=rand();
if (randx> 0.65)
{
dwplaycammyspeech(16012, "M3CA014.wav", 5, 2); //you weld like a pro
//playsoundlocal(weld, 1, 0, 0);
setpulse(0);
//add sparks lines here...
//sendmessage(spark, user4);
printflex(randx);
print("me");
}
else
{
setpulse(0);
print("or");
printflex(randx);
}
}
}
return;
end