first commit
This commit is contained in:
42
Gameplay/Dragon.cs
Normal file
42
Gameplay/Dragon.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class Dragon : Enemy
|
||||
{
|
||||
// public int _number;
|
||||
// public Board _board;
|
||||
public List<Mook> _mooks;
|
||||
// public Player _playerOpponent;
|
||||
// public Cell _cell;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
_mooks = GetChildren().Where(c=>c is Mook).Cast<Mook>().ToList();
|
||||
for (int i = 0; i < _mooks.Count; i++)
|
||||
{
|
||||
_mooks[i]._owner = this;
|
||||
_mooks[i]._number = _board._cells[i]._address;
|
||||
_board._cells[i]._tenant = _mooks[i];
|
||||
}
|
||||
}
|
||||
|
||||
public void Challenge()
|
||||
{
|
||||
_playerOpponent.Challenge(this);
|
||||
}
|
||||
|
||||
public override void PassPlayer(Player PLAYER)
|
||||
{
|
||||
base.PassPlayer(PLAYER);
|
||||
_mooks.ForEach(m=>m.PassPlayer(PLAYER));
|
||||
|
||||
}
|
||||
|
||||
public override void ClickCell(Cell CLICKEDCELL)
|
||||
{
|
||||
_playerOpponent.Challenge(CLICKEDCELL._tenant);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user