Implemented item portion names, e.g. "bag of Soft Sand"

This commit is contained in:
Maruno17
2023-01-03 21:32:32 +00:00
parent 707cd143d8
commit 2e8329f70b
18 changed files with 917 additions and 130 deletions

View File

@@ -594,33 +594,35 @@ end
module MessageTypes
# Value 0 is used for common event and map event text
Species = 1
Kinds = 2
Entries = 3
FormNames = 4
Moves = 5
MoveDescriptions = 6
Items = 7
ItemPlurals = 8
ItemDescriptions = 9
Abilities = 10
AbilityDescs = 11
Types = 12
TrainerTypes = 13
TrainerNames = 14
BeginSpeech = 15
EndSpeechWin = 16
EndSpeechLose = 17
RegionNames = 18
PlaceNames = 19
PlaceDescriptions = 20
MapNames = 21
PhoneMessages = 22
TrainerLoseText = 23
ScriptTexts = 24
RibbonNames = 25
RibbonDescriptions = 26
StorageCreator = 27
Species = 1
Kinds = 2
Entries = 3
FormNames = 4
Moves = 5
MoveDescriptions = 6
Items = 7
ItemPlurals = 8
ItemDescriptions = 9
Abilities = 10
AbilityDescs = 11
Types = 12
TrainerTypes = 13
TrainerNames = 14
BeginSpeech = 15
EndSpeechWin = 16
EndSpeechLose = 17
RegionNames = 18
PlaceNames = 19
PlaceDescriptions = 20
MapNames = 21
PhoneMessages = 22
TrainerLoseText = 23
ScriptTexts = 24
RibbonNames = 25
RibbonDescriptions = 26
StorageCreator = 27
ItemPortionNames = 28
ItemPortionNamePlurals = 29
@@messages = Messages.new
@@messagesFallback = Messages.new("Data/messages.dat", true)

View File

@@ -3,6 +3,8 @@ module GameData
attr_reader :id
attr_reader :real_name
attr_reader :real_name_plural
attr_reader :real_portion_name
attr_reader :real_portion_name_plural
attr_reader :pocket
attr_reader :price
attr_reader :sell_price
@@ -20,21 +22,23 @@ module GameData
PBS_BASE_FILENAME = "items"
SCHEMA = {
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
"NamePlural" => [:real_name_plural, "s"],
"Pocket" => [:pocket, "v"],
"Price" => [:price, "u"],
"SellPrice" => [:sell_price, "u"],
"BPPrice" => [:bp_price, "u"],
"FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, "TM" => 3,
"HM" => 4, "TR" => 5 }],
"BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, "OnBattler" => 3,
"OnFoe" => 4, "Direct" => 5 }],
"Flags" => [:flags, "*s"],
"Consumable" => [:consumable, "b"],
"Move" => [:move, "e", :Move],
"Description" => [:real_description, "q"]
"SectionName" => [:id, "m"],
"Name" => [:real_name, "s"],
"NamePlural" => [:real_name_plural, "s"],
"PortionName" => [:real_portion_name, "s"],
"PortionNamePlural" => [:real_portion_name_plural, "s"],
"Pocket" => [:pocket, "v"],
"Price" => [:price, "u"],
"SellPrice" => [:sell_price, "u"],
"BPPrice" => [:bp_price, "u"],
"FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2,
"TM" => 3, "HM" => 4, "TR" => 5 }],
"BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2,
"OnBattler" => 3, "OnFoe" => 4, "Direct" => 5 }],
"Flags" => [:flags, "*s"],
"Consumable" => [:consumable, "b"],
"Move" => [:move, "e", :Move],
"Description" => [:real_description, "q"]
}
extend ClassMethodsSymbols
@@ -108,21 +112,23 @@ module GameData
end
def initialize(hash)
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"
@real_name_plural = hash[:real_name_plural] || "Unnamed"
@pocket = hash[:pocket] || 1
@price = hash[:price] || 0
@sell_price = hash[:sell_price] || (@price / 2)
@bp_price = hash[:bp_price] || 1
@field_use = hash[:field_use] || 0
@battle_use = hash[:battle_use] || 0
@flags = hash[:flags] || []
@consumable = hash[:consumable]
@consumable = !is_important? if @consumable.nil?
@move = hash[:move]
@real_description = hash[:real_description] || "???"
@pbs_file_suffix = hash[:pbs_file_suffix] || ""
@id = hash[:id]
@real_name = hash[:real_name] || "Unnamed"
@real_name_plural = hash[:real_name_plural] || "Unnamed"
@real_portion_name = hash[:real_portion_name]
@real_portion_name_plural = hash[:real_portion_name_plural]
@pocket = hash[:pocket] || 1
@price = hash[:price] || 0
@sell_price = hash[:sell_price] || (@price / 2)
@bp_price = hash[:bp_price] || 1
@field_use = hash[:field_use] || 0
@battle_use = hash[:battle_use] || 0
@flags = hash[:flags] || []
@consumable = hash[:consumable]
@consumable = !is_important? if @consumable.nil?
@move = hash[:move]
@real_description = hash[:real_description] || "???"
@pbs_file_suffix = hash[:pbs_file_suffix] || ""
end
# @return [String] the translated name of this item
@@ -135,6 +141,18 @@ module GameData
return pbGetMessageFromHash(MessageTypes::ItemPlurals, @real_name_plural)
end
# @return [String] the translated portion name of this item
def portion_name
return pbGetMessageFromHash(MessageTypes::ItemPortionNames, @real_portion_name) if @real_portion_name
return name
end
# @return [String] the translated plural version of the portion name of this item
def portion_name_plural
return pbGetMessageFromHash(MessageTypes::ItemPortionNamePlurals, @real_portion_name_plural) if @real_portion_name_plural
return name_plural
end
# @return [String] the translated description of this item
def description
return pbGetMessageFromHash(MessageTypes::ItemDescriptions, @real_description)

View File

@@ -75,7 +75,7 @@ class Battle
end
def pbUseItemMessage(item, trainerName)
itemName = GameData::Item.get(item).name
itemName = GameData::Item.get(item).portion_name
if itemName.starts_with_vowel?
pbDisplayBrief(_INTL("{1} used an {2}.", trainerName, itemName))
else

View File

@@ -718,14 +718,12 @@ end
def pbItemBall(item, quantity = 1)
item = GameData::Item.get(item)
return false if !item || quantity < 1
itemname = (quantity > 1) ? item.name_plural : item.name
itemname = (quantity > 1) ? item.portion_name_plural : item.portion_name
pocket = item.pocket
move = item.move
if $bag.add(item, quantity) # If item can be picked up
meName = (item.is_key_item?) ? "Key item get" : "Item get"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You found some \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item == :DNASPLICERS
if item == :DNASPLICERS
pbMessage(_INTL("\\me[{1}]You found \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You found \\c[1]{2} {3}\\c[0]!\\wtnp[30]", meName, itemname, GameData::Move.get(move).name))
@@ -741,9 +739,7 @@ def pbItemBall(item, quantity = 1)
return true
end
# Can't add the item
if item == :LEFTOVERS
pbMessage(_INTL("You found some \\c[1]{1}\\c[0]!\\wtnp[30]", itemname))
elsif item.is_machine? # TM or HM
if item.is_machine? # TM or HM
pbMessage(_INTL("You found \\c[1]{1} {2}\\c[0]!\\wtnp[30]", itemname, GameData::Move.get(move).name))
elsif quantity > 1
pbMessage(_INTL("You found {1} \\c[1]{2}\\c[0]!\\wtnp[30]", quantity, itemname))
@@ -764,13 +760,11 @@ end
def pbReceiveItem(item, quantity = 1)
item = GameData::Item.get(item)
return false if !item || quantity < 1
itemname = (quantity > 1) ? item.name_plural : item.name
itemname = (quantity > 1) ? item.portion_name_plural : item.portion_name
pocket = item.pocket
move = item.move
meName = (item.is_key_item?) ? "Key item get" : "Item get"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You obtained some \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item == :DNASPLICERS
if item == :DNASPLICERS
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2} {3}\\c[0]!\\wtnp[30]", meName, itemname, GameData::Move.get(move).name))
@@ -795,7 +789,7 @@ end
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
item_name = (quantity > 1) ? item.portion_name_plural : item.portion_name
pocket = item.pocket
return false if !$bag.add(item, quantity)
pbMessage(_INTL("\\CNYou put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.",

View File

@@ -436,7 +436,7 @@ end
#===============================================================================
def pbPickBerry(berry, qty = 1)
berry = GameData::Item.get(berry)
berry_name = (qty > 1) ? berry.name_plural : berry.name
berry_name = (qty > 1) ? berry.portion_name_plural : berry.portion_name
if qty > 1
message = _INTL("There are {1} \\c[1]{2}\\c[0]!\nWant to pick them?", qty, berry_name)
else

View File

@@ -681,7 +681,7 @@ def pbUseItem(bag, item, bagscene = nil)
next unless ret && itm.consumed_after_use?
bag.remove(item, qty)
next if bag.has?(item)
pbMessage(_INTL("You used your last {1}.", itm.name)) { screen.pbUpdate }
pbMessage(_INTL("You used your last {1}.", itm.portion_name)) { screen.pbUpdate }
break
end
screen.pbEndScene
@@ -715,7 +715,7 @@ def pbUseItemOnPokemon(item, pkmn, scene)
elsif !pkmn.compatible_with_move?(machine)
pbMessage(_INTL("{1} can't learn {2}.", pkmn.name, movename)) { scene.pbUpdate }
else
pbMessage(_INTL("\\se[PC access]You booted up {1}.\1", itm.name)) { scene.pbUpdate }
pbMessage(_INTL("\\se[PC access]You booted up the {1}.\1", itm.potion_name)) { scene.pbUpdate }
if pbConfirmMessage(_INTL("Do you want to teach {1} to {2}?", movename, pkmn.name)) { scene.pbUpdate }
if pbLearnMove(pkmn, machine, false, true) { scene.pbUpdate }
$bag.remove(item) if itm.consumed_after_use?
@@ -731,7 +731,7 @@ def pbUseItemOnPokemon(item, pkmn, scene)
max_at_once = [max_at_once, $bag.quantity(item)].min
if max_at_once > 1
qty = scene.scene.pbChooseNumber(
_INTL("How many {1} do you want to use?", itm.name), max_at_once
_INTL("How many {1} do you want to use?", itm.potion_name_plural), max_at_once
)
scene.scene.pbSetHelpText("") if scene.is_a?(PokemonPartyScreen)
end
@@ -742,7 +742,7 @@ def pbUseItemOnPokemon(item, pkmn, scene)
if ret && itm.consumed_after_use?
$bag.remove(item, qty)
if !$bag.has?(item)
pbMessage(_INTL("You used your last {1}.", itm.name)) { scene.pbUpdate }
pbMessage(_INTL("You used your last {1}.", itm.potion_name)) { scene.pbUpdate }
end
end
return ret
@@ -775,7 +775,7 @@ end
# Give an item to a Pokémon to hold, and take a held item from a Pokémon
#===============================================================================
def pbGiveItemToPokemon(item, pkmn, scene, pkmnid = 0)
newitemname = GameData::Item.get(item).name
newitemname = GameData::Item.get(item).portion_name
if pkmn.egg?
scene.pbDisplay(_INTL("Eggs can't hold items."))
return false
@@ -784,10 +784,8 @@ def pbGiveItemToPokemon(item, pkmn, scene, pkmnid = 0)
return false if !pbTakeItemFromPokemon(pkmn, scene)
end
if pkmn.hasItem?
olditemname = pkmn.item.name
if pkmn.hasItem?(:LEFTOVERS)
scene.pbDisplay(_INTL("{1} is already holding some {2}.\1", pkmn.name, olditemname))
elsif newitemname.starts_with_vowel?
olditemname = pkmn.item.portion_name
if newitemname.starts_with_vowel?
scene.pbDisplay(_INTL("{1} is already holding an {2}.\1", pkmn.name, olditemname))
else
scene.pbDisplay(_INTL("{1} is already holding a {2}.\1", pkmn.name, olditemname))
@@ -837,14 +835,14 @@ def pbTakeItemFromPokemon(pkmn, scene)
end
elsif scene.pbConfirm(_INTL("If the mail is removed, its message will be lost. OK?"))
$bag.add(pkmn.item)
scene.pbDisplay(_INTL("Received the {1} from {2}.", pkmn.item.name, pkmn.name))
scene.pbDisplay(_INTL("Received the {1} from {2}.", pkmn.item.portion_name, pkmn.name))
pkmn.item = nil
pkmn.mail = nil
ret = true
end
else
$bag.add(pkmn.item)
scene.pbDisplay(_INTL("Received the {1} from {2}.", pkmn.item.name, pkmn.name))
scene.pbDisplay(_INTL("Received the {1} from {2}.", pkmn.item.portion_name, pkmn.name))
pkmn.item = nil
ret = true
end

View File

@@ -1429,6 +1429,7 @@ MenuHandlers.add(:party_menu_item, :move, {
pkmn = party[party_idx]
item = pkmn.item
itemname = item.name
portionitemname = item.portion_name
screen.scene.pbSetHelpText(_INTL("Move {1} to where?", itemname))
old_party_idx = party_idx
moved = false
@@ -1446,7 +1447,7 @@ MenuHandlers.add(:party_menu_item, :move, {
pkmn.item = nil
screen.scene.pbClearSwitching
screen.pbRefresh
screen.pbDisplay(_INTL("{1} was given the {2} to hold.", newpkmn.name, itemname))
screen.pbDisplay(_INTL("{1} was given the {2} to hold.", newpkmn.name, portionitemname))
moved = true
break
elsif newpkmn.item.is_mail?
@@ -1455,10 +1456,8 @@ MenuHandlers.add(:party_menu_item, :move, {
end
# New Pokémon is also holding an item; ask what to do with it
newitem = newpkmn.item
newitemname = newitem.name
if newitem == :LEFTOVERS
screen.pbDisplay(_INTL("{1} is already holding some {2}.\1", newpkmn.name, newitemname))
elsif newitemname.starts_with_vowel?
newitemname = newitem.portion_name
if newitemname.starts_with_vowel?
screen.pbDisplay(_INTL("{1} is already holding an {2}.\1", newpkmn.name, newitemname))
else
screen.pbDisplay(_INTL("{1} is already holding a {2}.\1", newpkmn.name, newitemname))
@@ -1468,7 +1467,7 @@ MenuHandlers.add(:party_menu_item, :move, {
pkmn.item = newitem
screen.scene.pbClearSwitching
screen.pbRefresh
screen.pbDisplay(_INTL("{1} was given the {2} to hold.", newpkmn.name, itemname))
screen.pbDisplay(_INTL("{1} was given the {2} to hold.", newpkmn.name, portionitemname))
screen.pbDisplay(_INTL("{1} was given the {2} to hold.", pkmn.name, newitemname))
moved = true
break

View File

@@ -505,7 +505,7 @@ class PokemonBagScreen
if $player.pokemon_count == 0
@scene.pbDisplay(_INTL("There is no Pokémon."))
elsif itm.is_important?
@scene.pbDisplay(_INTL("The {1} can't be held.", itemname))
@scene.pbDisplay(_INTL("The {1} can't be held.", itm.portion_name))
else
pbFadeOutIn {
sscene = PokemonParty_Scene.new
@@ -517,11 +517,11 @@ class PokemonBagScreen
elsif cmdToss >= 0 && command == cmdToss # Toss item
qty = @bag.quantity(item)
if qty > 1
helptext = _INTL("Toss out how many {1}?", itm.name_plural)
helptext = _INTL("Toss out how many {1}?", itm.portion_name_plural)
qty = @scene.pbChooseNumber(helptext, qty)
end
if qty > 0
itemname = itm.name_plural if qty > 1
itemname = (qty > 1) ? itm.portion_name_plural : itm.portion_name
if pbConfirm(_INTL("Is it OK to throw away {1} {2}?", qty, itemname))
pbDisplay(_INTL("Threw away {1} {2}.", qty, itemname))
qty.times { @bag.remove(item) }
@@ -620,7 +620,7 @@ class PokemonBagScreen
end
@scene.pbRefresh
dispqty = (itm.is_important?) ? 1 : qty
itemname = (dispqty > 1) ? itm.name_plural : itm.name
itemname = (dispqty > 1) ? itm.portion_name_plural : itm.portion_name
pbDisplay(_INTL("Withdrew {1} {2}.", dispqty, itemname))
else
pbDisplay(_INTL("There's no more room in the Bag."))
@@ -654,7 +654,7 @@ class PokemonBagScreen
end
@scene.pbRefresh
dispqty = (itm.is_important?) ? 1 : qty
itemname = (dispqty > 1) ? itm.name_plural : itm.name
itemname = (dispqty > 1) ? itm.portion_name_plural : itm.portion_name
pbDisplay(_INTL("Deposited {1} {2}.", dispqty, itemname))
else
pbDisplay(_INTL("There's no room to store items."))
@@ -680,8 +680,8 @@ class PokemonBagScreen
next
end
qty = storage.quantity(item)
itemname = itm.name
itemnameplural = itm.name_plural
itemname = itm.portion_name
itemnameplural = itm.portion_name_plural
if qty > 1
qty = @scene.pbChooseNumber(_INTL("Toss out how many {1}?", itemnameplural), qty)
end

View File

@@ -1896,8 +1896,8 @@ class PokemonStorageScreen
return
end
if pokemon.item
itemname = pokemon.item.name
if pbConfirm(_INTL("Take this {1}?", itemname))
itemname = pokemon.item.portion_name
if pbConfirm(_INTL("Take the {1}?", itemname))
if $bag.add(pokemon.item)
pbDisplay(_INTL("Took the {1}.", itemname))
pokemon.item = nil

View File

@@ -19,15 +19,15 @@ class PokemonMartAdapter
end
def getName(item)
return GameData::Item.get(item).name
return GameData::Item.get(item).portion_name
end
def getNamePlural(item)
return GameData::Item.get(item).name_plural
return GameData::Item.get(item).portion_name_plural
end
def getDisplayName(item)
item_name = getName(item)
item_name = GameData::Item.get(item).name
if GameData::Item.get(item).is_machine?
machine = GameData::Item.get(item).move
item_name = _INTL("{1} {2}", item_name, GameData::Move.get(machine).name)
@@ -36,7 +36,7 @@ class PokemonMartAdapter
end
def getDisplayNamePlural(item)
item_name_plural = getNamePlural(item)
item_name_plural = GameData::Item.get(item).name_plural
if GameData::Item.get(item).is_machine?
machine = GameData::Item.get(item).move
item_name_plural = _INTL("{1} {2}", item_name_plural, GameData::Move.get(machine).name)
@@ -103,10 +103,22 @@ class BuyAdapter
@adapter = adapter
end
# For showing in messages
def getName(item)
@adapter.getName(item)
end
# For showing in messages
def getNamePlural(item)
@adapter.getNamePlural(item)
end
# For showing in the list of items
def getDisplayName(item)
@adapter.getDisplayName(item)
end
# For showing in the list of items
def getDisplayNamePlural(item)
@adapter.getDisplayNamePlural(item)
end
@@ -128,10 +140,22 @@ class SellAdapter
@adapter = adapter
end
# For showing in messages
def getName(item)
@adapter.getName(item)
end
# For showing in messages
def getNamePlural(item)
@adapter.getNamePlural(item)
end
# For showing in the list of items
def getDisplayName(item)
@adapter.getDisplayName(item)
end
# For showing in the list of items
def getDisplayNamePlural(item)
@adapter.getDisplayNamePlural(item)
end
@@ -583,15 +607,15 @@ class PokemonMartScreen
item = @scene.pbChooseBuyItem
break if !item
quantity = 0
itemname = @adapter.getDisplayName(item)
itemnameplural = @adapter.getDisplayNamePlural(item)
itemname = @adapter.getName(item)
itemnameplural = @adapter.getNamePlural(item)
price = @adapter.getPrice(item)
if @adapter.getMoney < price
pbDisplayPaused(_INTL("You don't have enough money."))
next
end
if GameData::Item.get(item).is_important?
next if !pbConfirm(_INTL("So you want {1}?\nIt'll be ${2}. All right?",
next if !pbConfirm(_INTL("So you want the {1}?\nIt'll be ${2}. All right?",
itemname, price.to_s_formatted))
quantity = 1
else
@@ -632,8 +656,8 @@ class PokemonMartScreen
break if !@adapter.addItem(:PREMIERBALL)
premier_balls_added += 1
end
ball_name = GameData::Item.get(:PREMIERBALL).name
ball_name = GameData::Item.get(:PREMIERBALL).name_plural if premier_balls_added > 1
ball_name = GameData::Item.get(:PREMIERBALL).portion_name
ball_name = GameData::Item.get(:PREMIERBALL).portion_name_plural if premier_balls_added > 1
$stats.premier_balls_earned += premier_balls_added
pbDisplayPaused(_INTL("And have {1} {2} on the house!", premier_balls_added, ball_name))
elsif !Settings::MORE_BONUS_PREMIER_BALLS && GameData::Item.get(item) == :POKEBALL
@@ -661,8 +685,8 @@ class PokemonMartScreen
loop do
item = @scene.pbChooseSellItem
break if !item
itemname = @adapter.getDisplayName(item)
itemnameplural = @adapter.getDisplayNamePlural(item)
itemname = @adapter.getName(item)
itemnameplural = @adapter.getNamePlural(item)
if !@adapter.canSell?(item)
pbDisplayPaused(_INTL("Oh, no. I can't buy {1}.", itemnameplural))
next

View File

@@ -19,15 +19,15 @@ class BattlePointShopAdapter
end
def getName(item)
return GameData::Item.get(item).name
return GameData::Item.get(item).portion_name
end
def getNamePlural(item)
return GameData::Item.get(item).name_plural
return GameData::Item.get(item).portion_name_plural
end
def getDisplayName(item)
item_name = getName(item)
item_name = GameData::Item.get(item).name
if GameData::Item.get(item).is_machine?
machine = GameData::Item.get(item).move
item_name = _INTL("{1} {2}", item_name, GameData::Move.get(machine).name)
@@ -36,7 +36,7 @@ class BattlePointShopAdapter
end
def getDisplayNamePlural(item)
item_name_plural = getNamePlural(item)
item_name_plural = GameData::Item.get(item).name_plural
if GameData::Item.get(item).is_machine?
machine = GameData::Item.get(item).move
item_name_plural = _INTL("{1} {2}", item_name_plural, GameData::Move.get(machine).name)
@@ -446,8 +446,8 @@ class BattlePointShopScreen
item = @scene.pbChooseItem
break if !item
quantity = 0
itemname = @adapter.getDisplayName(item)
itemnameplural = @adapter.getDisplayNamePlural(item)
itemname = @adapter.getName(item)
itemnameplural = @adapter.getNamePlural(item)
price = @adapter.getPrice(item)
if @adapter.getBP < price
pbDisplayPaused(_INTL("You don't have enough BP."))
@@ -484,8 +484,8 @@ class BattlePointShopScreen
end
if added == quantity
$stats.battle_points_spent += price
#Add bpshop_items_bought to $stats?
#$stats.bpshop_items_bought += quantity
# TODO: Add bpshop_items_bought to $stats?
# $stats.bpshop_items_bought += quantity
@adapter.setBP(@adapter.getBP - price)
@stock.delete_if { |item| GameData::Item.get(item).is_important? && $bag.has?(item) }
pbDisplayPaused(_INTL("Here you are! Thank you!")) { pbSEPlay("Mart buy item") }

View File

@@ -406,10 +406,8 @@ def pbReceiveMysteryGift(id)
if $bag.can_add?(item, qty)
$bag.add(item, qty)
itm = GameData::Item.get(item)
itemname = (qty > 1) ? itm.name_plural : itm.name
if item == :LEFTOVERS
pbMessage(_INTL("\\me[Item get]You obtained some \\c[1]{1}\\c[0]!\\wtnp[30]", itemname))
elsif itm.is_machine? # TM or HM
itemname = (qty > 1) ? itm.portion_name_plural : itm.portion_name
if itm.is_machine? # TM or HM
pbMessage(_INTL("\\me[Item get]You obtained \\c[1]{1} {2}\\c[0]!\\wtnp[30]", itemname,
GameData::Move.get(itm.move).name))
elsif qty > 1

View File

@@ -250,14 +250,20 @@ module Compiler
# Get item names/descriptions for translating
item_names = []
item_names_plural = []
item_portion_names = []
item_portion_names_plural = []
item_descriptions = []
GameData::Item.each do |item|
item_names.push(item.real_name)
item_names_plural.push(item.real_name_plural)
item_portion_names.push(item.real_portion_name)
item_portion_names_plural.push(item.real_portion_name_plural)
item_descriptions.push(item.real_description)
end
MessageTypes.setMessagesAsHash(MessageTypes::Items, item_names)
MessageTypes.setMessagesAsHash(MessageTypes::ItemPlurals, item_names_plural)
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionNames, item_portion_names)
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionNamePlurals, item_portion_names_plural)
MessageTypes.setMessagesAsHash(MessageTypes::ItemDescriptions, item_descriptions)
end