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

@@ -153,6 +153,10 @@ module PokeBattle_BattleCommon
# Save the Pokémon for storage at the end of battle
@caughtPokemon.push(pkmn)
end
if numShakes != 4
@first_poke_ball = ball if !@poke_ball_failed
@poke_ball_failed = true
end
end
#=============================================================================

View File

@@ -79,6 +79,8 @@ class PokeBattle_Battle
attr_reader :successStates # Success states
attr_accessor :lastMoveUsed # Last move used
attr_accessor :lastMoveUser # Last move user
attr_accessor :first_poke_ball # ID of the first thrown Poké Ball that failed
attr_Accessor :poke_ball_failed # Set after first_poke_ball to prevent it being set again
attr_reader :switching # True if during the switching phase of the round
attr_reader :futureSight # True if Future Sight is hitting
attr_reader :endOfRound # True during the end of round

View File

@@ -110,6 +110,9 @@ class PokeBattle_Battle
return true if idxUser==idxTarget
return false if opposes?(idxUser,idxTarget)
return false if !nearBattlers?(idxUser,idxTarget)
when :AllAllies
return false if idxUser == idxTarget
return false if opposes?(idxUser, idxTarget)
when :UserAndAllies
return false if opposes?(idxUser,idxTarget)
when :NearFoe, :RandomNearFoe, :AllNearFoes

View File

@@ -593,7 +593,7 @@ class PokeBattle_Battle
BattleHandlers.triggerEOREffectAbility(b.ability,b,self) if b.abilityActive?
# Flame Orb, Sticky Barb, Toxic Orb
BattleHandlers.triggerEOREffectItem(b.item,b,self) if b.itemActive?
# Harvest, Pickup
# Harvest, Pickup, Ball Fetch
BattleHandlers.triggerEORGainItemAbility(b.ability,b,self) if b.abilityActive?
end
pbGainExp
@@ -650,6 +650,7 @@ class PokeBattle_Battle
b.tookPhysicalHit = false
b.statsRaised = false
b.statsLowered = false
b.canRestoreIceFace = false
b.lastRoundMoveFailed = b.lastMoveFailed
b.lastAttacker.clear
b.lastFoeAttacker.clear