MeleeAttack
Inherits: Area2D < CollisionObject2D < Node2D < CanvasItem < Node < Object
A Class that can cause damage to any Entity inside a certain area. Suited (but not limited) to close-range or Melee attacks.
This node is Frame-Synced.
Properties
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods
void |
_ready() |
void |
|
obstruction_check(target: Entity) |
|
void |
|
void |
damage_first(amount: float = <unknown>) |
void |
damage_closest(amount: float = <unknown>) |
void |
damage_all(amount: float = <unknown>) |
void |
damage_distributed(amount: float = <unknown>) |
Signals
attacked() 🔗
Emitted when the attack is activated.
hit(entity: Entity, damage_amount: float) 🔗
Emitted when an Entity gets hit by the attack.
Enumerations
enum DAMAGE_MODE: 🔗
DAMAGE_MODE FIRST = 0
Damage only the first Entity in the order in tree.
DAMAGE_MODE CLOSEST = 1
Damage only the Entity whose center is physically closest.
DAMAGE_MODE ALL = 2
Damage all Entity within the area with the full Damage.
DAMAGE_MODE DISTRIBUTED = 3
Distributes the Damage equally to all Entity within the area.
Property Descriptions
DAMAGE_MODE Mode 🔗
The selected DAMAGE_MODE.
The default damage amount.
A multiplier to increase applied damage exponentially.
Useful for power-ups.
Cooldown to temporarily disable Frame-Sync.
All Layers which will block this attack.
Name of the Animation which will automatically trigger this attack.
Frame at which the damage is applied.
AudioStreamPlayer2D AUX_On_Animation_Start 🔗
AudioStreamPlayer2D to play when the attack animation begins.
AudioStreamPlayer2D AUX_On_Hit_Frame 🔗
AudioStreamPlayer2D to play when the hit frame is reached and damage is applied.
Entity parent = get_parent() 🔗
The parent of this node.
The RayCast2D used to check for obstructioncs.
A boolean to tell whether the attack is currently in progress or not.
Method Descriptions
void _ready() 🔗
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
bool obstruction_check(target: Entity) 🔗
Checks whether anything in between is blocking the attack.
void damage(amount: float = <unknown>) 🔗
Applies damage based on the selected DAMAGE_MODE.
void damage_first(amount: float = <unknown>) 🔗
Applies damage to only the first Entity in the order in tree.
void damage_closest(amount: float = <unknown>) 🔗
Applies damage to only the Entity whose center is physically closest.
void damage_all(amount: float = <unknown>) 🔗
Applies damage to all Entity within the area with the full Damage.
void damage_distributed(amount: float = <unknown>) 🔗
Applies equally distributed damage to all Entity within the area.
The sum of all damages is equal to amount, which by default is Damage * Multiplier.