add runwon and runlost functions, default win cards, call button that calls a loaded contact, added rotatecells, shiftcells, and swapcells functions to actor, reworked address to be 0-8 instead of 1-9, added underscore naming convention to function parameters, business cards to be slightly transparent when not met, added actions to contacts and made a couple examples
This commit is contained in:
@@ -8,20 +8,39 @@ public partial class Phone : Sprite2D
|
||||
public PhoneButton _hoveredButton;
|
||||
public List<PhoneButton> _phoneButtons = new();
|
||||
public Player _player;
|
||||
public Contact _loadedContact;
|
||||
public CallButton _callButton;
|
||||
public RichTextLabel _debug;
|
||||
public override void _Ready()
|
||||
{
|
||||
_debug = GetNode<RichTextLabel>("Debug");
|
||||
_callButton = GetNode<CallButton>("CallButton");
|
||||
_callButton._phone = this;
|
||||
_phoneButtons = GetChildren().Where(c=>c is PhoneButton).Cast<PhoneButton>().ToList();
|
||||
for (int i = 0; i < _phoneButtons.Count; i++)
|
||||
{
|
||||
_phoneButtons[i]._phone = this;
|
||||
}
|
||||
_phoneButtons[0]._contact = new ShiftBack2();
|
||||
_phoneButtons[1]._contact = new Rotate90();
|
||||
_phoneButtons[2]._contact = new Swap1And6();
|
||||
}
|
||||
|
||||
public override void _Process(double DELTA_)
|
||||
{
|
||||
// _hoveredButton = _phoneButtons.FirstOrDefault(c => c._isHovered, null);
|
||||
}
|
||||
|
||||
|
||||
public void CallLoadedContact()
|
||||
{
|
||||
_loadedContact.CallAction();
|
||||
ResetContact();
|
||||
}
|
||||
|
||||
public void LoadContact(Contact CONTACT)
|
||||
{
|
||||
_loadedContact = CONTACT;
|
||||
_debug.Text = _loadedContact.GetType().ToString();
|
||||
}
|
||||
|
||||
public void PassPlayer(Player PLAYER)
|
||||
@@ -34,4 +53,10 @@ public partial class Phone : Sprite2D
|
||||
_phoneButtons[i]._contact.PassNumber((i+1)%10);
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetContact()
|
||||
{
|
||||
// _loadedContact = null;
|
||||
// _debug.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user