Explosions and Grenades, Triggers, OnDestroy, OnExAct, Fueltanks and destructible tables (#247)

* initial explosiveComponent

* remove garbagee

* assets

* tile mass deletion baby

* grenades

* tweaks

* Update Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs

Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Ex_act based on damage, fixes and tweaks

* One finishing touch

Done the most cringe way

* ex_act explosions, tables are destructible now

also adds fuel tanks

* adds ex_act to mobs
This commit is contained in:
Injazz
2019-06-07 16:15:20 +05:00
committed by Pieter-Jan Briers
parent f1aeaaa640
commit 10801af2f7
42 changed files with 756 additions and 18 deletions

View File

@@ -0,0 +1,44 @@
using System;
using Robust.Server.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.GameObjects;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Triggers;
namespace Content.Server.GameObjects.Components.Triggers
{
public class OnUseTimerTriggerComponent : Component, IUse
{
#pragma warning disable 649
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
#pragma warning restore 649
public override string Name => "OnUseTimerTrigger";
private float _delay = 0f;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _delay, "delay", 0f);
}
public override void Initialize()
{
base.Initialize();
}
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
{
var triggerSystem = _entitySystemManager.GetEntitySystem<TriggerSystem>();
if (Owner.TryGetComponent<AppearanceComponent>(out var appearance)) {
appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Primed);
}
triggerSystem.HandleTimerTrigger(TimeSpan.FromSeconds(_delay), eventArgs.User, Owner);
return true;
}
}
}