Tuesday, 19 August 2025 01:37:27
This commit is contained in:
@@ -4,17 +4,26 @@ using System.Collections.Generic;
|
||||
|
||||
public partial class BasicAttack : Effect
|
||||
{
|
||||
public BasicAttack() : base()
|
||||
public BasicAttack(Node2D OWNER) : base(OWNER)
|
||||
{
|
||||
_trigger.Add(Trigger.Collision);
|
||||
}
|
||||
|
||||
public override void TriggerEffect()
|
||||
public override void TriggerEffect(Node TARGET = null)
|
||||
{
|
||||
if (_workerOwner._collisionTarget is Worker)
|
||||
if (TARGET is Worker)
|
||||
{
|
||||
int damage = _workerOwner._aptitude;
|
||||
((Worker)_workerOwner._collisionTarget).ChangeHealth(damage, _workerOwner);
|
||||
Worker target = (Worker)TARGET;
|
||||
if (_owner is Worker)
|
||||
{
|
||||
Worker owner = (Worker)_owner;
|
||||
if (target._manager != owner._manager)
|
||||
{
|
||||
int damage = -owner._aptitude / 2;
|
||||
target.ChangeHealth(damage, owner);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
Gameplay/Effects/Caffeinate.cs
Normal file
22
Gameplay/Effects/Caffeinate.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Caffeinate : Effect
|
||||
{
|
||||
public Caffeinate(Node2D OWNER) : base(OWNER)
|
||||
{
|
||||
_trigger.Add(Trigger.Collision);
|
||||
}
|
||||
|
||||
public override void TriggerEffect(Node TARGET = null)
|
||||
{
|
||||
if (TARGET is Worker)
|
||||
{
|
||||
Worker target = (Worker)TARGET;
|
||||
target._rotationalForce += 10;
|
||||
Vector2 targetDistanceNormal = (target.Position - _owner.Position).Normalized();
|
||||
target.ApplyCentralForce(targetDistanceNormal * 10);
|
||||
target.ChangeHealth(-1, _owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Gameplay/Effects/Caffeinate.cs.uid
Normal file
1
Gameplay/Effects/Caffeinate.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cbk76ik5o17nx
|
||||
20
Gameplay/Effects/Spiky.cs
Normal file
20
Gameplay/Effects/Spiky.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Spiky : Effect
|
||||
{
|
||||
public Spiky(Node2D OWNER) : base(OWNER)
|
||||
{
|
||||
_trigger.Add(Trigger.Collision);
|
||||
}
|
||||
|
||||
public override void TriggerEffect(Node TARGET = null)
|
||||
{
|
||||
if (TARGET is Worker)
|
||||
{
|
||||
Worker target = (Worker)TARGET;
|
||||
target._rotationalForce += 10;
|
||||
target.ChangeHealth(-1, _owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Gameplay/Effects/Spiky.cs.uid
Normal file
1
Gameplay/Effects/Spiky.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ciwja82k4ihw6
|
||||
3
Gameplay/Effects/basic_attack.tscn
Normal file
3
Gameplay/Effects/basic_attack.tscn
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_scene format=3 uid="uid://bih70e65g1108"]
|
||||
|
||||
[node name="BasicAttack" type="Node"]
|
||||
6
Gameplay/Effects/caffeinate.tscn
Normal file
6
Gameplay/Effects/caffeinate.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bo2rj0albmkkw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbk76ik5o17nx" path="res://Gameplay/Effects/Caffeinate.cs" id="1_2f3ha"]
|
||||
|
||||
[node name="Caffeinate" type="Node"]
|
||||
script = ExtResource("1_2f3ha")
|
||||
6
Gameplay/Effects/spiky.tscn
Normal file
6
Gameplay/Effects/spiky.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cchjk4lohg8k3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ciwja82k4ihw6" path="res://Gameplay/Effects/Spiky.cs" id="1_levtu"]
|
||||
|
||||
[node name="Spiky" type="Node"]
|
||||
script = ExtResource("1_levtu")
|
||||
Reference in New Issue
Block a user