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

  1. #
  2. # b0_mazeDroid.cog
  3. #    
  4. # CommuniCog for the Droid in the Dark Maze.
  5. #
  6. # Desc:
  7. #     He's a droid, yes, and he's a talkin' like a [insert talky thing here]
  8. #
  9. # 12/23/97 DGS    Created. 
  10. #-----------------------------------------------------------------------------
  11.  
  12. symbols
  13.     message        converse
  14.     message       startup
  15.     message     user1
  16.     message        arrived
  17.     message        timer
  18.     message        pulse
  19.       sector        stopsector
  20.     thing        Gonk
  21.     thing       player                       local    
  22.  
  23.     int        Met=0                            local
  24.     int        Joke=0                            local
  25.     int        spoken_1=0                       local
  26.     int        gears=0                               local
  27.     int        ConversationActive=0            local
  28.     int     gonkcurframe=0                  local
  29.     int        ResponseID                        local
  30.     int        getit=0                            local
  31.     int        bye=0                            local
  32.     int        turnoff=0                        local
  33.     sound          goalsound=00tAccomplish.wav        local
  34.     flex    wait_time=1.3                    local
  35. end
  36.  
  37.  
  38. code
  39. startup:
  40.     setthingmass(gonk,100);
  41.     hastalked = 0;
  42.         return;
  43.      
  44. converse:
  45.     // What response did the player select?
  46.     ResponseID = dwGetPlayerResponse();
  47.     print("Converse");
  48.      if (getit==1) return;
  49.  
  50.     if (ResponseID == 0 && !ConversationActive)
  51.         {
  52.         ConversationActive = 1;   
  53.         playsong(0,0,0);
  54.         dwfreezeplayer();
  55.         ResponseID = 1;
  56.         }
  57.     
  58.     if (ResponseID == 1)                  #beginning Node          
  59.         {
  60.         //+++++++++++++++++++++++++++++++++++++++++++++++ Greetings setup
  61.         if (met == 0)    // If they haven't met. 
  62.             {
  63.             //dwSetDialogText("STC000"); // Droid: Are you ever a site for sore sensors 
  64.             dwplaycharacterspeech("STC000","T8TD001.wav");
  65.             
  66.             met = 2; // Tell him to say "anything else?"
  67.             }
  68.         else if (met == 1)
  69.             {
  70.             //dwSetDialogText("STC001"); // Droid: Hello again
  71.             dwplaycharacterspeech("STC001","T8TD002.wav");
  72.             met = 2; // Tell him to say "anything else?" 
  73.             }
  74.         else if (met == 2)
  75.             {
  76.             dwplayplayerresponse();
  77.             //dwSetDialogText("STC003"); // Droid: ..And?                         
  78.             dwplaycharacterspeech("STC003","T8TD004.wav");
  79.             }
  80.         else if (met == 3)
  81.             {
  82.             dwplayplayerresponse();
  83.             //dwSetDialogText("STC004"); // Droid: That's more than I can say...And?                         
  84.             dwplaycharacterspeech("STC004","T8TD005.wav");
  85.             met = 2;
  86.             }
  87.             //+++++++++++++++++++++++++++++++++++++++++++++++  END Greetings setup
  88.                                 dwAddResponse(100, "STP100","T6xx012.wav",71); //Player: What are you doing here?
  89.                                 dwAddResponse(200, "STP200","T8xx005.wav",71); //Player: How do I get out of here?
  90.                                 dwAddResponse(300, "STP300","T8xx006.wav",71); //Player: Are you afraid of the dark?
  91.         if (follow == 0)         dwAddResponse(400, "STP400","T8xx007.wav",70); //Player: I'm here to rescue you... 
  92.         else                     dwAddResponse(600, "STP600","T8xx013.wav",70); //Player: Follow Me, I know a way... 
  93.         if (follow == 0)          dwAddResponse(500, "STP500","IDxx222.wav",20); //player: Take it easy, I'm outta here
  94.         
  95.         }
  96.  
  97.     if (ResponseID == 100)                
  98.         {
  99.         dwplayplayerresponse();
  100.         //dwSetDialogText("STC100"); // Droid: I got lost during a test run.... 
  101.         dwplaycharacterspeech("STC100","T8TD007.wav");
  102.         met = 3;
  103.         dwAddResponse(1,"STP003","T8xx003.wav",60); //: Ah, I see. (send it back to the root node)           
  104.         }
  105.     if (ResponseID == 200)    //    How do I get outta here?            
  106.         {
  107.         dwplayplayerresponse();
  108.         //dwSetDialogText("STC200"); // Droid: Beats me. 
  109.         dwplaycharacterspeech("STC200","T8TD009.wav");
  110.         dwAddResponse(1,"STP002","T3xx002.wav",60); // Player: Thanks. (send it back to the root node)           
  111.         }
  112.     if (ResponseID == 300)    //        Are you afraid of the dark?          
  113.         {
  114.         dwplayplayerresponse();
  115.         //dwSetDialogText("STC300"); // Droid: Me? Nah.  
  116.         dwplaycharacterspeech("STC300","T8TD010.wav");
  117.         dwAddResponse(302, "STP302","T8xx008.wav",71);  //player: Tell me about the Assassins.
  118.         dwAddResponse(1  , "STP001","T1xx014.wav",72);  // player: Thanks. (send it back to the root node)           
  119.         }
  120.     if (ResponseID == 302)    //        Tell me about these assassins          
  121.         {
  122.         dwplayplayerresponse();
  123.         //dwSetDialogText("STC302"); // Droid: They're tough   
  124.         dwplaycharacterspeech("STC302","T8TD012.wav");
  125.         dwAddResponse(303, "STP303","T8xx009.wav",72); //player: So, you know about the factory, eh? 
  126.         dwAddResponse(1,   "STP001","T1xx014.wav",30); // player: Thanks. (send it back to the root node)           
  127.         }
  128.     if (ResponseID == 303)    //        SO, you know about that faxtory?          
  129.         {
  130.         dwplayplayerresponse();
  131.         //dwSetDialogText("STC303"); // Droid: Hey, If I did, etc, etc.     
  132.         dwplaycharacterspeech("STC303","T8TD013.wav");
  133.         dwAddResponse(1,"STP001","T1xx014.wav",30); // player: Thanks. (send it back to the root node)           
  134.         }
  135.     if (ResponseID == 400)    //            I'm here to rescue you....
  136.         {
  137.         dwplayplayerresponse();
  138.         //dwSetDialogText("STC400"); // droid: Great! I needs a battery... 
  139.         dwplaycharacterspeech("STC400","T8TD011.wav");
  140.         if ( (GetInv(getlocalplayerthing(), 16) > 0)|| (GetInv(getlocalplayerthing(), 17) > 0)|| (GetInv(getlocalplayerthing(), 18) > 0) )     //if battery inv bin is greater than 0
  141.             {
  142.             dwAddResponse(410,"STP410","T8xx010.wav",30); // player:    Here's a battery.            
  143.             dwAddResponse(420,"STP420","T8xx011.wav",70); // player:    let me think.            
  144.             }
  145.         else  dwAddResponse(430,"STP430","T8xx012.wav",40); // player:    I don't have any.            
  146.         }
  147.     if (ResponseID == 410)    // Here's a battery 
  148.         {
  149.         dwplayplayerresponse();
  150.         //dwSetDialogText("STC410"); //Droid: Thanks! 
  151.         call gonkftf;
  152.         dwplaycharacterspeech("STC410","T8TD014.wav");
  153.          if (GetInv(getlocalplayerthing(), 16) > 0) ChangeInv(getlocalplayerthing(), 16, -1);// Remove the battery from the INV
  154.          else if (GetInv(getlocalplayerthing(), 17) > 0) ChangeInv(getlocalplayerthing(), 17, -1);// Remove the battery from the INV
  155.          else if (GetInv(getlocalplayerthing(), 18) > 0) ChangeInv(getlocalplayerthing(), 18, -1);// Remove the battery from the INV
  156.         follow = 1;
  157.         // ================================= INV management
  158.         if (GetInv(getlocalplayerthing(), 16) == 0) SetInvAvailable(getlocalplayerthing(), 16, 0);    // Remove the batt from the inv
  159.         if (GetInv(getlocalplayerthing(), 17) == 0) SetInvAvailable(getlocalplayerthing(), 17, 0);    // Remove the batt from the inv
  160.         if (GetInv(getlocalplayerthing(), 18) == 0) SetInvAvailable(getlocalplayerthing(), 18, 0);    // Remove the batt from the inv
  161.             
  162.         dwAddResponse(1,"STP002","T3xx002.wav",60); // PLayer: Thanks. (send it back to the root node)           
  163.         }
  164.         
  165.     if (ResponseID == 420)    //        Let me think about it.          
  166.         {
  167.         dwplayplayerresponse();
  168.         //dwSetDialogText("STC420"); // Droid: AH, Circuit Breakers!      
  169.         dwplaycharacterspeech("STC420","T8TD015.wav");
  170.         dwAddResponse(1,"STP001","T1xx014.wav",60);// player: OKay ( it back to the root node)           
  171.         }
  172.  
  173.     if (ResponseID == 430)    //        Let me think about it.          
  174.         {
  175.         dwplayplayerresponse();
  176.         //dwSetDialogText("STC430"); // Droid: Sorry to hear that!      
  177.         dwplaycharacterspeech("STC430","T8TD016.wav");
  178.         dwAddResponse(1,"STP001","T1xx014.wav",60); // player: OKay ( it back to the root node)           
  179.         }
  180.         
  181.     if (ResponseID == 600)    //        Follow me          
  182.         {
  183.         dwplayplayerresponse();
  184.         //dwSetDialogText("STC600"); // Droid: Okay, but don't go to far....       
  185.         dwplaycharacterspeech("STC601","T8TD017.wav");
  186.         dwAddResponse(1,"STP001","T1xx014.wav",60); // player: OKay ( it back to the root node)           
  187.         dwcleardialog();
  188.         ConversationActive = 0;
  189.         ShuffleTracks(2, 3, 4, 5);
  190.         dwunfreezeplayer();
  191.         follow = 2;
  192.         }
  193.         
  194.     if (ResponseID == 500)    //            # bye
  195.         {
  196.         dwplayplayerresponse();
  197.         //dwSetDialogText("STC005"); //Complete goodbye  
  198.         dwplaycharacterspeech("STC005","T8TD006.wav");
  199.         met = 1;      //Reset the greeting so he'll say "Hello again" instead of "anything else?"
  200.         dwcleardialog();
  201.         ConversationActive = 0;
  202.         ShuffleTracks(2, 3, 4, 5);
  203.         dwunfreezeplayer();
  204.         }
  205.     return;
  206.  
  207. timer:
  208. gonkftf:
  209.      print("gonkftf");
  210.      playerpos=getthingpos(player);
  211.      AISetMoveSpeed(gonk, 2.0);
  212.      AISetMovePos(gonk, playerpos);
  213.      AISetLookPos(gonk, playerpos);
  214.      setpulse(1);
  215.      settimer(2);
  216.      return;
  217.  
  218.  
  219.      
  220. pulse:
  221.      gonkpos=getthingpos(gonk);
  222.      targetpos=getthingpos(player);
  223.      GPdist=vectordist(gonkpos, targetpos);
  224.      printflex(GPdist);
  225.      if ((getthingsector(gonk)==stopsector) && (getit == 0)) 
  226.         {
  227.         garbage = playsoundlocal(goalsound,1.0,0.0,0);
  228.         setInv(getlocalplayerthing(), 6, 1);  // Goal !!!! ! ! !! !  !  
  229.         getit = 1;
  230.           }
  231.      
  232.  
  233.      if ((gpdist<.35) && (turnoff == 0)) 
  234.         {
  235.         settimer(0);
  236.         turnoff = 1;
  237.         }
  238.      if ((gpdist>.35) && (turnoff == 1)) 
  239.         {
  240.         settimer(2);
  241.         turnoff = 0;
  242.         }
  243.     
  244.      return;
  245.      
  246. arrived:
  247.  
  248. return;
  249. end
  250.  
  251.  
  252.