From 0465572ca068df3eda5e45c7598d03841fa53455 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 30 Jan 2022 20:03:52 +0000 Subject: [PATCH] Added method for buying a Game Corner prize item, made def _I able to replace text like _INTL --- Data/Scripts/001_Technical/003_Intl_Messages.rb | 4 ++-- Data/Scripts/012_Overworld/001_Overworld.rb | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 22e052a66..01f4d0b27 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -758,8 +758,8 @@ def _ISPRINTF(*arg) return string end -def _I(str) - return _MAPINTL($game_map.map_id, str) +def _I(str, *arg) + return _MAPINTL($game_map.map_id, str, *arg) end def _MAPINTL(mapid, *arg) diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index db265985c..19205b417 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -806,3 +806,17 @@ def pbReceiveItem(item, quantity = 1) end return false # Can't add the item end + +#=============================================================================== +# Buying a prize item from the Game Corner +#=============================================================================== +def pbBuyPrize(item, quantity = 1) + item = GameData::Item.get(item) + return false if !item || quantity < 1 + item_name = (quantity > 1) ? item.name_plural : item.name + pocket = item.pocket + return false if !$bag.add(item, quantity) + pbMessage(_INTL("\\CNYou put the {1} in\\nyour Bag's \\c[1]{3}\\c[0] pocket.", + item_name, pocket, PokemonBag.pocket_names[pocket - 1])) + return true +end