Adds IThrown, ILand interfaces. Adds dice. (#273)

* Dice, IThrown, ILand

* Adds sounds to the dice using a sound collection.

* Seed random instance better.

* Missed a ")", should compile now
This commit is contained in:
Víctor Aguilera Puerto
2019-07-18 23:33:02 +02:00
committed by Pieter-Jan Briers
parent 92668432a7
commit d9077bde74
92 changed files with 447 additions and 5 deletions

View File

@@ -1,17 +1,29 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Projectiles;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.Components
{
class ThrownItemComponent : ProjectileComponent, ICollideBehavior
{
#pragma warning disable 649
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
#pragma warning restore 649
public override string Name => "ThrownItem";
/// <summary>
/// User who threw the item.
/// </summary>
public IEntity User;
void ICollideBehavior.CollideWith(List<IEntity> collidedwith)
{
foreach (var entity in collidedwith)
@@ -31,9 +43,13 @@ namespace Content.Server.GameObjects.Components
body.CollisionMask &= (int)~CollisionGroup.Mob;
body.IsScrapingFloor = true;
// KYS, your job is finished.
// KYS, your job is finished. Trigger ILand as well.
Owner.RemoveComponent<ThrownItemComponent>();
_entitySystemManager.GetEntitySystem<InteractionSystem>().LandInteraction(User, Owner, Owner.Transform.GridPosition);
}
}
}
}