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

  1. # DroidWorks
  2. #     b0_maze_rand.cog
  3. #     
  4. #    Randomizer cog for the dark maze.  
  5. #
  6. #
  7. #
  8. # Script handles random enviroment object for the maze. 
  9. # taken from env_pulley
  10. #
  11. #  
  12. # [01/16/98] DGS    Created 
  13. # [01/26/98] DGS    Added code to make it random
  14. # [01/30/98] DGS    Took from env_gear.cog and added extra things
  15. # [02/04/98] DGS    Took from b0_enf_pulley.
  16.  
  17. symbols
  18.  
  19. sector     Shuffle_s
  20. thing    thing1a
  21. thing    thing1b
  22. thing    thing1c
  23. thing    thing1d
  24. thing    thing1e
  25. thing    thing1f
  26. thing    thing1g
  27. thing    thing1h
  28.  
  29. thing    thing2a
  30. thing    thing2b
  31. thing    thing2c
  32. thing    thing2d
  33. thing    thing2e
  34. thing    thing2f
  35. thing    thing2g
  36. thing    thing2h
  37.  
  38. message    startup
  39. message pulse
  40. message entered
  41.  
  42. int    amount=0
  43. flex    set=0.0
  44. int    inv_number=0
  45. int    act_thinga     local
  46. int    act_thingb     local
  47. int    enter=0        local
  48.  
  49. end
  50.  
  51. # ========================================================================================
  52.  
  53. code
  54. startup:
  55.     setpulse(0.2);
  56.     return;
  57.  
  58. pulse:
  59.         set = (rand()*amount);
  60.         //printflex(set);
  61.         return;
  62.  
  63. entered:
  64.         if (enter == 0)
  65.             {
  66.             enter = 1;
  67.             setpulse(0);
  68.             call destroy;
  69.             }
  70.         return;
  71.     
  72. destroy:
  73.     if (set < 1)
  74.         {
  75.                 print("Rand: 1");
  76.         // Keep thing 1
  77.                 destroything(thing2a);
  78.         destroything(thing2b);
  79.                 destroything(thing2c);
  80.         destroything(thing2d);
  81.                 destroything(thing2e);
  82.                 destroything(thing2f);
  83.         destroything(thing2g);
  84.         destroything(thing2h);
  85.         }
  86.     else if ( set < 2)
  87.         {
  88.                 print("Rand: 2");
  89.         // keep thing 2
  90.         destroything(thing1a);
  91.         destroything(thing1b);
  92.                 destroything(thing1c);
  93.         destroything(thing1d);
  94.                 destroything(thing1e);
  95.                 destroything(thing1f);
  96.         destroything(thing1g);
  97.         destroything(thing1h);
  98.         }
  99.     return;
  100.  
  101. end
  102.  
  103.