mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Added separate SellPrice property for items, changed messages when learning a move, updates to Gen 8 items.txt
This commit is contained in:
@@ -5,6 +5,7 @@ module GameData
|
|||||||
attr_reader :real_name_plural
|
attr_reader :real_name_plural
|
||||||
attr_reader :pocket
|
attr_reader :pocket
|
||||||
attr_reader :price
|
attr_reader :price
|
||||||
|
attr_reader :sell_price
|
||||||
attr_reader :real_description
|
attr_reader :real_description
|
||||||
attr_reader :field_use
|
attr_reader :field_use
|
||||||
attr_reader :battle_use
|
attr_reader :battle_use
|
||||||
@@ -19,6 +20,7 @@ module GameData
|
|||||||
"NamePlural" => [:name_plural, "s"],
|
"NamePlural" => [:name_plural, "s"],
|
||||||
"Pocket" => [:pocket, "v"],
|
"Pocket" => [:pocket, "v"],
|
||||||
"Price" => [:price, "u"],
|
"Price" => [:price, "u"],
|
||||||
|
"SellPrice" => [:sell_price, "u"],
|
||||||
"Description" => [:description, "q"],
|
"Description" => [:description, "q"],
|
||||||
"FieldUse" => [:field_use, "e", {"OnPokemon" => 1, "Direct" => 2, "TM" => 3,
|
"FieldUse" => [:field_use, "e", {"OnPokemon" => 1, "Direct" => 2, "TM" => 3,
|
||||||
"HM" => 4, "OnPokemonReusable" => 5, "TR" => 6}],
|
"HM" => 4, "OnPokemonReusable" => 5, "TR" => 6}],
|
||||||
@@ -87,6 +89,7 @@ module GameData
|
|||||||
@real_name_plural = hash[:name_plural] || "Unnamed"
|
@real_name_plural = hash[:name_plural] || "Unnamed"
|
||||||
@pocket = hash[:pocket] || 1
|
@pocket = hash[:pocket] || 1
|
||||||
@price = hash[:price] || 0
|
@price = hash[:price] || 0
|
||||||
|
@sell_price = hash[:sell_price] || (@price / 2)
|
||||||
@real_description = hash[:description] || "???"
|
@real_description = hash[:description] || "???"
|
||||||
@field_use = hash[:field_use] || 0
|
@field_use = hash[:field_use] || 0
|
||||||
@battle_use = hash[:battle_use] || 0
|
@battle_use = hash[:battle_use] || 0
|
||||||
|
|||||||
@@ -228,10 +228,10 @@ class PokeBattle_Battle
|
|||||||
battler = pbFindBattler(idxParty)
|
battler = pbFindBattler(idxParty)
|
||||||
moveName = GameData::Move.get(newMove).name
|
moveName = GameData::Move.get(newMove).name
|
||||||
# Pokémon already knows the move
|
# Pokémon already knows the move
|
||||||
return if pkmn.moves.any? { |m| m && m.id == newMove }
|
return if pkmn.hasMove?(newMove)
|
||||||
# Pokémon has space for the new move; just learn it
|
# Pokémon has space for the new move; just learn it
|
||||||
if pkmn.moves.length < Pokemon::MAX_MOVES
|
if pkmn.numMoves < Pokemon::MAX_MOVES
|
||||||
pkmn.moves.push(Pokemon::Move.new(newMove))
|
pkmn.learn_move(newMove)
|
||||||
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }
|
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }
|
||||||
if battler
|
if battler
|
||||||
battler.moves.push(PokeBattle_Move.from_pokemon_move(self, pkmn.moves.last))
|
battler.moves.push(PokeBattle_Move.from_pokemon_move(self, pkmn.moves.last))
|
||||||
@@ -240,17 +240,16 @@ class PokeBattle_Battle
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
# Pokémon already knows the maximum number of moves; try to forget one to learn the new move
|
# Pokémon already knows the maximum number of moves; try to forget one to learn the new move
|
||||||
loop do
|
pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.",
|
||||||
pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.",
|
pkmnName, moveName, pkmn.numMoves.to_word))
|
||||||
pkmnName, moveName, pkmn.moves.length.to_word))
|
if pbDisplayConfirm(_INTL("Should {1} forget a move to learn {2}?", pkmnName, moveName))
|
||||||
if pbDisplayConfirm(_INTL("Forget a move to learn {1}?",moveName))
|
loop do
|
||||||
pbDisplayPaused(_INTL("Which move should be forgotten?"))
|
|
||||||
forgetMove = @scene.pbForgetMove(pkmn,newMove)
|
forgetMove = @scene.pbForgetMove(pkmn,newMove)
|
||||||
if forgetMove>=0
|
if forgetMove>=0
|
||||||
oldMoveName = pkmn.moves[forgetMove].name
|
oldMoveName = pkmn.moves[forgetMove].name
|
||||||
pkmn.moves[forgetMove] = Pokemon::Move.new(newMove) # Replaces current/total PP
|
pkmn.moves[forgetMove] = Pokemon::Move.new(newMove) # Replaces current/total PP
|
||||||
battler.moves[forgetMove] = PokeBattle_Move.from_pokemon_move(self, pkmn.moves[forgetMove]) if battler
|
battler.moves[forgetMove] = PokeBattle_Move.from_pokemon_move(self, pkmn.moves[forgetMove]) if battler
|
||||||
pbDisplayPaused(_INTL("1, 2, and... ... ... Ta-da!"))
|
pbDisplayPaused(_INTL("1, 2, and... ... ... Ta-da!")) { pbSEPlay("Battle ball drop") }
|
||||||
pbDisplayPaused(_INTL("{1} forgot how to use {2}. And...",pkmnName,oldMoveName))
|
pbDisplayPaused(_INTL("{1} forgot how to use {2}. And...",pkmnName,oldMoveName))
|
||||||
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }
|
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }
|
||||||
battler.pbCheckFormOnMovesetChange if battler
|
battler.pbCheckFormOnMovesetChange if battler
|
||||||
@@ -259,10 +258,9 @@ class PokeBattle_Battle
|
|||||||
pbDisplay(_INTL("{1} did not learn {2}.",pkmnName,moveName))
|
pbDisplay(_INTL("{1} did not learn {2}.",pkmnName,moveName))
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
elsif pbDisplayConfirm(_INTL("Give up on learning {1}?",moveName))
|
|
||||||
pbDisplay(_INTL("{1} did not learn {2}.",pkmnName,moveName))
|
|
||||||
break
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
pbDisplay(_INTL("{1} did not learn {2}.", pkmnName, moveName))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -484,50 +484,52 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Teach and forget a move
|
# Teach and forget a move
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block)
|
def pbLearnMove(pkmn, move, ignore_if_known = false, by_machine = false, &block)
|
||||||
return false if !pkmn
|
return false if !pkmn
|
||||||
move = GameData::Move.get(move).id
|
move = GameData::Move.get(move).id
|
||||||
if pkmn.egg? && !$DEBUG
|
if pkmn.egg? && !$DEBUG
|
||||||
pbMessage(_INTL("Eggs can't be taught any moves."),&block)
|
pbMessage(_INTL("Eggs can't be taught any moves."), &block)
|
||||||
|
return false
|
||||||
|
elsif pkmn.shadowPokemon?
|
||||||
|
pbMessage(_INTL("Shadow Pokémon can't be taught any moves."), &block)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if pkmn.shadowPokemon?
|
pkmn_name = pkmn.name
|
||||||
pbMessage(_INTL("Shadow Pokémon can't be taught any moves."),&block)
|
move_name = GameData::Move.get(move).name
|
||||||
return false
|
|
||||||
end
|
|
||||||
pkmnname = pkmn.name
|
|
||||||
movename = GameData::Move.get(move).name
|
|
||||||
if pkmn.hasMove?(move)
|
if pkmn.hasMove?(move)
|
||||||
pbMessage(_INTL("{1} already knows {2}.",pkmnname,movename),&block) if !ignoreifknown
|
pbMessage(_INTL("{1} already knows {2}.", pkmn_name, move_name), &block) if !ignore_if_known
|
||||||
return false
|
return false
|
||||||
end
|
elsif pkmn.numMoves < Pokemon::MAX_MOVES
|
||||||
if pkmn.numMoves<Pokemon::MAX_MOVES
|
|
||||||
pkmn.learn_move(move)
|
pkmn.learn_move(move)
|
||||||
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pkmnname,movename),&block)
|
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
loop do
|
pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1",
|
||||||
pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1",
|
pkmn_name, move_name, pkmn.numMoves.to_word), &block)
|
||||||
pkmnname, movename, pkmn.numMoves.to_word), &block) if !bymachine
|
if pbConfirmMessage(_INTL("Should {1} forget a move to learn {2}?", pkmn_name, move_name), &block)
|
||||||
pbMessage(_INTL("Please choose a move that will be replaced with {1}.",movename),&block)
|
loop do
|
||||||
forgetmove = pbForgetMove(pkmn,move)
|
move_index = pbForgetMove(pkmn, move)
|
||||||
if forgetmove>=0
|
if move_index >= 0
|
||||||
oldmovename = pkmn.moves[forgetmove].name
|
old_move_name = pkmn.moves[move_index].name
|
||||||
oldmovepp = pkmn.moves[forgetmove].pp
|
oldmovepp = pkmn.moves[move_index].pp
|
||||||
pkmn.moves[forgetmove] = Pokemon::Move.new(move) # Replaces current/total PP
|
pkmn.moves[move_index] = Pokemon::Move.new(move) # Replaces current/total PP
|
||||||
if bymachine && Settings::TAUGHT_MACHINES_KEEP_OLD_PP
|
if by_machine && Settings::TAUGHT_MACHINES_KEEP_OLD_PP
|
||||||
pkmn.moves[forgetmove].pp = [oldmovepp,pkmn.moves[forgetmove].total_pp].min
|
pkmn.moves[move_index].pp = [oldmovepp,pkmn.moves[move_index].total_pp].min
|
||||||
|
end
|
||||||
|
pbMessage(_INTL("1, 2, and...\\wt[16] ...\\wt[16] ...\\wt[16] Ta-da!\\se[Battle ball drop]\1"), &block)
|
||||||
|
pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1", pkmn_name, old_move_name), &block)
|
||||||
|
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block)
|
||||||
|
pkmn.changeHappiness("machine") if by_machine
|
||||||
|
return true
|
||||||
|
elsif pbConfirmMessage(_INTL("Give up on learning {1}?", move_name), &block)
|
||||||
|
pbMessage(_INTL("{1} did not learn {2}.", pkmn_name, move_name), &block)
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
pbMessage(_INTL("1, 2, and...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block)
|
|
||||||
pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1",pkmnname,oldmovename),&block)
|
|
||||||
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pkmnname,movename),&block)
|
|
||||||
pkmn.changeHappiness("machine") if bymachine
|
|
||||||
return true
|
|
||||||
elsif pbConfirmMessage(_INTL("Give up on learning {1}?",movename),&block)
|
|
||||||
pbMessage(_INTL("{1} did not learn {2}.",pkmnname,movename),&block)
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
pbMessage(_INTL("{1} did not learn {2}.", pkmn_name, move_name), &block)
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbForgetMove(pkmn,moveToLearn)
|
def pbForgetMove(pkmn,moveToLearn)
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class PokemonMartAdapter
|
|||||||
return $game_temp.mart_prices[item][0] if $game_temp.mart_prices[item][0] > 0
|
return $game_temp.mart_prices[item][0] if $game_temp.mart_prices[item][0] > 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return GameData::Item.get(item).sell_price if selling
|
||||||
return GameData::Item.get(item).price
|
return GameData::Item.get(item).price
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -623,11 +624,11 @@ class PokemonMartScreen
|
|||||||
item=@scene.pbChooseSellItem
|
item=@scene.pbChooseSellItem
|
||||||
break if !item
|
break if !item
|
||||||
itemname=@adapter.getDisplayName(item)
|
itemname=@adapter.getDisplayName(item)
|
||||||
price=@adapter.getPrice(item,true)
|
|
||||||
if !@adapter.canSell?(item)
|
if !@adapter.canSell?(item)
|
||||||
pbDisplayPaused(_INTL("{1}? Oh, no. I can't buy that.",itemname))
|
pbDisplayPaused(_INTL("{1}? Oh, no. I can't buy that.",itemname))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
price=@adapter.getPrice(item,true)
|
||||||
qty=@adapter.getQuantity(item)
|
qty=@adapter.getQuantity(item)
|
||||||
next if qty==0
|
next if qty==0
|
||||||
@scene.pbShowMoney
|
@scene.pbShowMoney
|
||||||
|
|||||||
@@ -811,6 +811,7 @@ def pbItemEditor
|
|||||||
[_INTL("NamePlural"), ItemNameProperty, _INTL("Plural name of this item as displayed by the game.")],
|
[_INTL("NamePlural"), ItemNameProperty, _INTL("Plural name of this item as displayed by the game.")],
|
||||||
[_INTL("Pocket"), PocketProperty, _INTL("Pocket in the Bag where this item is stored.")],
|
[_INTL("Pocket"), PocketProperty, _INTL("Pocket in the Bag where this item is stored.")],
|
||||||
[_INTL("Price"), LimitProperty.new(999999), _INTL("Purchase price of this item.")],
|
[_INTL("Price"), LimitProperty.new(999999), _INTL("Purchase price of this item.")],
|
||||||
|
[_INTL("SellPrice"), LimitProperty.new(999999), _INTL("Sell price of this item. If blank, is half the purchase price.")],
|
||||||
[_INTL("Description"), StringProperty, _INTL("Description of this item")],
|
[_INTL("Description"), StringProperty, _INTL("Description of this item")],
|
||||||
[_INTL("FieldUse"), EnumProperty.new(field_use_array), _INTL("How this item can be used outside of battle.")],
|
[_INTL("FieldUse"), EnumProperty.new(field_use_array), _INTL("How this item can be used outside of battle.")],
|
||||||
[_INTL("BattleUse"), EnumProperty.new(battle_use_array), _INTL("How this item can be used within a battle.")],
|
[_INTL("BattleUse"), EnumProperty.new(battle_use_array), _INTL("How this item can be used within a battle.")],
|
||||||
@@ -837,6 +838,7 @@ def pbItemEditor
|
|||||||
itm.real_name_plural,
|
itm.real_name_plural,
|
||||||
itm.pocket,
|
itm.pocket,
|
||||||
itm.price,
|
itm.price,
|
||||||
|
itm.sell_price,
|
||||||
itm.real_description,
|
itm.real_description,
|
||||||
itm.field_use,
|
itm.field_use,
|
||||||
itm.battle_use,
|
itm.battle_use,
|
||||||
@@ -851,11 +853,12 @@ def pbItemEditor
|
|||||||
:name_plural => data[2],
|
:name_plural => data[2],
|
||||||
:pocket => data[3],
|
:pocket => data[3],
|
||||||
:price => data[4],
|
:price => data[4],
|
||||||
:description => data[5],
|
:sell_price => data[5],
|
||||||
:field_use => data[6],
|
:description => data[6],
|
||||||
:battle_use => data[7],
|
:field_use => data[7],
|
||||||
:type => data[8],
|
:battle_use => data[8],
|
||||||
:move => data[9]
|
:type => data[9],
|
||||||
|
:move => data[10]
|
||||||
}
|
}
|
||||||
# Add item's data to records
|
# Add item's data to records
|
||||||
GameData::Item.register(item_hash)
|
GameData::Item.register(item_hash)
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ module Compiler
|
|||||||
f.write(sprintf("NamePlural = %s\r\n", item.real_name_plural))
|
f.write(sprintf("NamePlural = %s\r\n", item.real_name_plural))
|
||||||
f.write(sprintf("Pocket = %d\r\n", item.pocket))
|
f.write(sprintf("Pocket = %d\r\n", item.pocket))
|
||||||
f.write(sprintf("Price = %d\r\n", item.price))
|
f.write(sprintf("Price = %d\r\n", item.price))
|
||||||
|
f.write(sprintf("SellPrice = %d\r\n", item.sell_price)) if item.sell_price != item.price / 2
|
||||||
field_use = GameData::Item::SCHEMA["FieldUse"][2].key(item.field_use)
|
field_use = GameData::Item::SCHEMA["FieldUse"][2].key(item.field_use)
|
||||||
f.write(sprintf("FieldUse = %s\r\n", field_use)) if field_use
|
f.write(sprintf("FieldUse = %s\r\n", field_use)) if field_use
|
||||||
battle_use = GameData::Item::SCHEMA["BattleUse"][2].key(item.battle_use)
|
battle_use = GameData::Item::SCHEMA["BattleUse"][2].key(item.battle_use)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
388
PBS/items.txt
388
PBS/items.txt
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user