reworking effects, turning them into their own scene for replicability
This commit is contained in:
20
Gameplay/Effects/ClickEffects/ClickEffect1.cs
Normal file
20
Gameplay/Effects/ClickEffects/ClickEffect1.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class ClickEffect1 : ClickEffect
|
||||
{
|
||||
public override void Fire()
|
||||
{
|
||||
base.Fire();
|
||||
if (_available && (_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(-50,-30);
|
||||
shields[shieldNumber].ChangeHealth(damage);
|
||||
_contact._button._phone._player._debug.Text = "Shield "+shieldNumber+" damaged for "+damage+" Damage!";
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Gameplay/Effects/ClickEffects/ClickEffect1.cs.uid
Normal file
1
Gameplay/Effects/ClickEffects/ClickEffect1.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://qmmft72g5uj6
|
||||
9
Gameplay/Effects/ClickEffects/click_effect1.tscn
Normal file
9
Gameplay/Effects/ClickEffects/click_effect1.tscn
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://dkio7bpdjyh6q"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://fygidhjkgabe" path="res://Gameplay/effect.tscn" id="1_dgxlt"]
|
||||
[ext_resource type="Script" uid="uid://qmmft72g5uj6" path="res://Gameplay/Effects/ClickEffects/ClickEffect1.cs" id="2_wfqii"]
|
||||
|
||||
[node name="ClickEffect1" unique_id=110922950 instance=ExtResource("1_dgxlt")]
|
||||
script = ExtResource("2_wfqii")
|
||||
|
||||
[node name="Timer" type="Timer" parent="." index="0" unique_id=801745901]
|
||||
Reference in New Issue
Block a user