Saturday, 31 January 2026 01:00:43
This commit is contained in:
25
Gameplay/Actions/Example1.cs
Normal file
25
Gameplay/Actions/Example1.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public partial class Example1 : Action
|
||||
{
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
public override void Fire()
|
||||
{
|
||||
base.Fire();
|
||||
// GD.Print(_owner);
|
||||
List<Shield> unbrokenShields = [.. _owner._board._shields.Where(s=>!s._broken)];
|
||||
int shieldNumber = Globals._rng.Next(0, unbrokenShields.Count);
|
||||
int damageAmount = Globals._rng.Next(-12,-8);
|
||||
_owner._board._shields[shieldNumber].ChangeHealth(damageAmount);
|
||||
((Player)_owner)._phone._debug.Text = "Shield " + shieldNumber + " damaged " + damageAmount + "hp";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user