2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Chat.Managers;
|
2020-08-13 14:40:27 +02:00
|
|
|
using Content.Shared.Roles;
|
2019-11-17 11:18:39 -05:00
|
|
|
using Robust.Shared.IoC;
|
2021-10-06 13:51:11 +02:00
|
|
|
using Robust.Shared.Localization;
|
2021-12-14 00:22:43 +01:00
|
|
|
using Robust.Shared.ViewVariables;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Roles
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class Job : Role
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2021-12-14 00:22:43 +01:00
|
|
|
[ViewVariables]
|
2020-01-23 17:31:47 +01:00
|
|
|
public JobPrototype Prototype { get; }
|
2019-11-17 11:18:39 -05:00
|
|
|
|
|
|
|
|
public override string Name { get; }
|
2021-12-14 00:22:43 +01:00
|
|
|
|
2020-07-06 16:24:29 -05:00
|
|
|
public override bool Antagonist => false;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2021-12-14 00:22:43 +01:00
|
|
|
[ViewVariables]
|
2021-03-16 15:50:20 +01:00
|
|
|
public string? StartingGear => Prototype.StartingGear;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2021-12-14 00:22:43 +01:00
|
|
|
[ViewVariables]
|
2021-11-21 20:33:50 -06:00
|
|
|
public bool CanBeAntag;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
public Job(Mind.Mind mind, JobPrototype jobPrototype) : base(mind)
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2020-01-23 17:31:47 +01:00
|
|
|
Prototype = jobPrototype;
|
2019-11-17 11:18:39 -05:00
|
|
|
Name = jobPrototype.Name;
|
2021-11-21 20:33:50 -06:00
|
|
|
CanBeAntag = jobPrototype.CanBeAntag;
|
2019-11-17 11:18:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Greet()
|
|
|
|
|
{
|
|
|
|
|
base.Greet();
|
|
|
|
|
|
2021-03-16 15:50:20 +01:00
|
|
|
if (Mind.TryGetSession(out var session))
|
|
|
|
|
{
|
|
|
|
|
var chat = IoCManager.Resolve<IChatManager>();
|
2021-10-06 13:51:11 +02:00
|
|
|
chat.DispatchServerMessage(session, Loc.GetString("job-greet-introduce-job-name", ("jobName", Name)));
|
|
|
|
|
|
|
|
|
|
if(Prototype.RequireAdminNotify)
|
|
|
|
|
chat.DispatchServerMessage(session, Loc.GetString("job-greet-important-disconnect-admin-notify"));
|
|
|
|
|
|
|
|
|
|
chat.DispatchServerMessage(session, Loc.GetString("job-greet-supervisors-warning", ("jobName", Name), ("supervisors", Prototype.Supervisors)));
|
|
|
|
|
|
|
|
|
|
if(Prototype.JoinNotifyCrew && Mind.CharacterName != null)
|
|
|
|
|
chat.DispatchStationAnnouncement(Loc.GetString("job-greet-join-notify-crew", ("jobName", Name), ("characterName", Mind.CharacterName)),
|
2021-11-22 22:34:48 +00:00
|
|
|
Loc.GetString("job-greet-join-notify-crew-announcer"), false);
|
2021-03-16 15:50:20 +01:00
|
|
|
}
|
2019-11-17 11:18:39 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|