Add ERT time stats (#31629)
* add jobs for ghost roles * add job to ToggleableGhostRole * typo --------- Co-authored-by: Mota <belochuc@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Content.Server.Ghost.Roles.Raffles;
|
using Content.Server.Ghost.Roles.Raffles;
|
||||||
using Content.Server.Mind.Commands;
|
using Content.Server.Mind.Commands;
|
||||||
using Content.Shared.Roles;
|
using Content.Shared.Roles;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Server.Ghost.Roles.Components;
|
namespace Content.Server.Ghost.Roles.Components;
|
||||||
|
|
||||||
@@ -14,7 +15,6 @@ public sealed partial class GhostRoleComponent : Component
|
|||||||
|
|
||||||
[DataField("rules")] private string _roleRules = "ghost-role-component-default-rules";
|
[DataField("rules")] private string _roleRules = "ghost-role-component-default-rules";
|
||||||
|
|
||||||
// TODO ROLE TIMERS
|
|
||||||
// Actually make use of / enforce this requirement?
|
// Actually make use of / enforce this requirement?
|
||||||
// Why is this even here.
|
// Why is this even here.
|
||||||
// Move to ghost role prototype & respect CCvars.GameRoleTimerOverride
|
// Move to ghost role prototype & respect CCvars.GameRoleTimerOverride
|
||||||
@@ -99,4 +99,11 @@ public sealed partial class GhostRoleComponent : Component
|
|||||||
[DataField("raffle")]
|
[DataField("raffle")]
|
||||||
[Access(typeof(GhostRoleSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
|
[Access(typeof(GhostRoleSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
|
||||||
public GhostRoleRaffleConfig? RaffleConfig { get; set; }
|
public GhostRoleRaffleConfig? RaffleConfig { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Job the entity will receive after adding the mind.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("job")]
|
||||||
|
[Access(typeof(GhostRoleSystem), Other = AccessPermissions.ReadWriteExecute)] // also FIXME Friends
|
||||||
|
public ProtoId<JobPrototype>? JobProto = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
namespace Content.Server.Ghost.Roles.Components;
|
using Content.Shared.Roles;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.Server.Ghost.Roles.Components;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used for a ghost role which can be toggled on and off at will, like a PAI.
|
/// This is used for a ghost role which can be toggled on and off at will, like a PAI.
|
||||||
@@ -38,4 +41,7 @@ public sealed partial class ToggleableGhostRoleComponent : Component
|
|||||||
|
|
||||||
[DataField("stopSearchVerbPopup")]
|
[DataField("stopSearchVerbPopup")]
|
||||||
public string StopSearchVerbPopup = string.Empty;
|
public string StopSearchVerbPopup = string.Empty;
|
||||||
|
|
||||||
|
[DataField("job")]
|
||||||
|
public ProtoId<JobPrototype>? JobProto = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ using Content.Server.Popups;
|
|||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Collections;
|
using Robust.Shared.Collections;
|
||||||
using Content.Shared.Ghost.Roles.Components;
|
using Content.Shared.Ghost.Roles.Components;
|
||||||
|
using Content.Shared.Roles.Jobs;
|
||||||
|
|
||||||
namespace Content.Server.Ghost.Roles;
|
namespace Content.Server.Ghost.Roles;
|
||||||
|
|
||||||
@@ -599,6 +600,14 @@ public sealed class GhostRoleSystem : EntitySystem
|
|||||||
if (!TryComp(uid, out GhostRoleComponent? ghostRole))
|
if (!TryComp(uid, out GhostRoleComponent? ghostRole))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (ghostRole.JobProto != null)
|
||||||
|
{
|
||||||
|
if (HasComp<JobComponent>(args.Mind))
|
||||||
|
_roleSystem.MindRemoveRole<JobComponent>(args.Mind);
|
||||||
|
|
||||||
|
_roleSystem.MindAddRole(args.Mind, new JobComponent { Prototype = ghostRole.JobProto });
|
||||||
|
}
|
||||||
|
|
||||||
ghostRole.Taken = true;
|
ghostRole.Taken = true;
|
||||||
UnregisterGhostRole((uid, ghostRole));
|
UnregisterGhostRole((uid, ghostRole));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
|
|||||||
ghostRole.RoleName = Loc.GetString(component.RoleName);
|
ghostRole.RoleName = Loc.GetString(component.RoleName);
|
||||||
ghostRole.RoleDescription = Loc.GetString(component.RoleDescription);
|
ghostRole.RoleDescription = Loc.GetString(component.RoleDescription);
|
||||||
ghostRole.RoleRules = Loc.GetString(component.RoleRules);
|
ghostRole.RoleRules = Loc.GetString(component.RoleRules);
|
||||||
|
ghostRole.JobProto = component.JobProto;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnExamined(EntityUid uid, ToggleableGhostRoleComponent component, ExaminedEvent args)
|
private void OnExamined(EntityUid uid, ToggleableGhostRoleComponent component, ExaminedEvent args)
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTLeader
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTLeaderGear ]
|
prototypes: [ ERTLeaderGear ]
|
||||||
roleLoadout: [ RoleSurvivalExtended ]
|
roleLoadout: [ RoleSurvivalExtended ]
|
||||||
@@ -109,6 +110,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTLeader
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTLeaderGearEVA ]
|
prototypes: [ ERTLeaderGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -131,6 +133,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTLeader
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTLeaderGearEVALecter ]
|
prototypes: [ ERTLeaderGearEVALecter ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -163,6 +166,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTChaplain
|
||||||
- type: RandomMetadata
|
- type: RandomMetadata
|
||||||
nameSegments:
|
nameSegments:
|
||||||
- NamesFirstMilitary
|
- NamesFirstMilitary
|
||||||
@@ -194,6 +198,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTChaplain
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTChaplainGearEVA ]
|
prototypes: [ ERTChaplainGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -227,6 +232,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTJanitor
|
||||||
- type: RandomMetadata
|
- type: RandomMetadata
|
||||||
nameSegments:
|
nameSegments:
|
||||||
- NamesFirstMilitary
|
- NamesFirstMilitary
|
||||||
@@ -257,6 +263,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTJanitor
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTJanitorGearEVA ]
|
prototypes: [ ERTJanitorGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -289,6 +296,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTEngineer
|
||||||
- type: RandomMetadata
|
- type: RandomMetadata
|
||||||
nameSegments:
|
nameSegments:
|
||||||
- NamesFirstMilitary
|
- NamesFirstMilitary
|
||||||
@@ -319,6 +327,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTEngineer
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTEngineerGearEVA ]
|
prototypes: [ ERTEngineerGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -351,6 +360,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTSecurity
|
||||||
- type: RandomMetadata
|
- type: RandomMetadata
|
||||||
nameSegments:
|
nameSegments:
|
||||||
- NamesFirstMilitary
|
- NamesFirstMilitary
|
||||||
@@ -381,6 +391,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTSecurity
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTSecurityGearEVA ]
|
prototypes: [ ERTSecurityGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -403,6 +414,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTSecurity
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTSecurityGearEVALecter ]
|
prototypes: [ ERTSecurityGearEVALecter ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
@@ -435,6 +447,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTMedical
|
||||||
- type: RandomMetadata
|
- type: RandomMetadata
|
||||||
nameSegments:
|
nameSegments:
|
||||||
- NamesFirstMilitary
|
- NamesFirstMilitary
|
||||||
@@ -465,6 +478,7 @@
|
|||||||
rules: ghost-role-information-nonantagonist-rules
|
rules: ghost-role-information-nonantagonist-rules
|
||||||
raffle:
|
raffle:
|
||||||
settings: short
|
settings: short
|
||||||
|
job: ERTMedical
|
||||||
- type: Loadout
|
- type: Loadout
|
||||||
prototypes: [ ERTMedicalGearEVA ]
|
prototypes: [ ERTMedicalGearEVA ]
|
||||||
roleLoadout: [ RoleSurvivalEVA ]
|
roleLoadout: [ RoleSurvivalEVA ]
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
wipeVerbPopup: positronic-brain-wiped-device
|
wipeVerbPopup: positronic-brain-wiped-device
|
||||||
stopSearchVerbText: positronic-brain-stop-searching-verb-text
|
stopSearchVerbText: positronic-brain-stop-searching-verb-text
|
||||||
stopSearchVerbPopup: positronic-brain-stopped-searching
|
stopSearchVerbPopup: positronic-brain-stopped-searching
|
||||||
|
job: Borg
|
||||||
- type: BlockMovement
|
- type: BlockMovement
|
||||||
- type: Examiner
|
- type: Examiner
|
||||||
- type: BorgBrain
|
- type: BorgBrain
|
||||||
|
|||||||
Reference in New Issue
Block a user