mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
updates to version 6.1
This commit is contained in:
@@ -599,6 +599,54 @@ class PokeBattle_Battler
|
||||
GameData::Species.sprite_filename(pokemon.dexNum, spriteform_body,spriteform_head)
|
||||
end
|
||||
|
||||
|
||||
def playChangeFormAnimation(animation = "UltraBurst2")
|
||||
@battle.scene.pbChangePokemon(self, @pokemon)
|
||||
@battle.scene.pbCommonAnimation(animation, self)
|
||||
@battle.scene.pbRefreshOne(@index)
|
||||
end
|
||||
|
||||
def changeSpecies(pokemon, speciesToReplace,newSpecies, animation = "UltraBurst2")
|
||||
if pokemon.isFusion?()
|
||||
replaceFusionSpecies(pokemon,speciesToReplace,newSpecies)
|
||||
else
|
||||
changeSpeciesSpecific(pokemon,newSpecies)
|
||||
end
|
||||
playChangeFormAnimation(animation)
|
||||
end
|
||||
|
||||
|
||||
|
||||
# def changeUnfusedSpecies(pokemon, newSpecies, animation = "UltraBurst2")
|
||||
#
|
||||
# end
|
||||
|
||||
#For meloetta form change
|
||||
|
||||
def changeFormSpecies(oldForm, newForm,animation = "UltraBurst2")
|
||||
@pokemon.changeFormSpecies(oldForm,newForm)
|
||||
playChangeFormAnimation(animation)
|
||||
|
||||
# is_already_old_form = @pokemon.isFusionOf(oldForm) #A 466
|
||||
# is_already_new_form = @pokemon.isFusionOf(newForm) #P
|
||||
#
|
||||
#
|
||||
# #reverse the fusion if it's a meloA and meloP fusion
|
||||
# # There's probably a smarter way to do this but laziness lol
|
||||
# if is_already_old_form && is_already_new_form
|
||||
# if @pokemon.species_data.get_body_species() == oldForm
|
||||
# changeSpeciesSpecific(@pokemon,getFusedPokemonIdFromSymbols(newForm,oldForm))
|
||||
# else
|
||||
# changeSpeciesSpecific(@pokemon,getFusedPokemonIdFromSymbols(oldForm,newForm))
|
||||
# end
|
||||
# playChangeFormAnimation(animation)
|
||||
# else
|
||||
# changeSpecies(@pokemon, oldForm, newForm, animation) if is_already_old_form
|
||||
# changeSpecies(@pokemon, newForm, oldForm, animation) if is_already_new_form
|
||||
# end
|
||||
end
|
||||
|
||||
|
||||
def changeForm(newForm, formChangingSpecies, animation = "UltraBurst2")
|
||||
spriteform_body = newForm if @pokemon.hasBodyOf?(formChangingSpecies)
|
||||
spriteform_head = newForm if @pokemon.hasHeadOf?(formChangingSpecies)
|
||||
@@ -617,9 +665,7 @@ class PokeBattle_Battler
|
||||
@pokemon.spriteform_body = spriteform_body
|
||||
@pokemon.spriteform_head = spriteform_head
|
||||
end
|
||||
@battle.scene.pbChangePokemon(self, @pokemon)
|
||||
@battle.scene.pbCommonAnimation(animation, self)
|
||||
@battle.scene.pbRefreshOne(@index)
|
||||
playChangeFormAnimation(animation)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2993,10 +2993,10 @@ class PokeBattle_Move_0EB < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if @battle.wildBattle? && target.level>user.level
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
# if @battle.wildBattle? && target.level>user.level
|
||||
# @battle.pbDisplay(_INTL("But it failed!"))
|
||||
# return true
|
||||
# end
|
||||
if @battle.trainerBattle?
|
||||
canSwitch = false
|
||||
@battle.eachInTeamFromBattlerIndex(target.index) do |_pkmn,i|
|
||||
|
||||
@@ -2069,17 +2069,29 @@ class PokeBattle_Move_164 < PokeBattle_Move_163
|
||||
@calcCategory = (realAtk > realSpAtk) ? 0 : 1
|
||||
|
||||
if user.hasActiveItem?(:NECROZIUM) && (user.isFusionOf(:NECROZMA) && !user.pokemon.spriteform_body && !user.pokemon.spriteform_head)
|
||||
user.type2 = :DRAGON if user.pokemon.hasBodyOf?(:NECROZMA)
|
||||
user.attack*=1.3
|
||||
user.spatk*=1.3
|
||||
user.defense*=0.5
|
||||
user.spdef*=0.5
|
||||
user.speed*=1.5
|
||||
user.changeForm(1,:NECROZMA)
|
||||
# user.type2 = :DRAGON if user.pokemon.hasBodyOf?(:NECROZMA)
|
||||
# user.attack*=1.3
|
||||
# user.spatk*=1.3
|
||||
# user.defense*=0.5
|
||||
# user.spdef*=0.5
|
||||
# user.speed*=1.5
|
||||
|
||||
user.changeFormSpecies(:NECROZMA,:U_NECROZMA,"UltraBurst2")
|
||||
#user.changeForm(1,:NECROZMA)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#change back at the end of battle
|
||||
Events.onEndBattle += proc { |_sender,_e|
|
||||
$Trainer.party.each_with_index do |value, i|
|
||||
pokemon = $Trainer.party[i]
|
||||
if pokemon.isFusionOf(:U_NECROZMA)
|
||||
pokemon.changeFormSpecies(:U_NECROZMA,:NECROZMA)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
#===============================================================================
|
||||
# Negates the target's ability while it remains on the field, if it has already
|
||||
# performed its action this round. (Core Enforcer)
|
||||
|
||||
@@ -12,42 +12,57 @@ module PokeBattle_BattleCommon
|
||||
end
|
||||
# Store the Pokémon
|
||||
currentBox = @peer.pbCurrentBox
|
||||
storedBox = @peer.pbStorePokemon(pbPlayer,pkmn)
|
||||
if storedBox<0
|
||||
pbDisplayPaused(_INTL("{1} has been added to your party.",pkmn.name))
|
||||
@initialItems[0][pbPlayer.party.length-1] = pkmn.item_id if @initialItems
|
||||
storedBox = @peer.pbStorePokemon(pbPlayer, pkmn)
|
||||
if storedBox < 0
|
||||
pbDisplayPaused(_INTL("{1} has been added to your party.", pkmn.name))
|
||||
@initialItems[0][pbPlayer.party.length - 1] = pkmn.item_id if @initialItems
|
||||
return
|
||||
end
|
||||
# Messages saying the Pokémon was stored in a PC box
|
||||
creator = @peer.pbGetStorageCreatorName
|
||||
creator = @peer.pbGetStorageCreatorName
|
||||
curBoxName = @peer.pbBoxName(currentBox)
|
||||
boxName = @peer.pbBoxName(storedBox)
|
||||
if storedBox!=currentBox
|
||||
boxName = @peer.pbBoxName(storedBox)
|
||||
if storedBox != currentBox
|
||||
if creator
|
||||
pbDisplayPaused(_INTL("Box \"{1}\" on {2}'s PC was full.",curBoxName,creator))
|
||||
pbDisplayPaused(_INTL("Box \"{1}\" on {2}'s PC was full.", curBoxName, creator))
|
||||
else
|
||||
pbDisplayPaused(_INTL("Box \"{1}\" on someone's PC was full.",curBoxName))
|
||||
pbDisplayPaused(_INTL("Box \"{1}\" on someone's PC was full.", curBoxName))
|
||||
end
|
||||
pbDisplayPaused(_INTL("{1} was transferred to box \"{2}\".",pkmn.name,boxName))
|
||||
pbDisplayPaused(_INTL("{1} was transferred to box \"{2}\".", pkmn.name, boxName))
|
||||
else
|
||||
if creator
|
||||
pbDisplayPaused(_INTL("{1} was transferred to {2}'s PC.",pkmn.name,creator))
|
||||
pbDisplayPaused(_INTL("{1} was transferred to {2}'s PC.", pkmn.name, creator))
|
||||
else
|
||||
pbDisplayPaused(_INTL("{1} was transferred to someone's PC.",pkmn.name))
|
||||
pbDisplayPaused(_INTL("{1} was transferred to someone's PC.", pkmn.name))
|
||||
end
|
||||
pbDisplayPaused(_INTL("It was stored in box \"{1}\".",boxName))
|
||||
pbDisplayPaused(_INTL("It was stored in box \"{1}\".", boxName))
|
||||
end
|
||||
end
|
||||
|
||||
#def pbChoosePokemon(variableNumber, nameVarNumber, ableProc = nil, allowIneligible = false)
|
||||
# def swapCaughtPokemon(caughtPokemon)
|
||||
# pbChoosePokemon(1,2,
|
||||
# proc {|poke|
|
||||
# !poke.egg? &&
|
||||
# !(poke.isShadow? rescue false)
|
||||
# })
|
||||
# index = pbGet(1)
|
||||
# return false if index == -1
|
||||
# $PokemonStorage.pbStoreCaught($Trainer.party[index])
|
||||
# pbRemovePokemonAt(index)
|
||||
# pbStorePokemon(caughtPokemon)
|
||||
# return true
|
||||
# end
|
||||
|
||||
# Register all caught Pokémon in the Pokédex, and store them.
|
||||
def pbRecordAndStoreCaughtPokemon
|
||||
@caughtPokemon.each do |pkmn|
|
||||
pbPlayer.pokedex.register(pkmn) # In case the form changed upon leaving battle
|
||||
pbPlayer.pokedex.register(pkmn) # In case the form changed upon leaving battle
|
||||
# Record the Pokémon's species as owned in the Pokédex
|
||||
if !pbPlayer.owned?(pkmn.species)
|
||||
pbPlayer.pokedex.set_owned(pkmn.species)
|
||||
if $Trainer.has_pokedex
|
||||
pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.",pkmn.name))
|
||||
pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.", pkmn.name))
|
||||
pbPlayer.pokedex.register_last_seen(pkmn)
|
||||
@scene.pbShowPokedex(pkmn.species)
|
||||
end
|
||||
@@ -55,7 +70,7 @@ module PokeBattle_BattleCommon
|
||||
# Record a Shadow Pokémon's species as having been caught
|
||||
pbPlayer.pokedex.set_shadow_pokemon_owned(pkmn.species) if pkmn.shadowPokemon?
|
||||
# Store caught Pokémon
|
||||
pbStorePokemon(pkmn)
|
||||
promptCaughtPokemonAction(pkmn)
|
||||
if $game_switches[AUTOSAVE_CATCH_SWITCH]
|
||||
Kernel.tryAutosave()
|
||||
end
|
||||
@@ -64,10 +79,34 @@ module PokeBattle_BattleCommon
|
||||
@caughtPokemon.clear
|
||||
end
|
||||
|
||||
# def promptCaughtPokemonAction(pokemon)
|
||||
# pickedOption = false
|
||||
# return pbStorePokemon(pokemon) if !$Trainer.party_full?
|
||||
#
|
||||
# while !pickedOption
|
||||
# command = pbMessage(_INTL("\\ts[]Your team is full!"),
|
||||
# [_INTL("Add to your party"), _INTL("Store to PC"),], 2)
|
||||
# echoln ("command " + command.to_s)
|
||||
# case command
|
||||
# when 0 #SWAP
|
||||
# if swapCaughtPokemon(pokemon)
|
||||
# echoln pickedOption
|
||||
# pickedOption = true
|
||||
# end
|
||||
# else
|
||||
# #STORE
|
||||
# pbStorePokemon(pokemon)
|
||||
# echoln pickedOption
|
||||
# pickedOption = true
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# end
|
||||
|
||||
#=============================================================================
|
||||
# Throw a Poké Ball
|
||||
#=============================================================================
|
||||
def pbThrowPokeBall(idxBattler,ball,catch_rate=nil,showPlayer=false)
|
||||
def pbThrowPokeBall(idxBattler, ball, catch_rate = nil, showPlayer = false)
|
||||
# Determine which Pokémon you're throwing the Poké Ball at
|
||||
battler = nil
|
||||
if opposes?(idxBattler)
|
||||
@@ -85,58 +124,58 @@ module PokeBattle_BattleCommon
|
||||
itemName = GameData::Item.get(ball).name
|
||||
if battler.fainted?
|
||||
if itemName.starts_with_vowel?
|
||||
pbDisplay(_INTL("{1} threw an {2}!",pbPlayer.name,itemName))
|
||||
pbDisplay(_INTL("{1} threw an {2}!", pbPlayer.name, itemName))
|
||||
else
|
||||
pbDisplay(_INTL("{1} threw a {2}!",pbPlayer.name,itemName))
|
||||
pbDisplay(_INTL("{1} threw a {2}!", pbPlayer.name, itemName))
|
||||
end
|
||||
pbDisplay(_INTL("But there was no target..."))
|
||||
return
|
||||
end
|
||||
if itemName.starts_with_vowel?
|
||||
pbDisplayBrief(_INTL("{1} threw an {2}!",pbPlayer.name,itemName))
|
||||
pbDisplayBrief(_INTL("{1} threw an {2}!", pbPlayer.name, itemName))
|
||||
else
|
||||
pbDisplayBrief(_INTL("{1} threw a {2}!",pbPlayer.name,itemName))
|
||||
pbDisplayBrief(_INTL("{1} threw a {2}!", pbPlayer.name, itemName))
|
||||
end
|
||||
# Animation of opposing trainer blocking Poké Balls (unless it's a Snag Ball
|
||||
# at a Shadow Pokémon)
|
||||
if trainerBattle? && !(GameData::Item.get(ball).is_snag_ball? && battler.shadowPokemon?)
|
||||
@scene.pbThrowAndDeflect(ball,1)
|
||||
@scene.pbThrowAndDeflect(ball, 1)
|
||||
pbDisplay(_INTL("The Trainer blocked your Poké Ball! Don't be a thief!"))
|
||||
return
|
||||
elsif $game_switches[SWITCH_CANNOT_CATCH_POKEMON]
|
||||
@scene.pbThrowAndDeflect(ball,1)
|
||||
@scene.pbThrowAndDeflect(ball, 1)
|
||||
pbDisplay(_INTL("The Pokémon is impossible to catch!"))
|
||||
return
|
||||
end
|
||||
# Calculate the number of shakes (4=capture)
|
||||
pkmn = battler.pokemon
|
||||
@criticalCapture = false
|
||||
numShakes = pbCaptureCalc(pkmn,battler,catch_rate,ball)
|
||||
numShakes = pbCaptureCalc(pkmn, battler, catch_rate, ball)
|
||||
PBDebug.log("[Threw Poké Ball] #{itemName}, #{numShakes} shakes (4=capture)")
|
||||
# Animation of Ball throw, absorb, shake and capture/burst out
|
||||
@scene.pbThrow(ball,numShakes,@criticalCapture,battler.index,showPlayer)
|
||||
@scene.pbThrow(ball, numShakes, @criticalCapture, battler.index, showPlayer)
|
||||
# Outcome message
|
||||
case numShakes
|
||||
when 0
|
||||
pbDisplay(_INTL("Oh no! The Pokémon broke free!"))
|
||||
BallHandlers.onFailCatch(ball,self,battler)
|
||||
BallHandlers.onFailCatch(ball, self, battler)
|
||||
when 1
|
||||
pbDisplay(_INTL("Aww! It appeared to be caught!"))
|
||||
BallHandlers.onFailCatch(ball,self,battler)
|
||||
BallHandlers.onFailCatch(ball, self, battler)
|
||||
when 2
|
||||
pbDisplay(_INTL("Aargh! Almost had it!"))
|
||||
BallHandlers.onFailCatch(ball,self,battler)
|
||||
BallHandlers.onFailCatch(ball, self, battler)
|
||||
when 3
|
||||
pbDisplay(_INTL("Gah! It was so close, too!"))
|
||||
BallHandlers.onFailCatch(ball,self,battler)
|
||||
BallHandlers.onFailCatch(ball, self, battler)
|
||||
when 4
|
||||
if $game_switches[SWITCH_SILVERBOSS_BATTLE]
|
||||
pkmn.species=:PALDIATINA
|
||||
pkmn.species = :PALDIATINA
|
||||
pkmn.name = "Paldiatina"
|
||||
end
|
||||
pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pkmn.name))
|
||||
@scene.pbThrowSuccess # Play capture success jingle
|
||||
pbRemoveFromParty(battler.index,battler.pokemonIndex)
|
||||
pbDisplayBrief(_INTL("Gotcha! {1} was caught!", pkmn.name))
|
||||
@scene.pbThrowSuccess # Play capture success jingle
|
||||
pbRemoveFromParty(battler.index, battler.pokemonIndex)
|
||||
# Gain Exp
|
||||
if Settings::GAIN_EXP_FOR_CAPTURE
|
||||
battler.captured = true
|
||||
@@ -145,21 +184,21 @@ module PokeBattle_BattleCommon
|
||||
end
|
||||
battler.pbReset
|
||||
if pbAllFainted?(battler.index)
|
||||
@decision = (trainerBattle?) ? 1 : 4 # Battle ended by win/capture
|
||||
@decision = (trainerBattle?) ? 1 : 4 # Battle ended by win/capture
|
||||
end
|
||||
# Modify the Pokémon's properties because of the capture
|
||||
if GameData::Item.get(ball).is_snag_ball?
|
||||
pkmn.owner = Pokemon::Owner.new_from_trainer(pbPlayer)
|
||||
end
|
||||
BallHandlers.onCatch(ball,self,pkmn)
|
||||
BallHandlers.onCatch(ball, self, pkmn)
|
||||
pkmn.poke_ball = ball
|
||||
pkmn.makeUnmega if pkmn.mega?
|
||||
pkmn.makeUnprimal
|
||||
pkmn.update_shadow_moves if pkmn.shadowPokemon?
|
||||
pkmn.record_first_moves
|
||||
# Reset form
|
||||
pkmn.forced_form = nil if MultipleForms.hasFunction?(pkmn.species,"getForm")
|
||||
@peer.pbOnLeavingBattle(self,pkmn,true,true)
|
||||
pkmn.forced_form = nil if MultipleForms.hasFunction?(pkmn.species, "getForm")
|
||||
@peer.pbOnLeavingBattle(self, pkmn, true, true)
|
||||
# Make the Poké Ball and data box disappear
|
||||
@scene.pbHideCaptureBall(idxBattler)
|
||||
# Save the Pokémon for storage at the end of battle
|
||||
@@ -170,7 +209,7 @@ module PokeBattle_BattleCommon
|
||||
#=============================================================================
|
||||
# Calculate how many shakes a thrown Poké Ball will make (4 = capture)
|
||||
#=============================================================================
|
||||
def pbCaptureCalc(pkmn,battler,catch_rate,ball)
|
||||
def pbCaptureCalc(pkmn, battler, catch_rate, ball)
|
||||
return 4 if $DEBUG && Input.press?(Input::CTRL)
|
||||
# Get a catch rate if one wasn't provided
|
||||
catch_rate = pkmn.species_data.catch_rate if !catch_rate
|
||||
@@ -179,14 +218,14 @@ module PokeBattle_BattleCommon
|
||||
:KARTANA, :GUZZLORD, :POIPOLE, :NAGANADEL, :STAKATAKA,
|
||||
:BLACEPHALON].include?(pkmn.species)
|
||||
if !ultraBeast || ball == :BEASTBALL
|
||||
catch_rate = BallHandlers.modifyCatchRate(ball,catch_rate,self,battler,ultraBeast)
|
||||
catch_rate = BallHandlers.modifyCatchRate(ball, catch_rate, self, battler, ultraBeast)
|
||||
else
|
||||
catch_rate /= 10
|
||||
end
|
||||
# First half of the shakes calculation
|
||||
a = battler.totalhp
|
||||
b = battler.hp
|
||||
x = ((3*a-2*b)*catch_rate.to_f)/(3*a)
|
||||
x = ((3 * a - 2 * b) * catch_rate.to_f) / (3 * a)
|
||||
# Calculation modifiers
|
||||
if battler.status == :SLEEP || battler.status == :FROZEN
|
||||
x *= 2.5
|
||||
@@ -194,33 +233,38 @@ module PokeBattle_BattleCommon
|
||||
x *= 1.5
|
||||
end
|
||||
x = x.floor
|
||||
x = 1 if x<1
|
||||
x = 1 if x < 1
|
||||
# Definite capture, no need to perform randomness checks
|
||||
return 4 if x>=255 || BallHandlers.isUnconditional?(ball,self,battler)
|
||||
return 4 if x >= 255 || BallHandlers.isUnconditional?(ball, self, battler)
|
||||
# Second half of the shakes calculation
|
||||
y = ( 65536 / ((255.0/x)**0.1875) ).floor
|
||||
y = (65536 / ((255.0 / x) ** 0.1875)).floor
|
||||
# Critical capture check
|
||||
if Settings::ENABLE_CRITICAL_CAPTURES
|
||||
c = 0
|
||||
numOwned = $Trainer.pokedex.owned_count
|
||||
if numOwned>600; c = x*5/12
|
||||
elsif numOwned>450; c = x*4/12
|
||||
elsif numOwned>300; c = x*3/12
|
||||
elsif numOwned>150; c = x*2/12
|
||||
elsif numOwned>30; c = x/12
|
||||
if numOwned > 600;
|
||||
c = x * 5 / 12
|
||||
elsif numOwned > 450;
|
||||
c = x * 4 / 12
|
||||
elsif numOwned > 300;
|
||||
c = x * 3 / 12
|
||||
elsif numOwned > 150;
|
||||
c = x * 2 / 12
|
||||
elsif numOwned > 30;
|
||||
c = x / 12
|
||||
end
|
||||
# Calculate the number of shakes
|
||||
if c>0 && pbRandom(256)<c
|
||||
if c > 0 && pbRandom(256) < c
|
||||
@criticalCapture = true
|
||||
return 4 if pbRandom(65536)<y
|
||||
return 4 if pbRandom(65536) < y
|
||||
return 0
|
||||
end
|
||||
end
|
||||
# Calculate the number of shakes
|
||||
numShakes = 0
|
||||
for i in 0...4
|
||||
break if numShakes<i
|
||||
numShakes += 1 if pbRandom(65536)<y
|
||||
break if numShakes < i
|
||||
numShakes += 1 if pbRandom(65536) < y
|
||||
end
|
||||
return numShakes
|
||||
end
|
||||
|
||||
@@ -173,11 +173,20 @@ class PokeBattle_Battle
|
||||
def wildBattle?; return @opponent.nil?; end
|
||||
def trainerBattle?; return !@opponent.nil?; end
|
||||
|
||||
def get_default_battle_format()
|
||||
case $PokemonSystem.battle_type
|
||||
when 0 then return [1, 1]
|
||||
when 1 then return [2, 2]
|
||||
when 2 then return [3, 3]
|
||||
end
|
||||
return [1,1]
|
||||
end
|
||||
|
||||
# Sets the number of battler slots on each side of the field independently.
|
||||
# For "1v2" names, the first number is for the player's side and the second
|
||||
# number is for the opposing side.
|
||||
def setBattleMode(mode)
|
||||
default = $game_variables[VAR_DEFAULT_BATTLE_TYPE].is_a?(Array) ? $game_variables[VAR_DEFAULT_BATTLE_TYPE] : [1,1]
|
||||
default = get_default_battle_format()
|
||||
@sideSizes =
|
||||
case mode
|
||||
when "triple", "3v3" then [3, 3]
|
||||
|
||||
Reference in New Issue
Block a user