Files
tbd-station-14/Content.Server/GameObjects/Components/Interactable/MatchboxComponent.cs
Ygg01 c01b1d5c05 Add cigarettes and matches to SS14 (#2522)
* Add resources for cigs/matches

* Add files for cigarettes

* Remove Shared Components

* Applied some of the suggestions

* Change priority to allow matches to be set alight by matchbox

* Added item for pack of cigars

* Add swepts resources. Fix naming

* Fix naming, implement suggestions.

* Addressed Paul's suggestions

* Remove unused resources

* Fix Paul's suggestions
2021-01-11 00:17:28 +01:00

29 lines
927 B
C#

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