Some more rewrites of AI move score calculations (mainly item-related moves)

This commit is contained in:
Maruno17
2022-10-23 18:24:18 +01:00
parent 5a49bbbc94
commit e12fd08eb1
9 changed files with 164 additions and 94 deletions

View File

@@ -76,6 +76,9 @@ class Battle::AI
else
# Includes: Foe, NearAlly, NearFoe, NearOther, Other, RandomNearFoe, UserOrNearAlly
# If move affects one battler and you have to choose which one
# TODO: Figure out first which targets are valid. Includes the call to
# pbMoveCanTarget?, but also includes move-redirecting effects like
# Lightning Rod. Skip any battlers that can't be targeted.
@battle.allBattlers.each do |b|
next if !@battle.pbMoveCanTarget?(battler.index, b.index, target_data)
# TODO: This should consider targeting an ally if possible. Scores will