mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 18:25:54 +00:00
Locked Doors
This commit is contained in:
parent
e62b539a1e
commit
e25da0fe16
20 changed files with 318 additions and 61 deletions
|
|
@ -25,15 +25,25 @@ public partial class Switch : Interactable
|
|||
|
||||
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
ActivationType activationTypeToUse;
|
||||
if (activationType is ActivationType.Use)
|
||||
{
|
||||
activationTypeToUse = ActivationType;
|
||||
}
|
||||
else
|
||||
{
|
||||
activationTypeToUse = activationType;
|
||||
}
|
||||
|
||||
if (!MeetsRequirements()) return false;
|
||||
_activationSound?.Play();
|
||||
|
||||
EmitSignal(SignalName.OnActivated, (int)activationType);
|
||||
EmitSignal(SignalName.OnActivated, (int)activationTypeToUse);
|
||||
|
||||
// Compatibility for old single system
|
||||
bool success = ActivateTarget(Target, activationType);
|
||||
bool success = ActivateTarget(Target, activationTypeToUse);
|
||||
|
||||
return Targets.Aggregate(success, (current, target) => ActivateTarget(target, activationType) | success);
|
||||
return Targets.Aggregate(success, (current, target) => ActivateTarget(target, activationTypeToUse) | success);
|
||||
}
|
||||
|
||||
private bool ActivateTarget(Node2D target, ActivationType activationType = ActivationType.Toggle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue