Back to index

freedink-data  1.08.20080920
S8-DA.c
Go to the documentation of this file.
00001 void main( void )
00002 {
00003  int &bet;
00004  int &pick;
00005  int &win;
00006  &win = 0;
00007  if (&duckgame == 1)
00008  {
00009   &duckgame = 0;
00010   &vision = 1;
00011   int &junk;
00012   int &pap;
00013   int &pep;
00014   int &duck1;
00015   int &duck2;
00016   &pep = create_sprite(120, 245, 0, 0, 0);
00017   sp_brain(&pep, 3);
00018   sp_base_walk(&pep, 20);
00019   sp_speed(&pep, 1);
00020   sp_timing(&pep, 0);
00021   sp_size(&pep, 204);
00022   sp_hitpoints(&pep, 10);
00023   //set starting pic
00024   sp_pseq(&pep, 23);
00025   sp_pframe(&pep, 1);
00026   sp_script(&pep, "s8-duck4");
00027   freeze(1);
00028   freeze(&pep);
00029   //Begin the crack!!
00030   say_stop("`3Ok Dink, we like our games here bloody,", &pep);
00031   wait(250);
00032   say_stop("`3that's why we have duck fights!!", &pep);
00033   wait(250);
00034   betting:
00035   say_stop("`3Place your bets.", &pep);
00036   choice_start()
00037   "Bet 50"
00038   "Bet 100"
00039   "Bet 200"
00040   "Stop"
00041   choice_end()
00042   if (&result == 1)
00043   {
00044    if (&gold < 50)
00045    {
00046     say_stop("`3Hey, you don't have enough to play!", &pep);
00047     wait(250);
00048     say_stop("`3Come back later.", &pep);
00049     unfreeze(1);
00050     unfreeze(&current_sprite);
00051     return;
00052    }
00053    &bet = 50;
00054   }
00055   if (&result == 2)
00056   {
00057    if (&gold < 100)
00058    {
00059     if (&gold < 50)
00060     {
00061      say_stop("`3Hey, you don't have enough to play!", &pep);
00062      unfreeze(1);
00063      unfreeze(&current_sprite);
00064      return;
00065     }
00066     say_stop("You can't bet that much.", &pep);
00067     goto betting;
00068    }
00069    &bet = 100;
00070   }
00071   if (&result == 3)
00072   {
00073    if (&gold < 200)
00074    {
00075     if (&gold < 50)
00076     {
00077      say_stop("`3Hey, you don't have enough to play!", &pep);
00078      unfreeze(1);
00079      unfreeze(&current_sprite);
00080      return;
00081     }
00082     say_stop("You can't bet that much.", &pep);
00083     goto betting;
00084    }
00085    //Check
00086    &bet = 200;
00087   }
00088   if (&result == 4)
00089   {
00090    unfreeze(1);
00091    unfreeze(&pep);
00092    return;
00093   }
00094   say_stop("`3Who are you betting on?", &pep);
00095   choice_start()
00096   "Bet on duck 1"
00097   "Bet on duck 2"
00098   choice_end()
00099   if (&result == 1)
00100   {
00101    say_stop("Give me number one.", 1);
00102    &pick = 1;
00103    wait(250);
00104   }
00105   if (&result == 2)
00106   {
00107    say_stop("Give me number two.", 1);
00108    &pick = 2;
00109    wait(250);
00110   }
00111   //Let battle begin...
00112   say_stop("`3The bets are in, let's fight!", &pep);
00113   //Spawn ducks..
00114   if (&win == 1)
00115   {
00116    playsound(24, 22052, 0, 0, 0);
00117    int &mcrap2 = create_sprite(428, 256, 7, 167, 1);
00118    sp_seq(&mcrap2, 167);
00119    &duck2 = create_sprite(428, 256, 0, 0, 0);
00120    sp_brain(&duck2, 3);
00121    sp_base_walk(&duck2, 20);
00122    sp_size(&duck2, 204);
00123    //set starting pic
00124    sp_pseq(&duck2, 24);
00125    sp_pframe(&duck2, 1);
00126    goto fight;
00127   }
00128   if (&win == 2)
00129   {
00130    playsound(24, 22052, 0, 0, 0);
00131    int &mcrap = create_sprite(229, 256, 7, 167, 1);
00132    sp_seq(&mcrap, 167);
00133    &duck1 = create_sprite(229, 256, 0, 0, 0);
00134    sp_brain(&duck1, 3);
00135    sp_base_walk(&duck1, 20);
00136    sp_size(&duck1, 204);
00137    //set starting pic
00138    sp_pseq(&duck1, 26);
00139    sp_pframe(&duck1, 1);
00140    goto fight;
00141   }
00142   //Duck 1
00143   playsound(24, 22052, 0, 0, 0);
00144   int &mcrap = create_sprite(229, 256, 7, 167, 1);
00145   sp_seq(&mcrap, 167);
00146   &duck1 = create_sprite(229, 256, 0, 0, 0);
00147   sp_brain(&duck1, 3);
00148   sp_base_walk(&duck1, 20);
00149   sp_size(&duck1, 204);
00150   //set starting pic
00151   sp_pseq(&duck1, 26);
00152   sp_pframe(&duck1, 1);
00153   //Duck 2
00154   playsound(24, 22052, 0, 0, 0);
00155   int &mcrap2 = create_sprite(428, 256, 7, 167, 1);
00156   sp_seq(&mcrap2, 167);
00157   &duck2 = create_sprite(428, 256, 0, 0, 0);
00158   sp_brain(&duck2, 3);
00159   sp_base_walk(&duck2, 20);
00160   sp_size(&duck2, 204);
00161   //set starting pic
00162   sp_pseq(&duck2, 24);
00163   sp_pframe(&duck2, 1);
00164 
00165   goto fight;
00166   unfreeze(1);
00167  }
00168 }
00169    
00170 void check( void )
00171 {
00172  check:
00173  if (&win == 1)
00174  {
00175   if (&pick == 1)
00176   {
00177    say_stop("`3Congradulations!", &pep);
00178    &gold += &bet;
00179    goto betting;
00180   }
00181   say_stop("`3To bad, better luck next time.", &pep);
00182   &gold -= &bet;
00183   goto betting;
00184  }
00185  if (&win == 2)
00186  {
00187   if (&pick == 2)
00188   {
00189    say_stop("`3Congratulations!", &pep);
00190    &gold += &bet;
00191    goto betting;
00192   }
00193   say_stop("`3Too bad, better luck next time.", &pep);
00194   &gold -= &bet;
00195   goto betting;
00196  }
00197 }
00198 
00199 void fight( void )
00200 {
00201  fight:
00202  wait(500);
00203  &pap = random(2, 1);
00204  if (&pap == 1)
00205  {
00206   //Duck 2 WINS
00207   playsound(42,22050,0,0,0);
00208   &junk = create_sprite(410, 256, 11, 506, 1);
00209   sp_seq(&junk, 514); 
00210   sp_dir(&junk, 4);
00211   sp_speed(&junk, 4);
00212   sp_flying(&junk, 1);
00213   wait(570);
00214   sp_active(&junk, 0);
00215   &junk = create_sprite(229, 256, 7, 168, 1);
00216   sp_seq(&junk, 70);
00217   playsound(38,22050,0,0,0);
00218   hurt(&duck1, 10);
00219   wait(1200);  
00220   say_stop("`3You win this time.", &duck1);
00221   hurt(&duck1, 10);
00222   //sp_active(&duck1, 0);
00223   &win = 2;
00224  }
00225  if (&pap == 2)
00226  {
00227   //DUCK 1 WINS
00228   playsound(42,22050,0,0,0);
00229   &junk = create_sprite(240, 256, 11, 506, 1);
00230   sp_seq(&junk, 516); 
00231   sp_dir(&junk, 6);
00232   sp_speed(&junk, 4);
00233   sp_flying(&junk, 1);
00234   wait(570);
00235   sp_active(&junk, 0);
00236   &junk = create_sprite(428, 256, 7, 168, 1);
00237   sp_seq(&junk, 70);
00238   playsound(38,22050,0,0,0);
00239   hurt(&duck2, 10);
00240   wait(1200);  
00241   say_stop("`3You've beaten me.", &duck2);
00242   hurt(&duck2, 10);
00243   //Sp_active
00244   &win = 1;
00245  }
00246  goto check;
00247 }