mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
Rewrote various AI switching checks
This commit is contained in:
@@ -92,6 +92,7 @@ module Battle::AI::Handlers
|
||||
GeneralMoveScore = HandlerHash.new
|
||||
GeneralMoveAgainstTargetScore = HandlerHash.new
|
||||
ShouldSwitch = HandlerHash.new
|
||||
ShouldNotSwitch = HandlerHash.new
|
||||
|
||||
def self.move_will_fail?(function_code, *args)
|
||||
return MoveFailureCheck.trigger(function_code, *args) || false
|
||||
@@ -140,4 +141,13 @@ module Battle::AI::Handlers
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def self.should_not_switch?(*args)
|
||||
ret = false
|
||||
ShouldNotSwitch.each do |id, switch_proc|
|
||||
ret ||= switch_proc.call(*args)
|
||||
break if ret
|
||||
end
|
||||
return ret
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user