Split AI general move score modifiers into handlers

This commit is contained in:
Maruno17
2022-08-29 15:59:22 +01:00
parent 9ed2f3e920
commit 22dce593e8
13 changed files with 1029 additions and 885 deletions

View File

@@ -66,6 +66,7 @@ module Battle::AI::Handlers
MoveEffectScore = HandlerHash.new
MoveBasePower = HandlerHash.new
MoveFailureCheck = HandlerHash.new
GeneralMoveScore = HandlerHash.new
# Move type
# Move accuracy
# Move target
@@ -86,4 +87,12 @@ module Battle::AI::Handlers
ret = MoveBasePower.trigger(function_code, power, *args)
return (ret.nil?) ? power : ret
end
def self.apply_general_move_score_modifiers(score, *args)
GeneralMoveScore.each do |id, score_proc|
new_score = score_proc.call(score, *args)
score = new_score if new_score
end
return score
end
end