6.4 update (minus sprites)

This commit is contained in:
infinitefusion
2024-12-21 09:43:11 -05:00
parent f70c2cfde4
commit 1e325366d2
1717 changed files with 140299 additions and 27845 deletions

View File

@@ -1,9 +1,9 @@
class PokeBattle_Battler
# Fundamental to this object
attr_reader :battle
attr_reader :battle
attr_accessor :index
# The Pokémon and its properties
attr_reader :pokemon
attr_reader :pokemon
attr_accessor :pokemonIndex
attr_accessor :species
attr_accessor :type1
@@ -17,10 +17,10 @@ class PokeBattle_Battler
attr_accessor :spatk
attr_accessor :speed
attr_accessor :stages
attr_reader :totalhp
attr_reader :fainted # Boolean to mark whether self has fainted properly
attr_accessor :captured # Boolean to mark whether self was captured
attr_reader :dummy
attr_reader :totalhp
attr_reader :fainted # Boolean to mark whether self has fainted properly
attr_accessor :captured # Boolean to mark whether self was captured
attr_reader :dummy
attr_accessor :effects
# Things the battler has done in battle
attr_accessor :turnCount
@@ -32,16 +32,16 @@ class PokeBattle_Battler
attr_accessor :lastMoveUsed
attr_accessor :lastMoveUsedType
attr_accessor :lastRegularMoveUsed
attr_accessor :lastRegularMoveTarget # For Instruct
attr_accessor :lastRegularMoveTarget # For Instruct
attr_accessor :lastRoundMoved
attr_accessor :lastMoveFailed # For Stomping Tantrum
attr_accessor :lastRoundMoveFailed # For Stomping Tantrum
attr_accessor :lastMoveFailed # For Stomping Tantrum
attr_accessor :lastRoundMoveFailed # For Stomping Tantrum
attr_accessor :movesUsed
attr_accessor :currentMove # ID of multi-turn move currently being used
attr_accessor :tookDamage # Boolean for whether self took damage this round
attr_accessor :currentMove # ID of multi-turn move currently being used
attr_accessor :tookDamage # Boolean for whether self took damage this round
attr_accessor :tookPhysicalHit
attr_accessor :damageState
attr_accessor :initialHP # Set at the start of each move's usage
attr_accessor :initialHP # Set at the start of each move's usage
#=============================================================================
# Complex accessors
@@ -68,7 +68,6 @@ class PokeBattle_Battler
return @pokemon.ability_index >= 2
end
def ability=(value)
new_ability = GameData::Ability.try_get(value)
@ability_id = (new_ability) ? new_ability.id : nil
@@ -85,14 +84,14 @@ class PokeBattle_Battler
end
def defense
return @spdef if @battle.field.effects[PBEffects::WonderRoom]>0
return @spdef if @battle.field.effects[PBEffects::WonderRoom] > 0
return @defense
end
attr_writer :defense
def spdef
return @defense if @battle.field.effects[PBEffects::WonderRoom]>0
return @defense if @battle.field.effects[PBEffects::WonderRoom] > 0
return @spdef
end
@@ -101,18 +100,22 @@ class PokeBattle_Battler
attr_reader :hp
def hp=(value)
checkHPRelatedFormChange(value) #careful, setting @pokemon.hp also calls a method for changing the form on hp change so we should not change the form here, just update the graphics
@hp = value.to_i
@pokemon.hp = value.to_i if @pokemon
end
def fainted?; return @hp<=0; end
def fainted?
return @hp <= 0;
end
alias isFainted? fainted?
attr_reader :status
def status=(value)
@effects[PBEffects::Truant] = false if @status == :SLEEP && value != :SLEEP
@effects[PBEffects::Toxic] = 0 if value != :POISON
@effects[PBEffects::Toxic] = 0 if value != :POISON
@status = value
@pokemon.status = value if @pokemon
self.statusCount = 0 if value != :POISON && value != :SLEEP
@@ -130,9 +133,17 @@ class PokeBattle_Battler
#=============================================================================
# Properties from Pokémon
#=============================================================================
def happiness; return @pokemon ? @pokemon.happiness : 0; end
def nature; return @pokemon ? @pokemon.nature : 0; end
def pokerusStage; return @pokemon ? @pokemon.pokerusStage : 0; end
def happiness
return @pokemon ? @pokemon.happiness : 0;
end
def nature
return @pokemon ? @pokemon.nature : 0;
end
def pokerusStage
return @pokemon ? @pokemon.pokerusStage : 0;
end
#=============================================================================
# Mega Evolution, Primal Reversion, Shadow Pokémon
@@ -142,7 +153,10 @@ class PokeBattle_Battler
return @pokemon && @pokemon.hasMegaForm?
end
def mega?; return @pokemon && @pokemon.mega?; end
def mega?
return @pokemon && @pokemon.mega?;
end
alias isMega? mega?
def hasPrimal?
@@ -150,13 +164,21 @@ class PokeBattle_Battler
return @pokemon && @pokemon.hasPrimalForm?
end
def primal?; return @pokemon && @pokemon.primal?; end
def primal?
return @pokemon && @pokemon.primal?;
end
alias isPrimal? primal?
def shadowPokemon?; return false; end
def shadowPokemon?
return false;
end
alias isShadow? shadowPokemon?
def inHyperMode?; return false; end
def inHyperMode?
return false;
end
#=============================================================================
# Display-only properties
@@ -192,6 +214,7 @@ class PokeBattle_Battler
return @effects[PBEffects::Illusion].shiny? if @effects[PBEffects::Illusion]
return @pokemon && @pokemon.shiny?
end
alias isShiny? shiny?
def glitter?
@@ -202,6 +225,7 @@ class PokeBattle_Battler
return false if !@battle.wildBattle?
return $Trainer.owned?(displaySpecies)
end
alias owned owned?
def abilityName
@@ -214,27 +238,27 @@ class PokeBattle_Battler
return (itm) ? itm.name : ""
end
def pbThis(lowerCase=false)
def pbThis(lowerCase = false)
if opposes?
if @battle.trainerBattle?
return lowerCase ? _INTL("the opposing {1}",name) : _INTL("The opposing {1}",name)
return lowerCase ? _INTL("the opposing {1}", name) : _INTL("The opposing {1}", name)
else
return lowerCase ? _INTL("the wild {1}",name) : _INTL("The wild {1}",name)
return lowerCase ? _INTL("the wild {1}", name) : _INTL("The wild {1}", name)
end
elsif !pbOwnedByPlayer?
return lowerCase ? _INTL("the ally {1}",name) : _INTL("The ally {1}",name)
return lowerCase ? _INTL("the ally {1}", name) : _INTL("The ally {1}", name)
end
return name
end
def pbTeam(lowerCase=false)
def pbTeam(lowerCase = false)
if opposes?
return lowerCase ? _INTL("the opposing team") : _INTL("The opposing team")
end
return lowerCase ? _INTL("your team") : _INTL("Your team")
end
def pbOpposingTeam(lowerCase=false)
def pbOpposingTeam(lowerCase = false)
if opposes?
return lowerCase ? _INTL("your team") : _INTL("Your team")
end
@@ -246,46 +270,46 @@ class PokeBattle_Battler
#=============================================================================
def pbSpeed
return 1 if fainted?
stageMul = [2,2,2,2,2,2, 2, 3,4,5,6,7,8]
stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2]
stageMul = [2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8]
stageDiv = [8, 7, 6, 5, 4, 3, 2, 2, 2, 2, 2, 2, 2]
stage = @stages[:SPEED] + 6
speed = @speed*stageMul[stage]/stageDiv[stage]
speed = @speed * stageMul[stage] / stageDiv[stage]
speedMult = 1.0
# Ability effects that alter calculated Speed
if abilityActive?
speedMult = BattleHandlers.triggerSpeedCalcAbility(self.ability,self,speedMult)
speedMult = BattleHandlers.triggerSpeedCalcAbility(self.ability, self, speedMult)
end
# Item effects that alter calculated Speed
if itemActive?
speedMult = BattleHandlers.triggerSpeedCalcItem(self.item,self,speedMult)
speedMult = BattleHandlers.triggerSpeedCalcItem(self.item, self, speedMult)
end
# Other effects
speedMult *= 2 if pbOwnSide.effects[PBEffects::Tailwind]>0
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
speedMult *= 2 if pbOwnSide.effects[PBEffects::Tailwind] > 0
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp] > 0
# Paralysis
if status == :PARALYSIS && !hasActiveAbility?(:QUICKFEET)
speedMult /= (Settings::MECHANICS_GENERATION >= 7) ? 2 : 4
end
# Badge multiplier
if @battle.internalBattle && pbOwnedByPlayer? &&
@battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPEED
@battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPEED
speedMult *= 1.1
end
# Calculation
return [(speed*speedMult).round,1].max
return [(speed * speedMult).round, 1].max
end
def pbWeight
ret = (@pokemon) ? @pokemon.weight : 500
ret += @effects[PBEffects::WeightChange]
ret = 1 if ret<1
ret = 1 if ret < 1
if abilityActive? && !@battle.moldBreaker
ret = BattleHandlers.triggerWeightCalcAbility(self.ability,self,ret)
ret = BattleHandlers.triggerWeightCalcAbility(self.ability, self, ret)
end
if itemActive?
ret = BattleHandlers.triggerWeightCalcItem(self.item,self,ret)
ret = BattleHandlers.triggerWeightCalcItem(self.item, self, ret)
end
return [ret,1].max
return [ret, 1].max
end
#=============================================================================
@@ -293,11 +317,11 @@ class PokeBattle_Battler
#=============================================================================
def plainStats
ret = {}
ret[:ATTACK] = self.attack
ret[:DEFENSE] = self.defense
ret[:SPECIAL_ATTACK] = self.spatk
ret[:ATTACK] = self.attack
ret[:DEFENSE] = self.defense
ret[:SPECIAL_ATTACK] = self.spatk
ret[:SPECIAL_DEFENSE] = self.spdef
ret[:SPEED] = self.speed
ret[:SPEED] = self.speed
return ret
end
@@ -313,7 +337,6 @@ class PokeBattle_Battler
return @pokemon.hasHeadOf?(check_species)
end
def isFusionOf(check_species)
return @pokemon.isFusionOf(check_species)
end
@@ -322,13 +345,12 @@ class PokeBattle_Battler
return @pokemon.isFusion?()
end
# Returns the active types of this Pokémon. The array should not include the
# same type more than once, and should not include any invalid type numbers
# (e.g. -1).
def pbTypes(withType3=false)
def pbTypes(withType3 = false)
ret = [@type1]
ret.push(@type2) if @type2!=@type1
ret.push(@type2) if @type2 != @type1
# Burn Up erases the Fire-type.
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
# Roost erases the Flying-type. If there are no types left, adds the Normal-
@@ -373,6 +395,7 @@ class PokeBattle_Battler
return check_ability.include?(@ability_id) if check_ability.is_a?(Array)
return self.ability == check_ability
end
alias hasWorkingAbility hasActiveAbility?
# Applies to both losing self's ability (i.e. being replaced by another) and
@@ -385,8 +408,8 @@ class PokeBattle_Battler
# Form-changing abilities
:BATTLEBOND,
:DISGUISE,
# :FLOWERGIFT, # This can be stopped
# :FORECAST, # This can be stopped
# :FLOWERGIFT, # This can be stopped
# :FORECAST, # This can be stopped
:MULTITYPE,
:POWERCONSTRUCT,
:SCHOOLING,
@@ -427,11 +450,11 @@ class PokeBattle_Battler
return ability_blacklist.include?(abil.id)
end
def itemActive?(ignoreFainted=false)
def itemActive?(ignoreFainted = false)
return false if fainted? && !ignoreFainted
return false if @effects[PBEffects::Embargo]>0
return false if @battle.field.effects[PBEffects::MagicRoom]>0
return false if hasActiveAbility?(:KLUTZ,ignoreFainted)
return false if @effects[PBEffects::Embargo] > 0
return false if @battle.field.effects[PBEffects::MagicRoom] > 0
return false if hasActiveAbility?(:KLUTZ, ignoreFainted)
return true
end
@@ -440,6 +463,7 @@ class PokeBattle_Battler
return check_item.include?(@item_id) if check_item.is_a?(Array)
return self.item == check_item
end
alias hasWorkingItem hasActiveItem?
# Returns whether the specified item will be unlosable for this Pokémon.
@@ -448,9 +472,10 @@ class PokeBattle_Battler
return true if GameData::Item.get(check_item).is_mail?
return false if @effects[PBEffects::Transform]
# Items that change a Pokémon's form
if mega? # Check if item was needed for this Mega Evolution
if mega? # Check if item was needed for this Mega Evolution
return true if @pokemon.species_data.mega_stone == check_item
else # Check if item could cause a Mega Evolution
else
# Check if item could cause a Mega Evolution
GameData::Species.each do |data|
next if data.species != @species || data.unmega_form != @form
return true if data.mega_stone == check_item
@@ -516,15 +541,15 @@ class PokeBattle_Battler
return true
end
def takesIndirectDamage?(showMsg=false)
def takesIndirectDamage?(showMsg = false)
return false if fainted?
if hasActiveAbility?(:MAGICGUARD)
if showMsg
@battle.pbShowAbilitySplash(self)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
@battle.pbDisplay(_INTL("{1} is unaffected!", pbThis))
else
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", pbThis, abilityName))
end
@battle.pbHideAbilitySplash(self)
end
@@ -536,8 +561,8 @@ class PokeBattle_Battler
def takesSandstormDamage?
return false if !takesIndirectDamage?
return false if pbHasType?(:GROUND) || pbHasType?(:ROCK) || pbHasType?(:STEEL)
return false if inTwoTurnAttack?("0CA","0CB") # Dig, Dive
return false if hasActiveAbility?([:OVERCOAT,:SANDFORCE,:SANDRUSH,:SANDVEIL])
return false if inTwoTurnAttack?("0CA", "0CB") # Dig, Dive
return false if hasActiveAbility?([:OVERCOAT, :SANDFORCE, :SANDRUSH, :SANDVEIL])
return false if hasActiveItem?(:SAFETYGOGGLES)
return true
end
@@ -545,8 +570,8 @@ class PokeBattle_Battler
def takesHailDamage?
return false if !takesIndirectDamage?
return false if pbHasType?(:ICE)
return false if inTwoTurnAttack?("0CA","0CB") # Dig, Dive
return false if hasActiveAbility?([:OVERCOAT,:ICEBODY,:SNOWCLOAK])
return false if inTwoTurnAttack?("0CA", "0CB") # Dig, Dive
return false if hasActiveAbility?([:OVERCOAT, :ICEBODY, :SNOWCLOAK])
return false if hasActiveItem?(:SAFETYGOGGLES)
return true
end
@@ -557,10 +582,10 @@ class PokeBattle_Battler
return true
end
def affectedByPowder?(showMsg=false)
def affectedByPowder?(showMsg = false)
return false if fainted?
if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
@battle.pbDisplay(_INTL("{1} is unaffected!", pbThis)) if showMsg
return false
end
if Settings::MECHANICS_GENERATION >= 6
@@ -568,9 +593,9 @@ class PokeBattle_Battler
if showMsg
@battle.pbShowAbilitySplash(self)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
@battle.pbDisplay(_INTL("{1} is unaffected!", pbThis))
else
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", pbThis, abilityName))
end
@battle.pbHideAbilitySplash(self)
end
@@ -578,7 +603,7 @@ class PokeBattle_Battler
end
if hasActiveItem?(:SAFETYGOGGLES)
if showMsg
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,itemName))
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!", pbThis, itemName))
end
return false
end
@@ -587,50 +612,50 @@ class PokeBattle_Battler
end
def canHeal?
return false if fainted? || @hp>=@totalhp
return false if @effects[PBEffects::HealBlock]>0
return false if fainted? || @hp >= @totalhp
return false if @effects[PBEffects::HealBlock] > 0
return true
end
def affectedByContactEffect?(showMsg=false)
def affectedByContactEffect?(showMsg = false)
return false if fainted?
if hasActiveItem?(:PROTECTIVEPADS)
@battle.pbDisplay(_INTL("{1} protected itself with the {2}!",pbThis,itemName)) if showMsg
@battle.pbDisplay(_INTL("{1} protected itself with the {2}!", pbThis, itemName)) if showMsg
return false
end
return true
end
def movedThisRound?
return @lastRoundMoved && @lastRoundMoved==@battle.turnCount
return @lastRoundMoved && @lastRoundMoved == @battle.turnCount
end
def usingMultiTurnAttack?
return true if @effects[PBEffects::TwoTurnAttack]
return true if @effects[PBEffects::HyperBeam]>0
return true if @effects[PBEffects::Rollout]>0
return true if @effects[PBEffects::Outrage]>0
return true if @effects[PBEffects::Uproar]>0
return true if @effects[PBEffects::Bide]>0
return true if @effects[PBEffects::HyperBeam] > 0
return true if @effects[PBEffects::Rollout] > 0
return true if @effects[PBEffects::Outrage] > 0
return true if @effects[PBEffects::Uproar] > 0
return true if @effects[PBEffects::Bide] > 0
return false
end
def inTwoTurnAttack?(*arg)
return false if !@effects[PBEffects::TwoTurnAttack]
ttaFunction = GameData::Move.get(@effects[PBEffects::TwoTurnAttack]).function_code
arg.each { |a| return true if a==ttaFunction }
arg.each { |a| return true if a == ttaFunction }
return false
end
def semiInvulnerable?
return inTwoTurnAttack?("0C9","0CA","0CB","0CC","0CD","0CE","14D")
return inTwoTurnAttack?("0C9", "0CA", "0CB", "0CC", "0CD", "0CE", "14D")
end
def pbEncoredMoveIndex
return -1 if @effects[PBEffects::Encore]==0 || !@effects[PBEffects::EncoreMove]
return -1 if @effects[PBEffects::Encore] == 0 || !@effects[PBEffects::EncoreMove]
ret = -1
eachMoveWithIndex do |m,i|
next if m.id!=@effects[PBEffects::EncoreMove]
eachMoveWithIndex do |m, i|
next if m.id != @effects[PBEffects::EncoreMove]
ret = i
break
end
@@ -638,42 +663,42 @@ class PokeBattle_Battler
end
def initialItem
return @battle.initialItems[@index&1][@pokemonIndex]
return @battle.initialItems[@index & 1][@pokemonIndex]
end
def setInitialItem(newItem)
@battle.initialItems[@index&1][@pokemonIndex] = newItem
@battle.initialItems[@index & 1][@pokemonIndex] = newItem
end
def recycleItem
return @battle.recycleItems[@index&1][@pokemonIndex]
return @battle.recycleItems[@index & 1][@pokemonIndex]
end
def setRecycleItem(newItem)
@battle.recycleItems[@index&1][@pokemonIndex] = newItem
@battle.recycleItems[@index & 1][@pokemonIndex] = newItem
end
def belched?
return @battle.belch[@index&1][@pokemonIndex]
return @battle.belch[@index & 1][@pokemonIndex]
end
def setBelched
@battle.belch[@index&1][@pokemonIndex] = true
@battle.belch[@index & 1][@pokemonIndex] = true
end
#=============================================================================
# Methods relating to this battler's position on the battlefield
#=============================================================================
# Returns whether the given position belongs to the opposing Pokémon's side.
def opposes?(i=0)
def opposes?(i = 0)
i = i.index if i.respond_to?("index")
return (@index&1)!=(i&1)
return (@index & 1) != (i & 1)
end
# Returns whether the given position/battler is near to self.
def near?(i)
i = i.index if i.respond_to?("index")
return @battle.nearBattlers?(@index,i)
return @battle.nearBattlers?(@index, i)
end
# Returns whether self is owned by the player.
@@ -684,13 +709,13 @@ class PokeBattle_Battler
# Returns 0 if self is on the player's side, or 1 if self is on the opposing
# side.
def idxOwnSide
return @index&1
return @index & 1
end
# Returns 1 if self is on the player's side, or 0 if self is on the opposing
# side.
def idxOpposingSide
return (@index&1)^1
return (@index & 1) ^ 1
end
# Returns the data structure for this battler's side.
@@ -706,7 +731,7 @@ class PokeBattle_Battler
# Yields each unfainted ally Pokémon.
def eachAlly
@battle.battlers.each do |b|
yield b if b && !b.fainted? && !b.opposes?(@index) && b.index!=@index
yield b if b && !b.fainted? && !b.opposes?(@index) && b.index != @index
end
end
@@ -717,7 +742,7 @@ class PokeBattle_Battler
# Returns the battler that is most directly opposite to self. unfaintedOnly is
# whether it should prefer to return a non-fainted battler.
def pbDirectOpposing(unfaintedOnly=false)
def pbDirectOpposing(unfaintedOnly = false)
@battle.pbGetOpposingIndicesInOrder(@index).each do |i|
next if !@battle.battlers[i]
break if unfaintedOnly && @battle.battlers[i].fainted?
@@ -728,6 +753,49 @@ class PokeBattle_Battler
@battle.pbGetOpposingIndicesInOrder(@index).each do |i|
return @battle.battlers[i] if @battle.battlers[i]
end
return @battle.battlers[(@index^1)]
return @battle.battlers[(@index ^ 1)]
end
#Changes the form VISUALLY in battles. The species is changed in the equivalent method in Pokemon class
def checkHPRelatedFormChange(new_hp)
if @ability_id == :SHIELDSDOWN
if @pokemon.isFusionOf(:MINIOR_M)
if new_hp <= (@totalhp / 2)
changeBattlerForm(:MINIOR_M, :MINIOR_C,nil, :SHELLSMASH)
@battle.pbDisplay(_INTL("{1} changed to the Core Form!", pbThis))
end
end
if @pokemon.isFusionOf(:MINIOR_C)
if new_hp > (@totalhp / 2)
changeBattlerForm(:MINIOR_C, :MINIOR_M,nil, :SHELLSMASH)
@battle.pbDisplay(_INTL("{1} changed to the Meteor Form!", pbThis))
end
end
end
end
def changeBattlerForm(oldForm, newForm,commonAnimation=nil,moveAnimation=nil)
@pokemon.changeFormSpecies(oldForm, newForm)
if moveAnimation
changeFormSpeciesMoveAnimation(oldForm, newForm,moveAnimation)
else
changeFormSpeciesCommonAnimation(oldForm, newForm, commonAnimation)
end
end
#These methods only play the animation and change the graphics.
# To also change the species, call changeFormSpecies() instead
def changeFormSpeciesCommonAnimation(oldForm, newForm, animation = "UltraBurst2")
@battle.scene.pbChangePokemon(self, @pokemon)
@battle.scene.pbCommonAnimation(animation, self)
@battle.scene.pbRefreshOne(@index)
end
def changeFormSpeciesMoveAnimation(oldForm, newForm, moveID=:REFRESH)
@battle.scene.pbChangePokemon(self, @pokemon)
@battle.scene.pbAnimation(moveID, self,self)
@battle.scene.pbRefreshOne(@index)
end
end

View File

@@ -595,8 +595,8 @@ class PokeBattle_Battler
end
end
def ensure_form_has_sprite(pokemon,spriteform_body,spriteform_head)
GameData::Species.sprite_filename(pokemon.dexNum, spriteform_body,spriteform_head)
def ensure_form_has_sprite(pokemon)
GameData::Species.sprite_filename(pokemon.dexNum)
end
@@ -624,6 +624,7 @@ class PokeBattle_Battler
#For meloetta form change
def changeFormSpecies(oldForm, newForm,animation = "UltraBurst2")
@pokemon.changeFormSpecies(oldForm,newForm)
playChangeFormAnimation(animation)
@@ -651,10 +652,10 @@ class PokeBattle_Battler
spriteform_body = newForm if @pokemon.hasBodyOf?(formChangingSpecies)
spriteform_head = newForm if @pokemon.hasHeadOf?(formChangingSpecies)
ensure_form_has_sprite(@pokemon,spriteform_body,spriteform_head)
#ensure_form_has_sprite(@pokemon)
if self.isFusion?
current_form_has_custom = customSpriteExists(@pokemon.species)
current_form_has_custom = customSpriteExistsSpecies(@pokemon.species)
new_form_has_custom = customSpriteExistsForm(@pokemon.species, spriteform_head, spriteform_body)
should_change_sprite = (current_form_has_custom && new_form_has_custom) || !current_form_has_custom
else

View File

@@ -111,7 +111,7 @@ class PokeBattle_Battler
# Pokémon may be disobedient; calculate if it is
badgeLevel = 10 * (@battle.pbPlayer.badge_count + 1)
badgeLevel = GameData::GrowthRate.max_level if @battle.pbPlayer.badge_count >= 8
if @pokemon.foreign?(@battle.pbPlayer) && @level>badgeLevel
if (@pokemon.foreign?(@battle.pbPlayer) && @level>badgeLevel) || @pokemon.force_disobey
a = ((@level+badgeLevel)*@battle.pbRandom(256)/256).floor
disobedient |= (a>=badgeLevel)
end

View File

@@ -1753,7 +1753,7 @@ class PokeBattle_Move_060 < PokeBattle_Move
end
if !checkedTerrain
case @battle.environment
when :Grass, :TallGrass
when :Grass, :TallGrass, :Grass_alt1,:Grass_alt2,:Grass_alt3,
@newType = :GRASS
when :MovingWater, :StillWater, :Puddle, :Underwater
@newType = :WATER

View File

@@ -1659,7 +1659,8 @@ class PokeBattle_Move_0B6 < PokeBattle_Move
:TECHNOBLAST, # Genesect (Gen 5)
:THOUSANDARROWS, # Zygarde (Gen 6)
:THOUSANDWAVES, # Zygarde (Gen 6)
:VCREATE # Victini (Gen 5)
:VCREATE, # Victini (Gen 5)
:FAKEMOVE #not a real move
]
end

View File

@@ -2086,9 +2086,7 @@ end
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
pokemon.changeFormSpecies(:U_NECROZMA,:NECROZMA) if pokemon.isFusionOf(:U_NECROZMA)
end
}

View File

@@ -222,6 +222,9 @@ module PokeBattle_BattleCommon
else
catch_rate /= 10
end
# First half of the shakes calculation
a = battler.totalhp
b = battler.hp
@@ -238,8 +241,12 @@ module PokeBattle_BattleCommon
return 4 if x >= 255 || BallHandlers.isUnconditional?(ball, self, battler)
# Second half of the shakes calculation
y = (65536 / ((255.0 / x) ** 0.1875)).floor
#Increased chances of catching if is on last ball
isOnLastBall = !$PokemonBag.pbHasItem?(ball)
echoln isOnLastBall
# Critical capture check
if Settings::ENABLE_CRITICAL_CAPTURES
if isOnLastBall
c = 0
numOwned = $Trainer.pokedex.owned_count
if numOwned > 600;
@@ -248,11 +255,14 @@ module PokeBattle_BattleCommon
c = x * 4 / 12
elsif numOwned > 300;
c = x * 3 / 12
elsif numOwned > 150;
else
c = x * 2 / 12
elsif numOwned > 30;
c = x / 12
end
# 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
@criticalCapture = true

View File

@@ -282,7 +282,7 @@ class PokeBattle_Battle
pbStartBattleSendOut(sendOuts)
# Weather announcement
weather_data = GameData::BattleWeather.try_get(@field.weather)
echoln @field.weather
echoln "Current weather: #{@field.weather}"
pbCommonAnimation(weather_data.animation) if weather_data
case @field.weather

View File

@@ -183,7 +183,7 @@ BattleHandlers::StatusImmunityAbilityNonIgnorable.add(:COMATOSE,
BattleHandlers::StatusImmunityAbilityNonIgnorable.add(:SHIELDSDOWN,
proc { |ability,battler,status|
next true if battler.isSpecies?(:MINIOR) && battler.form<7
next true if battler.isFusionOf(:MINIOR_C) && battler.form<7
}
)

View File

@@ -110,7 +110,7 @@ class PokemonDataBox < SpriteWrapper
@expBar.bitmap = @expBarBitmap.bitmap
@sprites["expBar"] = @expBar
# Create sprite wrapper that displays everything except the above
@contents = BitmapWrapper.new(@databoxBitmap.width,@databoxBitmap.height)
@contents = BitmapWrapper.new(@databoxBitmap.width+14,@databoxBitmap.height)
self.bitmap = @contents
self.visible = false
self.z = 150+((@battler.index)/2)*5
@@ -274,11 +274,51 @@ class PokemonDataBox < SpriteWrapper
imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,56,
0,(s-1)*STATUS_ICON_HEIGHT,-1,STATUS_ICON_HEIGHT])
end
#Draw type icons (foe Pokémon only)
if @battler.opposes?(0) && $PokemonSystem.type_icons
drawEnemyTypeIcons(imagePos)
end
pbDrawImagePositions(self.bitmap,imagePos)
refreshHP
refreshExp
end
def drawEnemyTypeIcons(imagePos)
type1_number = GameData::Type.get(@battler.type1).id_number
type2_number = GameData::Type.get(@battler.type2).id_number
echoln type1_number
vertical_margin = 2
iconHeight=19
type_icons_x_position = @spriteBaseX + 210
type1_icon_y_position = 16
type2_icon_y_position = type1_icon_y_position+vertical_margin+iconHeight
type1_y_offset = type1_number*iconHeight
type2_y_offset = type2_number*iconHeight
x_offset=0
types_icon_path = "Graphics/Pictures/Battle/typesSmall"
if type1_number == type2_number
imagePos.push([types_icon_path,type_icons_x_position,type1_icon_y_position,
x_offset,type1_y_offset,-1,iconHeight])
else
imagePos.push([types_icon_path,type_icons_x_position,
type1_icon_y_position,
x_offset,
type1_y_offset,-1,iconHeight]
)
imagePos.push([types_icon_path,type_icons_x_position,type2_icon_y_position,
x_offset,
type2_y_offset,-1,iconHeight])
end
end
def refreshHP
@hpNumbers.bitmap.clear
return if !@battler.pokemon

View File

@@ -174,7 +174,9 @@ class PokeBattle_Scene
y = 410
sprite = IconSprite.new(x,y,@viewport)
sprite.setBitmapDirectly(generate_front_trainer_sprite_bitmap())
allowEasterEggPokeball = pbInSafari? #Never allow except in Safari Zone - add more conditions if needed
sprite.setBitmapDirectly(generate_front_trainer_sprite_bitmap(allowEasterEggPokeball))
sprite.zoom_x=2
sprite.zoom_y=2
sprite.z=100 + idxTrainer
@@ -211,6 +213,9 @@ class PokeBattle_Scene
spriteX, spriteY = PokeBattle_SceneConstants.pbTrainerPosition(1, idxTrainer, numTrainers)
trainer = pbAddSprite("trainer_#{idxTrainer + 1}", spriteX, spriteY, trainerFile, @viewport)
spriteOverrideBitmap = setTrainerSpriteOverrides(trainerType)
trainer.bitmap = spriteOverrideBitmap if spriteOverrideBitmap
return if !trainer.bitmap
# Alter position of sprite
trainer.z = 7 + idxTrainer
@@ -218,6 +223,12 @@ class PokeBattle_Scene
trainer.oy = trainer.bitmap.height
end
def setTrainerSpriteOverrides(trainer_type)
if TYPE_EXPERTS_APPEARANCES.keys.include?(trainer_type)
return generate_front_trainer_sprite_bitmap_from_appearance(TYPE_EXPERTS_APPEARANCES[trainer_type]).bitmap
end
end
def pbCreatePokemonSprite(idxBattler)
sideSize = @battle.pbSideSize(idxBattler)
batSprite = PokemonBattlerSprite.new(@viewport, sideSize, idxBattler, @animations)