home *** CD-ROM | disk | FTP | other *** search
- #
- # Droids Cog Script
- #
- # 00_t_dance.cog
- #
- #
- # Desc: lets droids dance
- #
- #
- # 4/23/98 [JP] Created
- #
- # <C> 1998 LucasLearningLimited. All Rights Reserved--------------------------------------------------------------------------------
-
-
- symbols
-
- message startup
- message timer
-
- message activate
- message entered
- message pulse
-
- keyframe dance local
-
- sector triggersector
- sound discowav=discobaby.wav local
- thing ghostcamera
-
- surface button1
- cog flicker
-
- surface a1 linkid=2
- surface a2 linkid=2
- sound switch=swt00drswtch.wav local
-
- end
-
- ## Code Section
- code
-
- startup:
- dance = -1;
- setwallcel(button1, 2);
- return;
-
- activate:
- if (getwallcel(button1)==2) {
- PlaySong(0, 0, 0);
- setwallcel(button1, 1);
- call adjoinon;
- sendmessage(flicker, user1);
- print("dance!");
- playsoundlocal(switch, 1, 0, 0);
- dance = PlayMode(getlocalplayerthing(), 17);
- //dwfreezeplayer();
- discochannel=playsoundlocal(discowav, 1.0, 0.0, 0x0);
- setcamerafocii(2, getlocalplayerthing(), ghostcamera);
- setcurrentcamera(2);
- movetoframe(ghostcamera, 5, 4);
- settimer(8);
- }
- return;
-
- timer:
- if (dance>=0) {
- setcurrentcamera(7);
- StopKey(getlocalplayerthing(), dance, 0);
- dance = -1;
- //dwunfreezeplayer();
- stopsound(discochannel, 2); //was 5.5
- setwallcel(button1, 2);
- call adjoinoff;
- sendmessage(flicker, user0);
- ShuffleTracks(2, 3, 4, 5);
- }
- return;
-
- adjoinon:
- clearadjoinflags(a1, 2);
- clearadjoinflags(a2, 2);
- return;
-
- adjoinoff:
- setadjoinflags(a1, 2);
- setadjoinflags(a2, 2);
- return;
-
-
-
-
- end
-
-