basic Party Manager
This commit is contained in:
parent
c141e6a169
commit
6f1d5ea681
10 changed files with 158 additions and 8 deletions
|
|
@ -5,6 +5,8 @@ public partial class CaptureUI : CanvasLayer
|
|||
[Export] public float BaseTimeLimit = 3.0f;
|
||||
[Export] public float BaseRequired = 14.0f; // “energy” required
|
||||
[Export] public float EnergyPerPress = 1.0f;
|
||||
[Export] public NodePath PartyManagerPath { get; set; }
|
||||
private PartyManager? _party;
|
||||
|
||||
private Creature? _target;
|
||||
private SaveManager? _save;
|
||||
|
|
@ -32,7 +34,8 @@ public partial class CaptureUI : CanvasLayer
|
|||
_ballOption.AddItem("Basic Soulball (easy)", 0);
|
||||
_ballOption.AddItem("Heavy Soulball (hard)", 1);
|
||||
|
||||
_save = GetNodeOrNull<SaveManager>("/root/Main/SaveManager"); // or export a path if you prefer
|
||||
_party = GetNodeOrNull<PartyManager>(PartyManagerPath);
|
||||
if (_party == null) GD.PrintErr("CaptureUI: PartyManagerPath not set.");
|
||||
}
|
||||
|
||||
public void StartCapture(Creature target)
|
||||
|
|
@ -102,13 +105,7 @@ public partial class CaptureUI : CanvasLayer
|
|||
|
||||
GD.Print($"Captured {_target.CreatureId}");
|
||||
|
||||
// v0: store captured creature IDs
|
||||
if (_save != null)
|
||||
{
|
||||
_save.State.CapturedCreatures.Add(_target.CreatureId);
|
||||
_save.Save();
|
||||
}
|
||||
|
||||
_party?.AddToParty(_target.CreatureId);
|
||||
_target.Despawn();
|
||||
EndCapture();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue