Friday, 22 August 2025 01:17:08
This commit is contained in:
36
Gameplay/Conditions/Caffeinated.cs
Normal file
36
Gameplay/Conditions/Caffeinated.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Gameplay/Conditions/Caffeinated.cs.uid
Normal file
1
Gameplay/Conditions/Caffeinated.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ciwja82k4ihw6
|
||||
@@ -16,7 +16,7 @@ public partial class Spiky : Condition
|
||||
{
|
||||
Worker target = (Worker)_target;
|
||||
target._rotationalForce += 10;
|
||||
target.ChangeHealth(-1, _owner);
|
||||
// target.ChangeHealth(-1, _owner);
|
||||
}
|
||||
_target = null;
|
||||
}
|
||||
|
||||
6
Gameplay/Conditions/caffeinated.tscn
Normal file
6
Gameplay/Conditions/caffeinated.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dtnwf7i53hix6"]
|
||||
|
||||
[ext_resource type="Script" path="res://Gameplay/Effects/Spiky.cs" id="1_pcknv"]
|
||||
|
||||
[node name="Spiky" type="Node"]
|
||||
script = ExtResource("1_pcknv")
|
||||
Reference in New Issue
Block a user