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:
Ygg01
2021-01-11 00:17:28 +01:00
committed by GitHub
parent 2a5fda5198
commit c01b1d5c05
31 changed files with 612 additions and 1 deletions

View File

@@ -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;
}
}
}