Extensive work done on basically everything. Attacks prototyped, animations prototyped, pawnbody split out, all traps but pitfall implemented, UI hooked up more.
This commit is contained in:
27
scripts/gas_square.gd
Normal file
27
scripts/gas_square.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Area3D
|
||||
|
||||
@onready var particles : GPUParticles3D = %ParticleFX
|
||||
var trap_owner : int
|
||||
var damage : int
|
||||
var time_remaining : float
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
particles.emitting = true
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
for body in get_overlapping_bodies():
|
||||
body.poison(damage, 2.0)
|
||||
time_remaining -= delta
|
||||
if time_remaining <= 0:
|
||||
queue_free()
|
||||
|
||||
func setup(owner, damage) -> void:
|
||||
self.trap_owner = trap_owner
|
||||
self.damage = damage
|
||||
time_remaining = 2.0
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if body.can_hurt():
|
||||
body.hurt(damage)
|
||||
body.poison(damage, 2.0)
|
||||
Reference in New Issue
Block a user