main(void)1 void main( void )
2 {
3  int &talker;
4  &talker = 0;
5  int &bsword;
6  int &b2sword;
7  int &bclaw;
8  int &bnut;
9  int &bad;
10  if (&story > 10)
11  {
12   &talker = 2;
13   return;
14  }
15  &bad = random(3, 1);
16  if (&bad == 1)
17  {
18   &bad = random(3, 1);
19   if (&bad == 1)
20   {
21   say_stop("`2Welcome to Jill's pawn shop.", &current_sprite);
22   }
23   if (&bad == 2)
24   {
25   say_stop("`2Oh, too have some food ...", &current_sprite);
26   }
27   if (&bad == 3)
28   {
29   say_stop("`2The ducks ... the ducks ...", &current_sprite);
30   }
31  }
32 }
33 
talk(void)34 void talk( void )
35 {
36  freeze(1);
37  freeze(&current_sprite);
38  choice_start()
39 (&talker == 0)"See what's news"
40 (&talker == 1)"See what's for sale"
41 (&talker == 2)"Say hi"
42  "Sell an item"
43  "Leave"
44  choice_end()
45   if (&result == 1)
46   {
47    say_stop("How's things been here lately?", 1);
48    wait(250);
49    say_stop("`2Oh just fine sir, thanks for asking.", &current_sprite);
50    wait(250);
51    say_stop("What's with all the ducks?", 1);
52    wait(250);
53    say_stop("`2Those ducks are our friends and keepers", &current_sprite);
54    say_stop("`2they've given us all we have today.", &current_sprite);
55    wait(1000);
56    say_stop("Okay, that's the weirdest statement I think I've heard today.", 1);
57    wait(250);
58    say_stop("`2Be kind to the ducks in this town.", &current_sprite);
59    wait(250);
60    say_stop("Sure, no problem.", 1);
61    &talker = 1;
62   }
63   if (&result == 2)
64   {
65    say_stop("Uh, do you have anything for sale?", 1);
66    wait(250);
67    say_stop("`2Well, I ... I'm afraid not right now sir.", &current_sprite);
68    wait(250);
69    say_stop("Why not?", 1);
70    wait(250);
71    say_stop("`2With the taxes being raised for the ducks,", &current_sprite);
72    wait(250);
73    say_stop("`2I've been forced to sell much of what I own to pay it.", &current_sprite);
74    wait(250);
75    say_stop("I see.", 1);
76    wait(250);
77    say_stop("`2Perhaps if you were to find me at a later date.", &current_sprite);
78    wait(250);
79    say_stop("`2Just, not right now.", &current_sprite);
80   }
81   if (&result == 3)
82   {
83    say_stop("Hi Jill, how are you doing?", 1);
84    wait(250);
85    say_stop("`2Oh Dink, thank you, thank you for saving us.", &current_sprite);
86    wait(250);
87    say_stop("`2I didn't know what was going to happen to the town.", &current_sprite);
88    wait(250);
89    say_stop("`2I've been doing fine, things are definitely doing better.", &current_sprite);
90    wait(250);
91    say_stop("`2Thank you.", &current_sprite);
92   }
93   if (&result == 4)
94   {
95    goto sell;
96   }
97  unfreeze(1);
98  unfreeze(&current_sprite);
99 }
100 
hit(void)101 void hit( void )
102 {
103  if (&story > 10)
104  {
105   say_stop("`2What kind of sick traitor are you?!?", &current_sprite);
106   return;
107  }
108  say_stop("`2Please, don't beat me sir.", &current_sprite);
109  wait(250);
110 }
111 
sell(void)112 void sell(void )
113 {
114 //let's sell some stuff back
115 
116 sell:
117 
118 //how many items do they have?
119 
120 &bsword = count_item("item-sw1");
121 &b2sword = count_item("item-sw2");
122 &bclaw = count_item("item-cl");
123 &bnut = count_item("item-nut");
124 
125          choice_start()
126         set_y 240
127         set_title_color 6
128         title_start();
129 "We'll buy a few things.  What have you got?"
130         title_end();
131        (&bsword > 0)  "Sell a Longsword - $200"
132        (&bnut > 0)  "Sell a nut - $2"
133        (&b2sword > 0)  "Sell a Clawsword - $1000"
134        (&bclaw > 0)  "Sell a slayer claw - $150"
135         "Sell nothing"
136         choice_end()
137 
138 if (&result == 1)
139     {
140      kill_this_item("item-sw1");
141      &gold += 200;
142     goto sell;
143     }
144 
145 if (&result == 2)
146     {
147      kill_this_item("item-nut");
148      &gold += 2;
149     goto sell;
150     }
151 
152 if (&result == 3)
153     {
154      kill_this_item("item-sw2");
155      &gold += 1000;
156     goto sell;
157     }
158 if (&result == 4)
159     {
160      kill_this_item("item-cl");
161      &gold += 150;
162     goto sell;
163     }
164 
165    unfreeze(1);
166    goto mainloop;
167    return;
168 }
169