Module: Battle::Effects::Mechanics::WithMarkedTargets

Includes:
WithTargets
Included in:
HelpingHand, LeechSeed
Defined in:
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00200 WithMarkedTargets.rb

Overview

Store targets informations

*Requirement*

  • Call initialize_with_marked_targets

**Initialization exemple** “`ruby # Inside EffectBase child class initialize_with_marked_targets(targets) { |target| YourMarkEffect.new(logic, self, user, target) } “`

Instance Method Summary collapse

Methods included from WithTargets

#initialize_with_targets, #targetted?

Instance Method Details

#dead?Boolean Also known as: wmt_dead?

Tell if the effect is dead

Returns:

  • (Boolean)


35
36
37
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00200 WithMarkedTargets.rb', line 35

def dead?
  super || !@wt_targets.all?(&:position) || @wt_targets.all?(&:dead?)
end

#initialize_with_marked_targets(user, targets, &block)

Initialize the mechanic

Parameters:



21
22
23
24
25
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00200 WithMarkedTargets.rb', line 21

def initialize_with_marked_targets(user, targets, &block)
  initialize_with_targets(targets)
  @wmt_user = user
  targets.each { |target| target.effects.add(block.call(target)) }
end

#launcherPFM::PokemonBattler?

The launcher of this effect

Returns:



29
30
31
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00200 WithMarkedTargets.rb', line 29

def launcher
  @wmt_user
end