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

  1. #-----------------------------------------------------------------------------
  2. #  Droidworks
  3. #  Sample cog for a simple conversation with Bob.
  4. #-----------------------------------------------------------------------------
  5.  
  6. symbols
  7.     message        converse
  8.      message        startup
  9.      message        arrived
  10.      message        user0
  11. //     message         activate
  12.      message        user1
  13.      message        user2
  14.  
  15.     thing        Gonk
  16.      thing          player                   local
  17.      thing          ghostcamera              linkid=1
  18.      thing          snapdoor                 linkid=1           
  19.      cog            callcratecog
  20.  
  21.     int            MetGonk=0                local
  22.     int            ConversationActive=0     local
  23.      int            gonkcurframe=0           local
  24.     int            ResponseID              local
  25.      flex           wait_time=1.3            local
  26.      cog            goalscog
  27. end
  28.  
  29.  
  30. code
  31. startup:
  32.      ct=0;
  33.      setthinglight(Gonk, 1.0, 0);
  34.      setthinglight(snapdoor, 1.0, 0);
  35.      player=getlocalplayerthing();
  36.      talksafe=0;
  37.      return;
  38.      
  39. activate:
  40.      print("activate");
  41.      curframe=getcurframe(snapdoor);
  42.      movetoframe(snapdoor, 1-curframe, 1);
  43.      return;
  44.      
  45. user1:
  46.      talksafe=3;
  47.      call converse;
  48.      return;
  49.  
  50. user2:
  51.      talksafe=4;
  52.      return;
  53.  
  54. converse:
  55.      dwplayplayerresponse();
  56.     # What response did the player select?
  57.     ResponseID = dwGetPlayerResponse();
  58.  
  59.     
  60.      if (ResponseID == 0 && !ConversationActive) {
  61.           ConversationActive = 1;
  62.           PlaySong(0,0,0);          
  63.         dwfreezeplayer();
  64.           ResponseID=1;
  65.      }
  66.      if (ResponseID==1) {
  67.           if (talksafe==0) return;
  68.           else if (talksafe==1) {
  69.                dwplaycharacterspeech("SFC000", "m2bd036.wav");
  70.                dwAddResponse(100, "SFP100", "m2xx021.wav", 70);
  71.                dwAddResponse(200, "SFP200", "m2xx022.wav", 71);                         
  72.           }          
  73.           else if (talksafe==2) {
  74.                dwplaycharacterspeech("SFC001", "m2bd037.wav");
  75.                dwcleardialog();
  76.                ConversationActive=0;
  77.                ShuffleTracks(6,7,8,9);
  78.                dwunfreezeplayer();
  79.           }
  80.           else if (talksafe==3) {
  81.                dwplaycharacterspeech("SFC601", "m2bd056.wav" ); #back so soon?
  82.                dwAddResponse(9500, "SFP500", "m2xx025.wav", 71); #Can I have that crystal?
  83.                dwAddResponse(9600, "SFP600", "t8xx005.wav", 73); #How do I get outta here? 
  84.           }
  85.           else if (talksafe==4) {
  86.                dwplaycharacterspeech("SFC420", "m2bd047.wav");
  87.                dwcleardialog();
  88.                ConversationActive=0;               
  89.                ShuffleTracks(6,7,8,9);              
  90.                dwunfreezeplayer();
  91.           }                          
  92.  
  93.     }     
  94.      else if (ResponseID == 100) {
  95.           dwplaycharacterspeech("SFC100", "m2bd038.wav");         
  96.            
  97.               
  98.           dwAddResponse(200, "SFP200", "m2xx022.wav", 72);         
  99.      }
  100.      else if (ResponseID == 200) {
  101.           dwplaycharacterspeech("SFC200", "m2bd039.wav");         
  102.            
  103.               
  104.           dwAddResponse(210, "SFP210", "m2xx023.wav", 73);         
  105.      }
  106.      else if (ResponseID == 210) {
  107.           dwplaycharacterspeech("SFC210", "m2bd041.wav");         
  108.            
  109.               
  110.           dwAddResponse(300, "SFP300", "m2xx024.wav", 40);         
  111.      }
  112.      else if (ResponseID == 300) {
  113.           dwplaycharacterspeech("SFC300", "m2bd044.wav");         
  114.            
  115.               
  116.           dwAddResponse(220, "SFP400", "", 20);         
  117.      }     
  118.      else if (ResponseID == 9500) {
  119.           dwplaycharacterspeech("XFC400", "m2bd052.wav"); #I suppose you deserve...        
  120.           sendmessage(goalscog, user1);  
  121.           dwAddResponse(9501, "SFP501", "m2xx026.wav", 30); #Thanks, but no thanks!         
  122.      }
  123.      else if (ResponseID == 9501) {
  124.           dwplaycharacterspeech("XFC500", "m2bd053.wav");   #Are you sure?          
  125.            
  126.               
  127.           dwAddResponse(9400, "SFP400", "", 20); #good bye         
  128.      }
  129.      else if (ResponseID == 9600) {
  130.           dwplaycharacterspeech("SFC501", "m2bd054.wav");   #mustyou go?         
  131.           dwAddResponse(9500, "SFP601", "m2xx028.wav", 30);         
  132.      }   
  133.      else if (ResponseID == 9400) {        
  134.           dwplaycharacterspeech("SFC600", "m2bd055.wav"); 
  135.                       
  136.           dwcleardialog();
  137.           ConversationActive=0;                    
  138.           dwplaycammyspeech(16015, "m2ca015.wav", 20, 2);
  139.           sleep(15);
  140.           dwendlevel();
  141.      }
  142.      else if (ResponseID == 220) {
  143.           dwplaycharacterspeech("SFC220", "m2bd043.wav");         
  144.            
  145.                       
  146.           dwcleardialog();
  147.           ConversationActive=0;          
  148.           ShuffleTracks(6,7,8,9);
  149.           sendmessage(callcratecog, user1);
  150.           talksafe=2;   
  151.           # Enable the player
  152.           dwunfreezeplayer();
  153.           call camtalk1;
  154.      }
  155.      return;
  156.  
  157.  
  158. user0:
  159.      print("move dang it");
  160.      movetoframe(ghostcamera, 3, 5);
  161.      aisetmovespeed(gonk, .5);
  162.      AISetLookFrame(gonk, 1);
  163.      AISetMoveFrame(gonk, 1);
  164.      gonkcurframe=1;
  165.      return;
  166.      
  167. arrived:
  168.      if (getsenderid()!=1){
  169.           if (gonkcurframe==1) {
  170.                aisetmovespeed(gonk, .5);
  171.               AISetLookFrame(gonk, 2);
  172.               AISetMoveFrame(gonk, 2);
  173.                gonkcurframe=2;
  174.           }
  175.           else if (gonkcurframe==2) {
  176.                aisetmovespeed(gonk, .5);
  177.               AISetLookFrame(gonk, 3);
  178.               AISetMoveFrame(gonk, 3);
  179.                gonkcurframe=3;
  180.           }
  181.           else if (gonkcurframe==3) {
  182.                aisetmovespeed(gonk, .5);
  183.               AISetLookFrame(gonk, 4);
  184.               AISetMoveFrame(gonk, 4);
  185.                gonkcurframe=4;
  186.           }
  187.           else if (gonkcurframe==4) {
  188.                aisetmovespeed(gonk, .5);
  189.               AISetLookFrame(gonk, 5);
  190.               AISetMoveFrame(gonk, 5);
  191.                gonkcurframe=5;
  192.           }
  193.           else if (gonkcurframe==5) {
  194.                aisetmovespeed(gonk, .5);
  195.                AISetLookFrame(gonk, 6);
  196.                AISetMoveFrame(gonk, 6);
  197.                gonkcurframe=6;
  198.           }
  199.           else if (gonkcurframe==6) {
  200.                movetoframe(snapdoor, 1, 5);           
  201.                sleep(2);
  202.                dwunfreezeplayer();
  203.                setCurrentCamera(7); 
  204.                clearactorflags(player, 8);         
  205.                talksafe=1;
  206.           }
  207.      }
  208.      return;
  209.      
  210. camtalk1:
  211.      if (ct1==0) {
  212.           dwplaycammyspeech(16014, "m2ca014.wav", 20, 2);
  213.           ct1=1;
  214.      }
  215.      return;
  216.      
  217.      
  218. end
  219.  
  220.  
  221.