mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added egg move sharing in Day Care, added some Settings for Day Care/Nursery mechanics, Neutralizing Gas now triggers held items if it negates Unnerve, Imposter now only triggers when the Pokémon enters battle
This commit is contained in:
@@ -40,6 +40,13 @@ module Settings
|
||||
HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED = (MECHANICS_GENERATION >= 8)
|
||||
# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
|
||||
POKERUS_CHANCE = 3
|
||||
# Whether Pokémon in the Day Care gain Exp for each step the player takes.
|
||||
# This is true for the Day Care and false for the Pokémon Nursery, both of
|
||||
# which use the same code in Essentials.
|
||||
DAY_CARE_POKEMON_GAIN_EXP_FROM_WALKING = (MECHANICS_GENERATION <= 6)
|
||||
# Whether two Pokémon in the Day Care can learn egg moves from each other if
|
||||
# they are the same species.
|
||||
DAY_CARE_POKEMON_CAN_SHARE_EGG_MOVES = (MECHANICS_GENERATION >= 8)
|
||||
# Whether a bred baby Pokémon can inherit any TM/TR/HM moves from its father.
|
||||
# It can never inherit TM/TR/HM moves from its mother.
|
||||
BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5)
|
||||
|
||||
@@ -295,6 +295,15 @@ module GameData
|
||||
return other_family.include?(@id)
|
||||
end
|
||||
|
||||
# If this species doesn't have egg moves, looks at prevolutions one at a
|
||||
# time and returns theirs instead.
|
||||
def get_egg_moves
|
||||
return @egg_moves if !@egg_moves.empty?
|
||||
prevo = get_previous_species
|
||||
return GameData::Species.get_species_form(prevo, @form).get_egg_moves if prevo != @species
|
||||
return @egg_moves
|
||||
end
|
||||
|
||||
def family_evolutions_have_method?(check_method, check_param = nil)
|
||||
sp = self.get_baby_species
|
||||
evos = GameData::Species.get(sp).get_family_evolutions
|
||||
|
||||
@@ -353,7 +353,7 @@ class Battle
|
||||
b.pbContinualAbilityChecks(true)
|
||||
# Abilities that trigger upon switching in
|
||||
if (!b.fainted? && b.unstoppableAbility?) || b.abilityActive?
|
||||
Battle::AbilityEffects.triggerOnSwitchIn(b.ability, b, self)
|
||||
Battle::AbilityEffects.triggerOnSwitchIn(b.ability, b, self, true)
|
||||
end
|
||||
pbEndPrimordialWeather # Checking this again just in case
|
||||
# Items that trigger upon switching in (Air Balloon message)
|
||||
|
||||
@@ -261,8 +261,8 @@ module Battle::AbilityEffects
|
||||
return trigger(TrappingByTarget, ability, switcher, bearer, battle)
|
||||
end
|
||||
|
||||
def self.triggerOnSwitchIn(ability, battler, battle)
|
||||
OnSwitchIn.trigger(ability, battler, battle)
|
||||
def self.triggerOnSwitchIn(ability, battler, battle, switch_in = false)
|
||||
OnSwitchIn.trigger(ability, battler, battle, switch_in)
|
||||
end
|
||||
|
||||
def self.triggerOnSwitchOut(ability, battler, end_of_battle)
|
||||
@@ -2574,7 +2574,7 @@ Battle::AbilityEffects::TrappingByTarget.add(:SHADOWTAG,
|
||||
#===============================================================================
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:AIRLOCK,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} has {2}!",battler.pbThis,battler.abilityName))
|
||||
@@ -2587,7 +2587,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:AIRLOCK,
|
||||
Battle::AbilityEffects::OnSwitchIn.copy(:AIRLOCK, :CLOUDNINE)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:ANTICIPATION,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if !battler.pbOwnedByPlayer?
|
||||
battlerTypes = battler.pbTypes(true)
|
||||
types = battlerTypes
|
||||
@@ -2621,7 +2621,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:ANTICIPATION,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:ASONECHILLINGNEIGH,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} has two Abilities!", battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2636,7 +2636,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:ASONECHILLINGNEIGH,
|
||||
Battle::AbilityEffects::OnSwitchIn.copy(:ASONECHILLINGNEIGH, :ASONEGRIMNEIGH)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:AURABREAK,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} reversed all other Pokémon's auras!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2644,7 +2644,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:AURABREAK,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:COMATOSE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is drowsing!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2652,7 +2652,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:COMATOSE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:CURIOUSMEDICINE,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battler.allAllies.none? { |b| b.hasAlteredStatStages? }
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battler.allAllies.each do |b|
|
||||
@@ -2670,7 +2670,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:CURIOUSMEDICINE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DARKAURA,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is radiating a dark aura!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2678,25 +2678,25 @@ Battle::AbilityEffects::OnSwitchIn.add(:DARKAURA,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DAUNTLESSSHIELD,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battler.pbRaiseStatStageByAbility(:ATTACK, 1, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DELTASTREAM,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:StrongWinds, battler, true)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DESOLATELAND,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:HarshSun, battler, true)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DOWNLOAD,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
oDef = oSpDef = 0
|
||||
battle.allOtherSideBattlers(battler.index).each do |b|
|
||||
oDef += b.defense
|
||||
@@ -2708,19 +2708,19 @@ Battle::AbilityEffects::OnSwitchIn.add(:DOWNLOAD,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DRIZZLE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:Rain, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:DROUGHT,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:Sun, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:ELECTRICSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battle.field.terrain == :Electric
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler, :Electric)
|
||||
@@ -2729,7 +2729,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:ELECTRICSURGE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:FAIRYAURA,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is radiating a fairy aura!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2737,7 +2737,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:FAIRYAURA,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:FOREWARN,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if !battler.pbOwnedByPlayer?
|
||||
highestPower = 0
|
||||
forewarnMoves = []
|
||||
@@ -2789,7 +2789,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:FOREWARN,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:FRISK,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if !battler.pbOwnedByPlayer?
|
||||
foes = battle.allOtherSideBattlers(battler.index).select { |b| b.item }
|
||||
if foes.length>0
|
||||
@@ -2810,7 +2810,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:FRISK,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:GRASSYSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battle.field.terrain == :Grassy
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler, :Grassy)
|
||||
@@ -2819,7 +2819,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:GRASSYSURGE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:ICEFACE,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if !battler.isSpecies?(:EISCUE) || battler.form != 1
|
||||
next if battler.effectiveWeather != :Hail
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
@@ -2832,8 +2832,8 @@ Battle::AbilityEffects::OnSwitchIn.add(:ICEFACE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:IMPOSTER,
|
||||
proc { |ability,battler,battle|
|
||||
next if battler.effects[PBEffects::Transform]
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if !switch_in || battler.effects[PBEffects::Transform]
|
||||
choice = battler.pbDirectOpposing
|
||||
next if choice.fainted?
|
||||
next if choice.effects[PBEffects::Transform] ||
|
||||
@@ -2850,7 +2850,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:IMPOSTER,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:INTIMIDATE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.allOtherSideBattlers(battler.index).each do |b|
|
||||
next if !b.near?(battler)
|
||||
@@ -2869,20 +2869,20 @@ Battle::AbilityEffects::OnSwitchIn.add(:INTIMIDATE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:INTREPIDSWORD,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battler.pbRaiseStatStageByAbility(:ATTACK, 1, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:MIMICRY,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battle.field.terrain == :None
|
||||
Battle::AbilityEffects.triggerOnTerrainChange(ability, battler, battle, false)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:MISTYSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battle.field.terrain == :Misty
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler, :Misty)
|
||||
@@ -2891,7 +2891,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:MISTYSURGE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:MOLDBREAKER,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} breaks the mold!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2899,7 +2899,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:MOLDBREAKER,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:NEUTRALIZINGGAS,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler, true)
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("Neutralizing gas filled the area!"))
|
||||
@@ -2922,11 +2922,18 @@ Battle::AbilityEffects::OnSwitchIn.add(:NEUTRALIZINGGAS,
|
||||
end
|
||||
end
|
||||
end
|
||||
# Trigger items upon Unnerve being negated
|
||||
battler.ability_id = nil # Allows checking if Unnerve was active before
|
||||
had_unnerve = battle.pbCheckGlobalAbility(:UNNERVE)
|
||||
battler.ability_id = :NEUTRALIZINGGAS
|
||||
if had_unnerve && !battle.pbCheckGlobalAbility(:UNNERVE)
|
||||
battle.allBattlers.each { |b| b.pbItemsOnUnnerveEnding }
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:PASTELVEIL,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battler.allAllies.none? { |b| b.status == :POISON }
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battler.allAllies.each do |b|
|
||||
@@ -2942,7 +2949,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:PASTELVEIL,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:PRESSURE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is exerting its pressure!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -2950,13 +2957,13 @@ Battle::AbilityEffects::OnSwitchIn.add(:PRESSURE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:PRIMORDIALSEA,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:HeavyRain, battler, true)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:PSYCHICSURGE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battle.field.terrain == :Psychic
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbStartTerrain(battler, :Psychic)
|
||||
@@ -2965,13 +2972,13 @@ Battle::AbilityEffects::OnSwitchIn.add(:PSYCHICSURGE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:SANDSTREAM,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:Sandstorm, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:SCREENCLEANER,
|
||||
proc { |ability, battler, battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if target.pbOwnSide.effects[PBEffects::AuroraVeil] == 0 &&
|
||||
target.pbOwnSide.effects[PBEffects::LightScreen] == 0 &&
|
||||
target.pbOwnSide.effects[PBEffects::Reflect] == 0 &&
|
||||
@@ -3008,7 +3015,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:SCREENCLEANER,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:SLOWSTART,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battler.effects[PBEffects::SlowStart] = 5
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -3022,13 +3029,13 @@ Battle::AbilityEffects::OnSwitchIn.add(:SLOWSTART,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:SNOWWARNING,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbStartWeatherAbility(:Hail, battler)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:TERAVOLT,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is radiating a bursting aura!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -3036,7 +3043,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:TERAVOLT,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:TURBOBLAZE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is radiating a blazing aura!",battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
@@ -3044,7 +3051,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:TURBOBLAZE,
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:UNNERVE,
|
||||
proc { |ability,battler,battle|
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battle.pbDisplay(_INTL("{1} is too nervous to eat Berries!",battler.pbOpposingTeam))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
#===============================================================================
|
||||
# NOTE: In Gen 7+, the Day Care is replaced by the Pokémon Nursery, which works
|
||||
# in much the same way except deposited Pokémon no longer gain Exp because
|
||||
# of the player walking around and, in Gen 8+, deposited Pokémon are able
|
||||
# to learn egg moves from each other if they are the same species. In
|
||||
# Essentials, this code can be used for both facilities, and these
|
||||
# mechanics differences are set by some Settings.
|
||||
# NOTE: The Day Care has a different price than the Pokémon Nursery. For the Day
|
||||
# Care, you are charged when you withdraw a deposited Pokémon and you pay
|
||||
# an amount based on how many levels it gained. For the Nursery, you pay
|
||||
# $500 up-front when you deposit a Pokémon. This difference will appear in
|
||||
# the Day Care Lady's event, not in these scripts.
|
||||
#===============================================================================
|
||||
class DayCare
|
||||
#=============================================================================
|
||||
# Code that generates an egg based on two given Pokémon.
|
||||
@@ -307,6 +320,7 @@ class DayCare
|
||||
attr_accessor :egg_generated
|
||||
attr_accessor :step_counter
|
||||
attr_accessor :gain_exp
|
||||
attr_accessor :share_egg_moves # For deposited Pokémon of the same species
|
||||
|
||||
MAX_SLOTS = 2
|
||||
|
||||
@@ -314,7 +328,8 @@ class DayCare
|
||||
@slots = []
|
||||
MAX_SLOTS.times { @slots.push(DayCareSlot.new) }
|
||||
reset_egg_counters
|
||||
@gain_exp = true
|
||||
@gain_exp = Settings::DAY_CARE_POKEMON_GAIN_EXP_FROM_WALKING
|
||||
@share_egg_moves = Settings::DAY_CARE_POKEMON_CAN_SHARE_EGG_MOVES
|
||||
end
|
||||
|
||||
def [](index)
|
||||
@@ -340,17 +355,46 @@ class DayCare
|
||||
return EggGenerator.generate(pkmn1, pkmn2)
|
||||
end
|
||||
|
||||
def share_egg_move
|
||||
return if count != 2
|
||||
pkmn1, pkmn2 = pokemon_pair
|
||||
return if pkmn1.species != pkmn2.species
|
||||
egg_moves1 = pkmn1.species_data.get_egg_moves
|
||||
egg_moves2 = pkmn2.species_data.get_egg_moves
|
||||
known_moves1 = []
|
||||
known_moves2 = []
|
||||
if pkmn2.numMoves < Pokemon::MAX_MOVES
|
||||
pkmn1.moves.each { |m| known_moves1.push(m.id) if egg_moves2.include?(m.id) && !pkmn2.hasMove?(m.id) }
|
||||
end
|
||||
if pkmn1.numMoves < Pokemon::MAX_MOVES
|
||||
pkmn2.moves.each { |m| known_moves2.push(m.id) if egg_moves1.include?(m.id) && !pkmn1.hasMove?(m.id) }
|
||||
end
|
||||
if !known_moves1.empty?
|
||||
if !known_moves2.empty?
|
||||
learner = [[pkmn1, known_moves2[0]], [pkmn2, known_moves1[0]]].sample
|
||||
learner[0].learn_move(learner[1])
|
||||
else
|
||||
pkmn2.learn_move(known_moves1[0])
|
||||
end
|
||||
elsif !known_moves2.empty?
|
||||
pkmn1.learn_move(known_moves2[0])
|
||||
end
|
||||
end
|
||||
|
||||
def update_on_step_taken
|
||||
# Make an egg available at the Day Care
|
||||
@step_counter += 1
|
||||
if @step_counter >= 256
|
||||
@step_counter = 0
|
||||
# Make an egg available at the Day Care
|
||||
if !@egg_generated && count == 2
|
||||
compat = compatibility
|
||||
egg_chance = [0, 20, 50, 70][compat]
|
||||
egg_chance = [0, 40, 80, 88][compat] if $bag.has?(:OVALCHARM)
|
||||
@egg_generated = true if rand(100) < egg_chance
|
||||
end
|
||||
# Have one deposited Pokémon learn an egg move from the other
|
||||
# NOTE: I don't know what the chance of this happening is.
|
||||
share_egg_move if @share_egg_moves && rand(100) < 50
|
||||
end
|
||||
# Day Care Pokémon gain Exp/moves
|
||||
if @gain_exp
|
||||
|
||||
@@ -5,15 +5,9 @@
|
||||
#===============================================================================
|
||||
|
||||
Other notes:
|
||||
- If a battle ends because of Rocky Helmet damage, the side that the Rocky
|
||||
Helmet holder is on should lose (Gen 7+) or win (Gen 6-).
|
||||
- If Neutralizing Gas switches in and negates Unnerve, should it cause an
|
||||
immediate triggering of held berries? Probably.
|
||||
- Emergency Exit/Wimp Out should NOT trigger if the bearer gained that ability
|
||||
part-way through the move's usage (i.e. via Wandering Spirit swapping
|
||||
abilities).
|
||||
- Imposter should only trigger upon being sent in, and not by any re-triggering
|
||||
of switch-in abilities.
|
||||
- The messages for a held item boosting stats are slightly different to what
|
||||
they currently are:
|
||||
"The Weakness Policy sharply raised {1}'s Attack!"
|
||||
@@ -25,17 +19,6 @@ Other notes:
|
||||
its Pokédex entry. Have a way to force adding it to the party for plot
|
||||
purposes (battle rule?).
|
||||
|
||||
- If two Pokémon of the same species are in the Day Care, and one knows an egg
|
||||
move(s) the other doesn't, and the other has an empty move slot(s), the other
|
||||
will learn the egg move(s) from the one after a time. Egg moves are checked in
|
||||
the order they're known by the one Pokémon. No egg moves are learned if the
|
||||
other Pokémon doesn't have an empty move slot. Volt Tackle cannot be learned
|
||||
this way. Gender is irrelevant. This is a feature of a Pokémon Nursery, which
|
||||
is like the Day Care but is only for breeding and the deposited Pokémon don't
|
||||
gain Exp (the fee is $500 per Pokémon up-front). The time it takes to do this
|
||||
is apparently the same as egg generation (e.g. a chance every 255 steps), but
|
||||
the parents don't need to be able to breed in order to learn egg moves.
|
||||
|
||||
#===============================================================================
|
||||
# Low priority or ignorable
|
||||
#===============================================================================
|
||||
@@ -73,6 +56,11 @@ Some abilities have changed effects:
|
||||
but in earlier Gens they are. Ignoring as this would be far too complicated to
|
||||
care about.
|
||||
|
||||
If a Battle Facility battle ends because of Rocky Helmet damage, the side that
|
||||
the Rocky Helmet holder is on should lose (Gen 7+) or win (Gen 6-). In other
|
||||
words, a decision should be reached as soon as main attack damage is dealt and
|
||||
before additional effects (in Gen 7+).
|
||||
|
||||
#===============================================================================
|
||||
# Implemented
|
||||
#===============================================================================
|
||||
@@ -167,6 +155,10 @@ Other changes:
|
||||
use. No reasonable game would have multiple sets of Pokémon to fuse at once,
|
||||
so allowing just one of each fusion at a time is probably fine.
|
||||
- Zygarde Cube now changes a Zygarde's form/ability.
|
||||
- If Neutralizing Gas switches in and negates Unnerve, should it cause an
|
||||
immediate triggering of held berries? Yes.
|
||||
- Imposter should only trigger upon being sent in, and not by any re-triggering
|
||||
of switch-in abilities.
|
||||
|
||||
What happens to the PP of Iron Head when turned into/from Behemoth Blade/Bash
|
||||
for Zacian/Zamazenta? It gets decreased to the total PP if it is higher than the
|
||||
@@ -199,4 +191,15 @@ apply above 179 happiness. Pokémon Camp will not be added. Affection effects an
|
||||
the 179 soft cap/160 evolution threshold may be added (the latter two should be
|
||||
treated as related rather than separate settings).
|
||||
|
||||
If two Pokémon of the same species are in the Day Care, and one knows an egg
|
||||
move(s) the other doesn't, and the other has an empty move slot(s), the other
|
||||
will learn the egg move(s) from the one after a time. Egg moves are checked in
|
||||
the order they're known by the one Pokémon. No egg moves are learned if the
|
||||
other Pokémon doesn't have an empty move slot. Volt Tackle cannot be learned
|
||||
this way. Gender is irrelevant. This is a feature of a Pokémon Nursery, which
|
||||
is like the Day Care but is only for breeding and the deposited Pokémon don't
|
||||
gain Exp (the fee is $500 per Pokémon up-front). The time it takes to do this
|
||||
is apparently the same as egg generation (e.g. a chance every 255 steps), but
|
||||
the parents don't need to be able to breed in order to learn egg moves.
|
||||
|
||||
=end
|
||||
|
||||
Reference in New Issue
Block a user