mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
added Belch to consideration for some function codes and fixed a typo (#199)
* added Belch to consideration for some AI function codes and fixed a typo
This commit is contained in:
@@ -1092,7 +1092,7 @@ class Battle::AI
|
|||||||
:KEEBERRY => :DEFENSE,
|
:KEEBERRY => :DEFENSE,
|
||||||
:MARANGABERRY => :SPECIAL_DEFENSE
|
:MARANGABERRY => :SPECIAL_DEFENSE
|
||||||
}[item]
|
}[item]
|
||||||
ret += 8 if stat && ai.stat_raise_worthwhile?(battler, stat)
|
ret += 8 if stat && stat_raise_worthwhile?(battler, stat)
|
||||||
ret = ret * 3 / 2 if GameData::Item.get(item).is_berry? && battler.has_active_ability?(:RIPEN)
|
ret = ret * 3 / 2 if GameData::Item.get(item).is_berry? && battler.has_active_ability?(:RIPEN)
|
||||||
when :STARFBERRY
|
when :STARFBERRY
|
||||||
# Random stat raise
|
# Random stat raise
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ Battle::AI::Handlers::MoveEffectScore.add("UserConsumeBerryRaiseDefense2",
|
|||||||
user.has_move_with_function?("RestoreUserConsumedItem")
|
user.has_move_with_function?("RestoreUserConsumedItem")
|
||||||
# Prefer if user couldn't normally consume the berry
|
# Prefer if user couldn't normally consume the berry
|
||||||
score += 4 if !user.battler.canConsumeBerry?
|
score += 4 if !user.battler.canConsumeBerry?
|
||||||
|
# Prefer if user will become able to use Belch
|
||||||
|
score += 4 if !user.battler.belched? && user.has_move_with_function?("FailsIfUserNotConsumedBerry")
|
||||||
end
|
end
|
||||||
next score
|
next score
|
||||||
}
|
}
|
||||||
@@ -229,6 +231,10 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("AllBattlersConsumeBerry"
|
|||||||
target.has_move_with_function?("RestoreUserConsumedItem")
|
target.has_move_with_function?("RestoreUserConsumedItem")
|
||||||
# Prefer if target couldn't normally consume the berry
|
# Prefer if target couldn't normally consume the berry
|
||||||
score_change += 4 if !target.battler.canConsumeBerry?
|
score_change += 4 if !target.battler.canConsumeBerry?
|
||||||
|
# Prefer if target will become able to use Belch
|
||||||
|
ai.each_same_side_battler(user.side) do |b, i|
|
||||||
|
score += 4 if !b.battler.belched? && b.has_move_with_function?("FailsIfUserNotConsumedBerry")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
score += (target.opposes?(user)) ? -score_change : score_change
|
score += (target.opposes?(user)) ? -score_change : score_change
|
||||||
next score
|
next score
|
||||||
|
|||||||
Reference in New Issue
Block a user