mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
More AI bug fixes, more work on testing AI
This commit is contained in:
@@ -22,6 +22,17 @@ class Battle::AI
|
||||
# against it.
|
||||
def pbGetMoveScores
|
||||
choices = []
|
||||
|
||||
# TODO: Delete this after testing AI.
|
||||
if $tested_abilities && @user.ability_id
|
||||
$tested_abilities[@user.ability_id] ||= 0
|
||||
$tested_abilities[@user.ability_id] += 1
|
||||
end
|
||||
if $tested_items && @user.item_id
|
||||
$tested_items[@user.item_id] ||= 0
|
||||
$tested_items[@user.item_id] += 1
|
||||
end
|
||||
|
||||
@user.battler.eachMoveWithIndex do |orig_move, idxMove|
|
||||
|
||||
# TODO: Delete this after testing AI.
|
||||
|
||||
@@ -456,7 +456,7 @@ Battle::AI::Handlers::ItemRanking.add(:BLACKSLUDGE,
|
||||
Battle::AI::Handlers::ItemRanking.add(:CHESTOBERRY,
|
||||
proc { |item, score, battler, ai|
|
||||
if ai.trainer.high_skill?
|
||||
score += 1 if battler.has_move_with_function("HealUserFullyAndFallAsleep")
|
||||
score += 1 if battler.has_move_with_function?("HealUserFullyAndFallAsleep")
|
||||
end
|
||||
next score
|
||||
}
|
||||
@@ -784,7 +784,7 @@ Battle::AI::Handlers::ItemRanking.add(:TOXICORB,
|
||||
Battle::AI::Handlers::ItemRanking.add(:WHITEHERB,
|
||||
proc { |item, score, battler, ai|
|
||||
if ai.trainer.high_skill?
|
||||
score += 1 if battler.has_move_with_function("LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2")
|
||||
score += 1 if battler.has_move_with_function?("LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2")
|
||||
end
|
||||
next score
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ class Battle::AI::AIMove
|
||||
if user.item_active?
|
||||
if user.item == :ZOOMLENS
|
||||
if rough_priority(user) <= 0
|
||||
mods[:accuracy_multiplier] *= 1.2 if target.faster_than?(user)
|
||||
modifiers[:accuracy_multiplier] *= 1.2 if target.faster_than?(user)
|
||||
end
|
||||
else
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(
|
||||
|
||||
@@ -147,7 +147,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DestroyTargetBerryOrGem"
|
||||
#===============================================================================
|
||||
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("CorrodeTargetItem",
|
||||
proc { |move, user, target, ai, battle|
|
||||
next true if !target.item || target.unlosableItem?(target.item) ||
|
||||
next true if !target.item || target.battler.unlosableItem?(target.item) ||
|
||||
target.effects[PBEffects::Substitute] > 0
|
||||
next true if target.has_active_ability?(:STICKYHOLD)
|
||||
next true if battle.corrosiveGas[target.index % 2][target.party_index]
|
||||
|
||||
Reference in New Issue
Block a user