Added evolution method for Galarian Yamask, minor refactoring in battle code, a Pokémon's ability no longer needs resetting when changing its ability_index

This commit is contained in:
Maruno17
2021-11-07 18:05:32 +00:00
parent ae7721316f
commit 34ab0b8afe
24 changed files with 109 additions and 52 deletions

View File

@@ -263,9 +263,6 @@ GameData::Evolution.register({
GameData::Evolution.register({ GameData::Evolution.register({
:id => :Shedinja, :id => :Shedinja,
:parameter => Integer, :parameter => Integer,
:level_up_proc => proc { |pkmn, parameter|
next false # This is a dummy proc and shouldn't next true
},
:after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species| :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species|
next false if $player.party_full? next false if $player.party_full?
next false if !$bag.has?(:POKEBALL) next false if !$bag.has?(:POKEBALL)
@@ -697,3 +694,19 @@ GameData::Evolution.register({
next true next true
} }
}) })
GameData::Evolution.register({
:id => :EventAfterDamageTaken,
:parameter => Integer,
:after_battle_proc => proc { |pkmn, party_index, parameter|
if $game_temp.party_direct_damage_taken &&
$game_temp.party_direct_damage_taken[party_index] &&
$game_temp.party_direct_damage_taken[party_index] >= parameter
pkmn.ready_to_evolve = true
end
next false
},
:event_proc => proc { |pkmn, parameter, value|
next pkmn.ready_to_evolve
}
})

View File

@@ -706,6 +706,10 @@ class PokeBattle_Battler
return @battle.pbOwnedByPlayer?(@index) return @battle.pbOwnedByPlayer?(@index)
end end
def wild?
return @battle.wildBattle? && opposes?
end
# Returns 0 if self is on the player's side, or 1 if self is on the opposing # Returns 0 if self is on the player's side, or 1 if self is on the opposing
# side. # side.
def idxOwnSide def idxOwnSide

View File

@@ -86,6 +86,7 @@ class PokeBattle_Battler
# Do other things # Do other things
@battle.pbClearChoice(@index) # Reset choice @battle.pbClearChoice(@index) # Reset choice
pbOwnSide.effects[PBEffects::LastRoundFainted] = @battle.turnCount pbOwnSide.effects[PBEffects::LastRoundFainted] = @battle.turnCount
$game_temp.party_direct_damage_taken[@pokemonIndex] = 0 if pbOwnedByPlayer?
# Check other battlers' abilities that trigger upon a battler fainting # Check other battlers' abilities that trigger upon a battler fainting
pbAbilitiesOnFainting pbAbilitiesOnFainting
# Check for end of primordial weather # Check for end of primordial weather

View File

@@ -5,7 +5,7 @@ class PokeBattle_Battler
def pbProcessTurn(choice,tryFlee=true) def pbProcessTurn(choice,tryFlee=true)
return false if fainted? return false if fainted?
# Wild roaming Pokémon always flee if possible # Wild roaming Pokémon always flee if possible
if tryFlee && @battle.wildBattle? && opposes? && if tryFlee && wild? &&
@battle.rules["alwaysflee"] && @battle.pbCanRun?(@index) @battle.rules["alwaysflee"] && @battle.pbCanRun?(@index)
pbBeginTurn(choice) pbBeginTurn(choice)
pbSEPlay("Battle flee") pbSEPlay("Battle flee")

View File

@@ -382,5 +382,6 @@ class PokeBattle_Move
target.lastHPLostFromFoe = damage # For Metal Burst target.lastHPLostFromFoe = damage # For Metal Burst
target.lastFoeAttacker.push(user.index) # For Metal Burst target.lastFoeAttacker.push(user.index) # For Metal Burst
end end
$game_temp.party_direct_damage_taken[target.pokemonIndex] += damage if target.pbOwnedByPlayer?
end end
end end

View File

@@ -9,7 +9,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_DoesNothingCongratuations < PokeBattle_Move class PokeBattle_Move_DoesNothingCongratuations < PokeBattle_Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
if @battle.wildBattle? && user.opposes? if user.wild?
@battle.pbDisplay(_INTL("Congratulations from {1}!",user.pbThis(true))) @battle.pbDisplay(_INTL("Congratulations from {1}!",user.pbThis(true)))
else else
@battle.pbDisplay(_INTL("Congratulations, {1}!",@battle.pbGetOwnerName(user.index))) @battle.pbDisplay(_INTL("Congratulations, {1}!",@battle.pbGetOwnerName(user.index)))

View File

@@ -4,7 +4,7 @@
#=============================================================================== #===============================================================================
class PokeBattle_Move_UserTakesTargetItem < PokeBattle_Move class PokeBattle_Move_UserTakesTargetItem < PokeBattle_Move
def pbEffectAfterAllHits(user,target) def pbEffectAfterAllHits(user,target)
return if @battle.wildBattle? && user.opposes? # Wild Pokémon can't thieve return if user.wild? # Wild Pokémon can't thieve
return if user.fainted? return if user.fainted?
return if target.damageState.unaffected || target.damageState.substitute return if target.damageState.unaffected || target.damageState.substitute
return if !target.item || user.item return if !target.item || user.item
@@ -14,8 +14,7 @@ class PokeBattle_Move_UserTakesTargetItem < PokeBattle_Move
itemName = target.itemName itemName = target.itemName
user.item = target.item user.item = target.item
# Permanently steal the item from wild Pokémon # Permanently steal the item from wild Pokémon
if @battle.wildBattle? && target.opposes? && !user.initialItem && if target.wild? && !user.initialItem && target.item == target.initialItem
target.item == target.initialItem
user.setInitialItem(target.item) user.setInitialItem(target.item)
target.pbRemoveItem target.pbRemoveItem
else else
@@ -56,8 +55,7 @@ class PokeBattle_Move_TargetTakesUserItem < PokeBattle_Move
itemName = user.itemName itemName = user.itemName
target.item = user.item target.item = user.item
# Permanently steal the item from wild Pokémon # Permanently steal the item from wild Pokémon
if @battle.wildBattle? && user.opposes? && !target.initialItem && if user.wild? && !target.initialItem && user.item == user.initialItem
user.item == user.initialItem
target.setInitialItem(user.item) target.setInitialItem(user.item)
user.pbRemoveItem user.pbRemoveItem
else else
@@ -74,7 +72,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_UserTargetSwapItems < PokeBattle_Move class PokeBattle_Move_UserTargetSwapItems < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if @battle.wildBattle? && user.opposes? if user.wild?
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -121,8 +119,7 @@ class PokeBattle_Move_UserTargetSwapItems < PokeBattle_Move
target.effects[PBEffects::ChoiceBand] = nil if !target.hasActiveAbility?(:GORILLATACTICS) target.effects[PBEffects::ChoiceBand] = nil if !target.hasActiveAbility?(:GORILLATACTICS)
target.effects[PBEffects::Unburden] = (!target.item && oldTargetItem) if target.hasActiveAbility?(:UNBURDEN) target.effects[PBEffects::Unburden] = (!target.item && oldTargetItem) if target.hasActiveAbility?(:UNBURDEN)
# Permanently steal the item from wild Pokémon # Permanently steal the item from wild Pokémon
if @battle.wildBattle? && target.opposes? && !user.initialItem && if target.wild? && !user.initialItem && oldTargetItem == target.initialItem
oldTargetItem == target.initialItem
user.setInitialItem(oldTargetItem) user.setInitialItem(oldTargetItem)
end end
@battle.pbDisplay(_INTL("{1} switched items with its opponent!",user.pbThis)) @battle.pbDisplay(_INTL("{1} switched items with its opponent!",user.pbThis))
@@ -180,7 +177,7 @@ class PokeBattle_Move_RemoveTargetItem < PokeBattle_Move
end end
def pbEffectAfterAllHits(user,target) def pbEffectAfterAllHits(user,target)
return if @battle.wildBattle? && user.opposes? # Wild Pokémon can't knock off return if user.wild? # Wild Pokémon can't knock off
return if user.fainted? return if user.fainted?
return if target.damageState.unaffected || target.damageState.substitute return if target.damageState.unaffected || target.damageState.substitute
return if !target.item || target.unlosableItem?(target.item) return if !target.item || target.unlosableItem?(target.item)

View File

@@ -22,7 +22,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_SwitchOutUserStatusMove < PokeBattle_Move class PokeBattle_Move_SwitchOutUserStatusMove < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if @battle.wildBattle? && user.opposes? if user.wild?
if !@battle.pbCanRun?(user.index) if !@battle.pbCanRun?(user.index)
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
@@ -35,7 +35,7 @@ class PokeBattle_Move_SwitchOutUserStatusMove < PokeBattle_Move
end end
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers) def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
return if @battle.wildBattle? && user.opposes? return if user.wild?
@battle.pbDisplay(_INTL("{1} went back to {2}!",user.pbThis, @battle.pbDisplay(_INTL("{1} went back to {2}!",user.pbThis,
@battle.pbGetOwnerName(user.index))) @battle.pbGetOwnerName(user.index)))
@battle.pbPursuit(user.index) @battle.pbPursuit(user.index)
@@ -50,7 +50,7 @@ class PokeBattle_Move_SwitchOutUserStatusMove < PokeBattle_Move
end end
def pbEffectGeneral(user) def pbEffectGeneral(user)
if @battle.wildBattle? && user.opposes? if user.wild?
@battle.pbDisplay(_INTL("{1} fled from battle!",user.pbThis)) @battle.pbDisplay(_INTL("{1} fled from battle!",user.pbThis))
@battle.decision = 3 # Escaped @battle.decision = 3 # Escaped
end end

View File

@@ -232,7 +232,8 @@ class PokeBattle_Battle
def pbGetOwnerFromBattlerIndex(idxBattler) def pbGetOwnerFromBattlerIndex(idxBattler)
idxTrainer = pbGetOwnerIndexFromBattlerIndex(idxBattler) idxTrainer = pbGetOwnerIndexFromBattlerIndex(idxBattler)
return (opposes?(idxBattler)) ? @opponent[idxTrainer] : @player[idxTrainer] trainer = (opposes?(idxBattler)) ? @opponent : @player
return (trainer.nil?) ? nil : trainer[idxTrainer]
end end
def pbGetOwnerIndexFromPartyIndex(idxBattler,idxParty) def pbGetOwnerIndexFromPartyIndex(idxBattler,idxParty)
@@ -248,7 +249,8 @@ class PokeBattle_Battle
# switch another trainer's Pokémon. # switch another trainer's Pokémon.
def pbGetOwnerFromPartyIndex(idxBattler,idxParty) def pbGetOwnerFromPartyIndex(idxBattler,idxParty)
idxTrainer = pbGetOwnerIndexFromPartyIndex(idxBattler,idxParty) idxTrainer = pbGetOwnerIndexFromPartyIndex(idxBattler,idxParty)
return (opposes?(idxBattler)) ? @opponent[idxTrainer] : @player[idxTrainer] trainer = (opposes?(idxBattler)) ? @opponent : @player
return (trainer.nil?) ? nil : trainer[idxTrainer]
end end
def pbGetOwnerName(idxBattler) def pbGetOwnerName(idxBattler)

View File

@@ -156,7 +156,7 @@ class PokeBattle_Battle
idxBattler = b.index idxBattler = b.index
next if !pbCanChooseNonActive?(idxBattler) next if !pbCanChooseNonActive?(idxBattler)
if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in
next if wildBattle? && opposes?(idxBattler) # Wild Pokémon can't switch next if b.wild? # Wild Pokémon can't switch
idxPartyNew = pbSwitchInBetween(idxBattler) idxPartyNew = pbSwitchInBetween(idxBattler)
opponent = pbGetOwnerFromBattlerIndex(idxBattler) opponent = pbGetOwnerFromBattlerIndex(idxBattler)
# NOTE: The player is only offered the chance to switch their own # NOTE: The player is only offered the chance to switch their own

View File

@@ -83,7 +83,7 @@ class PokeBattle_Battle
def pbCanMegaEvolve?(idxBattler) def pbCanMegaEvolve?(idxBattler)
return false if $game_switches[Settings::NO_MEGA_EVOLUTION] return false if $game_switches[Settings::NO_MEGA_EVOLUTION]
return false if !@battlers[idxBattler].hasMega? return false if !@battlers[idxBattler].hasMega?
return false if wildBattle? && opposes?(idxBattler) return false if @battlers[idxBattler].wild?
return true if $DEBUG && Input.press?(Input::CTRL) return true if $DEBUG && Input.press?(Input::CTRL)
return false if @battlers[idxBattler].effects[PBEffects::SkyDrop]>=0 return false if @battlers[idxBattler].effects[PBEffects::SkyDrop]>=0
return false if !pbHasMegaRing?(idxBattler) return false if !pbHasMegaRing?(idxBattler)

View File

@@ -33,7 +33,7 @@ class PokeBattle_Battle
next if b.effects[PBEffects::SkyDrop]>=0 next if b.effects[PBEffects::SkyDrop]>=0
next if b.hasActiveAbility?(:TRUANT) && b.effects[PBEffects::Truant] next if b.hasActiveAbility?(:TRUANT) && b.effects[PBEffects::Truant]
# Mega Evolve # Mega Evolve
if !wildBattle? || !b.opposes? if !b.wild?
owner = pbGetOwnerIndexFromBattlerIndex(b.index) owner = pbGetOwnerIndexFromBattlerIndex(b.index)
pbMegaEvolve(b.index) if @megaEvolution[b.idxOwnSide][owner]==b.index pbMegaEvolve(b.index) if @megaEvolution[b.idxOwnSide][owner]==b.index
end end
@@ -93,7 +93,7 @@ class PokeBattle_Battle
def pbAttackPhaseMegaEvolution def pbAttackPhaseMegaEvolution
pbPriority.each do |b| pbPriority.each do |b|
next if wildBattle? && b.opposes? next if b.wild?
next unless @choices[b.index][0]==:UseMove && !b.fainted? next unless @choices[b.index][0]==:UseMove && !b.fainted?
owner = pbGetOwnerIndexFromBattlerIndex(b.index) owner = pbGetOwnerIndexFromBattlerIndex(b.index)
next if @megaEvolution[b.idxOwnSide][owner]!=b.index next if @megaEvolution[b.idxOwnSide][owner]!=b.index

View File

@@ -1842,7 +1842,7 @@ BattleHandlers::UserAbilityEndOfMove.add(:MAGICIAN,
next if battle.futureSight next if battle.futureSight
next if !move.pbDamagingMove? next if !move.pbDamagingMove?
next if user.item next if user.item
next if battle.wildBattle? && user.opposes? next if user.wild?
targets.each do |b| targets.each do |b|
next if b.damageState.unaffected || b.damageState.substitute next if b.damageState.unaffected || b.damageState.substitute
next if !b.item next if !b.item
@@ -1919,7 +1919,7 @@ BattleHandlers::TargetAbilityAfterMoveUse.add(:PICKPOCKET,
# NOTE: According to Bulbapedia, this can still trigger to steal the user's # NOTE: According to Bulbapedia, this can still trigger to steal the user's
# item even if it was switched out by a Red Card. This doesn't make # item even if it was switched out by a Red Card. This doesn't make
# sense, so this code doesn't do it. # sense, so this code doesn't do it.
next if battle.wildBattle? && target.opposes? next if target.wild?
next if switched_battlers.include?(user.index) # User was switched out next if switched_battlers.include?(user.index) # User was switched out
next if !move.contactMove? next if !move.contactMove?
next if user.effects[PBEffects::Substitute]>0 || target.damageState.substitute next if user.effects[PBEffects::Substitute]>0 || target.damageState.substitute

View File

@@ -5,7 +5,7 @@ class PokeBattle_AI
#============================================================================= #=============================================================================
def pbChooseMoves(idxBattler) def pbChooseMoves(idxBattler)
user = @battle.battlers[idxBattler] user = @battle.battlers[idxBattler]
wildBattler = (@battle.wildBattle? && @battle.opposes?(idxBattler)) wildBattler = user.wild?
skill = 0 skill = 0
if !wildBattler if !wildBattler
skill = @battle.pbGetOwnerFromBattlerIndex(user.index).skill_level || 0 skill = @battle.pbGetOwnerFromBattlerIndex(user.index).skill_level || 0

View File

@@ -229,7 +229,7 @@ BattleHandlers::ItemOnStatDropped.add(:EJECTPACK,
next false if battler.effects[PBEffects::SkyDrop] >= 0 || next false if battler.effects[PBEffects::SkyDrop] >= 0 ||
battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSkyTargetCannotAct") # Sky Drop battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSkyTargetCannotAct") # Sky Drop
next false if battle.pbAllFainted?(battler.idxOpposingSide) next false if battle.pbAllFainted?(battler.idxOpposingSide)
next false if battle.wildBattle? && battler.opposes? # Wild Pokémon can't eject next false if battler.wild? # Wild Pokémon can't eject
next false if !battle.pbCanSwitch?(battler.index) # Battler can't switch out next false if !battle.pbCanSwitch?(battler.index) # Battler can't switch out
next false if !battle.pbCanChooseNonActive?(battler.index) # No Pokémon can switch in next false if !battle.pbCanChooseNonActive?(battler.index) # No Pokémon can switch in
battle.pbCommonAnimation("UseItem", battler) battle.pbCommonAnimation("UseItem", battler)

View File

@@ -27,7 +27,11 @@ class PokeBattle_RealBattlePeer
player.party[player.party.length] = pkmn player.party[player.party.length] = pkmn
return -1 return -1
end end
pkmn.heal if Settings::HEAL_STORED_POKEMON if Settings::HEAL_STORED_POKEMON
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
oldCurBox = pbCurrentBox oldCurBox = pbCurrentBox
storedBox = $PokemonStorage.pbStoreCaught(pkmn) storedBox = $PokemonStorage.pbStoreCaught(pkmn)
if storedBox<0 if storedBox<0

View File

@@ -15,6 +15,7 @@ class Game_Temp
attr_accessor :encounter_type attr_accessor :encounter_type
attr_accessor :party_levels_before_battle attr_accessor :party_levels_before_battle
attr_accessor :party_critical_hits_dealt attr_accessor :party_critical_hits_dealt
attr_accessor :party_direct_damage_taken
def battle_rules def battle_rules
@battle_rules = {} if !@battle_rules @battle_rules = {} if !@battle_rules
@@ -192,9 +193,11 @@ Events.onStartBattle += proc { |_sender|
# during battle and may need to evolve afterwards # during battle and may need to evolve afterwards
$game_temp.party_levels_before_battle = [] $game_temp.party_levels_before_battle = []
$game_temp.party_critical_hits_dealt = [] $game_temp.party_critical_hits_dealt = []
$game_temp.party_direct_damage_taken = []
$player.party.each_with_index do |pkmn, i| $player.party.each_with_index do |pkmn, i|
$game_temp.party_levels_before_battle[i] = pkmn.level $game_temp.party_levels_before_battle[i] = pkmn.level
$game_temp.party_critical_hits_dealt[i] = 0 $game_temp.party_critical_hits_dealt[i] = 0
$game_temp.party_direct_damage_taken[i] = 0
end end
} }

View File

@@ -190,7 +190,11 @@ class PokemonStorage
else # Copying into box else # Copying into box
pkmn = self[boxSrc,indexSrc] pkmn = self[boxSrc,indexSrc]
raise "Trying to copy nil to storage" if !pkmn raise "Trying to copy nil to storage" if !pkmn
pkmn.heal if Settings::HEAL_STORED_POKEMON if Settings::HEAL_STORED_POKEMON
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
self[boxDst,indexDst] = pkmn self[boxDst,indexDst] = pkmn
end end
return true return true
@@ -210,7 +214,11 @@ class PokemonStorage
def pbMoveCaughtToBox(pkmn,box) def pbMoveCaughtToBox(pkmn,box)
for i in 0...maxPokemon(box) for i in 0...maxPokemon(box)
if self[box,i]==nil if self[box,i]==nil
pkmn.heal if box >= 0 && Settings::HEAL_STORED_POKEMON if Settings::HEAL_STORED_POKEMON && box >= 0
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
self[box,i] = pkmn self[box,i] = pkmn
return true return true
end end
@@ -219,7 +227,11 @@ class PokemonStorage
end end
def pbStoreCaught(pkmn) def pbStoreCaught(pkmn)
pkmn.heal if Settings::HEAL_STORED_POKEMON if @currentBox >= 0 if Settings::HEAL_STORED_POKEMON && @currentBox >= 0
old_ready_evo = pkmn.ready_to_evolve
pkmn.heal
pkmn.ready_to_evolve = old_ready_evo
end
for i in 0...maxPokemon(@currentBox) for i in 0...maxPokemon(@currentBox)
if self[@currentBox,i]==nil if self[@currentBox,i]==nil
self[@currentBox,i] = pkmn self[@currentBox,i] = pkmn

View File

@@ -26,11 +26,6 @@ class Pokemon
# This Pokémon's shininess (true, false, nil). Is recalculated if made nil. # This Pokémon's shininess (true, false, nil). Is recalculated if made nil.
# @param value [Boolean, nil] whether this Pokémon is shiny # @param value [Boolean, nil] whether this Pokémon is shiny
attr_writer :shiny attr_writer :shiny
# The index of this Pokémon's ability (0, 1 are natural abilities, 2+ are
# hidden abilities)as defined for its species/form. An ability may not be
# defined at this index. Is recalculated (as 0 or 1) if made nil.
# @param value [Integer, nil] forced ability index (nil if none is set)
attr_writer :ability_index
# @return [Array<Pokemon::Move>] the moves known by this Pokémon # @return [Array<Pokemon::Move>] the moves known by this Pokémon
attr_accessor :moves attr_accessor :moves
# @return [Array<Symbol>] the IDs of moves known by this Pokémon when it was obtained # @return [Array<Symbol>] the IDs of moves known by this Pokémon when it was obtained
@@ -80,6 +75,9 @@ class Pokemon
attr_accessor :fused attr_accessor :fused
# @return [Integer] this Pokémon's personal ID # @return [Integer] this Pokémon's personal ID
attr_accessor :personalID attr_accessor :personalID
# Used by Galarian Yamask to remember that it took sufficient damage from a
# battle and can evolve.
attr_accessor :ready_to_evolve
# Max total IVs # Max total IVs
IV_STAT_LIMIT = 31 IV_STAT_LIMIT = 31
@@ -237,6 +235,7 @@ class Pokemon
def hp=(value) def hp=(value)
@hp = value.clamp(0, @totalhp) @hp = value.clamp(0, @totalhp)
heal_status if @hp == 0 heal_status if @hp == 0
@ready_to_evolve = false if @hp == 0
end end
# Sets this Pokémon's status. See {GameData::Status} for all possible status effects. # Sets this Pokémon's status. See {GameData::Status} for all possible status effects.
@@ -292,6 +291,7 @@ class Pokemon
heal_HP heal_HP
heal_status heal_status
heal_PP heal_PP
@ready_to_evolve = false
end end
#============================================================================= #=============================================================================
@@ -402,6 +402,7 @@ class Pokemon
return @super_shiny return @super_shiny
end end
# @param value [Boolean] whether this Pokémon is super shiny
def super_shiny=(value) def super_shiny=(value)
@super_shiny = value @super_shiny = value
@shiny = true if @super_shiny @shiny = true if @super_shiny
@@ -411,12 +412,21 @@ class Pokemon
# Ability # Ability
#============================================================================= #=============================================================================
# The index of this Pokémon's ability (0, 1 are natural abilities, 2+ are
# hidden abilities) as defined for its species/form. An ability may not be
# defined at this index. Is recalculated (as 0 or 1) if made nil.
# @return [Integer] the index of this Pokémon's ability # @return [Integer] the index of this Pokémon's ability
def ability_index def ability_index
@ability_index = (@personalID & 1) if !@ability_index @ability_index = (@personalID & 1) if !@ability_index
return @ability_index return @ability_index
end end
# @param value [Integer, nil] forced ability index (nil if none is set)
def ability_index=(value)
@ability_index = value
@ability = nil
end
# @return [GameData::Ability, nil] an Ability object corresponding to this Pokémon's ability # @return [GameData::Ability, nil] an Ability object corresponding to this Pokémon's ability
def ability def ability
return GameData::Ability.try_get(ability_id) return GameData::Ability.try_get(ability_id)

View File

@@ -587,6 +587,7 @@ class PokemonEvolutionScene
@pokemon.species = @newspecies @pokemon.species = @newspecies
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM) @pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
@pokemon.calc_stats @pokemon.calc_stats
@pokemon.ready_to_evolve = false
# See and own evolved species # See and own evolved species
$player.pokedex.register(@pokemon) $player.pokedex.register(@pokemon)
$player.pokedex.set_owned(@newspecies) $player.pokedex.set_owned(@newspecies)

View File

@@ -1727,7 +1727,11 @@ class PokemonStorageScreen
end end
if heldpoke || selected[0]==-1 if heldpoke || selected[0]==-1
p = (heldpoke) ? heldpoke : @storage[-1,index] p = (heldpoke) ? heldpoke : @storage[-1,index]
p.heal if Settings::HEAL_STORED_POKEMON if Settings::HEAL_STORED_POKEMON
old_ready_evo = p.ready_to_evolve
p.heal
p.ready_to_evolve = old_ready_evo
end
end end
@scene.pbStore(selected,heldpoke,destbox,firstfree) @scene.pbStore(selected,heldpoke,destbox,firstfree)
if heldpoke if heldpoke
@@ -1771,7 +1775,11 @@ class PokemonStorageScreen
pbDisplay("Please remove the mail.") pbDisplay("Please remove the mail.")
return return
end end
@heldpkmn.heal if Settings::HEAL_STORED_POKEMON if box >= 0 if Settings::HEAL_STORED_POKEMON && box >= 0
old_ready_evo = @heldpkmn.ready_to_evolve
@heldpkmn.heal
@heldpkmn.ready_to_evolve = old_ready_evo
end
@scene.pbPlace(selected,@heldpkmn) @scene.pbPlace(selected,@heldpkmn)
@storage[box,index] = @heldpkmn @storage[box,index] = @heldpkmn
if box==-1 if box==-1
@@ -1796,7 +1804,11 @@ class PokemonStorageScreen
pbDisplay("Please remove the mail.") pbDisplay("Please remove the mail.")
return false return false
end end
@heldpkmn.heal if Settings::HEAL_STORED_POKEMON if box >= 0 if Settings::HEAL_STORED_POKEMON && box >= 0
old_ready_evo = @heldpkmn.ready_to_evolve
@heldpkmn.heal
@heldpkmn.ready_to_evolve = old_ready_evo
end
@scene.pbSwap(selected,@heldpkmn) @scene.pbSwap(selected,@heldpkmn)
tmp = @storage[box,index] tmp = @storage[box,index]
@storage[box,index] = @heldpkmn @storage[box,index] = @heldpkmn

View File

@@ -20,17 +20,6 @@ Other notes:
"The Weakness Policy sharply raised {1}'s Sp. Atk!" "The Weakness Policy sharply raised {1}'s Sp. Atk!"
"The Weakness Policy was used up..." "The Weakness Policy was used up..."
New evolution methods:
- Milcery: spinning while holding an item. (Doesn't suit our control scheme.
We're not adding a way to easily spin on the spot just for this, cf.
not having to turn your computer upside-down to evolve Inkay.)
- Galarian Yamask: going to a particular spot after a battle in which it lost
49+ HP from a single attack and hasn't fainted since then;
healing doesn't affect this. (Utter nonsense, find a better
way - just evolve after a battle in which the damage was
taken.) Confirmed that the damage has to be dealt in a single
attack, not spread across multiple ones.
- Ask whether a captured Pokémon, or an added Pokémon, should be put in storage - Ask whether a captured Pokémon, or an added Pokémon, should be put in storage
or added to the party if the party is full. Also provide the option to look at or added to the party if the party is full. Also provide the option to look at
its Pokédex entry. Have a way to force adding it to the party for plot its Pokédex entry. Have a way to force adding it to the party for plot
@@ -58,6 +47,11 @@ toggled. (Probably don't bother implementing.)
Bicycle that can work on water. Bicycle that can work on water.
New evolution methods:
- Milcery: spinning while holding an item. (Doesn't suit our control scheme.
We're not adding a way to easily spin on the spot just for this, cf.
not having to turn your computer upside-down to evolve Inkay.)
I think there are some alternate forms which don't have a hidden ability while I think there are some alternate forms which don't have a hidden ability while
their base forms do. I don't think the compiler supports this, and instead their base forms do. I don't think the compiler supports this, and instead
treats Abilities and HiddenAbilities separately. Can work around this by setting treats Abilities and HiddenAbilities separately. Can work around this by setting
@@ -100,6 +94,9 @@ New evolution methods:
- Kubfu (triggered by an event; Kubfu's form can be set beforehand by the event, - Kubfu (triggered by an event; Kubfu's form can be set beforehand by the event,
so don't worry about the multiple forms it can evolve into) so don't worry about the multiple forms it can evolve into)
- Galarian Farfetch'd (performing 3 critical hits in a single battle) - Galarian Farfetch'd (performing 3 critical hits in a single battle)
- Galarian Yamask: going to a particular spot after a battle in which it lost
49+ HP in a single battle from direct attacks and hasn't
fainted since then; healing with Potions doesn't affect this.
Added AI for new moves/items/abilities. Added AI for new moves/items/abilities.

View File

@@ -1438,7 +1438,7 @@ TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQ
Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power.
Generation = 8 Generation = 8
Flags = InheritFormWithEverStone Flags = InheritFormWithEverStone
Evolutions = RUNERIGUS,Level,34 Evolutions = RUNERIGUS,EventAfterDamageTaken,49
#------------------------------- #-------------------------------
[DEERLING,1] [DEERLING,1]
FormName = Summer Form FormName = Summer Form

View File

@@ -1438,7 +1438,7 @@ TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQ
Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power.
Generation = 8 Generation = 8
Flags = InheritFormWithEverStone Flags = InheritFormWithEverStone
Evolutions = RUNERIGUS,Level,34 Evolutions = RUNERIGUS,EventAfterDamageTaken,49
#------------------------------- #-------------------------------
[DEERLING,1] [DEERLING,1]
FormName = Summer Form FormName = Summer Form