Class: Battle::AI::MoveHeuristicBase::Rest

Inherits:
Battle::AI::MoveHeuristicBase show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/08000 Battle_AI/00001 MoveHeuristic/00002 Rest.rb

Instance Method Summary collapse

Methods inherited from Battle::AI::MoveHeuristicBase

#ignore_effectiveness?, #ignore_power?, new, #overwrite_move_kind_flag?, register

Constructor Details

#initializeRest

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

Parameters:

Returns:

  • (Float)


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