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

  1. # Droids Cog Script
  2. #
  3. # D0_skyway.cog
  4. #
  5. # Skyways cog
  6. #
  7. #                                                      
  8. #
  9. #
  10. # [MT]
  11. #
  12. #
  13. # (C) 1997 LucasLearningLimited. All Rights Reserved
  14.  
  15.  
  16.  
  17. symbols                     
  18. message             startup     
  19. message             activate
  20. message             arrived
  21. message             pulse
  22. message             crossed
  23. message             entered
  24. message             timer
  25. message             user0                              //Countdown is done
  26. message             user1                              //Create fake crate
  27. message             user2                              //Edroid is ready
  28. message             user3                              //Rdroid is ready
  29. message             user4                              //Droids are walking to catapult
  30. message             touched
  31. message             exited
  32.  
  33. surface             adjustswitch        linkid=2       //rotates the catapult                    
  34. surface             callsmallcrate      linkid=4       //calls 50lb crate
  35. surface             callbigcrate        linkid=5       //calls 100lb crate
  36. surface             destructionfloor0   mask=0xfff     linkid=58
  37. surface             destructionfloor1   mask=0xfff     linkid=18
  38. surface             destructionfloor2   mask=0xfff     linkid=28
  39. surface             destructionfloor4   mask=0xfff     linkid=38
  40. surface             destructionfloor5   mask=0xfff     linkid=48
  41. surface             targetfloor3        mask=0xfff     linkid=11
  42. surface             fakelever           linkid=1       //launches the crate 
  43. surface             add_sand            linkid=10
  44. surface             rem_sand            linkid=9
  45. surface             led_ones            nolink
  46. surface             led_tens            nolink
  47. surface             led_hund            nolink
  48. surface             flbottom            linkid=1
  49. surface             blink               nolink     
  50.  
  51. sector              curplayersector
  52. sector              ipxsector           mask=0xfff     linkid=8       
  53.  
  54. thing               catapult
  55. thing               minecart            linkid=3
  56. thing               catapult0
  57. thing               catapult1
  58. thing               catapult2
  59. thing               catapult3
  60. thing               catapult4
  61. thing               catapult5
  62. thing               crated
  63. thing               smallcrate          local
  64. thing               player              local 
  65. thing               camera2
  66. thing               createcrateghost 
  67. thing               Edroid              linkid=13
  68. thing               Rdroid              linkid=16
  69.  
  70. template            Asmallcratetemplate
  71. template            Blargecratetemplate
  72. //template            Csmallcratetemplate
  73. template            Dlargecratetemplate
  74. template            Esmallcratetemplate
  75. template            Flargecratetemplate
  76.  
  77. cog                 countdowncog
  78. cog                 callcratecog
  79. cog                 Edroidcog
  80. cog                 Rdroidcog
  81. cog                 goalscog
  82.  
  83. //sound               t1catadjloop
  84. //sound               t1catadjstop
  85. sound               t1catlaunch
  86. sound               t1caton
  87. sound               t1catreset
  88. sound               t1catwarmup
  89. sound               texplo01             
  90.  
  91. flex                md_power=10.0       local
  92. flex                c_dest=10.0         local
  93. flex                sand_inc=5.0         local
  94. flex                payloadweight       local
  95. flex                playerweight        local
  96. flex                timecount           local
  97. int                 callcrate=0         local
  98. int                 crateisinworld=0    local
  99. int                 movedyet=0          local
  100. int                 launch=0            local
  101. int                 cratev              local
  102. int                   step=10             local
  103. vector              catvel              local  
  104. int                 channel22           local 
  105. sound               clicksound                  
  106. surface             targetfloor4        mask=0xfff     linkid=11
  107. surface             targetfloor5        mask=0xfff     linkid=11
  108. surface             fakeadd_sand1       linkid=10
  109. surface             fakeadd_sand2       linkid=10
  110. surface             fakerem_sand1       linkid=9
  111. surface             fakerem_sand2       linkid=9
  112. surface             fakeadjustswitch    linkid=2
  113. sector              badsector           mask=0xfff     linkid=8
  114. template              explosion_tpl=+grenade_exp    local 
  115. vector              pgwvector 
  116. thing               teledest
  117. surface             CRMface             linkid=2
  118. sound               switchsound=swt00ltswch1.wav  
  119. sound               dave=mcht1ctrsetstp.wav 
  120. surface             SugarSpunSister          nolink
  121. sound               EdroidSetWAV=t1ed013.wav             local
  122. sound               RdroidSetWAV=t1gk021.wav             local
  123. thing               ghostcamera                        nolink
  124. cog                 dcheckcog
  125. end
  126.  
  127.  
  128. ## Code Section
  129. code    
  130. startup:
  131.      playeronminecart=0;
  132.      print("startup");
  133.      launchinprogress=0;
  134.      player=getlocalplayerthing();
  135.      playerweight=getthingmass(player)/2.2;
  136.      attachthingtothing(minecart, catapult);
  137.      setwallcel(CRMface, 1);
  138.      callcrate=0;
  139.      launchisdeadly=0;
  140.      crateisinworld=0;
  141.      movedyet=0;
  142.      launch=0;
  143. //     timecount=0;
  144.      donotlaunch=0;
  145.      Rdroidready=0;
  146.      Edroidready=0;
  147.      if (getdifficulty()==0) {          
  148.           md_power=10.0;
  149.           call displayweight;
  150.           smallcrateweight=50;
  151.           largecrateweight=100;
  152.           if ( (playerweight>=37.5)&&(playerweight<=75) ) fakeplayerweight=40;
  153.           else if ( (playerweight>=75)&&(playerweight<=122.5) ) fakeplayerweight=66;
  154.           else fakeplayerweight=playerweight;
  155.           teleportthing(Edroid, teledest);
  156.           teleportthing(Rdroid, teledest);
  157.      }   
  158.      else if (getdifficulty()==1) {     
  159.           md_power=10.0;
  160.           call displayweight;
  161.           smallcrateweight=70;
  162.           largecrateweight=150;
  163.           if ( (playerweight>=25)&&(playerweight<=75) ) fakeplayerweight=33;
  164.           else if ( (playerweight>=120)&&(playerweight<=175) ) fakeplayerweight=99;
  165.           else if ( (playerweight>=75)&&(playerweight<=120) ) fakeplayerweight=66;
  166.           else fakeplayerweight=playerweight;
  167.           teleportthing(Edroid, teledest);
  168.           teleportthing(Rdroid, teledest);     
  169.      }               
  170.      else if (getdifficulty()==2) {     
  171.           md_power=50.0;
  172.           call displayweight;
  173.           smallcrateweight=1000;
  174.           largecrateweight=2000;
  175.           if ( (playerweight>=900)&&(playerweight<=1100) ) fakeplayerweight=660;
  176.           else if ( (playerweight>=1900)&&(playerweight<=2100) ) fakeplayerweight=1320;
  177.           else fakeplayerweight=playerweight;
  178.      }   
  179.      setwallcel(blink, 0);
  180.      setpulse(1);
  181.      setadjoinflags(SugarSpunSister, 2);  #you can now walk thru this adjoin
  182.      return;
  183.      
  184. entered:
  185.      if ( (getsourceref()==player)&&(getsenderref()==minecart) ) {
  186.           print("the player is on the minecart");
  187.           playeronminecart=1;
  188.      }   
  189.      if (getdifficulty()==1) {
  190.           print("here we are at diff 1");
  191.           if (crateisinworld==0) return;
  192.           if (getsenderid()==8) {
  193.                if (getsourceref()==crate) {
  194.                     print("the crate entered something");
  195.                     if (getsenderref()==ipxsector) {
  196.                          print("you did it!!!!");
  197.                          sendmessage(goalscog, user3);                         
  198. //                         setthingvel(crate, pgwvector);
  199.                     }                    
  200.                     else {
  201.                          print("try again. entered the wrong sector");
  202.                          call destroycrate;
  203.                     }
  204.                }
  205.           }
  206.      }
  207.      else {
  208.           if ( (getsenderid()==8)&&(getsourceref()==crate) ) {
  209.                if (getsenderref()==ipxsector) {
  210.                     print("you did it!!!! entered correct sector");
  211.                     sendmessage(