Class: Battle::AI::MoveHeuristicBase::CuringMove
- Inherits:
-
Battle::AI::MoveHeuristicBase
- Object
- Battle::AI::MoveHeuristicBase
- Battle::AI::MoveHeuristicBase::CuringMove
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00004 CuringMoves.rb
Instance Method Summary collapse
-
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic.
-
#initialize ⇒ CuringMove
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 ⇒ CuringMove
Create a new Rest Heuristic
6 7 8 |
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00004 CuringMoves.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/00004 CuringMoves.rb', line 16 def compute(move, user, target, ai) return 0 if target.effects.has?(:heal_block) return 0 if target.has_ability?(:soundproof) return 0 if target.dead? || target.status == 0 return 0.75 + ai.scene.logic.move_damage_rng.rand(0..0.25) end |