Added Gen 9 forms code, evolution code, some item effects

This commit is contained in:
Maruno17
2024-06-08 19:35:45 +01:00
parent 6c3d9e77ad
commit 5e23984765
26 changed files with 678 additions and 495 deletions

View File

@@ -297,10 +297,8 @@ class Battle::Move
@battle.pbDisplay(_INTL("The substitute took damage for {1}!", target.pbThis(true)))
end
if target.damageState.critical
if $game_temp.party_critical_hits_dealt &&
$game_temp.party_critical_hits_dealt[user.pokemonIndex] &&
user.pbOwnedByPlayer?
$game_temp.party_critical_hits_dealt[user.pokemonIndex] += 1
if user.pokemon.isSpecies?(:FARFETCHD) && user.pokemon.form == 1
user.pokemon.evolution_counter += 1
end
if target.damageState.affection_critical
if numTargets > 1
@@ -396,10 +394,8 @@ class Battle::Move
target.tookMoveDamageThisRound = true if damage > 0 && !target.damageState.substitute # For Focus Punch
target.tookDamageThisRound = true if damage > 0 # For Assurance
target.lastAttacker.push(user.index) # For Revenge
if $game_temp.party_direct_damage_taken &&
$game_temp.party_direct_damage_taken[target.pokemonIndex] &&
target.pbOwnedByPlayer?
$game_temp.party_direct_damage_taken[target.pokemonIndex] += damage
if target.pokemon.isSpecies?(:YAMASK) && target.pokemon.form == 1
target.pokemon.evolution_counter += damage
end
end
end

View File

@@ -424,6 +424,9 @@ class Battle::Move::RecoilMove < Battle::Move
return if user.hasActiveAbility?(:ROCKHEAD)
amt = pbRecoilDamage(user, target)
amt = 1 if amt < 1
if user.pokemon.isSpecies?(:BASCULIN) && [2, 3].include?(user.pokemon.form)
user.pokemon.evolution_counter += amt
end
user.pbReduceHP(amt, false)
@battle.pbDisplay(_INTL("{1} is damaged by recoil!", user.pbThis))
user.pbItemHPHealCheck

View File

@@ -847,7 +847,8 @@ class Battle::Move::RemoveScreens < Battle::Move
end
#===============================================================================
# User is protected against moves with the "B" flag this round. (Detect, Protect)
# User is protected against moves with the "CanProtect" flag this round.
# (Detect, Protect)
#===============================================================================
class Battle::Move::ProtectUser < Battle::Move::ProtectMove
def initialize(battle, move)
@@ -857,8 +858,8 @@ class Battle::Move::ProtectUser < Battle::Move::ProtectMove
end
#===============================================================================
# User is protected against moves with the "B" flag this round. If a Pokémon
# makes contact with the user while this effect applies, that Pokémon is
# User is protected against moves with the "CanProtect" flag this round. If a
# Pokémon makes contact with the user while this effect applies, that Pokémon is
# poisoned. (Baneful Bunker)
#===============================================================================
class Battle::Move::ProtectUserBanefulBunker < Battle::Move::ProtectMove