mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Revamped classes Pokemon, PBMove and PokemonMail
This commit is contained in:
@@ -866,7 +866,7 @@ class PokemonPartyScreen
|
||||
else
|
||||
pbDisplay(_INTL("Mail was transferred from the Mailbox."))
|
||||
pkmn.mail = $PokemonGlobal.mailbox[mailIndex]
|
||||
pkmn.setItem(pkmn.mail.item)
|
||||
pkmn.item = pkmn.mail.item
|
||||
$PokemonGlobal.mailbox.delete_at(mailIndex)
|
||||
pbRefreshSingle(pkmnid)
|
||||
end
|
||||
@@ -1286,8 +1286,8 @@ class PokemonPartyScreen
|
||||
if newpkmn.egg?
|
||||
pbDisplay(_INTL("Eggs can't hold items."))
|
||||
elsif !newpkmn.hasItem?
|
||||
newpkmn.setItem(item)
|
||||
pkmn.setItem(nil)
|
||||
newpkmn.item = item
|
||||
pkmn.item = nil
|
||||
@scene.pbClearSwitching
|
||||
pbRefresh
|
||||
pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
|
||||
@@ -1305,8 +1305,8 @@ class PokemonPartyScreen
|
||||
pbDisplay(_INTL("{1} is already holding a {2}.\1",newpkmn.name,newitemname))
|
||||
end
|
||||
if pbConfirm(_INTL("Would you like to switch the two items?"))
|
||||
newpkmn.setItem(item)
|
||||
pkmn.setItem(newitem)
|
||||
newpkmn.item = item
|
||||
pkmn.item = newitem
|
||||
@scene.pbClearSwitching
|
||||
pbRefresh
|
||||
pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
|
||||
|
||||
@@ -191,7 +191,7 @@ class PokemonSummary_Scene
|
||||
@sprites["movesel"].visible = false
|
||||
@sprites["movesel"].visible = true
|
||||
@sprites["movesel"].index = 0
|
||||
new_move = (move_to_learn) ? PBMove.new(move_to_learn) : nil
|
||||
new_move = (move_to_learn) ? Pokemon::Move.new(move_to_learn) : nil
|
||||
drawSelectedMove(new_move,@pokemon.moves[0])
|
||||
pbFadeInAndShow(@sprites)
|
||||
end
|
||||
@@ -436,7 +436,7 @@ class PokemonSummary_Scene
|
||||
memo = sprintf("<c3=404040,B0B0B0>%s\n",heartmessage)
|
||||
drawFormattedTextEx(overlay,234,304,264,memo)
|
||||
else
|
||||
endexp = PBExperience.pbGetStartExperience(@pokemon.level+1,@pokemon.growthrate)
|
||||
endexp = PBExperience.pbGetStartExperience(@pokemon.level+1,@pokemon.growth_rate)
|
||||
textpos.push([_INTL("Exp. Points"),238,240,0,base,shadow])
|
||||
textpos.push([@pokemon.exp.to_s_formatted,488,272,1,Color.new(64,64,64),Color.new(176,176,176)])
|
||||
textpos.push([_INTL("To Next Lv."),238,304,0,base,shadow])
|
||||
@@ -554,10 +554,10 @@ class PokemonSummary_Scene
|
||||
_INTL("Traded at Lv. {1}.",@pokemon.obtainLevel),
|
||||
"",
|
||||
_INTL("Had a fateful encounter at Lv. {1}.",@pokemon.obtainLevel)
|
||||
][@pokemon.obtainMode]
|
||||
][@pokemon.obtain_method]
|
||||
memo += sprintf("<c3=404040,B0B0B0>%s\n",mettext) if mettext && mettext!=""
|
||||
# If Pokémon was hatched, write when and where it hatched
|
||||
if @pokemon.obtainMode==1
|
||||
if @pokemon.obtain_method == 1
|
||||
if @pokemon.timeEggHatched
|
||||
date = @pokemon.timeEggHatched.day
|
||||
month = pbGetMonthName(@pokemon.timeEggHatched.mon)
|
||||
@@ -627,8 +627,8 @@ class PokemonSummary_Scene
|
||||
statshadows = []
|
||||
PBStats.eachStat { |s| statshadows[s] = shadow }
|
||||
if !@pokemon.shadowPokemon? || @pokemon.heartStage>3
|
||||
natup = PBNatures.getStatRaised(@pokemon.calcNature)
|
||||
natdn = PBNatures.getStatLowered(@pokemon.calcNature)
|
||||
natup = PBNatures.getStatRaised(@pokemon.nature_for_stats)
|
||||
natdn = PBNatures.getStatLowered(@pokemon.nature_for_stats)
|
||||
statshadows[natup] = Color.new(136,96,72) if natup!=natdn
|
||||
statshadows[natdn] = Color.new(64,120,152) if natup!=natdn
|
||||
end
|
||||
@@ -1202,7 +1202,7 @@ class PokemonSummary_Scene
|
||||
end
|
||||
|
||||
def pbChooseMoveToForget(move_to_learn)
|
||||
new_move = (move_to_learn) ? PBMove.new(move_to_learn) : nil
|
||||
new_move = (move_to_learn) ? Pokemon::Move.new(move_to_learn) : nil
|
||||
selmove = 0
|
||||
maxmove = (new_move) ? Pokemon::MAX_MOVES : Pokemon::MAX_MOVES - 1
|
||||
loop do
|
||||
|
||||
@@ -489,7 +489,7 @@ class PokemonBagScreen
|
||||
command = @scene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
|
||||
if cmdRead>=0 && command==cmdRead # Read mail
|
||||
pbFadeOutIn {
|
||||
pbDisplayMail(PokemonMail.new(item,"",""))
|
||||
pbDisplayMail(Mail.new(item, "", ""))
|
||||
}
|
||||
elsif cmdUse>=0 && command==cmdUse # Use item
|
||||
ret = pbUseItem(@bag,item,@scene)
|
||||
|
||||
@@ -1880,7 +1880,7 @@ class PokemonStorageScreen
|
||||
pbDisplay(_INTL("Can't store the {1}.",itemname))
|
||||
else
|
||||
pbDisplay(_INTL("Took the {1}.",itemname))
|
||||
pokemon.setItem(nil)
|
||||
pokemon.item = nil
|
||||
@scene.pbHardRefresh
|
||||
end
|
||||
end
|
||||
@@ -1888,7 +1888,7 @@ class PokemonStorageScreen
|
||||
item = scene.pbChooseItem($PokemonBag)
|
||||
if item
|
||||
itemname = GameData::Item.get(item).name
|
||||
pokemon.setItem(item)
|
||||
pokemon.item = item
|
||||
$PokemonBag.pbDeleteItem(item)
|
||||
pbDisplay(_INTL("{1} is now being held.",itemname))
|
||||
@scene.pbHardRefresh
|
||||
|
||||
@@ -104,13 +104,14 @@ class PokemonEggHatch_Scene
|
||||
updateScene(frames)
|
||||
pbBGMStop()
|
||||
pbMEPlay("Evolution success")
|
||||
pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]",@pokemon.name)) { update }
|
||||
@pokemon.name = nil
|
||||
pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update }
|
||||
if pbConfirmMessage(
|
||||
_INTL("Would you like to nickname the newly hatched {1}?",@pokemon.name)) { update }
|
||||
nickname=pbEnterPokemonName(_INTL("{1}'s nickname?",@pokemon.name),
|
||||
_INTL("Would you like to nickname the newly hatched {1}?", @pokemon.name)) { update }
|
||||
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", @pokemon.name),
|
||||
0, Pokemon::MAX_NAME_SIZE, "", @pokemon, true)
|
||||
@pokemon.name=nickname if nickname!=""
|
||||
@nicknamed=true
|
||||
@pokemon.name = nickname
|
||||
@nicknamed = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -192,11 +193,11 @@ end
|
||||
|
||||
def pbHatch(pokemon)
|
||||
speciesname = pokemon.speciesName
|
||||
pokemon.name = speciesname
|
||||
pokemon.name = nil
|
||||
pokemon.owner = Pokemon::Owner.new_from_trainer($Trainer)
|
||||
pokemon.happiness = 120
|
||||
pokemon.timeEggHatched = pbGetTimeNow
|
||||
pokemon.obtainMode = 1 # hatched from egg
|
||||
pokemon.obtain_method = 1 # hatched from egg
|
||||
pokemon.hatchedMap = $game_map.map_id
|
||||
$Trainer.seen[pokemon.species] = true
|
||||
$Trainer.owned[pokemon.species] = true
|
||||
@@ -206,11 +207,11 @@ def pbHatch(pokemon)
|
||||
pbMessage(_INTL("Huh?\1"))
|
||||
pbMessage(_INTL("...\1"))
|
||||
pbMessage(_INTL("... .... .....\1"))
|
||||
pbMessage(_INTL("{1} hatched from the Egg!",speciesname))
|
||||
if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?",speciesname))
|
||||
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?",speciesname),
|
||||
pbMessage(_INTL("{1} hatched from the Egg!", speciesname))
|
||||
if pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?", speciesname))
|
||||
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", speciesname),
|
||||
0, Pokemon::MAX_NAME_SIZE, "", pokemon)
|
||||
pokemon.name = nickname if nickname!=""
|
||||
pokemon.name = nickname
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -577,7 +577,6 @@ class PokemonEvolutionScene
|
||||
# Success jingle/message
|
||||
pbMEPlay("Evolution success")
|
||||
newspeciesname = GameData::Species.get(@newspecies).name
|
||||
is_nicknamed = @pokemon.nicknamed?
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]",
|
||||
@pokemon.name,newspeciesname)) { pbUpdate }
|
||||
@@ -586,7 +585,6 @@ class PokemonEvolutionScene
|
||||
pbEvolutionMethodAfterEvolution
|
||||
# Modify Pokémon to make it evolved
|
||||
@pokemon.species = @newspecies
|
||||
@pokemon.name = newspeciesname if !is_nicknamed
|
||||
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
|
||||
@pokemon.calcStats
|
||||
# See and own evolved species
|
||||
@@ -611,10 +609,10 @@ class PokemonEvolutionScene
|
||||
def self.pbDuplicatePokemon(pkmn, new_species)
|
||||
new_pkmn = pkmn.clone
|
||||
new_pkmn.species = new_species
|
||||
new_pkmn.name = GameData::Species.get(new_species).name
|
||||
new_pkmn.name = nil
|
||||
new_pkmn.markings = 0
|
||||
new_pkmn.ballused = 0
|
||||
new_pkmn.setItem(nil)
|
||||
new_pkmn.item = nil
|
||||
new_pkmn.clearAllRibbons
|
||||
new_pkmn.calcStats
|
||||
new_pkmn.heal
|
||||
|
||||
@@ -208,8 +208,8 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
raise _INTL("Species does not exist ({1}).", newpoke) if !species_data
|
||||
yourPokemon = Pokemon.new(species_data.id, myPokemon.level, opponent)
|
||||
end
|
||||
yourPokemon.name = nickname
|
||||
yourPokemon.obtainMode = 2 # traded
|
||||
yourPokemon.name = nickname
|
||||
yourPokemon.obtain_method = 2 # traded
|
||||
yourPokemon.resetMoves if resetmoves
|
||||
yourPokemon.pbRecordFirstMoves
|
||||
$Trainer.seen[yourPokemon.species] = true
|
||||
|
||||
@@ -383,7 +383,7 @@ def pbReceiveMysteryGift(id)
|
||||
gift[2].calcStats
|
||||
time=pbGetTimeNow
|
||||
gift[2].timeReceived=time.getgm.to_i
|
||||
gift[2].obtainMode=4 # Fateful encounter
|
||||
gift[2].obtain_method = 4 # Fateful encounter
|
||||
gift[2].pbRecordFirstMoves
|
||||
if $game_map
|
||||
gift[2].obtainMap=$game_map.map_id
|
||||
|
||||
Reference in New Issue
Block a user