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

  1. #standard type magnetic tram cog.
  2. #don't forget to set blocking walls to "no move"
  3. symbols
  4. message             startup
  5. message             arrived
  6. message             crossed
  7. message             entered
  8. message             user0
  9.  
  10. thing               magnettramghost
  11.  
  12. template            magnettramT   
  13.  
  14. sector              thrustsector        linkid=5   
  15.  
  16. surface             triggeradjoin       mask=0xfff    
  17. surface             tram1block1         nolink
  18. surface             tram1block2         nolink
  19. surface             tram1block3         nolink
  20. surface             tram1block4         nolink
  21.  
  22. vector              cratepos            local
  23. vector              trampos             local
  24. vector              thrustvector
  25.  
  26. cog                 gencog
  27. cog                 catapultcog
  28.  
  29. sound          t1dropcrate=t1dropcrate.wav
  30. sound          t1trammove=t1trammove.wav
  31. thing               nCrateGhost
  32. template            nCrateTemplate
  33. end
  34.  
  35. ## Code Section
  36. code                  
  37. startup:
  38.      tramlegal=1;
  39.      ItIsAttached=0;
  40.      player=getlocalplayerthing();
  41.      call createtram;
  42.      return;
  43.      
  44. crossed:
  45.      print("crossed the funky tram triggeradjoin");
  46.      hangoffset=('0,0,0');
  47.      setsectorthrust(thrustsector, thrustvector, 0);
  48.      sendmessage(catapultcog, user4);
  49.      call movetram;
  50.      
  51.      return;
  52.    
  53. movetram:
  54.      print("the sucker is attached");
  55.      ItIsAttached=1;
  56.      MadeOfStone=creatething(nCrateTemplate, nCrateGhost);
  57.      attachthingtothing(MadeOfStone, newtram);
  58.      return;
  59.      
  60. arrived:
  61.      //when the tram has arrived, drop the achthing and reset to stop 0
  62.      if (getcurframe(newtram)==5) {
  63.         
  64.           sleep(2);
  65.           if (ItIsAttached==1) {
  66.                ItIsAttached=0;
  67.                destroything(MadeOfStone);
  68.                sendmessage(catapultcog, user5);
  69.                sendmessage(gencog, user4);
  70.           }
  71.           movetoframe(newtram, 6, 5);
  72.      }
  73.      else if (getcurframe(newtram)==6) {          
  74.           destroything(newtram);          
  75.           stopsound(movechannel, 0.3); 
  76.           tramlegal=1;
  77.           call createtram;
  78.       }  
  79.      else if (getcurframe(newtram)==1) {
  80.           setsectorthrust(thrustsector, thrustvector, 8);
  81.           call setajnflgs;
  82.           sleep(4);
  83.           movetoframe(newtram, 2, 5);
  84.      }
  85.      else if (getcurframe(newtram)==2) {
  86.           setsectorthrust(thrustsector, thrustvector, 0);
  87.           movetoframe(newtram, 3, 5);
  88.           call clrajnflgs;
  89.      }
  90.      else if (getcurframe(newtram)==3) {
  91.           movetoframe(newtram, 5, 5);
  92.      }
  93.      return;
  94.  
  95. user0:     
  96. createtram:
  97.      if (tramlegal==1) {
  98.           tramlegal=0;
  99.           newtram=creatething(magnettramT, magnettramghost);
  100.           capturething(newtram);
  101.           movetoframe(newtram, 1, 5);
  102.      }
  103.      return;
  104.      
  105. clrajnflgs:
  106.      setadjoinflags(tram1block1, 2);
  107.      setadjoinflags(tram1block2, 2);
  108.      setadjoinflags(tram1block3, 2);
  109.      setadjoinflags(tram1block4, 2);
  110.      return;
  111.      
  112. setajnflgs:
  113.      clearadjoinflags(tram1block1, 2);
  114.      clearadjoinflags(tram1block2, 2);
  115.      clearadjoinflags(tram1block3, 2);
  116.      clearadjoinflags(tram1block4, 2);
  117.      return;
  118.           
  119.  
  120.  
  121. end
  122.  
  123.  
  124.