Chaplain stuff (#98)
* - add: Null rod. * - add: Only chaplain can use holy weapons. * - add: Chaplain is cult immune. * - fix: Fix component granting. * - add: Only chaplain can use null rod. * - add: Armaments beacon. * - add: Chaplain playtime requirement.
This commit is contained in:
13
Content.Shared/_White/Chaplain/ArmamentsBeaconComponent.cs
Normal file
13
Content.Shared/_White/Chaplain/ArmamentsBeaconComponent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class ArmamentsBeaconComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public List<EntProtoId> Armor = new();
|
||||
|
||||
[DataField]
|
||||
public List<EntProtoId?> Helmets = new();
|
||||
}
|
||||
21
Content.Shared/_White/Chaplain/ArmamentsBeaconUi.cs
Normal file
21
Content.Shared/_White/Chaplain/ArmamentsBeaconUi.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum SelectArmorUi
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class ArmorSelectedEvent : BoundUserInterfaceMessage
|
||||
{
|
||||
public int SelectedIndex;
|
||||
|
||||
public ArmorSelectedEvent(int index)
|
||||
{
|
||||
SelectedIndex = index;
|
||||
}
|
||||
}
|
||||
8
Content.Shared/_White/Chaplain/HolyComponent.cs
Normal file
8
Content.Shared/_White/Chaplain/HolyComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HolyComponent : Component
|
||||
{
|
||||
}
|
||||
8
Content.Shared/_White/Chaplain/HolyWeaponComponent.cs
Normal file
8
Content.Shared/_White/Chaplain/HolyWeaponComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HolyWeaponComponent : Component
|
||||
{
|
||||
}
|
||||
30
Content.Shared/_White/Chaplain/HolyWeaponSystem.cs
Normal file
30
Content.Shared/_White/Chaplain/HolyWeaponSystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
public sealed class HolyWeaponSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<HolyWeaponComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<HolyWeaponComponent, AttemptMeleeEvent>(OnMeleeAttempt);
|
||||
}
|
||||
|
||||
private void OnMeleeAttempt(Entity<HolyWeaponComponent> ent, ref AttemptMeleeEvent args)
|
||||
{
|
||||
if (HasComp<HolyComponent>(args.User) || HasComp<GhostComponent>(args.User))
|
||||
return;
|
||||
|
||||
args.Cancelled = true;
|
||||
args.Message = $"Вам не хватает веры, чтобы использовать {Name(ent)}";
|
||||
}
|
||||
|
||||
private void OnExamined(Entity<HolyWeaponComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup("[color=lightblue]Данное оружие наделено священной силой.[/color]");
|
||||
}
|
||||
}
|
||||
10
Content.Shared/_White/Chaplain/NullRodComponent.cs
Normal file
10
Content.Shared/_White/Chaplain/NullRodComponent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class NullRodComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public List<EntProtoId> Weapons = new();
|
||||
}
|
||||
20
Content.Shared/_White/Chaplain/NullRodUi.cs
Normal file
20
Content.Shared/_White/Chaplain/NullRodUi.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._White.Chaplain;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum SelectWeaponUi
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class WeaponSelectedEvent : BoundUserInterfaceMessage
|
||||
{
|
||||
public string SelectedWeapon;
|
||||
|
||||
public WeaponSelectedEvent(string weapon)
|
||||
{
|
||||
SelectedWeapon = weapon;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user