home *** CD-ROM | disk | FTP | other *** search
- #
- # Droids Cog Script
- #
- # 03_corrosioncheck.cog
- #
- #
- # Desc:
- # Will check if there's a corrosion head on in the level, sends a pulse to see if he turns it on, then sends messages
- # to the individual corrosion cogs...
- # 1/27/98 [JP] Created
- #
- # <C> 1998 LucasLearningLimited. All Rights Reserved--------------------------------------------------------------------------------
-
-
- symbols
-
- message startup
- message pulse
- message timer
- message user1
- message user2
- message user3
- message user4
- message user5
-
- cog c1
- cog c2
- cog c3
- cog c4
- cog c5
-
- int cor_toggle=0 local
- end
-
- ## Code Section
- code
- startup:
- player=getlocalplayerthing();
- cor_toggle=0;
- if (dwCheckDroidCaps(256)) //correct head
- {
- setpulse(0.1);
- print("c sensor on");
- }
- return;
-
- pulse:
- if(GetInv(player, 12))
- {
- //print("here so far");
- if( (IsInvActivated(player, 12) == 1) && (cor_toggle == 0) )//c.head on
- {
- cor_toggle = 1;
- sendmessage(c1, user1); //it's on, so that textures change
- sendmessage(c2, user1);
- sendmessage(c3, user1);
- sendmessage(c4, user1);
- sendmessage(c5, user1);
- print("c sent");
- }
-
- else if((IsInvActivated(player, 12) == 0) && (cor_toggle == 1))//c.head off
- {
- print("the head is off");
- cor_toggle = 0;
- sendmessage(c1, user2);
- sendmessage(c2, user2);
- sendmessage(c3, user2);
- sendmessage(c4, user2);
- sendmessage(c5, user2);
- }
- }
-
-
- end
-
-