Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,76 @@
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Shared.Weapons.Melee
{
/// <summary>
/// Raised directed on the used entity when a target entity is click attacked by a user.
/// </summary>
public class ClickAttackEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity used to attack, for broadcast purposes.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// The original location that was clicked by the user.
/// </summary>
public EntityCoordinates ClickLocation { get; }
/// <summary>
/// UID of the entity that was attacked.
/// </summary>
public EntityUid Target { get; }
/// <summary>
/// Entity that was attacked.
/// </summary>
public IEntity? TargetEntity { get; }
public ClickAttackEvent(IEntity used, IEntity user, EntityCoordinates clickLocation, EntityUid target = default)
{
Used = used;
User = user;
ClickLocation = clickLocation;
Target = target;
IoCManager.Resolve<IEntityManager>().TryGetEntity(Target, out var targetEntity);
TargetEntity = targetEntity;
}
}
/// <summary>
/// Raised directed on the used entity when a target entity is wide attacked by a user.
/// </summary>
public class WideAttackEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity used to attack, for broadcast purposes.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// The original location that was clicked by the user.
/// </summary>
public EntityCoordinates ClickLocation { get; }
public WideAttackEvent(IEntity used, IEntity user, EntityCoordinates clickLocation)
{
Used = used;
User = user;
ClickLocation = clickLocation;
}
}
}

View File

@@ -0,0 +1,55 @@
#nullable enable
using System;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Weapons.Melee
{
[Prototype("MeleeWeaponAnimation")]
public sealed class MeleeWeaponAnimationPrototype : IPrototype
{
[ViewVariables]
[DataField("id", required: true)]
public string ID { get; } = default!;
[ViewVariables]
[DataField("state")]
public string State { get; } = string.Empty;
[ViewVariables]
[DataField("prototype")]
public string Prototype { get; } = "WeaponArc";
[ViewVariables]
[DataField("length")]
public TimeSpan Length { get; } = TimeSpan.FromSeconds(0.5f);
[ViewVariables]
[DataField("speed")]
public float Speed { get; } = 1;
[ViewVariables]
[DataField("color")]
public Vector4 Color { get; } = new(1,1,1,1);
[ViewVariables]
[DataField("colorDelta")]
public Vector4 ColorDelta { get; } = Vector4.Zero;
[ViewVariables]
[DataField("arcType")]
public WeaponArcType ArcType { get; } = WeaponArcType.Slash;
[ViewVariables]
[DataField("width")]
public float Width { get; } = 90;
}
public enum WeaponArcType
{
Slash,
Poke,
}
}

View File

@@ -0,0 +1,48 @@
#nullable enable
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.Weapons.Melee
{
public static class MeleeWeaponSystemMessages
{
[Serializable, NetSerializable]
public sealed class PlayMeleeWeaponAnimationMessage : EntityEventArgs
{
public PlayMeleeWeaponAnimationMessage(string arcPrototype, Angle angle, EntityUid attacker, EntityUid source, List<EntityUid> hits, bool textureEffect = false, bool arcFollowAttacker = true)
{
ArcPrototype = arcPrototype;
Angle = angle;
Attacker = attacker;
Source = source;
Hits = hits;
TextureEffect = textureEffect;
ArcFollowAttacker = arcFollowAttacker;
}
public string ArcPrototype { get; }
public Angle Angle { get; }
public EntityUid Attacker { get; }
public EntityUid Source { get; }
public List<EntityUid> Hits { get; }
public bool TextureEffect { get; }
public bool ArcFollowAttacker { get; }
}
[Serializable, NetSerializable]
public sealed class PlayLungeAnimationMessage : EntityEventArgs
{
public Angle Angle { get; }
public EntityUid Source { get; }
public PlayLungeAnimationMessage(Angle angle, EntityUid source)
{
Angle = angle;
Source = source;
}
}
}
}