starting a major rework, where all effects are controlled within a contact

This commit is contained in:
2026-02-06 02:13:01 -05:00
parent 435fbc7ba2
commit 043eb19b5a
41 changed files with 128 additions and 805 deletions

View File

@@ -7,10 +7,7 @@ using System.Linq;
public partial class Phone : Sprite2D
{
public bool _running = false;
public PhoneButton _hoveredButton;
public List<PhoneButton> _phoneButtons = new();
public Player _player;
public Contact _loadedContact;
public CallButton _callButton;
public RichTextLabel _debug;
public override void _Ready()
@@ -18,12 +15,6 @@ public partial class Phone : Sprite2D
_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.LoadEffect("time_effect_1", "TimeEffects");
}
public override void _Process(double DELTA_)
@@ -46,18 +37,12 @@ public partial class Phone : Sprite2D
public virtual void HangUp()
{
_running = false;
_phoneButtons.ForEach(b=>b._contact.End());
}
public void PassPlayer(Player PLAYER)
{
_player = PLAYER;
for (int i = 0; i < _phoneButtons.Count; i++)
{
_phoneButtons[i]._phone = this;
_phoneButtons[i]._contact.PassNumber((i+1)%10);
}
}
public void ResetContact()
@@ -66,9 +51,8 @@ public partial class Phone : Sprite2D
// _debug.Text = "";
}
public virtual void Start()
public virtual void Begin()
{
_running = true;
_phoneButtons.ForEach(b=>b._contact.Start());
}
}