ProjectileAttack

Inherits: Node < Object

A Projectile launcher. Suited (but not limited) to long-range or Projectile attacks.

This node is Frame-Synced.

Properties

PackedScene

PR_Projectile_Scene

Vector2

PR_Offset

int

PR_Direction

1

Vector2

PR_Force

float

Damage

nan

float

Multiplier

1.0

bool

Cooldown

false

int

obstruction_layers

1

String

FS_Animation

""

int

FS_Spawn_Frame

0

int

FS_Launch_Frame

0

AudioStreamPlayer2D

AUX_On_Animation_Start

AudioStreamPlayer2D

AUX_On_Spawn_Frame

AudioStreamPlayer2D

AUX_On_Launch_Frame

Node2D

parent

get_parent()

bool

attacking

false

Projectile

new_projectile

Methods

void

_process(delta: float)

Variant

spawn(damage: float = Damage)

void

launch(force: Vector2 = PR_Force)

void

quick_shot(damage: float = Damage, force: Vector2 = PR_Force)


Signals

attacked() πŸ”—

Emitted when the attack is activated.


hit(entity: Entity, damage_amount: float) πŸ”—

Emitted when an Entity gets hit by the attack.


Property Descriptions

PackedScene PR_Projectile_Scene πŸ”—

The Projectile that will be shot from this attack.


Vector2 PR_Offset πŸ”—

The offset of the Projectile’s center from the parent/shooter’s center when the projectile is spawned while the character is facing right.

This will automatically be horizontally flipped if PR_Direction is -1.


int PR_Direction = 1 πŸ”—

The direction in which to shoot the projectile relative to the parent.

Intended value is 1 or -1. Only the sign of the value will be considered.


Vector2 PR_Force πŸ”—

The Force with which to shoot the Projectile if the character is facing right.

This will automatically be horizontally flipped by the Projectile itself if PR_Direction is -1.


float Damage = nan πŸ”—

Force overwrite damage on launched projectiles. Leave it as NAN to use the projectile’s inate value.


float Multiplier = 1.0 πŸ”—

A multiplier to increase applied damage exponentially.

Useful for power-ups.


bool Cooldown = false πŸ”—

Cooldown to temporarily disable Frame-Sync.


int obstruction_layers = 1 πŸ”—

All Layers which can be hit by this attack (including characters).

This is carried forward to the Projectile.


String FS_Animation = "" πŸ”—

Name of the Animation which will automatically trigger this attack.


int FS_Spawn_Frame = 0 πŸ”—

Frame at which the Projectile is spawned.


int FS_Launch_Frame = 0 πŸ”—

Frame at which the Projectile is launched.


AudioStreamPlayer2D AUX_On_Animation_Start πŸ”—

AudioStreamPlayer2D to play when the attack animation begins.


AudioStreamPlayer2D AUX_On_Spawn_Frame πŸ”—

AudioStreamPlayer2D to play when the spawn frame is reached.


AudioStreamPlayer2D AUX_On_Launch_Frame πŸ”—

AudioStreamPlayer2D to play when the launch frame is reached.


Node2D parent = get_parent() πŸ”—

The parent of this node.


bool attacking = false πŸ”—

A boolean to tell whether the attack is currently in progress or not.


Projectile new_projectile πŸ”—

Variable to hold the last spawned Projectile


Method Descriptions

void _process(delta: float) πŸ”—

There is currently no description for this method. Please help us by contributing one!


Variant spawn(damage: float = Damage) πŸ”—

Spawn sequence for the Projectile


void launch(force: Vector2 = PR_Force) πŸ”—

Launch sequence for the Projectile.

Force direction is automatically fixed by the Projectile.


void quick_shot(damage: float = Damage, force: Vector2 = PR_Force) πŸ”—

There is currently no description for this method. Please help us by contributing one!