mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Resolved all remaining TODO comments for AI (except testing), fixed effects of moves that can end the battle
This commit is contained in:
@@ -387,7 +387,7 @@ class Battle::Battler
|
||||
#=============================================================================
|
||||
# Item effects
|
||||
#=============================================================================
|
||||
def pbConfusionBerry(item_to_use, forced, flavor, confuse_msg)
|
||||
def pbConfusionBerry(item_to_use, forced, confuse_stat, confuse_msg)
|
||||
return false if !forced && !canHeal?
|
||||
return false if !forced && !canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7)
|
||||
used_item_name = GameData::Item.get(item_to_use).name
|
||||
@@ -415,12 +415,9 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("{1} restored its health using its {2}!", pbThis, used_item_name))
|
||||
end
|
||||
end
|
||||
flavor_stat = [:ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE][flavor]
|
||||
self.nature.stat_changes.each do |change|
|
||||
next if change[1] > 0 || change[0] != flavor_stat
|
||||
if self.nature.stat_changes.any? { |val| val[0] == confuse_stat && val[1] < 0 }
|
||||
@battle.pbDisplay(confuse_msg)
|
||||
pbConfuse if pbCanConfuseSelf?(false)
|
||||
break
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user