void main( void )
{
 int &talker;
 &talker = 0;
 int &smell;
 &smell = random(3, 1);
 if (&smell == 1)
 {
  say_stop("`6早上好先生。", &current_sprite);
 }
 if (&smell == 2)
 {
  say_stop("`6啊啊啊，我想念大海...", &current_sprite);
 }
}


void buys1( void)
{
int &junk = free_items();


if (&junk < 1)
 {
         choice_start()
        set_y 240
        title_start();
拿不下了啦
        title_end();
         "明白"
         choice_end()
 return;
 }


if (&gold < 400)
 {
         choice_start()
        set_y 240
        set_title_color 6
        title_start();
钱根本就不够买这剑嘛，岸上的人
        title_end();
         "哦"
         choice_end()
 return;
 }

&gold -= 400;
add_item("item-sw1",438, 7);

}


void buy( void )
{
buy:
         choice_start()
        set_y 240
        set_title_color 6
        title_start();
"啊啊啊，用这些精美的工具养养你的眼..."
        title_end();
         "长剑 - $400"
         "炸弹 - $20"
         "利爪剑- $2000"
         "离开"
         choice_end()

          if (&result == 1)
          {
           buys1();
           unfreeze(1);
           goto mainloop;
           return;

          }
          if (&result == 2)
          {
           buybomb();
           unfreeze(1);
           goto mainloop;
           return;

          }

          if (&result == 3)
          {
           buysw2();
           unfreeze(1);
           goto mainloop;
           return;

          }


   unfreeze(1);
   goto mainloop;
   return;

}

void buybomb( void)
{
int &junk = free_items();


if (&junk < 1)
 {
         choice_start()
        set_y 240
        title_start();
拿不下了啦
        title_end();
         "明白"
         choice_end()
 return;
 }


if (&gold < 20)
 {
         choice_start()
        set_y 240
        set_title_color 6
        title_start();
钱根本就不够买炸弹嘛
        title_end();
         "哦"
         choice_end()
 return;
 }

&gold -= 20;
add_item("item-bom",438, 3);

}

void buysw2( void)
{
int &junk = free_items();


if (&junk < 1)
 {
         choice_start()
        set_y 240
        title_start();
拿不下了啦
        title_end();
         "明白"
         choice_end()
 return;
 }


if (&gold < 2000)
 {
         choice_start()
        set_y 240
        set_title_color 6
        title_start();
钱根本就不够买利爪剑嘛
        title_end();
         "哦"
         choice_end()
 return;
 }
&gold -= 2000;
add_item("item-sw2",438, 20);
}


void talk( void )
{
 freeze(1);
 freeze(&current_sprite);
 choice_start()
(&talker == 0)"关于此店"
(&talker == 1)"关于 Pete"
 "有什么货呢"
 "离开"
 choice_end()
  if (&result == 1)
  {
   say_stop("不错的小店啊，卖什么呢？", 1);
   wait(250);
   say_stop("`6这什么地方？你看不出来吗？！", &current_sprite);
   wait(250);
   say_stop("`6这是 风雷闪电 Pete 武器点，", &current_sprite);
   wait(250);
   say_stop("`6大海这边最锋利的刀剑。", &current_sprite);
   &talker = 1;
  }
  if (&result == 2)
  {
   say_stop("你是海盗吗？", 1);
   wait(250);
   say_stop("`6啊啊啊，我曾经是 ...", &current_sprite);
   wait(250);
   say_stop("`6甚至可以说是一流的。", &current_sprite);
   wait(250);
   say_stop("那，你为甚到了这？", 1);
   wait(250);
   say_stop("你不该去海上找财宝吗？", 1);
   wait(250);
   say_stop("`6我曾经过的是那刀头舔血的日子，", &current_sprite);
   wait(250);
   say_stop("`6酒在肚中，金在手中。", &current_sprite);
   wait(250);
   say_stop("`6不过，一场和皇家海军的小战役", &current_sprite);
   wait(250);
   say_stop("`6让我不得不低调地休息一阵。", &current_sprite);
   wait(250);
   say_stop("`6不过放心，我的财宝还等着我，", &current_sprite);
   wait(250);
   say_stop("`6还在原来的地方埋藏着！", &current_sprite);
   wait(500);
   say_stop("`6你问这个干什么？", &current_sprite);
   wait(250);
   say_stop("我，我只是好奇。", 1);
  }
  if (&result == 3)
  {                                         f
 
  goto buy;
   //Stuff here
  }
 unfreeze(1);
 unfreeze(&current_sprite);
}

void hit( void )
{
 if (&story > 10)
 {
  say_stop("`6我要杀了你，大英雄！", &current_sprite); 
 }
 say_stop("`6不要向我挑战，小小子，我给你换条木头的腿！！", &current_sprite);
}
