General code improvements, progress step tracker implementation for worldgen, and work towards enemy behavior
This commit is contained in:
27
scripts/v2/status_effect.gd
Normal file
27
scripts/v2/status_effect.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
class_name StatusEffect
|
||||
extends Resource
|
||||
## A status effect is a temporary effect that can be applied to a creature.
|
||||
|
||||
## Duration of the status effect in seconds.
|
||||
@export var duration: float = 0.0
|
||||
|
||||
## Magnitude of the status effect.
|
||||
@export var magnitude: float = 0.0
|
||||
|
||||
|
||||
## Apply the status effect to a creature.
|
||||
func apply(creature: Creature) -> void:
|
||||
if self.has_method("_apply"):
|
||||
self.call("_apply", creature)
|
||||
|
||||
|
||||
## Remove the status effect from a creature.
|
||||
func remove(creature: Creature) -> void:
|
||||
if self.has_method("_remove"):
|
||||
self.call("_remove", creature)
|
||||
|
||||
|
||||
## Tick the status effect on a creature.
|
||||
func tick(creature: Creature, delta: float) -> void:
|
||||
if self.has_method("_tick"):
|
||||
self.call("_tick", creature, delta)
|
||||
Reference in New Issue
Block a user