Projectile2DModifier

Inherits: TimedModifier < RefCounted < Object

Specialized TimedModifier implementation for Projectile2D objects.


Description

The Projectile2DModifier class extends the base TimedModifier functionality, specifically to manage temporary effects applied to Projectile2D instances.

Use it to add temporary buffs and debuffs to your 2D projectiles.


Tutorials


Properties



Methods



Property Descriptions

Projectile2D projectile

Projectile2D instance being modified by this effect.

This property provides type-safe access to the target projectile, mapping directly to the base class target property.



Method Descriptions

Projectile2DModifier clone()

Returns an identical copy of the modifier.


void copy(base: TimedModifier)

Copies all properties from the base modifier, including Projectile2DModifier properties.


void disable()

Specialized disable behavior for projectile modifiers.

Disables the modifier, removes stacks and cleans up projectile references.


bool validate_modifier(_projectile: Projectile2D)

Returns true if the modifier can be applied, false otherwise.

Determines if the modifier can be applied to the specified _projectile.

Validation process:

  1. First checks if a custom validation callback exists and uses its result.
  2. If no callback exists, checks if the projectile already has a modifier with the same name.