From 22dce593e849817076aff34d2c506f414534544d Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 29 Aug 2022 15:59:22 +0100 Subject: [PATCH] Split AI general move score modifiers into handlers --- .../011_Battle/005_AI/001_Battle_AI.rb | 9 + Data/Scripts/011_Battle/005_AI/004_AI_Move.rb | 504 +----------------- .../005_AI/021_AI_MoveBaseScores.rb | 299 +++++++++++ .../005_AI/051_AI_MoveHandlers_Misc.rb | 68 +-- .../052_AI_MoveHandlers_BattlerStats.rb | 220 ++++---- .../053_AI_MoveHandlers_BattlerOther.rb | 105 ++-- .../054_AI_MoveHandlers_MoveAttributes.rb | 173 +++--- .../005_AI/055_AI_MoveHandlers_MultiHit.rb | 57 +- .../005_AI/056_AI_MoveHandlers_Healing.rb | 59 +- .../005_AI/057_AI_MoveHandlers_Items.rb | 24 +- .../058_AI_MoveHandlers_ChangeMoveEffect.rb | 58 +- .../059_AI_MoveHandlers_SwitchingActing.rb | 67 +-- .../070_AI_MoveHandlers_GeneralModifiers.rb | 271 ++++++++++ 13 files changed, 1029 insertions(+), 885 deletions(-) create mode 100644 Data/Scripts/011_Battle/005_AI/021_AI_MoveBaseScores.rb create mode 100644 Data/Scripts/011_Battle/005_AI/070_AI_MoveHandlers_GeneralModifiers.rb diff --git a/Data/Scripts/011_Battle/005_AI/001_Battle_AI.rb b/Data/Scripts/011_Battle/005_AI/001_Battle_AI.rb index a89ecfb8c..1ccf94a01 100644 --- a/Data/Scripts/011_Battle/005_AI/001_Battle_AI.rb +++ b/Data/Scripts/011_Battle/005_AI/001_Battle_AI.rb @@ -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 diff --git a/Data/Scripts/011_Battle/005_AI/004_AI_Move.rb b/Data/Scripts/011_Battle/005_AI/004_AI_Move.rb index 5434cc8d7..500f7640a 100644 --- a/Data/Scripts/011_Battle/005_AI/004_AI_Move.rb +++ b/Data/Scripts/011_Battle/005_AI/004_AI_Move.rb @@ -1,7 +1,6 @@ class Battle::AI #============================================================================= - # Get scores for the user's moves (done before any action is assessed) - # NOTE: A move is only added to the choices array if it has a non-zero score. + # Get scores for the user's moves (done before any action is assessed). #============================================================================= def pbGetMoveScores battler = @user.battler @@ -30,7 +29,7 @@ class Battle::AI end #============================================================================= - # Get scores for the given move against each possible target + # Get scores for the given move against each possible target. #============================================================================= # Wild Pokémon choose their moves randomly. # Trainer Pokémon calculate how much they want to use each of their moves. @@ -58,19 +57,22 @@ class Battle::AI # specially affects multiple Pokémon and the AI calculates an overall # score at once instead of per target score = pbGetMoveScore(move) - choices.push([idxMove, score, -1]) if score > 0 + choices.push([idxMove, score, -1]) elsif target_data.num_targets > 1 # Includes: AllFoes, AllNearFoes, AllNearOthers # Would also include UserAndAllies, AllAllies, AllBattlers, but they're above # If move affects multiple battlers and you don't choose a particular one # TODO: Should the scores from each target be averaged instead of summed? - totalScore = 0 + total_score = 0 + num_targets = 0 @battle.allBattlers.each do |b| next if !@battle.pbMoveCanTarget?(battler.index, b.index, target_data) score = pbGetMoveScore(move, b) - totalScore += ((battler.opposes?(b)) ? score : -score) + total_score += ((battler.opposes?(b)) ? score : -score) + num_targets += 1 end - choices.push([idxMove, totalScore, -1]) if totalScore > 0 + final_score = (num_targets == 1) ? total_score : 1.5 * total_score / num_targets + choices.push([idxMove, final_score, -1]) else # Includes: Foe, NearAlly, NearFoe, NearOther, Other, RandomNearFoe, UserOrNearAlly # If move affects one battler and you have to choose which one @@ -85,13 +87,13 @@ class Battle::AI # attack the ally anyway so it gains the effect of that ability). next if target_data.targets_foe && !battler.opposes?(b) score = pbGetMoveScore(move, b) - choices.push([idxMove, score, b.index]) if score > 0 + choices.push([idxMove, score, b.index]) end end end #============================================================================= - # Set some extra class variables for the move/target combo being assessed + # Set some extra class variables for the move/target combo being assessed. #============================================================================= def set_up_move_check(move, target) @move.set_up(move, @user) @@ -105,7 +107,7 @@ class Battle::AI #============================================================================= # Returns whether the move will definitely fail (assuming no battle conditions - # change between now and using the move) + # change between now and using the move). # TODO: Add skill checks in here for particular calculations? #============================================================================= def pbPredictMoveFailure @@ -153,7 +155,7 @@ class Battle::AI end #============================================================================= - # Get a score for the given move being used against the given target + # Get a score for the given move being used against the given target. #============================================================================= def pbGetMoveScore(move, target = nil) set_up_move_check(move, target) @@ -161,7 +163,7 @@ class Battle::AI target_battler = @target.battler # Predict whether the move will fail - return 10 if pbPredictMoveFailure + return 50 if pbPredictMoveFailure # Get the base score for the move if @move.damagingMove? @@ -174,485 +176,15 @@ class Battle::AI # Modify the score according to the move's effect score = Battle::AI::Handlers.apply_move_effect_score(@move.function, score, @move, @user, @target, self, @battle) + # Modify the score according to various other effects + score = Battle::AI::Handlers.apply_general_move_score_modifiers( + score, @move, @user, @target, self, @battle) - # A score of 0 here means it absolutely should not be used - return 0 if score <= 0 - - # TODO: High priority checks: - # => Prefer move if it will KO the target (moreso if user is slower than target) - # => Don't prefer damaging move if it won't KO, user has Stance Change and - # is in shield form, and user is slower than the target - # => Check memory for past damage dealt by a target's non-high priority move, - # and prefer move if user is slower than the target and another hit from - # the same amount will KO the user - # => Check memory for past damage dealt by a target's priority move, and don't - # prefer the move if user is slower than the target and can't move faster - # than it because of priority - # => Discard move if user is slower than the target and target is semi- - # invulnerable (and move won't hit it) - # => Check memory for whether target has previously used Quick Guard, and - # don't prefer move if so - - # TODO: Low priority checks: - # => Don't prefer move if user is faster than the target - # => Prefer move if user is faster than the target and target is semi- - # invulnerable - - # Don't prefer a dancing move if the target has the Dancer ability - # TODO: Check all battlers, not just the target. - if @move.move.danceMove? && @target.has_active_ability?(:DANCER) - score /= 2 - end - - # TODO: Check memory for whether target has previously used Ion Deluge, and - # don't prefer move if it's Normal-type and target is immune because - # of its ability (Lightning Rod, etc.). - - # TODO: Don't prefer sound move if user hasn't been Throat Chopped but - # target has previously used Throat Chop. - - # TODO: Prefer move if it has a high critical hit rate, critical hits are - # possible but not certain, and target has raised defences/user has - # lowered offences (Atk/Def or SpAtk/SpDef, whichever is relevant). - - # TODO: Don't prefer damaging moves if target is Destiny Bonding. - # => Also don't prefer damaging moves if user is slower than the target, move - # is likely to be lethal, and target has previously used Destiny Bond - - # TODO: Don't prefer a move that is stopped by Wide Guard if target has - # previously used Wide Guard. - - # TODO: Don't prefer Fire-type moves if target has previously used Powder. - - # TODO: Don't prefer contact move if making contact with the target could - # trigger an effect that's bad for the user (Static, etc.). - # => Also check if target has previously used Spiky Shield.King's Shield/ - # Baneful Bunker, and don't prefer move if so - - # TODO: Prefer a contact move if making contact with the target could trigger - # an effect that's good for the user (Poison Touch/Pickpocket). - - # TODO: Don't prefer a status move if user has a damaging move that will KO - # the target. - # => If target has previously used a move that will hurt the user by 30% of - # its current HP or more, moreso don't prefer a status move. - - # Prefer damaging moves if AI has no more Pokémon or AI is less clever - if @trainer.medium_skill? && @battle.pbAbleNonActiveCount(user_battler.idxOwnSide) == 0 && - !(@trainer.high_skill? && @battle.pbAbleNonActiveCount(target_battler.idxOwnSide) > 0) - if @move.move.statusMove? - score *= 0.9 - elsif target_battler.hp <= target_battler.totalhp / 2 - score *= 1.1 - end - end - - # Don't prefer attacking the target if they'd be semi-invulnerable - if @move.accuracy > 0 && @user_faster && - (target_battler.semiInvulnerable? || target_battler.effects[PBEffects::SkyDrop] >= 0) - miss = true - miss = false if @user.has_active_ability?(:NOGUARD) - miss = false if @trainer.best_skill? && @target.has_active_ability?(:NOGUARD) - if @trainer.best_skill? && miss - # Knows what can get past semi-invulnerability - if target_battler.effects[PBEffects::SkyDrop] >= 0 || - target_battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky", - "TwoTurnAttackInvulnerableInSkyParalyzeTarget", - "TwoTurnAttackInvulnerableInSkyTargetCannotAct") - miss = false if move.hitsFlyingTargets? - elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground") - miss = false if move.hitsDiggingTargets? - elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater") - miss = false if move.hitsDivingTargets? - end - end - score = 10 if miss - end - - # Pick a good move for the Choice items - if @trainer.medium_skill? - if @user.has_active_item?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF]) || - @user.has_active_ability?(:GORILLATACTICS) - # Really don't prefer status moves (except Trick) - score *= 0.1 if @move.move.statusMove? && @move.move.function != "UserTargetSwapItems" - # Don't prefer moves of certain types - move_type = @move.rough_type - # Most unpreferred types are 0x effective against another type, except - # Fire/Water/Grass - # TODO: Actually check through the types for 0x instead of hardcoding - # them. - # TODO: Reborn separately doesn't prefer Fire/Water/Grass/Electric, also - # with a 0.95x score, meaning Electric can be 0.95x twice. Why are - # these four types not preferred? Maybe because they're all not - # very effective against Dragon. - unpreferred_types = [:NORMAL, :FIGHTING, :POISON, :GROUND, :GHOST, - :FIRE, :WATER, :GRASS, :ELECTRIC, :PSYCHIC, :DRAGON] - score *= 0.95 if unpreferred_types.include?(move_type) - # Don't prefer moves with lower accuracy - score *= @move.accuracy / 100.0 if @move.accuracy > 0 - # Don't prefer moves with low PP - score *= 0.9 if @move.move.pp < 6 - end - end - - # If user is frozen, prefer a move that can thaw the user - if @trainer.medium_skill? && user_battler.status == :FROZEN - if @move.move.thawsUser? - score += 30 - else - user_battler.eachMove do |m| - next unless m.thawsUser? - score -= 30 # Don't prefer this move if user knows another move that thaws - break - end - end - end - - # If target is frozen, don't prefer moves that could thaw them - if @trainer.medium_skill? && target_battler.status == :FROZEN - if @move.rough_type == :FIRE || (Settings::MECHANICS_GENERATION >= 6 && @move.move.thawsUser?) - score *= 0.1 - end - end - - # Don't prefer hitting a wild shiny Pokémon - if @target.wild? && target_battler.shiny? - score *= 0.15 - end - - # TODO: Discard a move that can be Magic Coated if either opponent has Magic - # Bounce. - - # Account for accuracy of move - accuracy = @move.rough_accuracy - score *= accuracy / 100.0 - - # Prefer flinching external effects (note that move effects which cause - # flinching are dealt with in the function code part of score calculation) - if @trainer.medium_skill? - if !@target.has_active_ability?([:INNERFOCUS, :SHIELDDUST]) && - target_battler.effects[PBEffects::Substitute] == 0 - if @move.move.flinchingMove? || - (@move.move.damagingMove? && - (@user.has_active_item?([:KINGSROCK, :RAZORFANG]) || - @user.has_active_ability?(:STENCH))) - score *= 1.3 - end - end - end - - # # Adjust score based on how much damage it can deal - # if move.damagingMove? - # score = pbGetMoveScoreDamage(score, move, @user, @target, @trainer.skill) - # else # Status moves - # # Don't prefer attacks which don't deal damage - # score -= 10 - # # Account for accuracy of move - # accuracy = pbRoughAccuracy(move, target) - # score *= accuracy / 100.0 - # score = 0 if score <= 10 && @trainer.high_skill? - # end score = score.to_i score = 0 if score < 0 return score end - #============================================================================= - # Calculate how much damage a move is likely to do to a given target (as a - # percentage of the target's current HP) - # TODO: How much is this going to be used? Should the predicted percentage of - # damage be used as the initial score for damaging moves? - #============================================================================= - def pbGetDamagingMoveBaseScore - # Don't prefer moves that are ineffective because of abilities or effects - return 0 if @target.immune_to_move? - user_battler = @user.battler - target_battler = @target.battler - - # Calculate how much damage the move will do (roughly) - calc_damage = @move.rough_damage - - # TODO: Maybe move this check elsewhere? Note that Reborn's base score does - # not include this halving, but the predicted damage does. - # Two-turn attacks waste 2 turns to deal one lot of damage - calc_damage /= 2 if @move.move.chargingTurnMove? - - # TODO: Maybe move this check elsewhere? - # Increased critical hit rate - if @trainer.medium_skill? - crit_stage = @move.rough_critical_hit_stage - if crit_stage >= 0 - crit_fraction = (crit_stage > 50) ? 1 : Battle::Move::CRITICAL_HIT_RATIOS[crit_stage] - crit_mult = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? 0.5 : 1 - calc_damage *= (1 + crit_mult / crit_fraction) - end - end - - # Convert damage to percentage of target's remaining HP - damage_percentage = calc_damage * 100.0 / target_battler.hp - - # Don't prefer weak attacks -# damage_percentage /= 2 if damage_percentage < 20 - - # Prefer damaging attack if level difference is significantly high -# damage_percentage *= 1.2 if user_battler.level - 10 > target_battler.level - - # Adjust score - damage_percentage = 110 if damage_percentage > 110 # Treat all lethal moves the same - damage_percentage += 40 if damage_percentage > 100 # Prefer moves likely to be lethal - - return damage_percentage.to_i - end - - #============================================================================= - # TODO: Remove this method. If we're keeping any score changes inherent to a - # move's effect, they will go in MoveEffectScore handlers instead. - #============================================================================= - def pbGetStatusMoveBaseScore - # TODO: Call @target.immune_to_move? here too, not just for damaging moves - # (only if this status move will be affected). - - # TODO: Make sure all status moves are accounted for. - # TODO: Duplicates in Reborn's AI: - # "SleepTarget" Grass Whistle (15), Hypnosis (15), Sing (15), - # Lovely Kiss (20), Sleep Powder (20), Spore (60) - # "PoisonTarget" - Poison Powder (15), Poison Gas (20) - # "ParalyzeTarget" - Stun Spore (25), Glare (30) - # "ConfuseTarget" - Teeter Dance (5), Supersonic (10), - # Sweet Kiss (20), Confuse Ray (25) - # "RaiseUserAttack1" - Howl (10), Sharpen (10), Medicate (15) - # "RaiseUserSpeed2" - Agility (15), Rock Polish (25) - # "LowerTargetAttack1" - Growl (10), Baby-Doll Eyes (15) - # "LowerTargetAccuracy1" - Sand Attack (5), Flash (10), Kinesis (10), Smokescreen (10) - # "LowerTargetAttack2" - Charm (10), Feather Dance (15) - # "LowerTargetSpeed2" - String Shot (10), Cotton Spore (15), Scary Face (15) - # "LowerTargetSpDef2" - Metal Sound (10), Fake Tears (15) - case @move.move.function - when "ConfuseTarget", - "LowerTargetAccuracy1", - "LowerTargetEvasion1RemoveSideEffects", - "UserTargetSwapAtkSpAtkStages", - "UserTargetSwapDefSpDefStages", - "UserSwapBaseAtkDef", - "UserTargetAverageBaseAtkSpAtk", - "UserTargetAverageBaseDefSpDef", - "SetUserTypesToUserMoveType", - "SetTargetTypesToWater", - "SetUserTypesToTargetTypes", - "SetTargetAbilityToUserAbility", - "UserTargetSwapAbilities", - "PowerUpAllyMove", - "StartWeakenElectricMoves", - "StartWeakenFireMoves", - "EnsureNextMoveAlwaysHits", - "StartNegateTargetEvasionStatStageAndGhostImmunity", - "StartNegateTargetEvasionStatStageAndDarkImmunity", - "ProtectUserSideFromPriorityMoves", - "ProtectUserSideFromMultiTargetDamagingMoves", - "BounceBackProblemCausingStatusMoves", - "StealAndUseBeneficialStatusMove", - "DisableTargetMovesKnownByUser", - "DisableTargetHealingMoves", - "SetAttackerMovePPTo0IfUserFaints", - "UserEnduresFaintingThisTurn", - "RestoreUserConsumedItem", - "StartNegateHeldItems", - "StartDamageTargetEachTurnIfTargetAsleep", - "HealUserDependingOnUserStockpile", - "StartGravity", - "StartUserAirborne", - "UserSwapsPositionsWithAlly", - "StartSwapAllBattlersBaseDefensiveStats", - "RaiseTargetSpDef1", - "RaiseGroundedGrassBattlersAtkSpAtk1", - "RaiseGrassBattlersDef1", - "AddGrassTypeToTarget", - "TrapAllBattlersInBattleForOneTurn", - "EnsureNextCriticalHit", - "UserTargetSwapBaseSpeed", - "RedirectAllMovesToTarget", - "TargetUsesItsLastUsedMoveAgain" - return 55 - when "RaiseUserAttack1", - "RaiseUserDefense1", - "RaiseUserDefense1CurlUpUser", - "RaiseUserCriticalHitRate2", - "RaiseUserAtkSpAtk1", - "RaiseUserAtkSpAtk1Or2InSun", - "RaiseUserAtkAcc1", - "RaiseTargetRandomStat2", - "LowerTargetAttack1", - "LowerTargetDefense1", - "LowerTargetAccuracy1", - "LowerTargetAttack2", - "LowerTargetSpeed2", - "LowerTargetSpDef2", - "ResetAllBattlersStatStages", - "UserCopyTargetStatStages", - "SetUserTypesBasedOnEnvironment", - "DisableTargetUsingSameMoveConsecutively", - "StartTargetCannotUseItem", - "LowerTargetAttack1BypassSubstitute", - "LowerTargetAtkSpAtk1", - "LowerTargetSpAtk1", - "TargetNextFireMoveDamagesTarget" - return 60 - when "SleepTarget", - "SleepTargetIfUserDarkrai", - "SleepTargetChangeUserMeloettaForm", - "PoisonTarget", - "CureUserBurnPoisonParalysis", - "RaiseUserAttack1", - "RaiseUserSpDef1PowerUpElectricMove", - "RaiseUserEvasion1", - "RaiseUserSpeed2", - "LowerTargetAttack1", - "LowerTargetAtkDef1", - "LowerTargetAttack2", - "LowerTargetDefense2", - "LowerTargetSpeed2", - "LowerTargetSpAtk2IfCanAttract", - "LowerTargetSpDef2", - "ReplaceMoveThisBattleWithTargetLastMoveUsed", - "ReplaceMoveWithTargetLastMoveUsed", - "SetUserAbilityToTargetAbility", - "UseMoveTargetIsAboutToUse", - "UseRandomMoveFromUserParty", - "StartHealUserEachTurnTrapUserInBattle", - "HealTargetHalfOfTotalHP", - "UserFaintsHealAndCureReplacement", - "UserFaintsHealAndCureReplacementRestorePP", - "StartSunWeather", - "StartRainWeather", - "StartSandstormWeather", - "StartHailWeather", - "RaisePlusMinusUserAndAlliesDefSpDef1", - "LowerTargetSpAtk2", - "LowerPoisonedTargetAtkSpAtkSpd1", - "AddGhostTypeToTarget", - "LowerTargetAtkSpAtk1SwitchOutUser", - "RaisePlusMinusUserAndAlliesAtkSpAtk1", - "HealTargetDependingOnGrassyTerrain" - return 65 - when "SleepTarget", - "SleepTargetChangeUserMeloettaForm", - "SleepTargetNextTurn", - "PoisonTarget", - "ConfuseTarget", - "RaiseTargetSpAtk1ConfuseTarget", - "RaiseTargetAttack2ConfuseTarget", - "UserTargetSwapStatStages", - "StartUserSideImmunityToStatStageLowering", - "SetUserTypesToResistLastAttack", - "SetTargetAbilityToSimple", - "SetTargetAbilityToInsomnia", - "NegateTargetAbility", - "TransformUserIntoTarget", - "UseLastMoveUsedByTarget", - "UseLastMoveUsed", - "UseRandomMove", - "HealUserFullyAndFallAsleep", - "StartHealUserEachTurn", - "StartPerishCountsForAllBattlers", - "SwitchOutTargetStatusMove", - "TrapTargetInBattle", - "TargetMovesBecomeElectric", - "NormalMovesBecomeElectric", - "PoisonTargetLowerTargetSpeed1" - return 70 - when "BadPoisonTarget", - "ParalyzeTarget", - "BurnTarget", - "ConfuseTarget", - "AttractTarget", - "GiveUserStatusToTarget", - "RaiseUserDefSpDef1", - "RaiseUserDefense2", - "RaiseUserSpeed2", - "RaiseUserSpeed2LowerUserWeight", - "RaiseUserSpDef2", - "RaiseUserEvasion2MinimizeUser", - "RaiseUserDefense3", - "MaxUserAttackLoseHalfOfTotalHP", - "UserTargetAverageHP", - "ProtectUser", - "DisableTargetLastMoveUsed", - "DisableTargetStatusMoves", - "HealUserHalfOfTotalHP", - "HealUserHalfOfTotalHPLoseFlyingTypeThisTurn", - "HealUserPositionNextTurn", - "HealUserDependingOnWeather", - "StartLeechSeedTarget", - "AttackerFaintsIfUserFaints", - "UserTargetSwapItems", - "UserMakeSubstitute", - "UserAddStockpileRaiseDefSpDef1", - "RedirectAllMovesToUser", - "InvertTargetStatStages", - "HealUserByTargetAttackLowerTargetAttack1", - "HealUserDependingOnSandstorm" - return 75 - when "ParalyzeTarget", - "ParalyzeTargetIfNotTypeImmune", - "RaiseUserAtkDef1", - "RaiseUserAtkDefAcc1", - "RaiseUserSpAtkSpDef1", - "UseMoveDependingOnEnvironment", - "UseRandomUserMoveIfAsleep", - "DisableTargetUsingDifferentMove", - "SwitchOutUserPassOnEffects", - "AddSpikesToFoeSide", - "AddToxicSpikesToFoeSide", - "AddStealthRocksToFoeSide", - "CurseTargetOrLowerUserSpd1RaiseUserAtkDef1", - "StartSlowerBattlersActFirst", - "ProtectUserFromTargetingMovesSpikyShield", - "StartElectricTerrain", - "StartGrassyTerrain", - "StartMistyTerrain", - "StartPsychicTerrain", - "CureTargetStatusHealUserHalfOfTotalHP" - return 80 - when "CureUserPartyStatus", - "RaiseUserAttack2", - "RaiseUserSpAtk2", - "RaiseUserSpAtk3", - "StartUserSideDoubleSpeed", - "StartWeakenPhysicalDamageAgainstUserSide", - "StartWeakenSpecialDamageAgainstUserSide", - "ProtectUserSideFromDamagingMovesIfUserFirstTurn", - "ProtectUserFromDamagingMovesKingsShield", - "ProtectUserBanefulBunker" - return 85 - when "RaiseUserAtkSpd1", - "RaiseUserSpAtkSpDefSpd1", - "LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2", - "RaiseUserAtk1Spd2", - "TwoTurnAttackRaiseUserSpAtkSpDefSpd2" - return 90 - when "SleepTarget", - "SleepTargetChangeUserMeloettaForm", - "AddStickyWebToFoeSide", - "StartWeakenDamageAgainstUserSideIfHail" - return 100 - end - # "DoesNothingUnusableInGravity", - # "StartUserSideImmunityToInflictedStatus", - # "LowerTargetEvasion1", - # "LowerTargetEvasion2", - # "StartPreventCriticalHitsAgainstUserSide", - # "UserFaintsLowerTargetAtkSpAtk2", - # "FleeFromBattle", - # "SwitchOutUserStatusMove" - # "TargetTakesUserItem", - # "LowerPPOfTargetLastMoveBy4", - # "StartTargetAirborneAndAlwaysHitByMoves", - # "TargetActsNext", - # "TargetActsLast", - # "ProtectUserSideFromStatusMoves" - return 100 - end - #============================================================================= # Make the final choice of which move to use depending on the calculated # scores for each move. Moves with higher scores are more likely to be chosen. @@ -662,6 +194,8 @@ class Battle::AI # If there are no calculated choices, pick one at random if choices.length == 0 + # NOTE: Can only get here if no moves can be chosen, i.e. will auto-use a + # move or struggle. user_battler.eachMoveWithIndex do |_m, i| next if !@battle.pbCanChooseMove?(user_battler.index, i, false) choices.push([i, 100, -1]) # Move index, score, target diff --git a/Data/Scripts/011_Battle/005_AI/021_AI_MoveBaseScores.rb b/Data/Scripts/011_Battle/005_AI/021_AI_MoveBaseScores.rb new file mode 100644 index 000000000..2a1820087 --- /dev/null +++ b/Data/Scripts/011_Battle/005_AI/021_AI_MoveBaseScores.rb @@ -0,0 +1,299 @@ +class Battle::AI + #============================================================================= + # Calculate how much damage a move is likely to do to a given target (as a + # percentage of the target's current HP) + # TODO: How much is this going to be used? Should the predicted percentage of + # damage be used as the initial score for damaging moves? + #============================================================================= + def pbGetDamagingMoveBaseScore + return 100 + # Don't prefer moves that are ineffective because of abilities or effects + return 0 if @target.immune_to_move? + user_battler = @user.battler + target_battler = @target.battler + + # Calculate how much damage the move will do (roughly) + calc_damage = @move.rough_damage + + # TODO: Maybe move this check elsewhere? Note that Reborn's base score does + # not include this halving, but the predicted damage does. + # Two-turn attacks waste 2 turns to deal one lot of damage + calc_damage /= 2 if @move.move.chargingTurnMove? + + # TODO: Maybe move this check elsewhere? + # Increased critical hit rate + if @trainer.medium_skill? + crit_stage = @move.rough_critical_hit_stage + if crit_stage >= 0 + crit_fraction = (crit_stage > 50) ? 1 : Battle::Move::CRITICAL_HIT_RATIOS[crit_stage] + crit_mult = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? 0.5 : 1 + calc_damage *= (1 + crit_mult / crit_fraction) + end + end + + # Convert damage to percentage of target's remaining HP + damage_percentage = calc_damage * 100.0 / target_battler.hp + + # Don't prefer weak attacks +# damage_percentage /= 2 if damage_percentage < 20 + + # Prefer damaging attack if level difference is significantly high +# damage_percentage *= 1.2 if user_battler.level - 10 > target_battler.level + + # Adjust score + damage_percentage = 110 if damage_percentage > 110 # Treat all lethal moves the same + damage_percentage += 40 if damage_percentage > 100 # Prefer moves likely to be lethal + + return damage_percentage.to_i + end + + #============================================================================= + # TODO: Remove this method. If we're keeping any score changes inherent to a + # move's effect, they will go in MoveEffectScore handlers instead. + #============================================================================= + def pbGetStatusMoveBaseScore + return 100 + # TODO: Call @target.immune_to_move? here too, not just for damaging moves + # (only if this status move will be affected). + + # TODO: Make sure all status moves are accounted for. + # TODO: Duplicates in Reborn's AI: + # "SleepTarget" Grass Whistle (15), Hypnosis (15), Sing (15), + # Lovely Kiss (20), Sleep Powder (20), Spore (60) + # "PoisonTarget" - Poison Powder (15), Poison Gas (20) + # "ParalyzeTarget" - Stun Spore (25), Glare (30) + # "ConfuseTarget" - Teeter Dance (5), Supersonic (10), + # Sweet Kiss (20), Confuse Ray (25) + # "RaiseUserAttack1" - Howl (10), Sharpen (10), Medicate (15) + # "RaiseUserSpeed2" - Agility (15), Rock Polish (25) + # "LowerTargetAttack1" - Growl (10), Baby-Doll Eyes (15) + # "LowerTargetAccuracy1" - Sand Attack (5), Flash (10), Kinesis (10), Smokescreen (10) + # "LowerTargetAttack2" - Charm (10), Feather Dance (15) + # "LowerTargetSpeed2" - String Shot (10), Cotton Spore (15), Scary Face (15) + # "LowerTargetSpDef2" - Metal Sound (10), Fake Tears (15) + case @move.move.function + when "ConfuseTarget", + "LowerTargetAccuracy1", + "LowerTargetEvasion1RemoveSideEffects", + "UserTargetSwapAtkSpAtkStages", + "UserTargetSwapDefSpDefStages", + "UserSwapBaseAtkDef", + "UserTargetAverageBaseAtkSpAtk", + "UserTargetAverageBaseDefSpDef", + "SetUserTypesToUserMoveType", + "SetTargetTypesToWater", + "SetUserTypesToTargetTypes", + "SetTargetAbilityToUserAbility", + "UserTargetSwapAbilities", + "PowerUpAllyMove", + "StartWeakenElectricMoves", + "StartWeakenFireMoves", + "EnsureNextMoveAlwaysHits", + "StartNegateTargetEvasionStatStageAndGhostImmunity", + "StartNegateTargetEvasionStatStageAndDarkImmunity", + "ProtectUserSideFromPriorityMoves", + "ProtectUserSideFromMultiTargetDamagingMoves", + "BounceBackProblemCausingStatusMoves", + "StealAndUseBeneficialStatusMove", + "DisableTargetMovesKnownByUser", + "DisableTargetHealingMoves", + "SetAttackerMovePPTo0IfUserFaints", + "UserEnduresFaintingThisTurn", + "RestoreUserConsumedItem", + "StartNegateHeldItems", + "StartDamageTargetEachTurnIfTargetAsleep", + "HealUserDependingOnUserStockpile", + "StartGravity", + "StartUserAirborne", + "UserSwapsPositionsWithAlly", + "StartSwapAllBattlersBaseDefensiveStats", + "RaiseTargetSpDef1", + "RaiseGroundedGrassBattlersAtkSpAtk1", + "RaiseGrassBattlersDef1", + "AddGrassTypeToTarget", + "TrapAllBattlersInBattleForOneTurn", + "EnsureNextCriticalHit", + "UserTargetSwapBaseSpeed", + "RedirectAllMovesToTarget", + "TargetUsesItsLastUsedMoveAgain" + return 55 + when "RaiseUserAttack1", + "RaiseUserDefense1", + "RaiseUserDefense1CurlUpUser", + "RaiseUserCriticalHitRate2", + "RaiseUserAtkSpAtk1", + "RaiseUserAtkSpAtk1Or2InSun", + "RaiseUserAtkAcc1", + "RaiseTargetRandomStat2", + "LowerTargetAttack1", + "LowerTargetDefense1", + "LowerTargetAccuracy1", + "LowerTargetAttack2", + "LowerTargetSpeed2", + "LowerTargetSpDef2", + "ResetAllBattlersStatStages", + "UserCopyTargetStatStages", + "SetUserTypesBasedOnEnvironment", + "DisableTargetUsingSameMoveConsecutively", + "StartTargetCannotUseItem", + "LowerTargetAttack1BypassSubstitute", + "LowerTargetAtkSpAtk1", + "LowerTargetSpAtk1", + "TargetNextFireMoveDamagesTarget" + return 60 + when "SleepTarget", + "SleepTargetIfUserDarkrai", + "SleepTargetChangeUserMeloettaForm", + "PoisonTarget", + "CureUserBurnPoisonParalysis", + "RaiseUserAttack1", + "RaiseUserSpDef1PowerUpElectricMove", + "RaiseUserEvasion1", + "RaiseUserSpeed2", + "LowerTargetAttack1", + "LowerTargetAtkDef1", + "LowerTargetAttack2", + "LowerTargetDefense2", + "LowerTargetSpeed2", + "LowerTargetSpAtk2IfCanAttract", + "LowerTargetSpDef2", + "ReplaceMoveThisBattleWithTargetLastMoveUsed", + "ReplaceMoveWithTargetLastMoveUsed", + "SetUserAbilityToTargetAbility", + "UseMoveTargetIsAboutToUse", + "UseRandomMoveFromUserParty", + "StartHealUserEachTurnTrapUserInBattle", + "HealTargetHalfOfTotalHP", + "UserFaintsHealAndCureReplacement", + "UserFaintsHealAndCureReplacementRestorePP", + "StartSunWeather", + "StartRainWeather", + "StartSandstormWeather", + "StartHailWeather", + "RaisePlusMinusUserAndAlliesDefSpDef1", + "LowerTargetSpAtk2", + "LowerPoisonedTargetAtkSpAtkSpd1", + "AddGhostTypeToTarget", + "LowerTargetAtkSpAtk1SwitchOutUser", + "RaisePlusMinusUserAndAlliesAtkSpAtk1", + "HealTargetDependingOnGrassyTerrain" + return 65 + when "SleepTarget", + "SleepTargetChangeUserMeloettaForm", + "SleepTargetNextTurn", + "PoisonTarget", + "ConfuseTarget", + "RaiseTargetSpAtk1ConfuseTarget", + "RaiseTargetAttack2ConfuseTarget", + "UserTargetSwapStatStages", + "StartUserSideImmunityToStatStageLowering", + "SetUserTypesToResistLastAttack", + "SetTargetAbilityToSimple", + "SetTargetAbilityToInsomnia", + "NegateTargetAbility", + "TransformUserIntoTarget", + "UseLastMoveUsedByTarget", + "UseLastMoveUsed", + "UseRandomMove", + "HealUserFullyAndFallAsleep", + "StartHealUserEachTurn", + "StartPerishCountsForAllBattlers", + "SwitchOutTargetStatusMove", + "TrapTargetInBattle", + "TargetMovesBecomeElectric", + "NormalMovesBecomeElectric", + "PoisonTargetLowerTargetSpeed1" + return 70 + when "BadPoisonTarget", + "ParalyzeTarget", + "BurnTarget", + "ConfuseTarget", + "AttractTarget", + "GiveUserStatusToTarget", + "RaiseUserDefSpDef1", + "RaiseUserDefense2", + "RaiseUserSpeed2", + "RaiseUserSpeed2LowerUserWeight", + "RaiseUserSpDef2", + "RaiseUserEvasion2MinimizeUser", + "RaiseUserDefense3", + "MaxUserAttackLoseHalfOfTotalHP", + "UserTargetAverageHP", + "ProtectUser", + "DisableTargetLastMoveUsed", + "DisableTargetStatusMoves", + "HealUserHalfOfTotalHP", + "HealUserHalfOfTotalHPLoseFlyingTypeThisTurn", + "HealUserPositionNextTurn", + "HealUserDependingOnWeather", + "StartLeechSeedTarget", + "AttackerFaintsIfUserFaints", + "UserTargetSwapItems", + "UserMakeSubstitute", + "UserAddStockpileRaiseDefSpDef1", + "RedirectAllMovesToUser", + "InvertTargetStatStages", + "HealUserByTargetAttackLowerTargetAttack1", + "HealUserDependingOnSandstorm" + return 75 + when "ParalyzeTarget", + "ParalyzeTargetIfNotTypeImmune", + "RaiseUserAtkDef1", + "RaiseUserAtkDefAcc1", + "RaiseUserSpAtkSpDef1", + "UseMoveDependingOnEnvironment", + "UseRandomUserMoveIfAsleep", + "DisableTargetUsingDifferentMove", + "SwitchOutUserPassOnEffects", + "AddSpikesToFoeSide", + "AddToxicSpikesToFoeSide", + "AddStealthRocksToFoeSide", + "CurseTargetOrLowerUserSpd1RaiseUserAtkDef1", + "StartSlowerBattlersActFirst", + "ProtectUserFromTargetingMovesSpikyShield", + "StartElectricTerrain", + "StartGrassyTerrain", + "StartMistyTerrain", + "StartPsychicTerrain", + "CureTargetStatusHealUserHalfOfTotalHP" + return 80 + when "CureUserPartyStatus", + "RaiseUserAttack2", + "RaiseUserSpAtk2", + "RaiseUserSpAtk3", + "StartUserSideDoubleSpeed", + "StartWeakenPhysicalDamageAgainstUserSide", + "StartWeakenSpecialDamageAgainstUserSide", + "ProtectUserSideFromDamagingMovesIfUserFirstTurn", + "ProtectUserFromDamagingMovesKingsShield", + "ProtectUserBanefulBunker" + return 85 + when "RaiseUserAtkSpd1", + "RaiseUserSpAtkSpDefSpd1", + "LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2", + "RaiseUserAtk1Spd2", + "TwoTurnAttackRaiseUserSpAtkSpDefSpd2" + return 90 + when "SleepTarget", + "SleepTargetChangeUserMeloettaForm", + "AddStickyWebToFoeSide", + "StartWeakenDamageAgainstUserSideIfHail" + return 100 + end + # "DoesNothingUnusableInGravity", + # "StartUserSideImmunityToInflictedStatus", + # "LowerTargetEvasion1", + # "LowerTargetEvasion2", + # "StartPreventCriticalHitsAgainstUserSide", + # "UserFaintsLowerTargetAtkSpAtk2", + # "FleeFromBattle", + # "SwitchOutUserStatusMove" + # "TargetTakesUserItem", + # "LowerPPOfTargetLastMoveBy4", + # "StartTargetAirborneAndAlwaysHitByMoves", + # "TargetActsNext", + # "TargetActsLast", + # "ProtectUserSideFromStatusMoves" + return 100 + end +end diff --git a/Data/Scripts/011_Battle/005_AI/051_AI_MoveHandlers_Misc.rb b/Data/Scripts/011_Battle/005_AI/051_AI_MoveHandlers_Misc.rb index 40c37cd63..9b9910ce5 100644 --- a/Data/Scripts/011_Battle/005_AI/051_AI_MoveHandlers_Misc.rb +++ b/Data/Scripts/011_Battle/005_AI/051_AI_MoveHandlers_Misc.rb @@ -1,15 +1,15 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # Struggle #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # None #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DoesNothingCongratulations", proc { |score, move, user, target, ai, battle| @@ -19,7 +19,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DoesNothingCongratulations", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DoesNothingFailsIfNoAlly", proc { |move, user, target, ai, battle| @@ -30,24 +30,24 @@ Battle::AI::Handlers::MoveEffectScore.copy("DoesNothingCongratulations", "DoesNothingFailsIfNoAlly") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("DoesNothingCongratulations", "DoesNothingUnusableInGravity") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("DoesNothingCongratulations", "DoubleMoneyGainedFromBattle") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # AddMoneyGainedFromBattle #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FailsIfNotUserFirstTurn", proc { |move, user, target, ai, battle| @@ -56,7 +56,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("FailsIfNotUserFirstTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FailsIfUserHasUnusedMove", proc { |move, user, target, ai, battle| @@ -74,7 +74,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("FailsIfUserHasUnusedMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FailsIfUserNotConsumedBerry", proc { |move, user, target, ai, battle| @@ -83,7 +83,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("FailsIfUserNotConsumedBerry", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FailsIfTargetHasNoItem", proc { |move, user, target, ai, battle| @@ -97,7 +97,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FailsIfTargetHasNoItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FailsUnlessTargetSharesTypeWithUser", proc { |move, user, target, ai, battle| @@ -108,7 +108,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("FailsUnlessTargetSharesTypeWithUser" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("FailsIfUserDamagedThisTurn", proc { |score, move, user, target, ai, battle| @@ -120,12 +120,12 @@ Battle::AI::Handlers::MoveEffectScore.add("FailsIfUserDamagedThisTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # FailsIfTargetActed #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("CrashDamageIfFailsUnusableInGravity", proc { |score, move, user, target, ai, battle| @@ -134,7 +134,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CrashDamageIfFailsUnusableInGravity", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartSunWeather", proc { |move, user, target, ai, battle| @@ -158,7 +158,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartSunWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("StartSunWeather", "StartRainWeather") @@ -178,7 +178,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartRainWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("StartSunWeather", "StartSandstormWeather") @@ -192,7 +192,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartSandstormWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("StartSunWeather", "StartHailWeather") @@ -206,7 +206,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartHailWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartElectricTerrain", proc { |move, user, target, ai, battle| @@ -215,7 +215,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartElectricTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartGrassyTerrain", proc { |move, user, target, ai, battle| @@ -224,7 +224,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartGrassyTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartMistyTerrain", proc { |move, user, target, ai, battle| @@ -233,7 +233,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartMistyTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartPsychicTerrain", proc { |move, user, target, ai, battle| @@ -242,7 +242,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartPsychicTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RemoveTerrain", proc { |move, user, target, ai, battle| @@ -251,7 +251,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("RemoveTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddSpikesToFoeSide", proc { |move, user, target, ai, battle| @@ -271,7 +271,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AddSpikesToFoeSide", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddToxicSpikesToFoeSide", proc { |move, user, target, ai, battle| @@ -291,7 +291,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AddToxicSpikesToFoeSide", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddStealthRocksToFoeSide", proc { |move, user, target, ai, battle| @@ -309,7 +309,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AddStealthRocksToFoeSide", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddStickyWebToFoeSide", proc { |move, user, target, ai, battle| @@ -318,7 +318,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("AddStickyWebToFoeSide", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SwapSideEffects", proc { |move, user, target, ai, battle| @@ -364,7 +364,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwapSideEffects", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserMakeSubstitute", proc { |move, user, target, ai, battle| @@ -374,7 +374,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("UserMakeSubstitute", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RemoveUserBindingAndEntryHazards", proc { |score, move, user, target, ai, battle| @@ -390,7 +390,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RemoveUserBindingAndEntryHazards", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AttackTwoTurnsLater", proc { |move, user, target, ai, battle| @@ -407,7 +407,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AttackTwoTurnsLater", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserSwapsPositionsWithAlly", proc { |move, user, target, ai, battle| @@ -423,7 +423,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("UserSwapsPositionsWithAlly", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("BurnAttackerBeforeUserActs", proc { |score, move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/052_AI_MoveHandlers_BattlerStats.rb b/Data/Scripts/011_Battle/005_AI/052_AI_MoveHandlers_BattlerStats.rb index 7ba7ee504..3daf15780 100644 --- a/Data/Scripts/011_Battle/005_AI/052_AI_MoveHandlers_BattlerStats.rb +++ b/Data/Scripts/011_Battle/005_AI/052_AI_MoveHandlers_BattlerStats.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseUserAttack1", proc { |move, user, target, ai, battle| @@ -41,7 +41,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAttack1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAttack1", "RaiseUserAttack2") @@ -82,13 +82,13 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAttack2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserAttack2", "RaiseUserAttack2IfTargetFaints") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAttack2", "RaiseUserAttack3") @@ -96,13 +96,13 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserAttack2", "RaiseUserAttack3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserAttack2IfTargetFaints", "RaiseUserAttack3IfTargetFaints") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("MaxUserAttackLoseHalfOfTotalHP", proc { |move, user, target, ai, battle| @@ -131,7 +131,7 @@ Battle::AI::Handlers::MoveEffectScore.add("MaxUserAttackLoseHalfOfTotalHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAttack1", "RaiseUserDefense1") @@ -146,7 +146,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserDefense1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserDefense1", "RaiseUserDefense1CurlUpUser") @@ -154,7 +154,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserDefense1", "RaiseUserDefense1CurlUpUser") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserDefense1", "RaiseUserDefense2") @@ -172,7 +172,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserDefense2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserDefense1", "RaiseUserDefense3") @@ -190,7 +190,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserDefense3", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAttack1", "RaiseUserSpAtk1") @@ -228,7 +228,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpAtk1", "RaiseUserSpAtk2") @@ -268,7 +268,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpAtk2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpAtk1", "RaiseUserSpAtk3") @@ -308,7 +308,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpAtk3", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserDefense1", "RaiseUserSpDef1") @@ -326,7 +326,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpDef1", "RaiseUserSpDef1PowerUpElectricMove") @@ -349,7 +349,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpDef1PowerUpElectricMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpDef1", "RaiseUserSpDef2") @@ -357,7 +357,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserSpDef1", "RaiseUserSpDef2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpDef1", "RaiseUserSpDef3") @@ -365,7 +365,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserSpDef1", "RaiseUserSpDef3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpDef1", "RaiseUserSpeed1") @@ -386,6 +386,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpeed1", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpeed1", @@ -409,6 +410,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpeed2", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpeed2", @@ -417,6 +419,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserSpeed2", "RaiseUserSpeed2LowerUserWeight") #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpeed2", @@ -425,7 +428,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserSpeed2", "RaiseUserSpeed3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserSpeed1", "RaiseUserAccuracy1") @@ -443,7 +446,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAccuracy1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAccuracy1", "RaiseUserAccuracy2") @@ -451,7 +454,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserAccuracy1", "RaiseUserAccuracy2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAccuracy1", "RaiseUserAccuracy3") @@ -459,7 +462,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserAccuracy1", "RaiseUserAccuracy3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAccuracy1", "RaiseUserEvasion1") @@ -475,7 +478,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserEvasion1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserEvasion1", "RaiseUserEvasion2") @@ -493,7 +496,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserEvasion2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserEvasion2", "RaiseUserEvasion2MinimizeUser") @@ -501,7 +504,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserEvasion2", "RaiseUserEvasion2MinimizeUser") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserEvasion2", "RaiseUserEvasion3") @@ -509,7 +512,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("RaiseUserEvasion2", "RaiseUserEvasion3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseUserCriticalHitRate2", proc { |move, user, target, ai, battle| @@ -525,7 +528,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserCriticalHitRate2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseUserAtkDef1", proc { |move, user, target, ai, battle| @@ -562,7 +565,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkDef1", "RaiseUserAtkDefAcc1") @@ -589,7 +592,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkDefAcc1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkDef1", "RaiseUserAtkSpAtk1") @@ -615,7 +618,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", "RaiseUserAtkSpAtk1Or2InSun") @@ -642,7 +645,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkSpAtk1Or2InSun", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2", proc { |move, user, target, ai, battle| @@ -681,6 +684,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefSpDef1RaiseUserAtkSpAtkSp ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", @@ -713,6 +717,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkSpd1", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", @@ -744,7 +749,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtk1Spd2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", "RaiseUserAtkAcc1") @@ -770,7 +775,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserAtkAcc1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", "RaiseUserDefSpDef1") @@ -783,7 +788,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserDefSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", "RaiseUserSpAtkSpDef1") @@ -810,6 +815,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpAtkSpDef1", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", @@ -843,7 +849,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserSpAtkSpDefSpd1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("RaiseUserAtkSpAtk1", "RaiseUserMainStats1") @@ -864,7 +870,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserMainStats1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseUserMainStats1LoseThirdOfTotalHP", proc { |move, user, target, ai, battle| @@ -892,7 +898,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserMainStats1LoseThirdOfTotalHP ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseUserMainStats1TrapUserInBattle", proc { |move, user, target, ai, battle| @@ -923,7 +929,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseUserMainStats1TrapUserInBattle", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("StartRaiseUserAtk1WhenDamaged", proc { |score, move, user, target, ai, battle| @@ -932,7 +938,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartRaiseUserAtk1WhenDamaged", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserAttack1", proc { |score, move, user, target, ai, battle| @@ -941,13 +947,13 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserAttack1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("LowerUserAttack1", "LowerUserAttack2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefense1", proc { |score, move, user, target, ai, battle| @@ -956,13 +962,13 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefense1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("LowerUserDefense1", "LowerUserDefense2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpAtk1", proc { |score, move, user, target, ai, battle| @@ -971,13 +977,13 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("LowerUserSpAtk1", "LowerUserSpAtk2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpDef1", proc { |score, move, user, target, ai, battle| @@ -986,13 +992,13 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("LowerUserSpDef1", "LowerUserSpDef2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpeed1", proc { |score, move, user, target, ai, battle| @@ -1001,13 +1007,13 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserSpeed1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("LowerUserSpeed1", "LowerUserSpeed2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserAtkDef1", proc { |score, move, user, target, ai, battle| @@ -1018,7 +1024,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserAtkDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefSpDef1", proc { |score, move, user, target, ai, battle| @@ -1029,7 +1035,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefSpDefSpd1", proc { |score, move, user, target, ai, battle| @@ -1041,6 +1047,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerUserDefSpDefSpd1", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetAttack1", @@ -1051,7 +1058,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetAttack1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetAttack2ConfuseTarget", proc { |move, user, target, ai, battle| @@ -1067,7 +1074,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseTargetAttack2ConfuseTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetSpAtk1ConfuseTarget", proc { |move, user, target, ai, battle| @@ -1083,7 +1090,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseTargetSpAtk1ConfuseTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetSpDef1", proc { |move, user, target, ai, battle| @@ -1097,7 +1104,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseTargetSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetRandomStat2", proc { |move, user, target, ai, battle| @@ -1121,7 +1128,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseTargetRandomStat2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseTargetAtkSpAtk2", proc { |move, user, target, ai, battle| @@ -1140,7 +1147,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseTargetAtkSpAtk2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetAttack1", proc { |move, user, target, ai, battle| @@ -1182,7 +1189,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAttack1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAttack1", "LowerTargetAttack1BypassSubstitute") @@ -1207,7 +1214,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAttack1BypassSubstitute", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAttack1", "LowerTargetAttack2") @@ -1247,7 +1254,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAttack2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAttack2", "LowerTargetAttack3") @@ -1255,7 +1262,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetAttack2", "LowerTargetAttack3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAttack1", "LowerTargetDefense1") @@ -1271,7 +1278,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetDefense1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetDefense1", "LowerTargetDefense1PowersUpInGravity") @@ -1292,7 +1299,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetDefense1PowersUpInGravity" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetDefense1", "LowerTargetDefense2") @@ -1310,7 +1317,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetDefense2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetDefense2", "LowerTargetDefense3") @@ -1318,7 +1325,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetDefense2", "LowerTargetDefense3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAttack1", "LowerTargetSpAtk1") @@ -1356,7 +1363,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpAtk1", "LowerTargetSpAtk2") @@ -1369,7 +1376,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpAtk2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetSpAtk2IfCanAttract", proc { |move, user, target, ai, battle| @@ -1415,7 +1422,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpAtk2IfCanAttract", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpAtk1", "LowerTargetSpAtk3") @@ -1428,7 +1435,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpAtk3", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetDefense1", "LowerTargetSpDef1") @@ -1444,7 +1451,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpDef1", "LowerTargetSpDef2") @@ -1462,7 +1469,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpDef2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpDef2", "LowerTargetSpDef3") @@ -1470,7 +1477,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetSpDef2", "LowerTargetSpDef3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpDef1", "LowerTargetSpeed1") @@ -1491,7 +1498,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpeed1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpeed1", "LowerTargetSpeed1WeakerInGrassyTerrain") @@ -1504,7 +1511,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetSpeed1", "LowerTargetSpeed1WeakerInGrassyTerrain") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetSpeed1MakeTargetWeakerToFire", proc { |move, user, target, ai, battle| @@ -1527,7 +1534,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpeed1MakeTargetWeakerToFi ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpeed1", "LowerTargetSpeed2") @@ -1550,7 +1557,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetSpeed2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpeed2", "LowerTargetSpeed3") @@ -1558,7 +1565,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetSpeed2", "LowerTargetSpeed3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetSpeed1", "LowerTargetAccuracy1") @@ -1574,7 +1581,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAccuracy1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAccuracy1", "LowerTargetAccuracy2") @@ -1582,7 +1589,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetAccuracy1", "LowerTargetAccuracy2") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAccuracy1", "LowerTargetAccuracy3") @@ -1590,7 +1597,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetAccuracy1", "LowerTargetAccuracy3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAccuracy1", "LowerTargetEvasion1") @@ -1606,7 +1613,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetEvasion1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetEvasion1RemoveSideEffects", proc { |move, user, target, ai, battle| @@ -1651,7 +1658,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetEvasion1RemoveSideEffects" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetEvasion1", "LowerTargetEvasion2") @@ -1667,7 +1674,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetEvasion2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetEvasion2", "LowerTargetEvasion3") @@ -1675,7 +1682,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("LowerTargetEvasion2", "LowerTargetEvasion3") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetAtkDef1", proc { |move, user, target, ai, battle| @@ -1697,7 +1704,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAtkDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("LowerTargetAtkDef1", "LowerTargetAtkSpAtk1") @@ -1710,7 +1717,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAtkSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerPoisonedTargetAtkSpAtkSpd1", proc { |move, user, target, ai, battle| @@ -1734,7 +1741,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerPoisonedTargetAtkSpAtkSpd1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseAlliesAtkDef1", proc { |move, user, target, ai, battle| @@ -1765,7 +1772,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseAlliesAtkDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaisePlusMinusUserAndAlliesAtkSpAtk1", proc { |move, user, target, ai, battle| @@ -1794,7 +1801,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaisePlusMinusUserAndAlliesAtkSpAtk1" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaisePlusMinusUserAndAlliesAtkSpAtk1", proc { |move, user, target, ai, battle| @@ -1823,7 +1830,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaisePlusMinusUserAndAlliesDefSpDef1" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseGroundedGrassBattlersAtkSpAtk1", proc { |move, user, target, ai, battle| @@ -1853,7 +1860,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseGroundedGrassBattlersAtkSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RaiseGrassBattlersDef1", proc { |move, user, target, ai, battle| @@ -1881,7 +1888,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RaiseGrassBattlersDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapAtkSpAtkStages", proc { |score, move, user, target, ai, battle| @@ -1904,7 +1911,8 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapAtkSpAtkStages", ) #=============================================================================== -# +# TODO: Review score modifiers. +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapDefSpDefStages", proc { |score, move, user, target, ai, battle| @@ -1927,7 +1935,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapDefSpDefStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapStatStages", proc { |score, move, user, target, ai, battle| @@ -1947,7 +1955,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapStatStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserCopyTargetStatStages", proc { |score, move, user, target, ai, battle| @@ -1967,6 +1975,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserCopyTargetStatStages", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: Account for stat theft before damage calculation. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserStealTargetPositiveStatStages", @@ -1981,7 +1990,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserStealTargetPositiveStatStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("InvertTargetStatStages", proc { |move, user, target, ai, battle| @@ -2002,7 +2011,7 @@ Battle::AI::Handlers::MoveEffectScore.add("InvertTargetStatStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ResetTargetStatStages", proc { |score, move, user, target, ai, battle| @@ -2020,7 +2029,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ResetTargetStatStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ResetAllBattlersStatStages", proc { |move, user, target, ai, battle| @@ -2046,7 +2055,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ResetAllBattlersStatStages", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartUserSideImmunityToStatStageLowering", proc { |move, user, target, ai, battle| @@ -2055,7 +2064,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartUserSideImmunityToStatStageLowe ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserSwapBaseAtkDef", proc { |score, move, user, target, ai, battle| @@ -2078,7 +2087,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserSwapBaseAtkDef", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapBaseSpeed", proc { |score, move, user, target, ai, battle| @@ -2094,7 +2103,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapBaseSpeed", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageBaseAtkSpAtk", proc { |score, move, user, target, ai, battle| @@ -2118,7 +2127,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageBaseAtkSpAtk", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageBaseDefSpDef", proc { |score, move, user, target, ai, battle| @@ -2142,7 +2151,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageBaseDefSpDef", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageHP", proc { |score, move, user, target, ai, battle| @@ -2158,7 +2167,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetAverageHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartUserSideDoubleSpeed", proc { |move, user, target, ai, battle| @@ -2167,6 +2176,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartUserSideDoubleSpeed", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # StartSwapAllBattlersBaseDefensiveStats diff --git a/Data/Scripts/011_Battle/005_AI/053_AI_MoveHandlers_BattlerOther.rb b/Data/Scripts/011_Battle/005_AI/053_AI_MoveHandlers_BattlerOther.rb index e77e5196d..e547a40d5 100644 --- a/Data/Scripts/011_Battle/005_AI/053_AI_MoveHandlers_BattlerOther.rb +++ b/Data/Scripts/011_Battle/005_AI/053_AI_MoveHandlers_BattlerOther.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SleepTarget", proc { |move, user, target, ai, battle| @@ -26,7 +26,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SleepTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SleepTargetIfUserDarkrai", proc { |move, user, target, ai, battle| @@ -38,13 +38,13 @@ Battle::AI::Handlers::MoveEffectScore.copy("SleepTarget", "SleepTargetIfUserDarkrai") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("SleepTarget", "SleepTargetChangeUserMeloettaForm") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SleepTargetNextTurn", proc { |move, user, target, ai, battle| @@ -69,7 +69,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SleepTargetNextTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("PoisonTarget", proc { |move, user, target, ai, battle| @@ -96,7 +96,7 @@ Battle::AI::Handlers::MoveEffectScore.add("PoisonTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("PoisonTargetLowerTargetSpeed1", proc { |move, user, target, ai, battle| @@ -132,7 +132,7 @@ Battle::AI::Handlers::MoveEffectScore.add("PoisonTargetLowerTargetSpeed1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("PoisonTarget", "BadPoisonTarget") @@ -156,7 +156,7 @@ Battle::AI::Handlers::MoveEffectScore.add("BadPoisonTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ParalyzeTarget", proc { |move, user, target, ai, battle| @@ -183,7 +183,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ParalyzeTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ParalyzeTargetIfNotTypeImmune", proc { |move, user, target, ai, battle| @@ -196,14 +196,14 @@ Battle::AI::Handlers::MoveEffectScore.copy("ParalyzeTarget", "ParalyzeTargetIfNotTypeImmune") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("ParalyzeTarget", "ParalyzeTargetAlwaysHitsInRainHitsTargetInSky", "ParalyzeFlinchTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("BurnTarget", proc { |move, user, target, ai, battle| @@ -221,19 +221,19 @@ Battle::AI::Handlers::MoveEffectScore.add("BurnTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("BurnTarget", "BurnTargetIfTargetStatsRaisedThisTurn") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("BurnTarget", "BurnFlinchTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FreezeTarget", proc { |move, user, target, ai, battle| @@ -251,25 +251,25 @@ Battle::AI::Handlers::MoveEffectScore.add("FreezeTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("FreezeTarget", "FreezeTargetSuperEffectiveAgainstWater") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("FreezeTarget", "FreezeTargetAlwaysHitsInHail") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("FreezeTarget", "FreezeFlinchTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ParalyzeBurnOrFreezeTarget", proc { |score, move, user, target, ai, battle| @@ -278,7 +278,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ParalyzeBurnOrFreezeTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("GiveUserStatusToTarget", proc { |move, user, target, ai, battle| @@ -293,7 +293,7 @@ Battle::AI::Handlers::MoveEffectScore.add("GiveUserStatusToTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CureUserBurnPoisonParalysis", proc { |move, user, target, ai, battle| @@ -321,7 +321,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CureUserBurnPoisonParalysis", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CureUserPartyStatus", proc { |move, user, target, ai, battle| @@ -344,7 +344,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CureUserPartyStatus", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("CureTargetBurn", proc { |score, move, user, target, ai, battle| @@ -360,7 +360,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CureTargetBurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartUserSideImmunityToInflictedStatus", proc { |move, user, target, ai, battle| @@ -379,7 +379,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartUserSideImmunityToInflictedStatu ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("FlinchTarget", proc { |score, move, user, target, ai, battle| @@ -389,7 +389,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FlinchTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FlinchTargetFailsIfUserNotAsleep", proc { |move, user, target, ai, battle| @@ -406,7 +406,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FlinchTargetFailsIfUserNotAsleep", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FlinchTargetFailsIfNotUserFirstTurn", proc { |move, user, target, ai, battle| @@ -421,7 +421,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FlinchTargetFailsIfNotUserFirstTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FlinchTargetDoublePowerIfTargetInSky", proc { |power, move, user, target, ai, battle| @@ -436,7 +436,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FlinchTargetDoublePowerIfTargetInSky" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ConfuseTarget", proc { |move, user, target, ai, battle| @@ -450,13 +450,13 @@ Battle::AI::Handlers::MoveEffectScore.add("ConfuseTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.copy("ConfuseTarget", "ConfuseTargetAlwaysHitsInRainHitsTargetInSky") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AttractTarget", proc { |move, user, target, ai, battle| @@ -477,7 +477,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AttractTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesBasedOnEnvironment", proc { |move, user, target, ai, battle| @@ -524,7 +524,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesBasedOnEnvironment", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToResistLastAttack", proc { |move, user, target, ai, battle| @@ -543,7 +543,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToResistLastAttack", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToTargetTypes", proc { |move, user, target, ai, battle| @@ -555,7 +555,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToTargetTypes", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToUserMoveType", proc { |move, user, target, ai, battle| @@ -573,7 +573,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetUserTypesToUserMoveType", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetTargetTypesToPsychic", proc { |move, user, target, ai, battle| @@ -584,7 +584,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetTargetTypesToPsychic", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetTargetTypesToWater", proc { |move, user, target, ai, battle| @@ -594,7 +594,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetTargetTypesToWater", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddGhostTypeToTarget", proc { |move, user, target, ai, battle| @@ -604,7 +604,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("AddGhostTypeToTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AddGrassTypeToTarget", proc { |move, user, target, ai, battle| @@ -614,7 +614,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("AddGrassTypeToTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserLosesFireType", proc { |move, user, target, ai, battle| @@ -623,7 +623,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("UserLosesFireType", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetTargetAbilityToSimple", proc { |move, user, target, ai, battle| @@ -634,7 +634,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetTargetAbilityToSimple", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetTargetAbilityToInsomnia", proc { |move, user, target, ai, battle| @@ -645,7 +645,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("SetTargetAbilityToInsomnia", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetUserAbilityToTargetAbility", proc { |move, user, target, ai, battle| @@ -666,7 +666,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SetUserAbilityToTargetAbility", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SetTargetAbilityToUserAbility", proc { |move, user, target, ai, battle| @@ -687,7 +687,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SetTargetAbilityToUserAbility", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserTargetSwapAbilities", proc { |move, user, target, ai, battle| @@ -710,7 +710,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapAbilities", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("NegateTargetAbility", proc { |move, user, target, ai, battle| @@ -720,7 +720,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("NegateTargetAbility", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("NegateTargetAbilityIfTargetActed", proc { |score, move, user, target, ai, battle| @@ -734,12 +734,12 @@ Battle::AI::Handlers::MoveEffectScore.add("NegateTargetAbilityIfTargetActed", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # IgnoreTargetAbility #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartUserAirborne", proc { |move, user, target, ai, battle| @@ -750,7 +750,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartUserAirborne", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartTargetAirborneAndAlwaysHitByMoves", proc { |move, user, target, ai, battle| @@ -766,12 +766,12 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartTargetAirborneAndAlwaysHitByMov ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # HitsTargetInSky #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("HitsTargetInSkyGroundsTarget", proc { |score, move, user, target, ai, battle| @@ -789,6 +789,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitsTargetInSkyGroundsTarget", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartGravity", @@ -821,7 +822,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartGravity", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TransformUserIntoTarget", proc { |move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/054_AI_MoveHandlers_MoveAttributes.rb b/Data/Scripts/011_Battle/005_AI/054_AI_MoveHandlers_MoveAttributes.rb index a7bbb4b9e..3a3d7aaef 100644 --- a/Data/Scripts/011_Battle/005_AI/054_AI_MoveHandlers_MoveAttributes.rb +++ b/Data/Scripts/011_Battle/005_AI/054_AI_MoveHandlers_MoveAttributes.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FixedDamage20", proc { |power, move, user, target, ai, battle| @@ -18,7 +18,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FixedDamage20", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FixedDamage40", proc { |power, move, user, target, ai, battle| @@ -32,7 +32,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FixedDamage40", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FixedDamageHalfTargetHP", proc { |power, move, user, target, ai, battle| @@ -47,7 +47,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FixedDamageHalfTargetHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FixedDamageUserLevel", proc { |power, move, user, target, ai, battle| @@ -61,7 +61,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FixedDamageUserLevel", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("FixedDamageUserLevelRandom", proc { |power, move, user, target, ai, battle| @@ -75,7 +75,7 @@ Battle::AI::Handlers::MoveEffectScore.add("FixedDamageUserLevelRandom", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetHPToUserHP", proc { |move, user, target, ai, battle| @@ -94,7 +94,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetHPToUserHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("OHKO", proc { |move, user, target, ai, battle| @@ -109,7 +109,7 @@ Battle::AI::Handlers::MoveBasePower.add("OHKO", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("OHKOIce", proc { |move, user, target, ai, battle| @@ -124,7 +124,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("OHKO", "OHKOIce") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("OHKO", "OHKOHitsUndergroundTarget") @@ -132,7 +132,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("OHKO", "OHKOHitsUndergroundTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DamageTargetAlly", proc { |score, move, user, target, ai, battle| @@ -145,7 +145,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DamageTargetAlly", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithUserHP", proc { |power, move, user, target, ai, battle| @@ -154,55 +154,55 @@ Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithUserHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerLowerWithUserHP") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithTargetHP") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithUserHappiness") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerLowerWithUserHappiness") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithUserPositiveStatStages") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithTargetPositiveStatStages") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithUserFasterThanTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP", "PowerHigherWithTargetFasterThanUser") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithLessPP", proc { |power, move, user, target, ai, battle| @@ -214,7 +214,7 @@ Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithLessPP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithTargetWeight", proc { |power, move, user, target, ai, battle| @@ -223,13 +223,13 @@ Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithTargetWeight", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithTargetWeight", "PowerHigherWithUserHeavierThanTarget") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithConsecutiveUse", proc { |power, move, user, target, ai, battle| @@ -238,7 +238,7 @@ Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithConsecutiveUse", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithConsecutiveUseOnUserSide", proc { |power, move, user, target, ai, battle| @@ -247,7 +247,7 @@ Battle::AI::Handlers::MoveBasePower.add("PowerHigherWithConsecutiveUseOnUserSide ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("RandomPowerDoublePowerIfTargetUnderground", proc { |power, move, user, target, ai, battle| @@ -257,7 +257,7 @@ Battle::AI::Handlers::MoveBasePower.add("RandomPowerDoublePowerIfTargetUndergrou ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetHPLessThanHalf", proc { |power, move, user, target, ai, battle| @@ -266,13 +266,13 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetHPLessThanHalf", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetHPLessThanHalf", "DoublePowerIfUserPoisonedBurnedParalyzed") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetHPLessThanHalf", "DoublePowerIfTargetAsleepCureTarget") @@ -284,7 +284,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetAsleepCureTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetPoisoned", proc { |power, move, user, target, ai, battle| @@ -293,7 +293,7 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetPoisoned", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetPoisoned", "DoublePowerIfTargetParalyzedCureTarget") @@ -304,7 +304,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetParalyzedCureTarge ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetStatusProblem", proc { |power, move, user, target, ai, battle| @@ -313,7 +313,7 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetStatusProblem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfUserHasNoItem", proc { |power, move, user, target, ai, battle| @@ -322,7 +322,7 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfUserHasNoItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetUnderwater", proc { |power, move, user, target, ai, battle| @@ -331,13 +331,13 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetUnderwater", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetUnderwater", "DoublePowerIfTargetUnderground") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetInSky", proc { |power, move, user, target, ai, battle| @@ -346,25 +346,25 @@ Battle::AI::Handlers::MoveBasePower.add("DoublePowerIfTargetInSky", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetInSky", "DoublePowerInElectricTerrain") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetInSky", "DoublePowerIfUserLastMoveFailed") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("DoublePowerIfTargetInSky", "DoublePowerIfAllyFaintedLastTurn") #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfUserLostHPThisTurn", proc { |score, move, user, target, ai, battle| @@ -373,7 +373,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfUserLostHPThisTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetLostHPThisTurn", proc { |score, move, user, target, ai, battle| @@ -382,12 +382,12 @@ Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetLostHPThisTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # DoublePowerIfUserStatsLoweredThisTurn #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetActed", proc { |score, move, user, target, ai, battle| @@ -396,17 +396,17 @@ Battle::AI::Handlers::MoveEffectScore.add("DoublePowerIfTargetActed", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # DoublePowerIfTargetNotActed #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # AlwaysCriticalHit #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("EnsureNextCriticalHit", proc { |score, move, user, target, ai, battle| @@ -420,7 +420,7 @@ Battle::AI::Handlers::MoveEffectScore.add("EnsureNextCriticalHit", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartPreventCriticalHitsAgainstUserSide", proc { |move, user, target, ai, battle| @@ -429,7 +429,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartPreventCriticalHitsAgainstUserS ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CannotMakeTargetFaint", proc { |move, user, target, ai, battle| @@ -449,6 +449,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CannotMakeTargetFaint", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserEnduresFaintingThisTurn", @@ -465,7 +466,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserEnduresFaintingThisTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenElectricMoves", proc { |move, user, target, ai, battle| @@ -483,7 +484,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartWeakenElectricMoves", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenFireMoves", proc { |move, user, target, ai, battle| @@ -501,7 +502,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartWeakenFireMoves", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenPhysicalDamageAgainstUserSide", proc { |move, user, target, ai, battle| @@ -510,7 +511,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenPhysicalDamageAgainstUser ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenSpecialDamageAgainstUserSide", proc { |move, user, target, ai, battle| @@ -519,7 +520,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenSpecialDamageAgainstUserS ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartWeakenDamageAgainstUserSideIfHail", proc { |move, user, target, ai, battle| @@ -534,7 +535,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartWeakenDamageAgainstUserSideIfHai ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RemoveScreens", proc { |score, move, user, target, ai, battle| @@ -546,6 +547,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RemoveScreens", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ProtectUser", @@ -565,6 +567,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUser", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ProtectUserBanefulBunker", @@ -585,6 +588,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUserBanefulBunker", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromDamagingMovesKingsShield", @@ -604,6 +608,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromDamagingMovesKingsShie ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromDamagingMovesObstruct", @@ -623,6 +628,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromDamagingMovesObstruct" ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromTargetingMovesSpikyShield", @@ -642,7 +648,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUserFromTargetingMovesSpikyShi ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ProtectUserSideFromDamagingMovesIfUserFirstTurn", proc { |move, user, target, ai, battle| @@ -656,7 +662,7 @@ Battle::AI::Handlers::MoveEffectScore.add("ProtectUserSideFromDamagingMovesIfUse ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ProtectUserSideFromStatusMoves", proc { |move, user, target, ai, battle| @@ -665,27 +671,29 @@ Battle::AI::Handlers::MoveFailureCheck.add("ProtectUserSideFromStatusMoves", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # ProtectUserSideFromPriorityMoves #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # ProtectUserSideFromMultiTargetDamagingMoves #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # RemoveProtections #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # RemoveProtectionsBypassSubstitute #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HoopaRemoveProtectionsBypassSubstituteLowerUserDef1", proc { |move, user, target, ai, battle| @@ -699,7 +707,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HoopaRemoveProtectionsBypassSubstitut ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RecoilQuarterOfDamageDealt", proc { |score, move, user, target, ai, battle| @@ -708,7 +716,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RecoilQuarterOfDamageDealt", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RecoilThirdOfDamageDealtParalyzeTarget", proc { |score, move, user, target, ai, battle| @@ -731,7 +739,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RecoilThirdOfDamageDealtParalyzeTarge ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RecoilThirdOfDamageDealtBurnTarget", proc { |score, move, user, target, ai, battle| @@ -745,7 +753,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RecoilThirdOfDamageDealtBurnTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RecoilHalfOfDamageDealt", proc { |score, move, user, target, ai, battle| @@ -754,7 +762,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RecoilHalfOfDamageDealt", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("EffectivenessIncludesFlyingType", proc { |power, move, user, target, ai, battle| @@ -775,7 +783,7 @@ Battle::AI::Handlers::MoveBasePower.add("EffectivenessIncludesFlyingType", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("CategoryDependsOnHigherDamagePoisonTarget", proc { |score, move, user, target, ai, battle| @@ -784,27 +792,27 @@ Battle::AI::Handlers::MoveEffectScore.add("CategoryDependsOnHigherDamagePoisonTa ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # CategoryDependsOnHigherDamageIgnoreTargetAbility #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # UseUserBaseDefenseInsteadOfUserBaseAttack #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # UseTargetAttackInsteadOfUserAttack #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # UseTargetDefenseInsteadOfTargetSpDef #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("EnsureNextMoveAlwaysHits", proc { |score, move, user, target, ai, battle| @@ -813,7 +821,7 @@ Battle::AI::Handlers::MoveEffectScore.add("EnsureNextMoveAlwaysHits", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("StartNegateTargetEvasionStatStageAndGhostImmunity", proc { |score, move, user, target, ai, battle| @@ -829,7 +837,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartNegateTargetEvasionStatStageAndG ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("StartNegateTargetEvasionStatStageAndDarkImmunity", proc { |score, move, user, target, ai, battle| @@ -845,17 +853,17 @@ Battle::AI::Handlers::MoveEffectScore.add("StartNegateTargetEvasionStatStageAndD ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # IgnoreTargetDefSpDefEvaStatStages #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TypeIsUserFirstType #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("TypeDependsOnUserIVs", proc { |power, move, user, target, ai, battle| @@ -864,7 +872,7 @@ Battle::AI::Handlers::MoveBasePower.add("TypeDependsOnUserIVs", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TypeAndPowerDependOnUserBerry", proc { |move, user, target, ai, battle| @@ -882,22 +890,22 @@ Battle::AI::Handlers::MoveBasePower.add("TypeAndPowerDependOnUserBerry", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TypeDependsOnUserPlate #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TypeDependsOnUserMemory #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TypeDependsOnUserDrive #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TypeDependsOnUserMorpekoFormRaiseUserSpeed1", proc { |move, user, target, ai, battle| @@ -911,7 +919,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TypeDependsOnUserMorpekoFormRaiseUser ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("TypeAndPowerDependOnWeather", proc { |power, move, user, target, ai, battle| @@ -920,7 +928,7 @@ Battle::AI::Handlers::MoveBasePower.add("TypeAndPowerDependOnWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("TypeAndPowerDependOnWeather", "TypeAndPowerDependOnTerrain") @@ -931,7 +939,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TypeAndPowerDependOnTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TargetMovesBecomeElectric", proc { |score, move, user, target, ai, battle| @@ -940,6 +948,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TargetMovesBecomeElectric", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code can be called with or without a target. Make sure it doesn't # assume that there is a target. #=============================================================================== diff --git a/Data/Scripts/011_Battle/005_AI/055_AI_MoveHandlers_MultiHit.rb b/Data/Scripts/011_Battle/005_AI/055_AI_MoveHandlers_MultiHit.rb index c3bb04ddb..57eb984d0 100644 --- a/Data/Scripts/011_Battle/005_AI/055_AI_MoveHandlers_MultiHit.rb +++ b/Data/Scripts/011_Battle/005_AI/055_AI_MoveHandlers_MultiHit.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitTwoTimes", proc { |power, move, user, target, ai, battle| @@ -8,7 +8,7 @@ Battle::AI::Handlers::MoveBasePower.add("HitTwoTimes", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("HitTwoTimes", "HitTwoTimesPoisonTarget") @@ -31,7 +31,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitTwoTimesPoisonTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.copy("HitTwoTimes", "HitTwoTimesFlinchTarget") @@ -42,7 +42,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitTwoTimesFlinchTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitTwoTimesTargetThenTargetAlly", proc { |power, move, user, target, ai, battle| @@ -51,7 +51,7 @@ Battle::AI::Handlers::MoveBasePower.add("HitTwoTimesTargetThenTargetAlly", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitThreeTimesPowersUpWithEachHit", proc { |power, move, user, target, ai, battle| @@ -60,7 +60,7 @@ Battle::AI::Handlers::MoveBasePower.add("HitThreeTimesPowersUpWithEachHit", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitThreeTimesAlwaysCriticalHit", proc { |power, move, user, target, ai, battle| @@ -77,7 +77,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitThreeTimesAlwaysCriticalHit", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitTwoToFiveTimes", proc { |power, move, user, target, ai, battle| @@ -87,7 +87,7 @@ Battle::AI::Handlers::MoveBasePower.add("HitTwoToFiveTimes", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitTwoToFiveTimesOrThreeForAshGreninja", proc { |power, move, user, target, ai, battle| @@ -100,7 +100,7 @@ Battle::AI::Handlers::MoveBasePower.add("HitTwoToFiveTimesOrThreeForAshGreninja" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitTwoToFiveTimesRaiseUserSpd1LowerUserDef1", proc { |power, move, user, target, ai, battle| @@ -123,7 +123,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitTwoToFiveTimesRaiseUserSpd1LowerUs ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HitOncePerUserTeamMember", proc { |move, user, target, ai, battle| @@ -147,17 +147,17 @@ Battle::AI::Handlers::MoveBasePower.add("HitOncePerUserTeamMember", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # AttackAndSkipNextTurn #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttack #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("TwoTurnAttackOneTurnInSun", proc { |power, move, user, target, ai, battle| @@ -166,7 +166,7 @@ Battle::AI::Handlers::MoveBasePower.add("TwoTurnAttackOneTurnInSun", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackParalyzeTarget", proc { |score, move, user, target, ai, battle| @@ -190,7 +190,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackParalyzeTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackBurnTarget", proc { |score, move, user, target, ai, battle| @@ -202,7 +202,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackBurnTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackFlinchTarget", proc { |score, move, user, target, ai, battle| @@ -214,6 +214,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackFlinchTarget", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TwoTurnAttackRaiseUserSpAtkSpDefSpd2", @@ -257,7 +258,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackRaiseUserSpAtkSpDefSpd2" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackChargeRaiseUserDefense1", proc { |score, move, user, target, ai, battle| @@ -275,7 +276,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackChargeRaiseUserDefense1" ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackChargeRaiseUserSpAtk1", proc { |score, move, user, target, ai, battle| @@ -292,27 +293,27 @@ Battle::AI::Handlers::MoveEffectScore.add("TwoTurnAttackChargeRaiseUserSpAtk1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttackInvulnerableUnderground #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttackInvulnerableUnderwater #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttackInvulnerableInSky #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttackInvulnerableInSkyParalyzeTarget #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TwoTurnAttackInvulnerableInSkyTargetCannotAct", proc { |move, user, target, ai, battle| @@ -324,22 +325,22 @@ Battle::AI::Handlers::MoveFailureCheck.add("TwoTurnAttackInvulnerableInSkyTarget ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TwoTurnAttackInvulnerableRemoveProtections #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # MultiTurnAttackPreventSleeping #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # MultiTurnAttackConfuseUserAtEnd #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("MultiTurnAttackPowersUpEachTurn", proc { |power, move, user, target, ai, battle| @@ -348,7 +349,7 @@ Battle::AI::Handlers::MoveBasePower.add("MultiTurnAttackPowersUpEachTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("MultiTurnAttackBideThenReturnDoubleDamage", proc { |power, move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/056_AI_MoveHandlers_Healing.rb b/Data/Scripts/011_Battle/005_AI/056_AI_MoveHandlers_Healing.rb index c96c2c6bc..e8784a4ce 100644 --- a/Data/Scripts/011_Battle/005_AI/056_AI_MoveHandlers_Healing.rb +++ b/Data/Scripts/011_Battle/005_AI/056_AI_MoveHandlers_Healing.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserFullyAndFallAsleep", proc { |move, user, target, ai, battle| @@ -18,7 +18,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserFullyAndFallAsleep", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserHalfOfTotalHP", proc { |move, user, target, ai, battle| @@ -34,7 +34,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserHalfOfTotalHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("HealUserHalfOfTotalHP", "HealUserDependingOnWeather") @@ -54,7 +54,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserDependingOnWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("HealUserHalfOfTotalHP", "HealUserDependingOnSandstorm") @@ -68,7 +68,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserDependingOnSandstorm", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("HealUserHalfOfTotalHP", "HealUserHalfOfTotalHPLoseFlyingTypeThisTurn") @@ -81,7 +81,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserHalfOfTotalHPLoseFlyingTypeTh ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CureTargetStatusHealUserHalfOfTotalHP", proc { |move, user, target, ai, battle| @@ -98,7 +98,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CureTargetStatusHealUserHalfOfTotalHP ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserByTargetAttackLowerTargetAttack1", proc { |move, user, target, ai, battle| @@ -133,7 +133,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserByTargetAttackLowerTargetAtta ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("HealUserByHalfOfDamageDone", proc { |score, move, user, target, ai, battle| @@ -147,7 +147,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserByHalfOfDamageDone", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserByHalfOfDamageDoneIfTargetAsleep", proc { |move, user, target, ai, battle| @@ -166,7 +166,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserByHalfOfDamageDoneIfTargetAsl ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("HealUserByThreeQuartersOfDamageDone", proc { |score, move, user, target, ai, battle| @@ -180,7 +180,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserByThreeQuartersOfDamageDone", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserAndAlliesQuarterOfTotalHP", proc { |move, user, target, ai, battle| @@ -202,7 +202,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserAndAlliesQuarterOfTotalHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserAndAlliesQuarterOfTotalHPCureStatus", proc { |move, user, target, ai, battle| @@ -225,7 +225,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserAndAlliesQuarterOfTotalHPCure ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealTargetHalfOfTotalHP", proc { |move, user, target, ai, battle| @@ -243,7 +243,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealTargetHalfOfTotalHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("HealTargetHalfOfTotalHP", "HealTargetDependingOnGrassyTerrain") @@ -261,7 +261,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealTargetDependingOnGrassyTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserPositionNextTurn", proc { |move, user, target, ai, battle| @@ -270,7 +270,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("HealUserPositionNextTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartHealUserEachTurn", proc { |move, user, target, ai, battle| @@ -279,7 +279,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartHealUserEachTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartHealUserEachTurnTrapUserInBattle", proc { |move, user, target, ai, battle| @@ -288,7 +288,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("StartHealUserEachTurnTrapUserInBattl ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartDamageTargetEachTurnIfTargetAsleep", proc { |move, user, target, ai, battle| @@ -308,7 +308,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartDamageTargetEachTurnIfTargetAsle ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartLeechSeedTarget", proc { |move, user, target, ai, battle| @@ -330,7 +330,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartLeechSeedTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfOfTotalHP", proc { |score, move, user, target, ai, battle| @@ -339,7 +339,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfOfTotalHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserLosesHalfOfTotalHPExplosive", proc { |move, user, target, ai, battle| @@ -362,7 +362,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfOfTotalHPExplosive", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("UserLosesHalfOfTotalHPExplosive", "UserFaintsExplosive") @@ -382,7 +382,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserFaintsExplosive", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("UserLosesHalfOfTotalHPExplosive", "UserFaintsPowersUpInMistyTerrainExplosive") @@ -407,7 +407,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserFaintsPowersUpInMistyTerrainExplo ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("UserFaintsFixedDamageUserHP", proc { |power, move, user, target, ai, battle| @@ -416,7 +416,7 @@ Battle::AI::Handlers::MoveBasePower.add("UserFaintsFixedDamageUserHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserFaintsLowerTargetAtkSpAtk2", proc { |score, move, user, target, ai, battle| @@ -435,7 +435,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserFaintsLowerTargetAtkSpAtk2", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserFaintsHealAndCureReplacement", proc { |move, user, target, ai, battle| @@ -449,7 +449,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserFaintsHealAndCureReplacement", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("UserFaintsHealAndCureReplacement", "UserFaintsHealAndCureReplacementRestorePP") @@ -457,6 +457,7 @@ Battle::AI::Handlers::MoveEffectScore.copy("UserFaintsHealAndCureReplacement", "UserFaintsHealAndCureReplacementRestorePP") #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartPerishCountsForAllBattlers", @@ -474,7 +475,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartPerishCountsForAllBattlers", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AttackerFaintsIfUserFaints", proc { |move, user, target, ai, battle| @@ -491,7 +492,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AttackerFaintsIfUserFaints", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("SetAttackerMovePPTo0IfUserFaints", proc { |score, move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/057_AI_MoveHandlers_Items.rb b/Data/Scripts/011_Battle/005_AI/057_AI_MoveHandlers_Items.rb index 3a29ad8d6..af598cbfa 100644 --- a/Data/Scripts/011_Battle/005_AI/057_AI_MoveHandlers_Items.rb +++ b/Data/Scripts/011_Battle/005_AI/057_AI_MoveHandlers_Items.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserTakesTargetItem", proc { |score, move, user, target, ai, battle| @@ -17,7 +17,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTakesTargetItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TargetTakesUserItem", proc { |move, user, target, ai, battle| @@ -38,7 +38,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TargetTakesUserItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserTargetSwapItems", proc { |move, user, target, ai, battle| @@ -63,7 +63,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserTargetSwapItems", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RestoreUserConsumedItem", proc { |move, user, target, ai, battle| @@ -78,7 +78,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RestoreUserConsumedItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("RemoveTargetItem", proc { |power, move, user, target, ai, battle| @@ -95,7 +95,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RemoveTargetItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DestroyTargetBerryOrGem", proc { |score, move, user, target, ai, battle| @@ -109,7 +109,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DestroyTargetBerryOrGem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CorrodeTargetItem", proc { |move, user, target, ai, battle| @@ -131,7 +131,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CorrodeTargetItem", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("StartTargetCannotUseItem", proc { |move, user, target, ai, battle| @@ -145,6 +145,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartTargetCannotUseItem", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("StartNegateHeldItems", @@ -155,7 +156,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartNegateHeldItems", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserConsumeBerryRaiseDefense2", proc { |move, user, target, ai, battle| @@ -188,6 +189,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserConsumeBerryRaiseDefense2", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AllBattlersConsumeBerry", @@ -232,7 +234,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AllBattlersConsumeBerry", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserConsumeTargetBerry", proc { |score, move, user, target, ai, battle| @@ -246,7 +248,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserConsumeTargetBerry", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ThrowUserItemAtTarget", proc { |move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/058_AI_MoveHandlers_ChangeMoveEffect.rb b/Data/Scripts/011_Battle/005_AI/058_AI_MoveHandlers_ChangeMoveEffect.rb index ce1c5361a..099ad7748 100644 --- a/Data/Scripts/011_Battle/005_AI/058_AI_MoveHandlers_ChangeMoveEffect.rb +++ b/Data/Scripts/011_Battle/005_AI/058_AI_MoveHandlers_ChangeMoveEffect.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RedirectAllMovesToUser", proc { |score, move, user, target, ai, battle| @@ -8,7 +8,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RedirectAllMovesToUser", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("RedirectAllMovesToTarget", proc { |score, move, user, target, ai, battle| @@ -17,7 +17,7 @@ Battle::AI::Handlers::MoveEffectScore.add("RedirectAllMovesToTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("CannotBeRedirected", proc { |score, move, user, target, ai, battle| @@ -39,7 +39,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CannotBeRedirected", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("RandomlyDamageOrHealTarget", proc { |power, move, user, target, ai, battle| @@ -48,7 +48,7 @@ Battle::AI::Handlers::MoveBasePower.add("RandomlyDamageOrHealTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealAllyOrDamageFoe", proc { |move, user, target, ai, battle| @@ -66,7 +66,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HealAllyOrDamageFoe", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("CurseTargetOrLowerUserSpd1RaiseUserAtkDef1", proc { |move, user, target, ai, battle| @@ -101,12 +101,12 @@ Battle::AI::Handlers::MoveEffectScore.add("CurseTargetOrLowerUserSpd1RaiseUserAt ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # EffectDependsOnEnvironment #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("HitsAllFoesAndPowersUpInPsychicTerrain", proc { |power, move, user, target, ai, battle| @@ -120,7 +120,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HitsAllFoesAndPowersUpInPsychicTerrai ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TargetNextFireMoveDamagesTarget", proc { |move, user, target, ai, battle| @@ -141,17 +141,17 @@ Battle::AI::Handlers::MoveEffectScore.add("TargetNextFireMoveDamagesTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # DoublePowerAfterFusionFlare #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # DoublePowerAfterFusionBolt #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("PowerUpAllyMove", proc { |move, user, target, ai, battle| @@ -166,6 +166,7 @@ Battle::AI::Handlers::MoveEffectScore.add("PowerUpAllyMove", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("CounterPhysicalDamage", @@ -192,6 +193,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CounterPhysicalDamage", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("CounterSpecialDamage", @@ -218,6 +220,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CounterSpecialDamage", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("CounterDamagePlusHalf", @@ -232,7 +235,7 @@ Battle::AI::Handlers::MoveEffectScore.add("CounterDamagePlusHalf", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UserAddStockpileRaiseDefSpDef1", proc { |move, user, target, ai, battle| @@ -254,7 +257,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserAddStockpileRaiseDefSpDef1", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("PowerDependsOnUserStockpile", proc { |move, user, target, ai, battle| @@ -268,7 +271,7 @@ Battle::AI::Handlers::MoveBasePower.add("PowerDependsOnUserStockpile", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("HealUserDependingOnUserStockpile", proc { |move, user, target, ai, battle| @@ -288,22 +291,22 @@ Battle::AI::Handlers::MoveEffectScore.add("HealUserDependingOnUserStockpile", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # GrassPledge #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # FirePledge #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # WaterPledge #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UseLastMoveUsed", proc { |move, user, target, ai, battle| @@ -313,7 +316,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("UseLastMoveUsed", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UseLastMoveUsedByTarget", proc { |move, user, target, ai, battle| @@ -328,22 +331,23 @@ Battle::AI::Handlers::MoveEffectScore.add("UseLastMoveUsedByTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # UseMoveTargetIsAboutToUse #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # UseMoveDependingOnEnvironment #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # UseRandomMove #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UseRandomMoveFromUserParty", proc { |move, user, target, ai, battle| @@ -364,7 +368,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("UseRandomMoveFromUserParty", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("UseRandomUserMoveIfAsleep", proc { |move, user, target, ai, battle| @@ -386,17 +390,19 @@ Battle::AI::Handlers::MoveEffectScore.add("UseRandomUserMoveIfAsleep", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # BounceBackProblemCausingStatusMoves #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # StealAndUseBeneficialStatusMove #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ReplaceMoveThisBattleWithTargetLastMoveUsed", proc { |move, user, target, ai, battle| @@ -410,7 +416,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("ReplaceMoveThisBattleWithTargetLastM ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("ReplaceMoveWithTargetLastMoveUsed", proc { |move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/059_AI_MoveHandlers_SwitchingActing.rb b/Data/Scripts/011_Battle/005_AI/059_AI_MoveHandlers_SwitchingActing.rb index 23966bba1..76c91b343 100644 --- a/Data/Scripts/011_Battle/005_AI/059_AI_MoveHandlers_SwitchingActing.rb +++ b/Data/Scripts/011_Battle/005_AI/059_AI_MoveHandlers_SwitchingActing.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("FleeFromBattle", proc { |move, user, target, ai, battle| @@ -8,7 +8,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("FleeFromBattle", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SwitchOutUserStatusMove", proc { |move, user, target, ai, battle| @@ -46,7 +46,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwitchOutUserStatusMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("SwitchOutUserDamagingMove", proc { |score, move, user, target, ai, battle| @@ -56,7 +56,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwitchOutUserDamagingMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerTargetAtkSpAtk1SwitchOutUser", proc { |move, user, target, ai, battle| @@ -79,7 +79,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerTargetAtkSpAtk1SwitchOutUser", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SwitchOutUserPassOnEffects", proc { |move, user, target, ai, battle| @@ -113,7 +113,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwitchOutUserPassOnEffects", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("SwitchOutTargetStatusMove", proc { |move, user, target, ai, battle| @@ -142,7 +142,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwitchOutTargetStatusMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("SwitchOutTargetDamagingMove", proc { |score, move, user, target, ai, battle| @@ -157,7 +157,7 @@ Battle::AI::Handlers::MoveEffectScore.add("SwitchOutTargetDamagingMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("BindTarget", proc { |score, move, user, target, ai, battle| @@ -166,7 +166,7 @@ Battle::AI::Handlers::MoveEffectScore.add("BindTarget", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveBasePower.add("BindTargetDoublePowerIfTargetUnderwater", proc { |power, move, user, target, ai, battle| @@ -180,7 +180,7 @@ Battle::AI::Handlers::MoveEffectScore.add("BindTargetDoublePowerIfTargetUnderwat ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TrapTargetInBattle", proc { |move, user, target, ai, battle| @@ -192,7 +192,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("TrapTargetInBattle", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TrapTargetInBattle", proc { |move, user, target, ai, battle| @@ -212,7 +212,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TrapTargetInBattleLowerTargetDefSpDef ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("TrapUserAndTargetInBattle", proc { |score, move, user, target, ai, battle| @@ -224,7 +224,7 @@ Battle::AI::Handlers::MoveEffectScore.add("TrapUserAndTargetInBattle", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TrapAllBattlersInBattleForOneTurn", proc { |move, user, target, ai, battle| @@ -233,12 +233,12 @@ Battle::AI::Handlers::MoveFailureCheck.add("TrapAllBattlersInBattleForOneTurn", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # PursueSwitchingFoe #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UsedAfterUserTakesPhysicalDamage", proc { |score, move, user, target, ai, battle| @@ -256,7 +256,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UsedAfterUserTakesPhysicalDamage", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UsedAfterAllyRoundWithDoublePower", proc { |score, move, user, target, ai, battle| @@ -271,17 +271,17 @@ Battle::AI::Handlers::MoveEffectScore.add("UsedAfterAllyRoundWithDoublePower", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TargetActsNext #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== # TargetActsLast #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("TargetUsesItsLastUsedMoveAgain", proc { |move, user, target, ai, battle| @@ -305,12 +305,13 @@ Battle::AI::Handlers::MoveEffectScore.add("TargetUsesItsLastUsedMoveAgain", ) #=============================================================================== +# TODO: Review score modifiers. # TODO: This code shouldn't make use of target. #=============================================================================== # StartSlowerBattlersActFirst #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("HigherPriorityInGrassyTerrain", proc { |score, move, user, target, ai, battle| @@ -322,7 +323,7 @@ Battle::AI::Handlers::MoveEffectScore.add("HigherPriorityInGrassyTerrain", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("LowerPPOfTargetLastMoveBy3", proc { |score, move, user, target, ai, battle| @@ -335,7 +336,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerPPOfTargetLastMoveBy3", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("LowerPPOfTargetLastMoveBy4", proc { |move, user, target, ai, battle| @@ -350,7 +351,7 @@ Battle::AI::Handlers::MoveEffectScore.add("LowerPPOfTargetLastMoveBy4", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetLastMoveUsed", proc { |move, user, target, ai, battle| @@ -368,7 +369,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetLastMoveUsed", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetUsingSameMoveConsecutively", proc { |move, user, target, ai, battle| @@ -383,7 +384,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DisableTargetUsingSameMoveConsecutive ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetUsingDifferentMove", proc { |move, user, target, ai, battle| @@ -420,7 +421,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DisableTargetUsingDifferentMove", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetStatusMoves", proc { |move, user, target, ai, battle| @@ -431,7 +432,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetStatusMoves", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetHealingMoves", proc { |move, user, target, ai, battle| @@ -441,7 +442,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetHealingMoves", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("DisableTargetSoundMoves", proc { |score, move, user, target, ai, battle| @@ -459,7 +460,7 @@ Battle::AI::Handlers::MoveEffectScore.add("DisableTargetSoundMoves", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetMovesKnownByUser", proc { |move, user, target, ai, battle| @@ -468,7 +469,7 @@ Battle::AI::Handlers::MoveFailureCheck.add("DisableTargetMovesKnownByUser", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("AllBattlersLoseHalfHPUserSkipsNextTurn", proc { |move, user, target, ai, battle| @@ -485,7 +486,7 @@ Battle::AI::Handlers::MoveEffectScore.add("AllBattlersLoseHalfHPUserSkipsNextTur ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfHP", proc { |score, move, user, target, ai, battle| @@ -496,7 +497,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfHP", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.copy("StartSunWeather", "StartShadowSkyWeather") @@ -512,7 +513,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartShadowSkyWeather", ) #=============================================================================== -# +# TODO: Review score modifiers. #=============================================================================== Battle::AI::Handlers::MoveFailureCheck.add("RemoveAllScreens", proc { |move, user, target, ai, battle| diff --git a/Data/Scripts/011_Battle/005_AI/070_AI_MoveHandlers_GeneralModifiers.rb b/Data/Scripts/011_Battle/005_AI/070_AI_MoveHandlers_GeneralModifiers.rb new file mode 100644 index 000000000..7ba7709e3 --- /dev/null +++ b/Data/Scripts/011_Battle/005_AI/070_AI_MoveHandlers_GeneralModifiers.rb @@ -0,0 +1,271 @@ +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: High priority checks: +# => Prefer move if it will KO the target (moreso if user is slower than target) +# => Don't prefer damaging move if it won't KO, user has Stance Change and +# is in shield form, and user is slower than the target +# => Check memory for past damage dealt by a target's non-high priority move, +# and prefer move if user is slower than the target and another hit from +# the same amount will KO the user +# => Check memory for past damage dealt by a target's priority move, and don't +# prefer the move if user is slower than the target and can't move faster +# than it because of priority +# => Discard move if user is slower than the target and target is semi- +# invulnerable (and move won't hit it) +# => Check memory for whether target has previously used Quick Guard, and +# don't prefer move if so + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Low priority checks: +# => Don't prefer move if user is faster than the target +# => Prefer move if user is faster than the target and target is semi- +# invulnerable + +#=============================================================================== +# Don't prefer a dancing move if the target has the Dancer ability. +# TODO: Review score modifier. +# TODO: Check all battlers, not just the target. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:dance_move_against_dancer, + proc { |score, move, user, target, ai, battle| + next score /= 2 if move.move.danceMove? && target&.has_active_ability?(:DANCER) + } +) + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Check memory for whether target has previously used Ion Deluge, and +# don't prefer move if it's Normal-type and target is immune because +# of its ability (Lightning Rod, etc.). + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer sound move if user hasn't been Throat Chopped but +# target has previously used Throat Chop. + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Prefer move if it has a high critical hit rate, critical hits are +# possible but not certain, and target has raised defences/user has +# lowered offences (Atk/Def or SpAtk/SpDef, whichever is relevant). + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer damaging moves if target is Destiny Bonding. +# => Also don't prefer damaging moves if user is slower than the target, move +# is likely to be lethal, and target has previously used Destiny Bond + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer a move that is stopped by Wide Guard if target has +# previously used Wide Guard. + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer Fire-type moves if target has previously used Powder. + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer contact move if making contact with the target could +# trigger an effect that's bad for the user (Static, etc.). +# => Also check if target has previously used Spiky Shield.King's Shield/ +# Baneful Bunker, and don't prefer move if so + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Prefer a contact move if making contact with the target could trigger +# an effect that's good for the user (Poison Touch/Pickpocket). + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Don't prefer a status move if user has a damaging move that will KO +# the target. +# => If target has previously used a move that will hurt the user by 30% of +# its current HP or more, moreso don't prefer a status move. + +#=============================================================================== +# Prefer damaging moves if AI has no more Pokémon or AI is less clever. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:damaging_moves_if_last_pokemon, + proc { |score, move, user, target, ai, battle| + if ai.trainer.medium_skill? && battle.pbAbleNonActiveCount(user.idxOwnSide) == 0 && + !(ai.trainer.high_skill? && target && battle.pbAbleNonActiveCount(target.idxOwnSide) > 0) + next score * 0.9 if move.statusMove? + next score * 1.1 if target_battler.hp <= target_battler.totalhp / 2 + end + } +) + +#=============================================================================== +# Don't prefer attacking the target if they'd be semi-invulnerable. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:target_semi_invulnerable, + proc { |score, move, user, target, ai, battle| + if move.accuracy > 0 && target && user.faster_than?(target) && + (target.battler.semiInvulnerable? || target.effects[PBEffects::SkyDrop] >= 0) + miss = true + miss = false if user.has_active_ability?(:NOGUARD) + miss = false if ai.trainer.best_skill? && target.has_active_ability?(:NOGUARD) + if ai.trainer.best_skill? && miss + # Knows what can get past semi-invulnerability + if target.effects[PBEffects::SkyDrop] >= 0 || + target.battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky", + "TwoTurnAttackInvulnerableInSkyParalyzeTarget", + "TwoTurnAttackInvulnerableInSkyTargetCannotAct") + miss = false if move.move.hitsFlyingTargets? + elsif target.battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground") + miss = false if move.move.hitsDiggingTargets? + elsif target.battler.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater") + miss = false if move.move.hitsDivingTargets? + end + end + next score - 50 if miss + end + } +) + +#=============================================================================== +# Pick a good move for the Choice items. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:good_move_for_choice_item, + proc { |score, move, user, target, ai, battle| + if ai.trainer.medium_skill? + if user.has_active_item?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF]) || + user.has_active_ability?(:GORILLATACTICS) + # Really don't prefer status moves (except Trick) + score *= 0.1 if move.statusMove? && move.function != "UserTargetSwapItems" + # Don't prefer moves of certain types + move_type = move.rough_type + # Most unpreferred types are 0x effective against another type, except + # Fire/Water/Grass + # TODO: Actually check through the types for 0x instead of hardcoding + # them. + # TODO: Reborn separately doesn't prefer Fire/Water/Grass/Electric, also + # with a 0.95x score, meaning Electric can be 0.95x twice. Why are + # these four types not preferred? Maybe because they're all not + # very effective against Dragon. + unpreferred_types = [:NORMAL, :FIGHTING, :POISON, :GROUND, :GHOST, + :FIRE, :WATER, :GRASS, :ELECTRIC, :PSYCHIC, :DRAGON] + score *= 0.95 if unpreferred_types.include?(move_type) + # Don't prefer moves with lower accuracy + score *= move.accuracy / 100.0 if move.accuracy > 0 + # Don't prefer moves with low PP + score *= 0.9 if move.move.pp < 6 + next score + end + end + } +) + +#=============================================================================== +# If user is frozen, prefer a move that can thaw the user. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:thawing_move_when_frozen, + proc { |score, move, user, target, ai, battle| + if ai.trainer.medium_skill? && user.status == :FROZEN + if move.move.thawsUser? + score += 30 + else + user.battler.eachMove do |m| + next unless m.thawsUser? + score -= 30 # Don't prefer this move if user knows another move that thaws + break + end + end + next score + end + } +) + +#=============================================================================== +# If target is frozen, don't prefer moves that could thaw them. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:thawing_move_against_frozen_target, + proc { |score, move, user, target, ai, battle| + if ai.trainer.medium_skill? && target&.status == :FROZEN + if move.rough_type == :FIRE || (Settings::MECHANICS_GENERATION >= 6 && move.move.thawsUser?) + next score - 30 + end + end + } +) + +#=============================================================================== +# Don't prefer hitting a wild shiny Pokémon. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:shiny_target, + proc { |score, move, user, target, ai, battle| + next score - 40 if target&.wild? && target&.battler.shiny? + } +) + +#=============================================================================== +# TODO: Review score modifier. +#=============================================================================== +# TODO: Discard a move that can be Magic Coated if either opponent has Magic +# Bounce. + +#=============================================================================== +# Account for accuracy of move. +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:move_accuracy, + proc { |score, move, user, target, ai, battle| + next score * move.rough_accuracy / 100.0 + } +) + +#=============================================================================== +# Prefer flinching external effects (note that move effects which cause +# flinching are dealt with in the function code part of score calculation). +# TODO: Review score modifier. +#=============================================================================== +Battle::AI::Handlers::GeneralMoveScore.add(:flinching_effects, + proc { |score, move, user, target, ai, battle| + if ai.trainer.medium_skill? && target + if !target.has_active_ability?([:INNERFOCUS, :SHIELDDUST]) && + target.effects[PBEffects::Substitute] == 0 + if move.move.flinchingMove? || + (move.damagingMove? && + (user.has_active_item?([:KINGSROCK, :RAZORFANG]) || + user.has_active_ability?(:STENCH))) + next score + 20 + end + end + end + } +) + +#=============================================================================== +# Adjust score based on how much damage it can deal. +# TODO: Review score modifier. +#=============================================================================== +# Battle::AI::Handlers::GeneralMoveScore.add(:add_predicted_damage, +# proc { |score, move, user, target, ai, battle| +# if move.damagingMove? +# dmg = move.rough_damage +# next score + [30.0 * dmg / target.hp, 40].min +# else # Status moves +# # Don't prefer attacks which don't deal damage +# next score - 10 +# end +# } +# )