Class: Battle::AI::MoveHeuristicBase::ReflectMoves
- Inherits:
-
Battle::AI::MoveHeuristicBase
- Object
- Battle::AI::MoveHeuristicBase
- Battle::AI::MoveHeuristicBase::ReflectMoves
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00005 ReflectMoves.rb
Instance Method Summary collapse
-
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic.
-
#initialize ⇒ ReflectMoves
constructor
Create a new Rest Heuristic.
Methods inherited from Battle::AI::MoveHeuristicBase
#ignore_effectiveness?, #ignore_power?, new, #overwrite_move_kind_flag?, register
Constructor Details
#initialize ⇒ ReflectMoves
Create a new Rest Heuristic
6 7 8 |
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00005 ReflectMoves.rb', line 6 def initialize super(true, true, true) end |
Instance Method Details
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic
16 17 18 19 20 21 22 |
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00005 ReflectMoves.rb', line 16 def compute(move, user, target, ai) return 0 if ai.scene.logic.bank_effects[user.bank].has?(move.db_symbol) || (move.db_symbol == :aurora_veil && !$env.hail?) return 0.80 if move.db_symbol == :light_screen && ai.scene.logic.foes_of(user).none? { |foe| foe.moveset.none?(&:special?) } return 0.80 if move.db_symbol == :reflect && ai.scene.logic.foes_of(user).none? { |foe| foe.moveset.none?(&:physical?) } return 0.90 + ai.scene.logic.move_damage_rng.rand(0..0.10) end |