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
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user