General code improvements, progress step tracker implementation for worldgen, and work towards enemy behavior

This commit is contained in:
2024-01-23 21:45:52 +01:00
parent 3f465a708c
commit 49562ba9ce
11 changed files with 517 additions and 214 deletions

View 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)