home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_05_callcrate.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  2.5 KB  |  103 lines

  1. symbols
  2. message        user1
  3. message        arrived
  4. message        startup
  5. message        crossed
  6. message        entered
  7. message        timer
  8.  
  9. template       w50cratetemplate
  10.  
  11. surface        triggeradjoin            mask=0xffff
  12.  
  13. sector         thrustsector
  14. vector         thrustvector
  15.  
  16. thing          wcreatecrateghost
  17. thing          newtram 
  18.  
  19. thing          beamstart
  20. thing          beamend
  21. thing          beamend2
  22. thing          beamstart2
  23.      
  24. cog            catapultcog
  25.  
  26. thing          launchcamera
  27. thing          callcratecamera  
  28.  
  29. sound          t1dropcrate
  30. sound          t1trammove
  31. sound          t1tramstart
  32.      
  33.  
  34. end
  35.  
  36. code
  37. startup:
  38.      player=getlocalplayerthing();
  39.      setsectorthrust(thrustsector, thrustvector, 8);
  40.      crateishere=0;
  41.      return;    
  42.  
  43.  
  44. user1:
  45.      playsoundthing(t1tramstart, newtram, 1, -1, 80, 0);
  46.      movechannel=playsoundthing(t1trammove, newtram, 1, -1, 80, 0x1);     
  47.      crateishere=1;
  48.      smallcrate=creatething (w50cratetemplate, wcreatecrateghost);
  49.      dwfreezeplayer();
  50.      setcamerafocii(2, newtram, callcratecamera);
  51.      setcurrentcamera(2);
  52.      setTimerEX(6.5, 3, 0, 0);
  53.      return;
  54.                
  55. arrived:
  56.  
  57.      if (getcurframe(newtram)==0) {
  58.           stopsound(movechannel, 0.3);     
  59.           setsectorthrust(thrustsector, thrustvector, 8); 
  60.      }          
  61.      else if (getcurframe(newtram)==4) {
  62.           sleep(2);          
  63.           destroything(achthing);
  64.           sendmessage(catapultcog, user1);
  65.           crateishere=0;
  66.           playsoundthing(t1dropcrate, newtram, 1, -1, -1, 0);          
  67.           movetoframe(newtram, 0, 25);
  68.      }    
  69.      return;
  70.      
  71. crossed:
  72.      print("crossed");
  73.      hangoffset=('0,0,0');
  74.      achthing=getsourceref();
  75.      call movetram;
  76.      return;
  77.      
  78. movetram:
  79.      print("attaching the thing");
  80.      //turn off sectorthrust
  81.      setsectorthrust(thrustsector, thrustvector, 0);
  82.      totalradius = GetThingRadius(achthing) + GetThingRadius(newtram);
  83.     VectorSet(hangoffset, 0, 0, -totalradius);
  84.     hangoffset = VectorAdd(hangoffset, GetThingInsertOffset(newtram));
  85.      hangoffset = VectorSub(hangoffset, GetThingInsertOffset(achthing));
  86.     SetThingPos(achthing, VectorAdd(GetThingPos(newtram), hangoffset));
  87.     AttachThingToThingEx(achthing, newtram, 8);
  88.      movetoframe(newtram, 4, 7);
  89.      return;
  90.      
  91. timer:
  92.      if (getsenderid()==3) {
  93.           setcurrentcamera(7);
  94.           dwunfreezeplayer();
  95.      }
  96.      return;
  97.  
  98.  
  99.  
  100.  
  101. end
  102.  
  103.