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
-
#dead? ⇒ Boolean
(also: #wmt_dead?)
Tell if the effect is dead.
-
#initialize_with_marked_targets(user, targets, &block)
Initialize the mechanic.
-
#launcher ⇒ PFM::PokemonBattler?
The launcher of this effect.
Methods included from WithTargets
#initialize_with_targets, #targetted?
Instance Method Details
#dead? ⇒ Boolean Also known as: wmt_dead?
Tell if the effect is dead
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
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 |
#launcher ⇒ PFM::PokemonBattler?
The launcher of this effect
29 30 31 |
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00001 Mechanics/00200 WithMarkedTargets.rb', line 29 def launcher @wmt_user end |