add default goal business cards, allow Board.GetCellsByOwner to accept actor instead of player, rework BusinessCard click to be accepted based on _goalMet instead of Disabled, add default goals to enemy class,

This commit is contained in:
2026-01-20 01:59:28 -05:00
parent 5cfc05b662
commit c1ef887be3
11 changed files with 171 additions and 23 deletions

View File

@@ -19,9 +19,12 @@ public partial class BusinessCard : TextureButton
public override void _Pressed()
{
base._Pressed();
GD.Print("Pressed");
_player._activeEnemy.Defeat(_goalName);
_player.Challenge(_player._activeEnemy._owner._board._owner);
_player._busDebug.Text = _goalName.ToString() + (_goalMet ? "": " NOT") + " MET";
if (_goalMet)
{
_player._activeEnemy.Defeat(_goalName);
_player.Challenge(_player._activeEnemy._owner._board._owner);
}
}
public void AssignGoal(GoalName GOALNAME)
@@ -29,14 +32,17 @@ public partial class BusinessCard : TextureButton
_goalName = GOALNAME;
}
public void AssignRandomGoal()
{
Random r = new Random();
AssignGoal(_goal._conditions.Keys.ElementAt(r.Next(_goal._conditions.Keys.Count)));
}
public void CheckGoal()
{
List<Cell> ownedCells = _player._board.GetCellsByOwner(_player);
List<int> addresses = _goal.GetAddresses(_goalName);
_goalMet = addresses.All(a=>ownedCells.Select(c=>c._address).ToList().IndexOf(a)>-1);
GD.Print(_goalMet);
Disabled = !_goalMet;
GD.Print(Disabled);
}
public void PassPlayer(Player PLAYER)