Antag preferences and antag prototype (#1264)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Content.Server.Mobs
|
||||
/// <summary>
|
||||
/// Whether this role should be considered antagonistic or not.
|
||||
/// </summary>
|
||||
public abstract bool Antag { get; }
|
||||
public abstract bool Antagonist { get; }
|
||||
|
||||
protected Role(Mind mind)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.Mobs.Roles
|
||||
public JobPrototype Prototype { get; }
|
||||
|
||||
public override string Name { get; }
|
||||
public override bool Antag => false;
|
||||
public override bool Antagonist => false;
|
||||
|
||||
public string StartingGear => Prototype.StartingGear;
|
||||
|
||||
|
||||
@@ -2,24 +2,32 @@ using Content.Server.GameObjects;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared.Antags;
|
||||
|
||||
namespace Content.Server.Mobs.Roles
|
||||
{
|
||||
public class SuspicionInnocentRole : Role
|
||||
{
|
||||
public SuspicionInnocentRole(Mind mind) : base(mind)
|
||||
public AntagPrototype Prototype { get; }
|
||||
|
||||
public SuspicionInnocentRole(Mind mind, AntagPrototype antagPrototype) : base(mind)
|
||||
{
|
||||
Prototype = antagPrototype;
|
||||
Name = antagPrototype.Name;
|
||||
Antagonist = antagPrototype.Antagonist;
|
||||
}
|
||||
|
||||
public override string Name => "Innocent";
|
||||
public override bool Antag => false;
|
||||
public override string Name { get; }
|
||||
public string Objective => Prototype.Objective;
|
||||
public override bool Antagonist { get; }
|
||||
|
||||
public override void Greet()
|
||||
{
|
||||
base.Greet();
|
||||
|
||||
var chat = IoCManager.Resolve<IChatManager>();
|
||||
chat.DispatchServerMessage(Mind.Session, "You're an innocent!");
|
||||
chat.DispatchServerMessage(Mind.Session, $"You're a {Name}!");
|
||||
chat.DispatchServerMessage(Mind.Session, $"Objective: {Objective}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,33 @@
|
||||
using Content.Server.GameObjects;
|
||||
using Content.Server.GameObjects;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared.Antags;
|
||||
|
||||
namespace Content.Server.Mobs.Roles
|
||||
{
|
||||
public sealed class SuspicionTraitorRole : Role
|
||||
{
|
||||
public SuspicionTraitorRole(Mind mind) : base(mind)
|
||||
public AntagPrototype Prototype { get; }
|
||||
|
||||
public SuspicionTraitorRole(Mind mind, AntagPrototype antagPrototype) : base(mind)
|
||||
{
|
||||
Prototype = antagPrototype;
|
||||
Name = antagPrototype.Name;
|
||||
Antagonist = antagPrototype.Antagonist;
|
||||
}
|
||||
|
||||
public override string Name => "Traitor";
|
||||
public override bool Antag => true;
|
||||
public override string Name { get; }
|
||||
public string Objective => Prototype.Objective;
|
||||
public override bool Antagonist { get; }
|
||||
|
||||
public override void Greet()
|
||||
{
|
||||
base.Greet();
|
||||
|
||||
var chat = IoCManager.Resolve<IChatManager>();
|
||||
chat.DispatchServerMessage(Mind.Session, "You're a traitor!");
|
||||
chat.DispatchServerMessage(Mind.Session, $"You're a {Name}!");
|
||||
chat.DispatchServerMessage(Mind.Session, $"Objective: {Objective}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user