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

@@ -238,6 +238,9 @@ class Battle::Battler
# Record move as having been used
@lastMoveUsed = move.id
@lastMoveUsedType = move.calcType # For Conversion 2
if @pokemon.isSpecies?(:PRIMEAPE) && @lastMoveUsed == :RAGEFIST
@pokemon.evolution_counter += 1
end
if !specialUsage
@lastRegularMoveUsed = move.id # For Disable, Encore, Instruct, Mimic, Mirror Move, Sketch, Spite
@lastRegularMoveTarget = choice[3] # For Instruct (remembering original target is fine)
@@ -707,7 +710,13 @@ class Battle::Battler
move.pbEffectAgainstTarget(user, b)
end
move.pbEffectGeneral(user)
targets.each { |b| b.pbFaint if b&.fainted? }
targets.each do |b|
next if !b&.fainted?
b.pbFaint
if user.pokemon.isSpecies?(:BISHARP) && b.isSpecies?(:BISHARP) && b.item == :LEADERSCREST
user.pokemon.evolution_counter += 1
end
end
user.pbFaint if user.fainted?
# Additional effect
if !user.hasActiveAbility?(:SHEERFORCE)