Module: Battle::Move::Mechanics::PowerBasedOnItem

Includes:
ItemBased
Included in:
Fling, NaturalGift
Defined in:
scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00001 Mechanics/00050 ItemBased.rb

Overview

Preset used for attacks with power based on held item. Should be included only in a Battle::Move class or a class with the same interface The includer must overwrite the following methods:

  • private consume_item?

  • private valid_item_hold?

  • private get_power_by_item

Instance Method Summary collapse

Methods included from ItemBased

#move_usable_by_user

Instance Method Details

#real_base_power(user, target) ⇒ Integer Also known as: power_based_on_item_real_base_power

Get the real base power of the move (taking in account all parameter)

Parameters:

Returns:



71
72
73
74
75
76
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00001 Mechanics/00050 ItemBased.rb', line 71

def real_base_power(user, target)
  return super unless valid_held_item?(user.item_db_symbol)

  log_data("power = #{get_power_by_item(user.item_db_symbol)} # move based on held item")
  return get_power_by_item(user.item_db_symbol)
end