Added more Gen 8 code

This commit is contained in:
Maruno17
2021-07-13 20:52:26 +01:00
parent 8b7a532e29
commit 78f5530cbe
25 changed files with 199 additions and 97 deletions

View File

@@ -42,6 +42,7 @@ class PokeBattle_Battler
attr_accessor :tookPhysicalHit
attr_accessor :statsRaised # Boolean for whether self's stat(s) raised this round
attr_accessor :statsLowered # Boolean for whether self's stat(s) lowered this round
attr_accessor :canRestoreIceFace # Whether Hail started in the round
attr_accessor :damageState
attr_accessor :initialHP # Set at the start of each move's usage
@@ -361,6 +362,7 @@ class PokeBattle_Battler
:DISGUISE,
# :FLOWERGIFT, # This can be stopped
# :FORECAST, # This can be stopped
:ICEFACE,
:MULTITYPE,
:POWERCONSTRUCT,
:SCHOOLING,
@@ -385,6 +387,7 @@ class PokeBattle_Battler
:DISGUISE,
:FLOWERGIFT,
:FORECAST,
:ICEFACE,
:MULTITYPE,
:POWERCONSTRUCT,
:SCHOOLING,

View File

@@ -152,6 +152,7 @@ class PokeBattle_Battler
@tookPhysicalHit = false
@statsRaised = false
@statsLowered = false
@canRestoreIceFace = false
@lastMoveUsed = nil
@lastMoveUsedType = nil
@lastRegularMoveUsed = nil

View File

@@ -163,7 +163,7 @@ class PokeBattle_Battler
end
end
def pbCheckFormOnWeatherChange
def pbCheckFormOnWeatherChange(ability_changed = false)
return if fainted? || @effects[PBEffects::Transform]
# Castform - Forecast
if isSpecies?(:CASTFORM)
@@ -197,6 +197,11 @@ class PokeBattle_Battler
pbChangeForm(0,_INTL("{1} transformed!",pbThis))
end
end
# Eiscue - Ice Face
if !ability_changed && isSpecies?(:EISCUE) && self.ability = :ICEFACE &&
@form == 1 && @battle.pbWeather == :Hail
@canRestoreIceFace = true # Changed form at end of round
end
end
# Checks the Pokémon's form and updates it if necessary. Used for when a
@@ -261,6 +266,12 @@ class PokeBattle_Battler
pbChangeForm(newForm,_INTL("{1} transformed into its Complete Forme!",pbThis))
end
end
# Morpeko - Hunger Switch
if isSpecies?(:MORPEKO) && hasActiveAbility?(:HUNGERSWITCH) && endOfRound
# Intentionally doesn't show the ability splash or a message
newForm = (@form + 1) % 2
pbChangeForm(newForm, nil)
end
end
def pbTransform(target)

View File

@@ -116,7 +116,7 @@ class PokeBattle_Battler
@effects[PBEffects::GastroAcid] = false if unstoppableAbility?
@effects[PBEffects::SlowStart] = 0 if self.ability != :SLOWSTART
# Revert form if Flower Gift/Forecast was lost
pbCheckFormOnWeatherChange
pbCheckFormOnWeatherChange(true)
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
end

View File

@@ -47,6 +47,10 @@ class PokeBattle_Battler
if !pbAddTarget(targets,user,targetBattler,move,true,true)
pbAddTarget(targets,user,user,move,true,true)
end
when :AllAllies
@battle.eachSameSideBattler(user.index) do |b|
pbAddTarget(targets,user,b,move,false,true) if b.index != user.index
end
when :UserAndAllies
pbAddTarget(targets,user,user,move,true,true)
@battle.eachSameSideBattler(user.index) { |b| pbAddTarget(targets,user,b,move,false,true) }
@@ -93,6 +97,7 @@ class PokeBattle_Battler
return targets if @battle.switching # For Pursuit interrupting a switch
return targets if move.cannotRedirect? || move.targetsPosition?
return targets if !target_data.can_target_one_foe? || targets.length != 1
return targets if user.hasActiveAbility?([:PROPELLERTAIL, :STALWART])
priority = @battle.pbPriority(true)
nearOnly = !target_data.can_choose_distant_target?
# Spotlight (takes priority over Follow Me/Rage Powder/Lightning Rod/Storm Drain)