Back to index

freedink-data  1.08.20080920
S2-BAR.c
Go to the documentation of this file.
00001 //script for bar and stuff, actually attached to the bench
00002 
00003 void main( void )
00004 {
00005  &temp4hold = 0;
00006 
00007  int &crap = create_sprite(390,120, 0, 0, 0);
00008  &temphold = &crap;
00009  int &jcrap;
00010 
00011 preload_seq(391);
00012 preload_seq(393);
00013 
00014  //build server girl
00015  &crap = create_sprite(290,250, 0, 0, 0);
00016  &temp2hold = &crap;
00017  sp_script(&crap, "s2-wench");
00018 
00019 //build old fart 1
00020  &crap = create_sprite(90,280, 0, 0, 0);
00021  &temp3hold = &crap;
00022 
00023  sp_script(&crap, "s2-man1");
00024 
00025 
00026 //build old fart 2
00027  int &crap = create_sprite(90,220, 0, 0, 0);
00028  sp_script(&crap, "s2-man2");
00029 
00030 //Maybe build Thief
00031  &crap = random(2,1)
00032  if (&thief < 1)
00033  {
00034   if (&crap == 1)       
00035   {
00036   &crap = create_sprite(560, 248, 0, 0, 0);
00037   sp_script(&crap, "s2-ryant");
00038   }
00039  }
00040 
00041 int &myrand;
00042 sp_brain(&temphold, 0);
00043 sp_base_walk(&temphold, 390);
00044 sp_speed(&temphold, 0);
00045 
00046 //set starting pic
00047 
00048 sp_pseq(&temphold, 393);
00049 sp_pframe(&temphold, 1);
00050 
00051 //Maybe do cave sequence...
00052  if (&caveguy == 1)
00053  {
00054  &temp4hold = 1;
00055 
00056   script_attach(1000);
00057   &crap = create_sprite(470, 360, 0, 0, 0);
00058   sp_brain(&crap, 0);
00059   sp_base_walk(&crap, 300);
00060   sp_speed(&crap, 1);
00061   sp_timing(&crap, 0);
00062   //set starting pic
00063   sp_pseq(&crap, 303);
00064   sp_pframe(&crap, 1);
00065   freeze(1);
00066   say_stop("Hey everybody!", 1);
00067   move_stop(1, 8, 200, 1);
00068   say_stop("There's some guy trapped in a dungeon nearby.", 1);
00069   move_stop(1, 6, 420, 1);
00070   say_stop("I gotta help him!", 1);
00071   wait(500);
00072   say_stop("He's trapped with some sort of magic.", 1);
00073   sp_dir(1, 2);
00074   wait(250);
00075   say_stop("Can anyone help?", 1);
00076   wait(250);
00077   sp_dir(1, 4);
00078   wait(250);
00079   sp_dir(1, 6);
00080   wait(250);
00081   sp_dir(1, 8);
00082   say_stop("`4There's an old guy in the house south of here.", &temphold);
00083   wait(500);
00084   say_stop("`4I've heard he knows some magic.", &temphold);
00085   wait(500);
00086   say_stop("`4Why don't you try asking him?", &temphold);
00087   wait(250);
00088   say_stop("Ok, thanks.", 1);
00089   move_stop(1, 4, 325, 1);
00090   move_stop(1, 2, 385, 1);
00091   sp_disabled(1, 1);
00092   Playmidi("battle.mid");
00093   move_stop(&crap, 8, 200, 1);
00094   move_stop(&crap, 4, 325, 1);
00095   say_stop("`4Someone knows.", &crap);
00096   say_stop("`4He must die!", &crap);
00097   move_stop(&crap, 2, 420, 1);
00098   sp_active(&crap, 0);
00099   &caveguy = 2;
00100   unfreeze(1);
00101   fade_down();
00102   fill_screen(0);
00103   //move Dink
00104   &player_map = 498;
00105   sp_x(1, 320);
00106   sp_y(1, 373);
00107   sp_disabled(1, 0);
00108   load_screen();
00109   draw_screen();
00110   draw_status();
00111   fade_up();
00112   kill_this_task();
00113  }
00114 
00115 
00116 mainloop:
00117 wait(3540);
00118 &myrand = random(8, 1);
00119 
00120   if (&myrand == 1)
00121   {
00122   sp_pseq(&temphold, 393);
00123   }
00124 
00125   if (&myrand == 2)
00126   {
00127   sp_pseq(&temphold, 391);
00128   }
00129 
00130 &myrand = random(37, 1);
00131 
00132   if (&myrand == 1)
00133   {
00134   say_stop_npc("`4Woman, serve those men!", &temphold);
00135   }
00136 
00137   if (&myrand == 2)
00138   {
00139   say_stop_npc("`4Get to work you stupid wench!", &temphold);
00140   }
00141 
00142 
00143 goto mainloop;
00144 }
00145 
00146 
00147 void hit( void )
00148 {
00149 
00150 wait(400);
00151 say_stop_npc("`4Trying to break up the place, are ya?", &temphold);
00152 wait(800);
00153 goto mainloop;
00154 }
00155 
00156 void talk( void )
00157 {
00158  &temp4hold = 1;
00159 
00160  freeze(1);
00161          choice_start()
00162          "Gossip"
00163          "Threaten"
00164          "Leave"
00165          choice_end()
00166 
00167  if (&result == 2)
00168  {
00169 
00170   wait(400);
00171    say_stop("I don't much like you.",1);
00172   wait(400);
00173   say_stop("`4And?",&temphold);
00174   wait(400);
00175    say_stop("I might kill you.",1);
00176   wait(400);
00177   say("`4<presses button under the counter>",&temphold);
00178   wait(400);
00179 
00180 preload_seq(291);
00181 preload_seq(293);
00182 preload_seq(297);
00183 preload_seq(299);
00184 
00185 preload_seq(722);
00186 preload_seq(724);
00187 preload_seq(725);
00188 preload_seq(726);
00189 
00190  playmidi("battle.mid");
00191  //build guards
00192  &crap = create_sprite(380,450, 9, 0, 0);
00193  freeze(&crap);
00194  sp_base_walk(&crap, 290);
00195  sp_base_attack(&crap, 720); 
00196  sp_speed(&crap, 1);
00197  sp_strength(&crap, 10);
00198  sp_touch_damage(&crap, 2);
00199  sp_timing(&crap, 0);
00200  move_stop(&crap, 7,250, 1);
00201  sp_target(&crap, 1);
00202  sp_hitpoints(&crap, 40);
00203  &jcrap = create_sprite(280,450, 9, 0, 0);
00204  freeze(&jcrap);
00205  sp_base_walk(&jcrap, 290);
00206  sp_base_attack(&jcrap, 720); 
00207  sp_strength(&jcrap, 10);
00208  sp_distance(&crap, 50);
00209 
00210  sp_touch_damage(&jcrap, 2);
00211 
00212  sp_speed(&jcrap, 1);
00213  sp_timing(&jcrap, 0);
00214  move_stop(&jcrap, 9,400, 1);
00215  sp_distance(&jcrap, 50);
00216  sp_target(&jcrap, 1);
00217  sp_hitpoints(&jcrap, 40);
00218 
00219  say_stop("`4Guards!! Help me, destroy this madman!", &temphold);
00220  wait(500);
00221  sp_dir(1, 2);
00222  say_stop("Let's play.", 1);
00223  
00224  say("Attack him!", &crap);
00225  unfreeze(&jcrap);
00226  unfreeze(&crap);
00227 
00228  sp_script(&crap, "s2-fight");
00229  sp_script(&jcrap, "s2-fight");
00230  unfreeze(1);
00231  &temp4hold = 0;
00232 
00233  }
00234 
00235 if (&result  == 1)
00236   {
00237 
00238 
00239   wait(400);
00240    say_stop("Any news, Barkeep?",1);
00241   wait(400);
00242 
00243   if (&story < 8)
00244   {
00245   say_stop("`4Well.. Nadine's little girl is missing.  That's about it.",&temphold);
00246   wait(400);
00247    say_stop("Really?",1);
00248   wait(400);
00249   say_stop("`4Yep.",&temphold);
00250    unfreeze(1);
00251  &temp4hold = 0;
00252    goto mainloop;
00253   
00254   }
00255   say_stop("`4Nice job on saving Nadine's little girl.  You are something of a...",&temphold);
00256   wait(400);
00257 
00258    say_stop("`4hero around here.  Oh, and my employees are lazy, that's about it.",&temphold);
00259   }
00260 
00261 
00262    unfreeze(1);
00263    &temp4hold = 0;
00264    goto mainloop;
00265    return;
00266 
00267 }
00268