Fixed typo in egg generatio, fixed typo in battle code that changes a Pokémon's type, fixed bug in AI that prevents switching

This commit is contained in:
Maruno17
2021-05-15 20:28:15 +01:00
parent f303b84033
commit 66b40fd181
3 changed files with 5 additions and 5 deletions

View File

@@ -118,7 +118,7 @@ class PokeBattle_Battler
@type2 = (newTypes.length == 1) ? newTypes[0] : newTypes[1] @type2 = (newTypes.length == 1) ? newTypes[0] : newTypes[1]
@effects[PBEffects::Type3] = newType3 @effects[PBEffects::Type3] = newType3
else else
newType = GameData::Item.get(newType).id newType = GameData::Type.get(newType).id
@type1 = newType @type1 = newType
@type2 = newType @type2 = newType
@effects[PBEffects::Type3] = nil @effects[PBEffects::Type3] = nil

View File

@@ -10,7 +10,7 @@ class PokeBattle_AI
return false if @battle.wildBattle? return false if @battle.wildBattle?
shouldSwitch = forceSwitch shouldSwitch = forceSwitch
batonPass = -1 batonPass = -1
moveType = -1 moveType = nil
skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler).skill_level || 0 skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler).skill_level || 0
battler = @battle.battlers[idxBattler] battler = @battle.battlers[idxBattler]
# If Pokémon is within 6 levels of the foe, and foe's last move was # If Pokémon is within 6 levels of the foe, and foe's last move was
@@ -107,7 +107,7 @@ class PokeBattle_AI
end end
end end
# moveType is the type of the target's last used move # moveType is the type of the target's last used move
if moveType>=0 && Effectiveness.ineffective?(pbCalcTypeMod(moveType,battler,battler)) if moveType && Effectiveness.ineffective?(pbCalcTypeMod(moveType,battler,battler))
weight = 65 weight = 65
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true)) typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
if Effectiveness.super_effective?(typeMod) if Effectiveness.super_effective?(typeMod)
@@ -115,7 +115,7 @@ class PokeBattle_AI
weight = 85 weight = 85
end end
list.unshift(i) if pbAIRandom(100)<weight # Put this Pokemon first list.unshift(i) if pbAIRandom(100)<weight # Put this Pokemon first
elsif moveType>=0 && Effectiveness.resistant?(pbCalcTypeMod(moveType,battler,battler)) elsif moveType && Effectiveness.resistant?(pbCalcTypeMod(moveType,battler,battler))
weight = 40 weight = 40
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true)) typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
if Effectiveness.super_effective?(typeMod) if Effectiveness.super_effective?(typeMod)

View File

@@ -172,7 +172,7 @@ def pbDayCareGenerateEgg
babyspecies = (ditto1) ? father.species : mother.species babyspecies = (ditto1) ? father.species : mother.species
end end
# Determine the egg's species # Determine the egg's species
babyspecies = GameData::Species.get(babyspecies).get_bably_species(true, mother.item_id, father.item_id) babyspecies = GameData::Species.get(babyspecies).get_baby_species(true, mother.item_id, father.item_id)
case babyspecies case babyspecies
when :MANAPHY when :MANAPHY
babyspecies = :PHIONE if GameData::Species.exists?(:PHIONE) babyspecies = :PHIONE if GameData::Species.exists?(:PHIONE)