Багфиксы и всякое (#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:
Aviu00
2024-02-13 01:22:36 +09:00
committed by GitHub
parent a68c1d13b7
commit 5b4164e118
27 changed files with 60 additions and 70 deletions

View File

@@ -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,

View File

@@ -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;

View File

@@ -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);

View File

@@ -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 ||

View File

@@ -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)

View File

@@ -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}");
}
}

View File

@@ -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;

View File

@@ -7,4 +7,7 @@ public sealed partial class ConstructComponent : Component
{
[DataField("actions")]
public List<EntProtoId> Actions = new();
[ViewVariables]
public List<EntityUid?> ActionEntities = new();
}

View File

@@ -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();
}

View File

@@ -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 _))
{

View File

@@ -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));
}
}

View File

@@ -364,6 +364,7 @@ public abstract partial class SharedGunSystem
// No ammo returned.
else
{
CycleCartridge(uid, component, args.User); // WD EDIT
return;
}
@@ -398,6 +399,7 @@ public abstract partial class SharedGunSystem
}
else
{
SetBoltClosed(uid, component, false, user: args.User, appearance: appearance); // WD EDIT
Appearance.SetData(uid, AmmoVisuals.MagLoaded, false, appearance);
return;
}

View File

@@ -19,7 +19,7 @@ public sealed partial class CultistComponent : Component
public CancellationTokenSource? HolyConvertToken;
[NonSerialized]
public List<string> SelectedEmpowers = new();
public List<EntityUid?> SelectedEmpowers = new();
public static string SummonCultDaggerAction = "InstantActionSummonCultDagger";

View File

@@ -1,4 +0,0 @@
author: ficcialfaint and deltanedas
changes:
- type: Add
message: Criminal records and the console that manages them have been added to the game. They also have a guidebook entry.

View File

@@ -237,14 +237,13 @@
components:
- type: StorageFill
contents:
- id: ClothingEyesHudSecurity
- id: WeaponDisabler
- id: ClothingOuterCoatHoSTrench
- id: ClothingOuterHardsuitSecurityRed
- id: ClothingMaskGasSwat
- id: ClothingBeltSecurityFilled
- id: ClothingHeadsetAltSecurity
- id: ClothingEyesGlassesSunglasses
- id: ClothingEyesGlassesSecurity
- id: ClothingShoesBootsJack
- id: CigarGoldCase
prob: 0.50
@@ -263,7 +262,6 @@
components:
- type: StorageFill
contents:
- id: ClothingEyesHudSecurity
- id: WeaponEgun
- id: ClothingHeadHatBeretHoS
- id: ClothingHeadHatHoshat
@@ -271,7 +269,7 @@
- id: ClothingOuterCoatHoSTrench
- id: ClothingBeltSecurityFilled
- id: ClothingHeadsetAltSecurity
- id: ClothingEyesGlassesSunglasses
- id: ClothingEyesGlassesSecurity
- id: ClothingShoesBootsJack
- id: CigarGoldCase
prob: 0.50

View File

@@ -10,7 +10,7 @@
prob: 0.3
- id: ClothingBeltSecurityFilled
- id: Flash
- id: ClothingEyesGlassesSunglasses
- id: ClothingEyesGlassesSecurity
- id: ClothingHeadsetAltSecurity
- id: ClothingHandsGlovesCombat
- id: ClothingShoesBootsJack
@@ -20,7 +20,6 @@
- id: DoorRemoteArmory
- id: ClothingOuterHardsuitWarden
- id: HoloprojectorSecurity
- id: ClothingEyesHudSecurity
- id: BoxBodyCamera
- type: entity
@@ -36,7 +35,7 @@
- id: ClothingHeadHatBeretWarden
- id: ClothingBeltSecurityFilled
- id: Flash
- id: ClothingEyesGlassesSunglasses
- id: ClothingEyesGlassesSecurity
- id: ClothingHeadsetAltSecurity
- id: ClothingHandsGlovesCombat
- id: ClothingShoesBootsJack
@@ -45,7 +44,6 @@
- id: RubberStampWarden
- id: DoorRemoteArmory
- id: HoloprojectorSecurity
- id: ClothingEyesHudSecurity
- id: BoxBodyCamera
- type: entity
@@ -64,13 +62,12 @@
- id: ClothingBeltSecurityFilled
- id: Flash
prob: 0.5
- id: ClothingEyesGlassesSunglasses
- id: ClothingEyesGlassesSecurity
- id: ClothingHeadsetSecurity
- id: ClothingHandsGlovesColorBlack
- id: ClothingShoesBootsJack
- id: WeaponMeleeNeedle
prob: 0.1
- id: ClothingEyesHudSecurity
- id: WeaponDisabler
- id: HoloprojectorSecurity
prob: 0.6
@@ -82,7 +79,6 @@
components:
- type: StorageFill
contents:
- id: ClothingEyesHudSecurity
- id: WeaponDisabler
- id: TrackingImplanter
amount: 2
@@ -118,8 +114,6 @@
components:
- type: StorageFill
contents:
- id: ClothingEyesHudSecurity
prob: 0.3
- id: ClothingHeadHatFedoraBrown
- id: ClothingNeckTieDet
- id: ClothingOuterVestDetective

View File

@@ -12,6 +12,7 @@
ClothingEyesGlassesSunglasses: 2
ClothingEyesHudSecurity: 2
ClothingEyesEyepatchHudSecurity: 1
ClothingEyesGlassesSecurity: 4
ClothingBeltSecurityWebbing: 5
Zipties: 12
RiotShield: 2

View File

@@ -29,8 +29,6 @@
- Command
- Brig
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
- !type:AddComponentSpecial
components:
- type: CommandStaff

View File

@@ -51,8 +51,6 @@
- Atmospherics
- Medical
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
- !type:AddComponentSpecial
components:
- type: CommandStaff

View File

@@ -31,8 +31,6 @@
- Atmospherics
- Brig
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
- !type:AddComponentSpecial
components:
- type: CommandStaff

View File

@@ -28,8 +28,6 @@
- ChiefMedicalOfficer
- Brig
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
- !type:AddComponentSpecial
components:
- type: CommandStaff

View File

@@ -25,8 +25,6 @@
- ResearchDirector
- Brig
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
- !type:AddComponentSpecial
components:
- type: CommandStaff

View File

@@ -31,7 +31,7 @@
jumpsuit: ClothingUniformJumpsuitDetective
back: ClothingBackpackSecurityFilledDetective
shoes: ClothingShoesBootsCombatFilled
eyes: ClothingEyesGlassesSunglasses
eyes: ClothingEyesGlassesSecurity
head: ClothingHeadHatFedoraBrown
outerClothing: ClothingOuterVestDetective
id: DetectivePDA

View File

@@ -44,7 +44,7 @@
back: ClothingBackpackHOSFilled
shoes: ClothingShoesBootsCombatFilled
outerClothing: ClothingOuterCoatHoSTrench
eyes: ClothingEyesGlassesSunglasses
eyes: ClothingEyesGlassesSecurity
head: ClothingHeadHatBeretHoS
id: HoSPDA
gloves: ClothingHandsGlovesCombat

View File

@@ -29,7 +29,7 @@
jumpsuit: ClothingUniformJumpsuitSec
back: ClothingBackpackSecurityFilled
shoes: ClothingShoesBootsCombatFilled
eyes: ClothingEyesGlassesSunglasses
eyes: ClothingEyesGlassesSecurity
head: ClothingHeadHelmetBasic
outerClothing: ClothingOuterArmorBasic
id: SecurityPDA

View File

@@ -32,7 +32,7 @@
jumpsuit: ClothingUniformJumpsuitWarden
back: ClothingBackpackSecurityFilled
shoes: ClothingShoesBootsCombatFilled
eyes: ClothingEyesGlassesSunglasses
eyes: ClothingEyesGlassesSecurity
outerClothing: ClothingOuterCoatWarden
id: WardenPDA
ears: ClothingHeadsetSecurity

View File

@@ -25,6 +25,8 @@
- gcf
- gc
- gc_mode
- resetent
- resetallents
- cvar
- midipanic
- replay_recording_start
@@ -50,8 +52,6 @@
- hidemechanisms
- showmechanisms
- menuvis
- resetent
- resetallents
- togglehealthoverlay
- toggledecals
- nodevis