Add basic PDA/Syndicate Uplink. (#942)
Co-authored-by: FL-OZ <anotherscuffed@gmail.com> Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Server.GameObjects.Components.Access;
|
||||
using Content.Server.GameObjects.Components.Markers;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.GameObjects.Components.PDA;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.GameTicking.GamePresets;
|
||||
using Content.Server.Interfaces;
|
||||
@@ -17,6 +18,7 @@ using Content.Server.Mobs.Roles;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Content.Shared.Jobs;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Server.Interfaces;
|
||||
@@ -627,20 +629,38 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
var inventory = mob.GetComponent<InventoryComponent>();
|
||||
|
||||
if (!inventory.TryGetSlotItem(Slots.IDCARD, out ItemComponent cardItem))
|
||||
if (!inventory.TryGetSlotItem(Slots.IDCARD, out ItemComponent pdaItem))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var card = cardItem.Owner;
|
||||
var pda = pdaItem.Owner;
|
||||
|
||||
var cardComponent = card.GetComponent<IdCardComponent>();
|
||||
cardComponent.FullName = characterName;
|
||||
cardComponent.JobTitle = jobPrototype.Name;
|
||||
var pdaComponent = pda.GetComponent<PDAComponent>();
|
||||
if (pdaComponent.IdSlotEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var card = pdaComponent.ContainedID;
|
||||
card.FullName = characterName;
|
||||
card.JobTitle = jobPrototype.Name;
|
||||
|
||||
var access = card.Owner.GetComponent<AccessComponent>();
|
||||
var accessTags = access.GetTags();
|
||||
accessTags.AddRange(jobPrototype.Access);
|
||||
access.SetTags(accessTags);
|
||||
pdaComponent.SetPDAOwner(mob);
|
||||
var mindComponent = mob.GetComponent<MindComponent>();
|
||||
if (mindComponent.HasMind)//Redundancy checks.
|
||||
{
|
||||
if (mindComponent.Mind.AllRoles.Any(role => role.Antag)) //Give antags a new uplinkaccount.
|
||||
{
|
||||
var uplinkAccount = new UplinkAccount(mob.Uid, 20); //TODO: make me into a variable based on server pop or something.
|
||||
pdaComponent.InitUplinkAccount(uplinkAccount);
|
||||
}
|
||||
}
|
||||
|
||||
var access = card.GetComponent<AccessComponent>();
|
||||
access.Tags.Clear();
|
||||
access.Tags.AddRange(jobPrototype.Access);
|
||||
}
|
||||
|
||||
private void AddManifestEntry(string characterName, string jobId)
|
||||
|
||||
Reference in New Issue
Block a user