mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
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:
@@ -118,7 +118,7 @@ class PokeBattle_Battler
|
||||
@type2 = (newTypes.length == 1) ? newTypes[0] : newTypes[1]
|
||||
@effects[PBEffects::Type3] = newType3
|
||||
else
|
||||
newType = GameData::Item.get(newType).id
|
||||
newType = GameData::Type.get(newType).id
|
||||
@type1 = newType
|
||||
@type2 = newType
|
||||
@effects[PBEffects::Type3] = nil
|
||||
|
||||
@@ -10,7 +10,7 @@ class PokeBattle_AI
|
||||
return false if @battle.wildBattle?
|
||||
shouldSwitch = forceSwitch
|
||||
batonPass = -1
|
||||
moveType = -1
|
||||
moveType = nil
|
||||
skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler).skill_level || 0
|
||||
battler = @battle.battlers[idxBattler]
|
||||
# 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
|
||||
# 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
|
||||
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
|
||||
if Effectiveness.super_effective?(typeMod)
|
||||
@@ -115,7 +115,7 @@ class PokeBattle_AI
|
||||
weight = 85
|
||||
end
|
||||
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
|
||||
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
|
||||
if Effectiveness.super_effective?(typeMod)
|
||||
|
||||
@@ -172,7 +172,7 @@ def pbDayCareGenerateEgg
|
||||
babyspecies = (ditto1) ? father.species : mother.species
|
||||
end
|
||||
# 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
|
||||
when :MANAPHY
|
||||
babyspecies = :PHIONE if GameData::Species.exists?(:PHIONE)
|
||||
|
||||
Reference in New Issue
Block a user