Class: Battle::Effects::Item::TypeResistingBerry

Inherits:
Berry
  • Object
show all
Defined in:
docs/5_Battle_06_Effects_05_Item_Effects.rb

Overview

Class describing Type Resisting Berry item effects

Constant Summary collapse

CONDITIONS =

List of conditions to yield the attack multiplier

Returns:

  • (Hash{Symbol => Proc})
{}

Constants inherited from Berry

Berry::FLAVORS

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.register(db_symbol, klass = TypeResistingBerry, &block) {|user, target, move| ... }

Register an item with defense multiplier only

Parameters:

  • db_symbol (Symbol) —

    db_symbol of the item

  • klass (Class<TypeResistingBerry>) (defaults to: TypeResistingBerry) —

    klass to instanciate

  • block (Proc) —

    condition to verify

Yield Parameters:

Yield Returns:

  • (Boolean)


596
597
# File 'docs/5_Battle_06_Effects_05_Item_Effects.rb', line 596

def register(db_symbol, klass = TypeResistingBerry, &block)
end

Instance Method Details

#execute_berry_effect(force_heal: false, force_execution: false)

Function that executes the effect of the berry (for Pluck & Bug Bite)

Parameters:

  • force_heal (Boolean) (defaults to: false) —

    tell if a healing berry should force the heal

  • force_execution (Boolean) (defaults to: false) —

    tell if the execution of the berry has to be forced



577
578
# File 'docs/5_Battle_06_Effects_05_Item_Effects.rb', line 577

def execute_berry_effect(force_heal: false, force_execution: false)
end

#mod3_multiplier(user, target, move) ⇒ Float, Integer

Give the move mod3 mutiplier (after everything)

Parameters:

Returns:

  • (Float, Integer) —

    multiplier



572
573
# File 'docs/5_Battle_06_Effects_05_Item_Effects.rb', line 572

def mod3_multiplier(user, target, move)
end