reworking effects, turning them into their own scene for replicability

This commit is contained in:
2026-02-03 03:37:58 -05:00
parent 36b934b200
commit 435fbc7ba2
32 changed files with 321 additions and 172 deletions

View File

@@ -1,10 +1,12 @@
using Godot;
using Godot.NativeInterop;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class Phone : Sprite2D
{
public bool _running = false;
public PhoneButton _hoveredButton;
public List<PhoneButton> _phoneButtons = new();
public Player _player;
@@ -21,12 +23,7 @@ public partial class Phone : Sprite2D
{
_phoneButtons[i]._phone = this;
}
_phoneButtons[0]._contact._action = new Example1();
_phoneButtons[0]._contact.PassOwner(_player);
_phoneButtons[0]._contact.SetTimer(1.5f);
_phoneButtons[1]._contact._action = new Example2();
_phoneButtons[1]._contact.PassOwner(_player);
_phoneButtons[1]._contact.SetCooldown(15f);
_phoneButtons[0]._contact.LoadEffect("time_effect_1", "TimeEffects");
}
public override void _Process(double DELTA_)
@@ -46,13 +43,19 @@ public partial class Phone : Sprite2D
// _debug.Text = _loadedContact.GetType().ToString();
// }
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.PassOwner(PLAYER);
_phoneButtons[i]._contact.PassNumber((i+1)%10);
}
}
@@ -62,4 +65,10 @@ public partial class Phone : Sprite2D
// _loadedContact = null;
// _debug.Text = "";
}
public virtual void Start()
{
_running = true;
_phoneButtons.ForEach(b=>b._contact.Start());
}
}