Files
tictactoe/Gameplay/Boss.cs

35 lines
819 B
C#

using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class Boss : Enemy
{
public List<Dragon> _dragons;
public override void _Ready()
{
base._Ready();
_number = 1;
_dragons = GetChildren().Where(c=>c is Dragon).Cast<Dragon>().ToList();
for (int i = 0; i < _dragons.Count; i++)
{
_dragons[i]._owner = this;
_dragons[i]._number = _board._shields[i]._address;
_board._shields[i]._tenant = _dragons[i];
}
}
public override void PassPlayer(Player PLAYER)
{
base.PassPlayer(PLAYER);
_dragons.ForEach(d=>d.PassPlayer(PLAYER));
}
public override void ClickShield(Shield CLICKED_SHIELD)
{
_playerOpponent.Challenge(CLICKED_SHIELD._tenant);
}
}