Friday, 22 August 2025 01:17:08

This commit is contained in:
2025-08-22 01:17:10 -04:00
parent 2eb95b18fd
commit 4fe431a8e0
18 changed files with 172 additions and 56 deletions

View File

@@ -0,0 +1,36 @@
using Godot;
using System;
public partial class Caffeinated : Condition
{
public Caffeinated(Node2D OWNER) : base(OWNER)
{
_triggers.Add(Trigger.On.Time);
_countdown = 2;
_timer.OneShot = true;
_timer.WaitTime = _countdown;
_timer.Autostart = true;
AddChild(_timer);
// GetNode<Timer>("Timer").Timeout += Fire;
if (OWNER is Worker)
{
((Worker)OWNER)._staminaCanDrain = false;
}
}
public override void Fire()
{
_expired = true;
if (_target != null)
{
if (_target is Worker)
{
Worker target = (Worker)_target;
target._stamina -= 1;
target._staminaCanDrain = true;
target._conditions.Remove(this);
}
_target = null;
}
}
}