Class: Battle::AI::MoveHeuristicBase::Rest
- Inherits:
-
Battle::AI::MoveHeuristicBase
- Object
- Battle::AI::MoveHeuristicBase
- Battle::AI::MoveHeuristicBase::Rest
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00002 Rest.rb
Instance Method Summary collapse
-
#compute(move, user, target, ai) ⇒ Float
Compute the heuristic.
-
#initialize ⇒ Rest
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 ⇒ Rest
Create a new Rest Heuristic
6 7 8 |
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00002 Rest.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 |
# File 'scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00002 Rest.rb', line 16 def compute(move, user, target, ai) boost = user.status_effect.instance_of?(Effects::Status) ? 0 : 1 return (1 - user.hp_rate) * 2 + boost end |