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

  1. # b_0PulleyJawa.cog
  2. #    
  3. # CommuniCog for the Jawa in the Pulley Puzzle.
  4. #
  5. # Desc:
  6. #     Het talks, you know, like a jawa?
  7. #
  8. # 12/23/97 DGS    Created. 
  9. #-----------------------------------------------------------------------------
  10.  
  11. symbols
  12.     message        arrived
  13.     message        blocked
  14.     message        timer
  15.     message        converse
  16.     message       startup
  17.     message     user1
  18.     message     crossed
  19.  
  20.     cog                level_c
  21.     thing            Gonk
  22.     thing             elevator             linkid=1       
  23.     surface            top_adjoin    
  24.     surface            Bottom_adjoin    
  25.     thing          player                   local
  26.     flex    e_speed=5.0                        local
  27.     int        Met=0                            local
  28.     flex    g_speed=3.0                        local
  29.     int        Joke=0                            local
  30.     int        spoken_1=0                       local
  31.     int        gears=0                            local
  32.     int        ConversationActive=0            local
  33.     int         gonkcurframe=0              local
  34.     int        ResponseID                        local
  35.     int        e_moving=0                        local
  36.     int        bye=0                            local
  37.     int        destframe=0                        local
  38.     int        ask=0                            local    
  39.     flex        wait_time=1.3                local
  40. end
  41.  
  42.  
  43. code
  44. startup:
  45.     hastalked = 0;
  46.    tonto = 1;
  47.    return;
  48. timer:
  49.     movetoframe(elevator, 0, e_speed);
  50.     return;
  51.  
  52. arrived:
  53.     print("doug");
  54.     if (getsenderref() == elevator)
  55.         {
  56.         if (e_moving == 2)
  57.             {
  58.             call g_cont;
  59.             }
  60.         if (e_moving == 3)
  61.             {
  62.             AISetMoveSpeed(gonk, g_speed);
  63.             AISetLookFrame(gonk, 4);
  64.             AISetMoveFrame(gonk, 4);
  65.             destframe = 4;
  66.             
  67.             }
  68.         if (getcurframe(elevator) == 1)
  69.             {
  70.             settimer(10);
  71.             }
  72.         print("HEY HEY HEY");
  73.         e_moving = 0;
  74.         }
  75.         
  76.     if (getsenderref() == gonk)
  77.         {
  78.         print("arrived at:");
  79.         printint(destframe);
  80.         
  81.         if (destframe == 1)
  82.             {
  83.             AISetMoveSpeed(gonk, g_speed);
  84.             AISetLookFrame(gonk, 2);
  85.             AISetMoveFrame(gonk, 2);
  86.             destframe = 2;
  87.             }
  88.         else if (destframe == 2)
  89.             {
  90.             AISetMoveSpeed(gonk, g_speed);
  91.             AISetLookFrame(gonk, 4);
  92.             AISetMoveFrame(gonk, 4);
  93.             destframe = 4;
  94.             }
  95.         else if (destframe == 4)
  96.             {
  97.             e_moving = 1;
  98.             movetoframe(elevator,0, e_speed);
  99.             AISetMoveSpeed(gonk, g_speed);
  100.             AISetLookFrame(gonk, 5);
  101.             AISetMoveFrame(gonk, 5);
  102.             destframe = 5;
  103.             }
  104.         else if (destframe == 5)
  105.             {
  106.             AISetMoveSpeed(gonk, g_speed);
  107.             AISetLookFrame(gonk, 6);
  108.             AISetMoveFrame(gonk, 6);
  109.             destframe = 6;
  110.             }
  111.         else if (destframe == 6)
  112.             {
  113.             AISetMoveSpeed(gonk, g_speed);
  114.             AISetLookFrame(gonk, 7);
  115.             AISetMoveFrame(gonk, 7);
  116.             destframe = 7;
  117.             }
  118.         else if (destframe == 7)
  119.             {
  120.             AISetMoveSpeed(gonk, g_speed);
  121.             AISetLookFrame(gonk, 8);
  122.             AISetMoveFrame(gonk, 8);
  123.             destframe = 8;
  124.             }
  125.         else if (destframe == 8)
  126.             {
  127.             AISetMoveSpeed(gonk, g_speed);
  128.             AISetLookFrame(gonk, 9);
  129.             AISetMoveFrame(gonk, 9);
  130.             destframe = 9;
  131.             }
  132.         else if (destframe == 9)
  133.             {
  134.             setthingmass(gonk, 100); 
  135.             AISetMoveSpeed(gonk, g_speed);
  136.             AISetLookFrame(gonk, 10);
  137.             AISetMoveFrame(gonk, 10);
  138.             destframe = 10;
  139.             }
  140.         else if (destframe == 10)
  141.                {
  142.             print("MASSSS!");
  143.             setthingmass(gonk, 0); 
  144.             }
  145.         
  146.             
  147.         }    
  148.  
  149.     return;
  150.  
  151. g_cont:
  152.     print("whoo woooo");
  153.     AISetMoveSpeed(gonk, g_speed);
  154.     AISetLookFrame(gonk, 3);
  155.     AISetMoveFrame(gonk, 3);
  156.     e_moving = 1;        // Keep anything from triggering the elevator while gonk is moving onto it
  157.     destframe = 3;
  158.     return;
  159.     
  160. blocked:
  161.     print(blocked);
  162.     if (getsenderref() == elevator)
  163.         {
  164.         movetoframe(elevator,1,e_speed);
  165.         }
  166.     return;
  167.  
  168. crossed:
  169.     print("CROSSEDED");
  170.     if (e_moving == 0)
  171.         {
  172.         if ((getsenderref() == bottom_adjoin) && (getcurframe(elevator) == 0))
  173.             {
  174.             sleep(1);
  175.             
  176.             movetoframe(elevator, 1, e_speed);
  177.             
  178.             e_moving = 1;
  179.             }
  180.         else if ((getsenderref() == top_adjoin) && (getcurframe(elevator) == 1))
  181.             {
  182.             sleep(1);
  183.             movetoframe(elevator, 0, e_speed);
  184.             e_moving = 1;
  185.             settimer(0);
  186.             }
  187.         }
  188.     return;
  189.  
  190.      
  191. converse:
  192.     // What response did the player select?
  193.     ResponseID = dwGetPlayerResponse();
  194.     print("converse");
  195.     if ((ResponseID == 0) && (!ConversationActive) &&(destframe == 0))
  196.         {
  197.         ConversationActive = 1;   
  198.         playsong(0, 0, 0);
  199.         dwfreezeplayer();
  200.         ResponseID = 1;
  201.         }
  202.     
  203.     if (ResponseID == 1)                  #beginning Node          
  204.         {
  205.                 //+++++++++++++++++++++++++++++++++++++++++++++++ Greetings setup
  206.         if (met == 0)    // If they haven't met. 
  207.             {
  208.             //dwSetDialogText("R2C000"); // Jawwa: Hello
  209.             dwplaycharacterspeech("R2C000","M1R2001.wav");
  210.             
  211.             met = 2; // Tell him to say "anything else?"
  212.             }
  213.         else if (met == 1)
  214.             {
  215.             //dwSetDialogText("R2C001"); // Jawa: Hello again
  216.             dwplaycharacterspeech("R2C001","M1R2002.wav");
  217.             met = 2; // Tell him to say "anything else?" 
  218.                         }
  219.         else if (met == 2)
  220.             {
  221.             dwplayplayerresponse();
  222.             //dwSetDialogText("R2C002"); // Aynthing else?                         
  223.             dwplaycharacterspeech("R2C002","M1R2002.wav");
  224.             }
  225.         //+++++++++++++++++++++++++++++++++++++++++++++++  END Greetings setup
  226.         if ((global7 == 0) && (ask == 0))         dwAddResponse(100, "R2P100","T6xx001.wav",71);  //droid: I need your help
  227.         else if ((global7 != 0) && (ask == 0))    dwAddResponse(100, "R2P120","T6xx010.wav",72);  //droid: Can you jump on the lever?
  228.         //dwAddResponse(100, "R2P100");  //droid: Can you help me get the Jawa out of that trap?
  229.         dwAddResponse(300, "R2P400","",20); //droid: Gotta go.
  230.         }
  231.  
  232.     if (ResponseID == 100)    // 
  233.         {
  234.         ask = 1;
  235.         print("tonto");
  236.         printint(tonto);
  237.         dwplayplayerresponse();
  238.         if (global8 == 0) dwplaycharacterspeech("R2C100","M1R2004.wav"); // r2: I'm not going out there when that assassin droid etc...
  239.         if (global8 == 1) 
  240.             {
  241.             tonto = 1;
  242.             if (global7 == 0) dwplaycharacterspeech("R2C110","M1R2007.wav");// r2: What can I do? Come back when you have a plan... 
  243.             if (global7 == 1) dwplaycharacterspeech("R2C120","M1R2009.wav"); // r2: Cut the other wire, then we'll talk....
  244.             if (global7 == 2) 
  245.                 {
  246.                 tonto = 400;
  247.                 dwplaycharacterspeech("R2C130","M1R2010.wav");
  248.                 //dwSetDialogText("R2C130"); // r2: I'll help you out.   
  249.                 }
  250.             }
  251.         dwAddResponse(tonto,"R2P001","T1xx014.wav",60); // Droid: Thanks. (send it back to the root node)           
  252.         }
  253.     if (ResponseID == 300)    //            # bye
  254.         {
  255.         ask = 0;
  256.         dwplayplayerresponse();
  257.         //dwSetDialogText("R2C300"); //first goodbye  
  258.         met = 1;      //Reset the greeting so he'll say "Hello again" instead of "anything else?"
  259.         dwcleardialog();
  260.         ShuffleTracks(6, 7, 8, 9);
  261.         ConversationActive = 0;
  262.                 
  263.         // Enable the player
  264.         dwunfreezeplayer();
  265.         }
  266.     if (ResponseID == 400)    //            # bye
  267.         {
  268.         dwplayplayerresponse();
  269.         dwUnfreezeplayer();
  270.         //ClearActorFlags(GetLocalPlayerThing(), 0x200000);
  271.         dwcleardialog();
  272.         ConversationActive = 0;
  273.         ShuffleTracks(6, 7, 8, 9);
  274.         ask = 0;
  275.         AISetMoveSpeed(gonk, g_speed);
  276.         AISetLookFrame(gonk, 1);
  277.         AISetMoveFrame(gonk, 1);
  278.         destframe = 1;
  279.         }
  280.     
  281.     return;
  282.  
  283. gonkhelpsout:
  284. return;
  285.      
  286.  
  287. end
  288.  
  289.  
  290.