mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Add prototype-backed admin verb framework * Add reusable admin verb operations * Add smite-specific admin operations * Migrate admin smites to prototypes * More docs for god of docs * We dont have prediction here, so... * Final cleanup * Fix adminSmite * Add segment display control * Add generic thermoregulator * Add thermobath systems * Replace hotplate with thermobath * Refine thermobath layout * move simple smites to effects * move comps to effects * move add action to effect * move add mind role to effect * move add user interfaces to effect * move godmode to effect * move eye zoom to effect * move speed swap to effect * move spill bloodstream to effect * move remove organs to effect * move cream pie to effect * move slip to effect * fix server effect usings * move homing rod to effect * move locker stuff to effect * move tabletop dimension to effect * move pinball to effect * move yeet to effect * move silicon laws to effect * move ghost kick to effect * remove admin operations * revert sht * remove BOM * use admin verb prototypes for smites * add heart attack smite prototype * docs update * fix AdminSmiteVomitOrgans * split and move to shared * move to shared * move to shared and predict * PredictedQueueDel * fix Popup * fix HomingRod * port DeleteEntityEntityEffectSystem * fix StuffIntoLockerEntityEffectSystem * upd * fix eye * fix movement * fix!! * fix and doc * Add admin verb category prototype * upd AdminVerbPrototype * split verbs * SuperSuperSuperBonk * Update PopupMessageEntityEffectSystem.cs * fields --------- Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using Content.Shared.Mind;
|
|
using Content.Shared.Roles;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.EntityEffects.Effects;
|
|
|
|
/// <summary>
|
|
/// Adds a role to this entity's mind unless that role prototype is already present.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EntityEffectSystem{T, TEffect}"/>
|
|
public sealed partial class AddMindRoleEntityEffectSystem : EntityEffectSystem<MetaDataComponent, AddMindRole>
|
|
{
|
|
[Dependency] private SharedMindSystem _mind = default!;
|
|
[Dependency] private SharedRoleSystem _role = default!;
|
|
|
|
protected override void Effect(Entity<MetaDataComponent> entity, ref EntityEffectEvent<AddMindRole> args)
|
|
{
|
|
if (!_mind.TryGetMind(entity, out var mindId, out var mind))
|
|
return;
|
|
|
|
var rolePrototype = args.Effect.Role;
|
|
foreach (var role in mind.MindRoleContainer.ContainedEntities)
|
|
{
|
|
if (rolePrototype.Equals(MetaData(role).EntityPrototype?.ID))
|
|
return;
|
|
}
|
|
|
|
_role.MindAddRole(mindId, rolePrototype, mind);
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc cref="EntityEffect"/>
|
|
public sealed partial class AddMindRole : EntityEffectBase<AddMindRole>
|
|
{
|
|
/// <summary>
|
|
/// Mind role entity prototype to grant to this entity's mind.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public EntProtoId Role;
|
|
}
|