Revamped classes Pokemon, PBMove and PokemonMail

This commit is contained in:
Maruno17
2021-01-21 23:04:51 +00:00
parent 94ce80c183
commit 8a89ef1220
40 changed files with 1016 additions and 1038 deletions

View File

@@ -5,9 +5,9 @@ module PokeBattle_BattleCommon
def pbStorePokemon(pkmn)
# Nickname the Pokémon (unless it's a Shadow Pokémon)
if !pkmn.shadowPokemon?
if pbDisplayConfirm(_INTL("Would you like to give a nickname to {1}?",pkmn.name))
nickname = @scene.pbNameEntry(_INTL("{1}'s nickname?",pkmn.speciesName),pkmn)
pkmn.name = nickname if nickname!=""
if pbDisplayConfirm(_INTL("Would you like to give a nickname to {1}?", pkmn.name))
nickname = @scene.pbNameEntry(_INTL("{1}'s nickname?", pkmn.speciesName), pkmn)
pkmn.name = nickname
end
end
# Store the Pokémon

View File

@@ -161,9 +161,9 @@ class PokeBattle_Battle
@runCommand = 0
@nextPickupUse = 0
if GameData::Move.exists?(:STRUGGLE)
@struggle = PokeBattle_Move.pbFromPBMove(self,PBMove.new(:STRUGGLE))
@struggle = PokeBattle_Move.from_pokemon_move(self, Pokemon::Move.new(:STRUGGLE))
else
@struggle = PokeBattle_Struggle.new(self,nil)
@struggle = PokeBattle_Struggle.new(self, nil)
end
end

View File

@@ -478,7 +478,7 @@ class PokeBattle_Battle
pbParty(0).each_with_index do |pkmn,i|
next if !pkmn
@peer.pbOnLeavingBattle(self,pkmn,@usedInBattle[0][i],true) # Reset form
pkmn.setItem(@initialItems[0][i])
pkmn.item = @initialItems[0][i]
end
return @decision
end

View File

@@ -89,7 +89,7 @@ class PokeBattle_Battle
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
pkmn = pbParty(0)[idxParty] # The Pokémon gaining EVs from defeatedBattler
growthRate = pkmn.growthrate
growthRate = pkmn.growth_rate
# Don't bother calculating if gainer is already at max Exp
if pkmn.exp>=PBExperience.pbGetMaxExperience(growthRate)
pkmn.calcStats # To ensure new EVs still have an effect
@@ -100,7 +100,7 @@ class PokeBattle_Battle
level = defeatedBattler.level
# Main Exp calculation
exp = 0
a = level*defeatedBattler.pokemon.baseExp
a = level*defeatedBattler.pokemon.base_exp
if expShare.length>0 && (isPartic || hasExpShare)
if numPartic==0 # No participants, all Exp goes to Exp Share holders
exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1)
@@ -227,8 +227,8 @@ class PokeBattle_Battle
for i in 0...Pokemon::MAX_MOVES
m = pkmn.moves[i]
return if m && m.id==newMove # Already knows the new move
pkmn.moves[i] = PBMove.new(newMove)
battler.moves[i] = PokeBattle_Move.pbFromPBMove(self,pkmn.moves[i]) if battler
pkmn.moves[i] = Pokemon::Move.new(newMove)
battler.moves[i] = PokeBattle_Move.from_pokemon_move(self, pkmn.moves[i]) if battler
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }
battler.pbCheckFormOnMovesetChange if battler
return
@@ -241,8 +241,8 @@ class PokeBattle_Battle
forgetMove = @scene.pbForgetMove(pkmn,newMove)
if forgetMove>=0
oldMoveName = pkmn.moves[forgetMove].name
pkmn.moves[forgetMove] = PBMove.new(newMove) # Replaces current/total PP
battler.moves[forgetMove] = PokeBattle_Move.pbFromPBMove(self,pkmn.moves[forgetMove]) if battler
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
pbDisplayPaused(_INTL("1, 2, and... ... ... Ta-da!"))
pbDisplayPaused(_INTL("{1} forgot how to use {2}. And...",pkmnName,oldMoveName))
pbDisplay(_INTL("{1} learned {2}!",pkmnName,moveName)) { pbSEPlay("Pkmn move learnt") }