Back to index

freedink-data  1.08.20080920
S4-ST1P.c
Go to the documentation of this file.
00001 void main( void )
00002 {
00003  int &talker;
00004  &talker = 0;
00005  int &bsword;
00006  int &b2sword;
00007  int &bclaw;
00008  int &bnut; 
00009  int &bad;
00010  if (&story > 10)
00011  {
00012   &talker = 2;
00013   return;
00014  }
00015  &bad = random(3, 1);
00016  if (&bad == 1)
00017  {
00018   &bad = random(3, 1);
00019   if (&bad == 1)
00020   {
00021   say_stop("`2Welcome to Jill's pawn shop.", &current_sprite);
00022   }
00023   if (&bad == 2)
00024   {
00025   say_stop("`2Oh, too have some food ...", &current_sprite);
00026   }
00027   if (&bad == 3)
00028   {
00029   say_stop("`2The ducks ... the ducks ...", &current_sprite);
00030   }
00031  }
00032 }
00033 
00034 void talk( void )
00035 {
00036  freeze(1);
00037  freeze(&current_sprite);
00038  choice_start()
00039 (&talker == 0)"See what's news"
00040 (&talker == 1)"See what's for sale"
00041 (&talker == 2)"Say hi"
00042  "Sell an item"
00043  "Leave"
00044  choice_end()
00045   if (&result == 1)
00046   {
00047    say_stop("How's things been here lately?", 1);
00048    wait(250);
00049    say_stop("`2Oh just fine sir, thanks for asking.", &current_sprite);
00050    wait(250);
00051    say_stop("What's with all the ducks?", 1);
00052    wait(250);
00053    say_stop("`2Those ducks are our friends and keepers", &current_sprite);
00054    say_stop("`2they've given us all we have today.", &current_sprite);
00055    wait(1000);
00056    say_stop("Okay, that's the weirdest statement I think I've heard today.", 1);
00057    wait(250);
00058    say_stop("`2Be kind to the ducks in this town.", &current_sprite);
00059    wait(250);
00060    say_stop("Sure, no problem.", 1);
00061    &talker = 1;
00062   }
00063   if (&result == 2)
00064   {
00065    say_stop("Uh, do you have anything for sale?", 1);
00066    wait(250);
00067    say_stop("`2Well, I ... I'm afraid not right now sir.", &current_sprite);
00068    wait(250);
00069    say_stop("Why not?", 1);
00070    wait(250);
00071    say_stop("`2With the taxes being raised for the ducks,", &current_sprite);
00072    wait(250);
00073    say_stop("`2I've been forced to sell much of what I own to pay it.", &current_sprite);
00074    wait(250);
00075    say_stop("I see.", 1);
00076    wait(250);
00077    say_stop("`2Perhaps if you were to find me at a later date.", &current_sprite);
00078    wait(250);
00079    say_stop("`2Just, not right now.", &current_sprite);
00080   }
00081   if (&result == 3)
00082   {
00083    say_stop("Hi Jill, how are you doing?", 1);
00084    wait(250);
00085    say_stop("`2Oh Dink, thank you, thank you for saving us.", &current_sprite);
00086    wait(250);
00087    say_stop("`2I didn't know what was going to happen to the town.", &current_sprite);
00088    wait(250);
00089    say_stop("`2I've been doing fine, things are definitely doing better.", &current_sprite);
00090    wait(250);
00091    say_stop("`2Thank you.", &current_sprite);
00092   }
00093   if (&result == 4)
00094   {
00095    goto sell;
00096   }
00097  unfreeze(1);
00098  unfreeze(&current_sprite);
00099 }
00100 
00101 void hit( void )
00102 {
00103  if (&story > 10)
00104  {
00105   say_stop("`2What kind of sick traitor are you?!?", &current_sprite);
00106   return;
00107  }
00108  say_stop("`2Please, don't beat me sir.", &current_sprite);
00109  wait(250);
00110 }
00111 
00112 void sell(void )
00113 {
00114 //let's sell some stuff back
00115 
00116 sell:
00117 
00118 //how many items do they have?
00119 
00120 &bsword = count_item("item-sw1");
00121 &b2sword = count_item("item-sw2");
00122 &bclaw = count_item("item-cl");
00123 &bnut = count_item("item-nut");
00124 
00125          choice_start()
00126         set_y 240
00127         set_title_color 6
00128         title_start();
00129 "We'll buy a few things.  What have you got?"
00130         title_end();
00131        (&bsword > 0)  "Sell a Longsword - $200"
00132        (&bnut > 0)  "Sell a nut - $2"
00133        (&b2sword > 0)  "Sell a Clawsword - $1000"
00134        (&bclaw > 0)  "Sell a slayer claw - $150"
00135         "Sell nothing"
00136         choice_end()
00137 
00138 if (&result == 1)
00139     {
00140      kill_this_item("item-sw1");
00141      &gold += 200;
00142     goto sell;
00143     }
00144 
00145 if (&result == 2)
00146     {
00147      kill_this_item("item-nut");
00148      &gold += 2;
00149     goto sell;
00150     }
00151 
00152 if (&result == 3)
00153     {
00154      kill_this_item("item-sw2");
00155      &gold += 1000;
00156     goto sell;
00157     }
00158 if (&result == 4)
00159     {
00160      kill_this_item("item-cl");
00161      &gold += 150;
00162     goto sell;
00163     }
00164 
00165    unfreeze(1);
00166    goto mainloop;
00167    return;
00168 }