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:
20
Player.cs
20
Player.cs
@@ -11,7 +11,7 @@ public partial class Player : Actor
|
||||
public Phone _phone;
|
||||
public Boss _boss;
|
||||
public Enemy _activeEnemy;
|
||||
public RichTextLabel _debug;
|
||||
public RichTextLabel _debug, _busDebug;
|
||||
public List<BusinessCard> _businessCards;
|
||||
|
||||
public override void _Ready()
|
||||
@@ -19,6 +19,7 @@ public partial class Player : Actor
|
||||
base._Ready();
|
||||
|
||||
_debug = GetNode<RichTextLabel>("Debug");
|
||||
_busDebug = GetNode<RichTextLabel>("BusDebug");
|
||||
|
||||
_phone = GetNode<Phone>("Phone");
|
||||
_phone.PassPlayer(this);
|
||||
@@ -30,10 +31,19 @@ public partial class Player : Actor
|
||||
for (int i = 0; i < _businessCards.Count; i++)
|
||||
{
|
||||
_businessCards[i].PassPlayer(this);
|
||||
_businessCards[i].AssignGoal(GoalName.MiddleColumn);
|
||||
if (_businessCards[i].Name.ToString().IndexOf("Default") > -1)
|
||||
{
|
||||
string goalNameString = _businessCards[i].Name.ToString().Replace("Default","").Replace("Alt","");
|
||||
GoalName goalName;
|
||||
Enum.TryParse(goalNameString, out goalName);
|
||||
_businessCards[i].AssignGoal(goalName);
|
||||
}
|
||||
else
|
||||
{
|
||||
_businessCards[i].AssignRandomGoal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Challenge(_boss);
|
||||
}
|
||||
|
||||
@@ -43,7 +53,7 @@ public partial class Player : Actor
|
||||
ENEMY._board.Activate();
|
||||
_board = ENEMY._board;
|
||||
_activeEnemy = ENEMY;
|
||||
CheckBusinessCards();
|
||||
CheckGoals();
|
||||
|
||||
string text = "";
|
||||
if (_activeEnemy is Mook)
|
||||
@@ -57,7 +67,7 @@ public partial class Player : Actor
|
||||
_debug.Text = text;
|
||||
}
|
||||
|
||||
public void CheckBusinessCards()
|
||||
public void CheckGoals()
|
||||
{
|
||||
_businessCards.ForEach(b=>b.CheckGoal());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user