Багфиксы и всякое (#47)
* - tweak: Tweak CPR speed.
* - fix: Cult action fix.
* Revert "Put entity resetting behind command flag (#24436)"
This reverts commit 5267d3c601.
* - fix: Mindshield fixes.
* - tweak: Give security security glasses.
* - fix: Fix warning.
* - fix: Fix ling TTS.
* - fix: Fix gun cycle.
* - fix: Mark cultist and lings as antags.
* - fix: Fix borg name.
* - fix: Fix carrying throw.
* - fix: Fix gun bolt with no mag.
This commit is contained in:
@@ -307,7 +307,7 @@ public sealed class RespiratorSystem : EntitySystem
|
||||
|
||||
private void DoCPR(EntityUid target, RespiratorComponent comp, EntityUid user)
|
||||
{
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, comp.CycleDelay * 4, new CPREndedEvent(), target,
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, 1, new CPREndedEvent(), target,
|
||||
target: target)
|
||||
{
|
||||
BreakOnTargetMove = true,
|
||||
|
||||
@@ -731,6 +731,8 @@ public sealed partial class ChangelingSystem
|
||||
ClonePerson(polymorphEntity.Value, transformData.AppearanceComponent, polyAppearance);
|
||||
TransferDna(polymorphEntity.Value, transformData.Dna);
|
||||
|
||||
_humanoidAppearance.SetTTSVoice(polymorphEntity.Value, transformData.AppearanceComponent.Voice, polyAppearance);
|
||||
|
||||
if (!TryComp<MetaDataComponent>(polymorphEntity.Value, out var meta))
|
||||
return null;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ using Content.Shared.Preferences;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Roles.Jobs;
|
||||
using Content.Shared._White;
|
||||
using Content.Shared.NameIdentifier;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
@@ -300,9 +301,11 @@ namespace Content.Server.GameTicking
|
||||
if (jobId.Contains("Mime"))
|
||||
if (newMind.Comp.MimeName != null)
|
||||
_metaData.SetEntityName(mob, newMind.Comp.MimeName);
|
||||
if (jobId.Contains("Cyborg"))
|
||||
if (newMind.Comp.BorgName != null)
|
||||
_metaData.SetEntityName(mob, newMind.Comp.BorgName);
|
||||
if (jobId.Contains("Borg"))
|
||||
if (newMind.Comp.BorgName != null && TryComp(mob, out NameIdentifierComponent? identifier))
|
||||
{
|
||||
_metaData.SetEntityName(mob, $"{newMind.Comp.BorgName} {identifier.FullIdentifier}");
|
||||
}
|
||||
|
||||
_mind.TransferTo(newMind, mob);
|
||||
|
||||
|
||||
@@ -201,6 +201,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
|
||||
return;
|
||||
|
||||
if (HasComp<RevolutionaryComponent>(ev.Target) ||
|
||||
HasComp<CommandStaffComponent>(ev.Target) ||
|
||||
HasComp<MindShieldComponent>(ev.Target) ||
|
||||
!HasComp<HumanoidAppearanceComponent>(ev.Target) &&
|
||||
!alwaysConvertible ||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Server.Changeling;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Roles;
|
||||
@@ -19,6 +21,8 @@ public sealed class RoleSystem : SharedRoleSystem
|
||||
SubscribeAntagEvents<TraitorRoleComponent>();
|
||||
SubscribeAntagEvents<ZombieRoleComponent>();
|
||||
SubscribeAntagEvents<ThiefRoleComponent>();
|
||||
SubscribeAntagEvents<ChangelingRoleComponent>(); // WD EDIT
|
||||
SubscribeAntagEvents<CultistRoleComponent>(); // WD EDIT
|
||||
}
|
||||
|
||||
public string? MindGetBriefing(EntityUid? mindId)
|
||||
|
||||
@@ -20,6 +20,7 @@ using Content.Shared.Roles.Jobs;
|
||||
using Content.Shared.Station;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared._White.CharacterExamine;
|
||||
using Content.Shared.NameIdentifier;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Map;
|
||||
@@ -215,15 +216,18 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
|
||||
jobSpecial.AfterEquip(entity);
|
||||
}
|
||||
|
||||
if (prototype.ID.Contains("Cyborg"))
|
||||
if (prototype.ID.Contains("Borg"))
|
||||
{
|
||||
if (!TryComp<NameIdentifierComponent>(entity, out var identifier))
|
||||
return;
|
||||
|
||||
if (_randomizeCharacters || profile == null)
|
||||
{
|
||||
_metaSystem.SetEntityName(entity, HumanoidCharacterProfile.GetBorgName());
|
||||
_metaSystem.SetEntityName(entity, $"{HumanoidCharacterProfile.GetBorgName()} {identifier.FullIdentifier}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_metaSystem.SetEntityName(entity, profile.BorgName);
|
||||
_metaSystem.SetEntityName(entity, $"{profile.BorgName} {identifier.FullIdentifier}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Content.Server.Carrying
|
||||
/// Basically using virtual item passthrough to throw the carried person. A new age!
|
||||
/// Maybe other things besides throwing should use virt items like this...
|
||||
/// </summary>
|
||||
private void OnThrow(EntityUid uid, CarryingComponent component, BeforeThrowEvent args)
|
||||
private void OnThrow(EntityUid uid, CarryingComponent component, ref BeforeThrowEvent args)
|
||||
{
|
||||
if (!TryComp<VirtualItemComponent>(args.ItemUid, out var virtItem) || !HasComp<CarriableComponent>(virtItem.BlockingEntity))
|
||||
return;
|
||||
|
||||
@@ -7,4 +7,7 @@ public sealed partial class ConstructComponent : Component
|
||||
{
|
||||
[DataField("actions")]
|
||||
public List<EntProtoId> Actions = new();
|
||||
|
||||
[ViewVariables]
|
||||
public List<EntityUid?> ActionEntities = new();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules;
|
||||
@@ -41,6 +42,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
|
||||
[Dependency] private readonly JobSystem _jobSystem = default!;
|
||||
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
|
||||
[Dependency] private readonly ActionsSystem _actions = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
@@ -171,6 +173,11 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
|
||||
cultistsRule.CurrentCultists.Remove(component);
|
||||
|
||||
foreach (var empower in component.SelectedEmpowers)
|
||||
{
|
||||
_actions.RemoveAction(uid, empower);
|
||||
}
|
||||
|
||||
RemoveCultistAppearance(uid);
|
||||
CheckRoundShouldEnd();
|
||||
}
|
||||
|
||||
@@ -17,13 +17,11 @@ namespace Content.Server._White.Cult.Runes.Systems;
|
||||
public partial class CultSystem
|
||||
{
|
||||
[Dependency] private readonly TileSystem _tileSystem = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly TurfSystem _turf = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
|
||||
|
||||
public void InitializeConstructsAbilities()
|
||||
{
|
||||
@@ -45,10 +43,9 @@ public partial class CultSystem
|
||||
|
||||
private void OnMapInit(EntityUid uid, ConstructComponent component, MapInitEvent args)
|
||||
{
|
||||
var comp = EnsureComp<ActionsContainerComponent>(uid);
|
||||
foreach (var id in component.Actions)
|
||||
{
|
||||
_actionContainer.AddAction(uid, id, comp);
|
||||
component.ActionEntities.Add(_actionsSystem.AddAction(uid, id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +64,11 @@ public partial class CultSystem
|
||||
|
||||
private void OnConstructComponentRemoved(EntityUid uid, ConstructComponent component, ComponentRemove args)
|
||||
{
|
||||
foreach (var entity in component.ActionEntities)
|
||||
{
|
||||
_actionsSystem.RemoveAction(uid, entity);
|
||||
}
|
||||
|
||||
var query = EntityQueryEnumerator<CultRuleComponent, GameRuleComponent>();
|
||||
while (query.MoveNext(out var ruleEnt, out var cultRuleComponent, out _))
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ using Content.Shared._White.Cult;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared._White.Cult.Runes;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Components;
|
||||
@@ -61,7 +62,6 @@ public sealed partial class CultSystem : EntitySystem
|
||||
[Dependency] private readonly GunSystem _gunSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly FlammableSystem _flammableSystem = default!;
|
||||
[Dependency] private readonly SharedJobSystem _jobSystem = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
@@ -419,15 +419,9 @@ public sealed partial class CultSystem : EntitySystem
|
||||
// Проверка, является ли жертва целью
|
||||
_entityManager.TryGetComponent<MindContainerComponent>(target?.CurrentEntity, out var targetMind);
|
||||
var isTarget = mind!.Mind!.Value == targetMind?.Mind!.Value;
|
||||
var jobAllowConvert = true;
|
||||
|
||||
if(_jobSystem.MindTryGetJob(mind.Mind!.Value, out var _, out var prototype))
|
||||
{
|
||||
jobAllowConvert = prototype.CanBeAntag;
|
||||
}
|
||||
|
||||
// Выполнение действия в зависимости от условий
|
||||
if (canBeConverted && jobAllowConvert && !isTarget)
|
||||
if (canBeConverted && !HasComp<MindShieldComponent>(victim.Value) && !isTarget)
|
||||
{
|
||||
result = Convert(uid, victim.Value, args.User, args.Cultists);
|
||||
}
|
||||
@@ -1123,38 +1117,27 @@ public sealed partial class CultSystem : EntitySystem
|
||||
{
|
||||
var playerEntity = args.Session.AttachedEntity;
|
||||
|
||||
if (!playerEntity.HasValue || !TryComp<CultistComponent>(playerEntity, out var comp) ||
|
||||
!TryComp<ActionsComponent>(playerEntity, out var actionsComponent))
|
||||
if (!playerEntity.HasValue || !TryComp<CultistComponent>(playerEntity, out var comp))
|
||||
return;
|
||||
|
||||
var cultistsActions = 0;
|
||||
|
||||
foreach (var userAction in actionsComponent.Actions)
|
||||
{
|
||||
var entityPrototypeId = MetaData(userAction).EntityPrototype?.ID;
|
||||
if (entityPrototypeId != null && CultistComponent.CultistActions.Contains(entityPrototypeId))
|
||||
cultistsActions++;
|
||||
}
|
||||
|
||||
var action = CultistComponent.CultistActions.FirstOrDefault(x => x.Equals(args.ActionType));
|
||||
|
||||
if (action == null)
|
||||
return;
|
||||
|
||||
EntityUid? actionId = null;
|
||||
if (component.IsRune)
|
||||
{
|
||||
if (cultistsActions > component.MaxAllowedCultistActions)
|
||||
if (comp.SelectedEmpowers.Count > component.MaxAllowedCultistActions)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("cult-too-much-empowers"), uid);
|
||||
return;
|
||||
}
|
||||
|
||||
_actionsSystem.AddAction(playerEntity.Value, ref actionId, action);
|
||||
comp.SelectedEmpowers.Add(_actionsSystem.AddAction(playerEntity.Value, action));
|
||||
}
|
||||
else if (cultistsActions < component.MinRequiredCultistActions)
|
||||
else if (comp.SelectedEmpowers.Count < component.MinRequiredCultistActions)
|
||||
{
|
||||
_actionsSystem.AddAction(playerEntity.Value, ref actionId, action);
|
||||
comp.SelectedEmpowers.Add(_actionsSystem.AddAction(playerEntity.Value, action));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user