:mailbox_super_bag
  play child read_letter_super_bag

:read_letter_super_bag
  Letter "Hello <name>.<BR><BR>We are now selling a super bag in the general store! If you buy it, you'll be able to carry even more items.<BR><BR>Serge."

:mailbox_mushroom_seeds
  play child read_letter_mushroom_seeds

:read_letter_mushroom_seeds
  Letter "Hello <name>.<BR><BR>We are now selling mushroom seeds in the general store! <BR>Mushrooms grow only in caves, even if you don't water it.<BR><BR>Serge."

:mailbox_strawberry_seeds
  Letter "Hello <name>.<BR><BR>We are now selling strawberry seeds in the general store! <BR>The strawberry is a very profitable spring crop.<BR><BR>Serge."

:mailbox_watermelon_seeds
  Letter "Hello <name>.<BR><BR>We are now selling watermelon seeds in the general store! <BR>The watermelon is a very profitable summer crop.<BR><BR>Serge."

:mailbox_pumpkin_seeds
  Letter "Hello <name>.<BR><BR>We are now selling pumpkin seeds in the general store! <BR>The pumpkin is a very profitable fall crop.<BR><BR>Serge."

:mailbox_chillipepper_seeds
  Letter "Hello <name>.<BR><BR>We are now selling chillipepper seeds in the general store!<BR><BR>Serge."

:mailbox_cassava_seeds
  Letter "Hello <name>.<BR><BR>We are now selling cassava seeds in the general store!<BR><BR>Serge."

:mailbox_grape_seeds
  Letter "Hello <name>.<BR><BR>We are now selling grape seeds in the general store!<BR><BR>Serge."

:mailbox_beet_seeds
  Letter "Hello <name>.<BR><BR>We are now selling beet seeds in the general store!<BR><BR>Serge."

:mailbox_bellpepper_seeds
  Letter "Hello <name>.<BR><BR>We are now selling bellpepper seeds in the general store!<BR><BR>Serge."

:mailbox_broccoli_seeds
  Letter "Hello <name>.<BR><BR>We are now selling broccoli seeds in the general store!<BR><BR>Serge."

:mailbox_peanut_seeds
  Letter "Hello <name>.<BR><BR>We are now selling peanut seeds in the general store!<BR><BR>Serge."

:mailbox_radish_seeds
  Letter "Hello <name>.<BR><BR>We are now selling radish seeds in the general store!<BR><BR>Serge."

:mailbox_spinach_seeds
  Letter "Hello <name>.<BR><BR>We are now selling spinach seeds in the general store!<BR><BR>Serge."

:store_buy_item
  Serge "\v[9]<buy>"

:store_buy_switch
  if Managers.Shop.switchId == Switches._gotFirstBag
    play child store_buy_small_bag
    return
  end

  if Managers.Shop.switchId == Switches._gotSecondBag
    play child store_buy_big_bag
    return
  end

  if Managers.Shop.switchId == Switches._hasMilker
    play child store_buy_milker
    return
  end

  if Managers.Shop.switchId == Switches._hasClippers
    play child store_buy_clippers
    return
  end

  if Managers.Shop.switchId == Switches._hasMagnifier
    play child store_buy_magnifier
    return
  end

  Serge "Sorry, I can't sell that yet."

:store_buy_stuff_no_money
  if Managers.Time.month == Seasons.SPRING
    Serge "If you need some quick cash, you should buy some Turnip Seeds and sow them on your farm. They grow very fast."
  else
    if Managers.Time.month == Seasons.SUMMER
      Serge "If you need some quick cash, you should buy some Onion Seeds and sow them on your farm. They grow relatively fast for a summer crop."
    else
      if Managers.Time.month == Seasons.FALL
        Serge "If you need some quick cash, you should buy some Radish or Carrot Seeds and sow them on your farm. They grow relatively fast for a fall crop."
      else
        if Managers.Time.month == Seasons.WINTER
          Serge "If you need some quick cash, you should buy some Lettuce Seeds and sow them on your farm. They grow quite fast."
        end
      end
    end
  end

  Serge "You can also forage in the mountains. There's all sorts of fruits and object you can find there that you can ship to us."

:store_buy_small_bag
  Serge ("For $ 5,000, this bag will let you carry more items with you. Do you want to buy it?", "Yes", "No", "No")

  if response == "Yes"
    if Managers.Items.gold >= 5000
      js Switches.gotFirstBag = true;
      js Managers.Items.loseGold(5000);
      js Managers.History.registerEvent('got_first_bag');
      js Managers.Items.requestHudRefresh();
      Serge "Great! The bag is yours. Now you can carry a lot more than before."
    else
      Serge "You need $ 5,000 to buy this small bag."
      play child store_buy_stuff_no_money
    end

    return
  end

  if response == "No"
    Serge "Are you sure? You would no longer need to make two trips home every time you go shopping."
    Serge "Let me know if you ever change your mind, then."
    return
  end

:store_buy_big_bag
  Serge ("For $ 20,000, this bag will let you carry even more items with you. Do you want to buy it?", "Yes", "No", "No")

  if response == "Yes"
    if Managers.Items.gold >= 20000
      js Switches.gotSecondBag = true;
      js Managers.History.registerEvent('got_second_bag');
      js Managers.Items.loseGold(20000);
      js Managers.Items.requestHudRefresh();
      Serge "Great! The bag is yours. Now you can carry a lot more than before."
    else
      Serge "You need $ 20,000 to buy this small bag."

      play child store_buy_stuff_no_money
    end

    return
  end

  if response == "No"
    Serge "Are you sure? You would no longer need to make two trips home every time you go shopping."
    Serge "Let me know if you ever change your mind, then."
    return
  end

:store_buy_milker
  Serge ("For $ 500, this tool will let you milk your farm animals every day. Do you want to buy it?", "Yes", "No", "No")

  if response == "Yes"
    if Managers.Items.gold >= 500
      js Switches.hasMilker = true;
      js Managers.Items.loseGold(500);
      js Managers.History.registerEvent('got_milker');
      js Managers.Items.requestHudRefresh();
      Serge "That's great! Make good use of this tool on your farm."
    else
      Serge "Not enough money, <name>."
      play child store_buy_stuff_no_money
    end

    return
  end

  if response == "No"
    Serge "Let me know if you ever change your mind, then."
    return
  end

:store_buy_clippers
  Serge ("For $ 700, this tool will let you shear your farm animals. Do you want to buy it?", "Yes", "No", "No")

  if response == "Yes"
    if Managers.Items.gold >= 700
      js Switches.hasClippers = true;
      + Managers.Items.loseGold(700);
      + Managers.History.registerEvent('got_clippers');
      + Managers.Items.requestHudRefresh();
      Serge "That's great! Make good use of this tool on your farm."
    else
      Serge "Not enough money, <name>."
      play child store_buy_stuff_no_money
    end

    return
  end

  if response == "No"
    Serge "Let me know if you ever change your mind, then."
    return
  end

:store_buy_magnifier
  Serge ("For $ 300, this tool will show you information about crops, objects and animals. Do you want to buy it?", "Yes", "No", "No")

  if response == "Yes"
    if Managers.Items.gold >= 300
      js Switches.hasMagnifier = true;
      + Managers.Items.loseGold(300);
      + Managers.History.registerEvent('got_magnifier');
      + Managers.Items.requestHudRefresh();
      Serge "That's great! Make good use of this tool on your farm."
    else
      Serge "Not enough money, <name>."
      play child store_buy_stuff_no_money
    end
  end

  if response == "No"
    Serge "Let me know if you ever change your mind, then."
    return
  end

:store_shelf
  js Managers.Scenes.snapForBackground();
  js Managers.Scenes.push(GameScenes.OrangeTownGeneralStore);

:crop_shop
  js Managers.Scenes.snapForBackground();
  js Managers.Scenes.push(GameScenes.OrangeTownGeneralStoreCrops);

:seed_shop
  Serge "Let me show you all the seeds we have available. Please keep in mind that we only sell closed boxes with 10 bags of seeds each."
  wait 10

  js Managers.Scenes.snapForBackground();
  js Managers.Scenes.push(GameScenes.OrangeTownGeneralStoreSeeds);
