Wednesday, 20 August 2025 02:02:40
This commit is contained in:
24
Gameplay/Conditions/Spiky.cs
Normal file
24
Gameplay/Conditions/Spiky.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Spiky : Condition
|
||||
{
|
||||
public Spiky(Node2D OWNER) : base(OWNER)
|
||||
{
|
||||
_triggers.Add(Trigger.On.Collision);
|
||||
}
|
||||
|
||||
public override void Fire()
|
||||
{
|
||||
if (_target != null)
|
||||
{
|
||||
if (_target is Worker)
|
||||
{
|
||||
Worker target = (Worker)_target;
|
||||
target._rotationalForce += 10;
|
||||
target.ChangeHealth(-1, _owner);
|
||||
}
|
||||
_target = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Gameplay/Conditions/Spiky.cs.uid
Normal file
1
Gameplay/Conditions/Spiky.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ciwja82k4ihw6
|
||||
6
Gameplay/Conditions/spiky.tscn
Normal file
6
Gameplay/Conditions/spiky.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://devvkr2joh1u2"]
|
||||
|
||||
[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