Makes Match[sticks/box] ECS, Makes Matchsticks ignite plasma

This commit is contained in:
Paul
2021-08-18 23:17:47 +02:00
parent fb4d7be08e
commit b651ee93d0
4 changed files with 137 additions and 86 deletions

View File

@@ -8,22 +8,8 @@ namespace Content.Server.Light.Components
// TODO make changes in icons when different threshold reached
// e.g. different icons for 10% 50% 100%
[RegisterComponent]
public class MatchboxComponent : Component, IInteractUsing
public class MatchboxComponent : Component
{
public override string Name => "Matchbox";
int IInteractUsing.Priority => 1;
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
if (eventArgs.Using.TryGetComponent<MatchstickComponent>(out var matchstick)
&& matchstick.CurrentState == SharedBurningStates.Unlit)
{
matchstick.Ignite(eventArgs.User);
return true;
}
return false;
}
}
}