reworking effects, turning them into their own scene for replicability
This commit is contained in:
21
Gameplay/Effects/TimeEffects/TimeEffect1.cs
Normal file
21
Gameplay/Effects/TimeEffects/TimeEffect1.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class TimeEffect1 : TimeEffect
|
||||
{
|
||||
public override void Fire()
|
||||
{
|
||||
base.Fire();
|
||||
if (_calls <= _maxCalls || _maxCalls == 0)
|
||||
{
|
||||
List<Shield> shields = _contact._button._phone._player._board._shields.Where(s=>!s._broken).ToList();
|
||||
int shieldNumber = Globals._rng.Next(0, shields.Count);
|
||||
int damage = Globals._rng.Next(-12,-8);
|
||||
shields[shieldNumber].ChangeHealth(damage);
|
||||
_contact._button._phone._player._debug.Text = "Shield "+shieldNumber+" damaged for "+damage+" Damage!";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
1
Gameplay/Effects/TimeEffects/TimeEffect1.cs.uid
Normal file
1
Gameplay/Effects/TimeEffects/TimeEffect1.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b3ql333letuv
|
||||
10
Gameplay/Effects/TimeEffects/time_effect_1.tscn
Normal file
10
Gameplay/Effects/TimeEffects/time_effect_1.tscn
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_scene format=3 uid="uid://dxr716rnqu2e"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b3ql333letuv" path="res://Gameplay/Effects/TimeEffects/TimeEffect1.cs" id="1_l6ud1"]
|
||||
|
||||
[node name="TimeEffect1" type="Node" unique_id=980963154]
|
||||
script = ExtResource("1_l6ud1")
|
||||
|
||||
[node name="Timer" type="Timer" parent="." unique_id=1364707554]
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="OnTimerTimeout"]
|
||||
Reference in New Issue
Block a user