Fixes & more (#548)
* - fix: Narsie not spawning, items not dropping on paralyze, cult tweaks. * - fix: Diagonal grilles layer. * - add: Cockroaches don't drop organs. * - add: Magic hands now work on interact & disable context menu interaction. * - fix: Shackles speech after doafter. * - tweak: Reduce flashbang knockdown, check for CanLieDown. * - tweak: Hspear limit. * - tweak: Remove knockdown tile friction. * - tweak: Engi belt in sus box. * - fix: Constructs can hear cult chat. * - fix: Desword audio. * - fix: Context menu. * - fix: Actually drop items on paralyze. * - tweak: Revert range reduction. * - add: Update thermal visibility. * - add: NPCs can miss. * - tweak: Update desc. * - fix: Actually fix desword audio. * - tweak: Secret weights & game presets. * - fix: Cult stun.
This commit is contained in:
@@ -24,6 +24,7 @@ using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Players;
|
||||
using Content.Shared.Radio;
|
||||
using Content.Shared._White;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared._White.Cult.Systems;
|
||||
using Robust.Server.Player;
|
||||
@@ -795,6 +796,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
return Filter.Empty()
|
||||
.AddWhereAttachedEntity(HasComp<GhostComponent>)
|
||||
.AddWhereAttachedEntity(HasComp<CultistComponent>)
|
||||
.AddWhereAttachedEntity(HasComp<ConstructComponent>)
|
||||
.Recipients
|
||||
.Union(_adminManager.ActiveAdmins)
|
||||
.Select(p => p.Channel);
|
||||
|
||||
@@ -14,7 +14,7 @@ public sealed partial class CultRitesHandComponent : BaseMagicHandComponent
|
||||
public SoundSpecifier SuckSound = new SoundPathSpecifier("/Audio/White/Cult/enter_blood.ogg");
|
||||
|
||||
[DataField]
|
||||
public float HealModifier = 0.5f;
|
||||
public float HealModifier = 1f;
|
||||
|
||||
[DataField(customTypeSerializer: typeof(PrototypeIdListSerializer<CultistFactoryProductionPrototype>))]
|
||||
public List<string> BloodRites = new ()
|
||||
|
||||
@@ -17,11 +17,11 @@ using Content.Shared.Examine;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Fluids.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Robust.Server.Audio;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -50,9 +50,8 @@ public sealed class MagicHandSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CultStunHandComponent, MeleeHitEvent>(OnStunHit);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, MeleeHitEvent>(OnRitesHit);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, AfterInteractEvent>(OnInteract);
|
||||
SubscribeLocalEvent<CultStunHandComponent, AfterInteractEvent>(OnStunInteract);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, AfterInteractEvent>(OnRitesInteract);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, CultistFactoryItemSelectedMessage>(OnBloodRitesSelected);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, ActivatableUIOpenAttemptEvent>(OnRitesSelectAttempt);
|
||||
SubscribeLocalEvent<CultRitesHandComponent, BeforeActivatableUIOpenEvent>(BeforeRitesSelect);
|
||||
@@ -122,17 +121,26 @@ public sealed class MagicHandSystem : EntitySystem
|
||||
cultist.RitesBloodAmount -= prototype.BloodCost;
|
||||
}
|
||||
|
||||
private void OnInteract(Entity<CultRitesHandComponent> ent, ref AfterInteractEvent args)
|
||||
private void OnRitesInteract(Entity<CultRitesHandComponent> ent, ref AfterInteractEvent args)
|
||||
{
|
||||
if (!args.CanReach || args.Target is not { } target)
|
||||
return;
|
||||
|
||||
if (!TryComp(args.User, out CultistComponent? cultist))
|
||||
return;
|
||||
|
||||
if (HasComp<CultistComponent>(target) || HasComp<ConstructComponent>(target))
|
||||
{
|
||||
RitesHeal(ent, target, args.User, cultist);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var puddleQuery = GetEntityQuery<PuddleComponent>();
|
||||
if (!puddleQuery.HasComp(target))
|
||||
return;
|
||||
|
||||
if (!TryComp(args.User, out BloodstreamComponent? bloodstreamComponent) ||
|
||||
!TryComp(args.User, out CultistComponent? cultist))
|
||||
if (!TryComp(args.User, out BloodstreamComponent? bloodstreamComponent))
|
||||
return;
|
||||
|
||||
var xform = Transform(target);
|
||||
@@ -176,28 +184,22 @@ public sealed class MagicHandSystem : EntitySystem
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnRitesHit(Entity<CultRitesHandComponent> ent, ref MeleeHitEvent args)
|
||||
private void RitesHeal(Entity<CultRitesHandComponent> ent, EntityUid target, EntityUid user, CultistComponent cultist)
|
||||
{
|
||||
if (args.HitEntities.Count == 0)
|
||||
return;
|
||||
|
||||
var target = args.HitEntities[0];
|
||||
var (uid, comp) = ent;
|
||||
|
||||
QueueDel(uid);
|
||||
|
||||
if (!TryComp(args.User, out CultistComponent? cultist) || !TryComp(target, out DamageableComponent? damageable))
|
||||
if (!TryComp(target, out DamageableComponent? damageable) || !TryComp(target, out MobStateComponent? mobState))
|
||||
return;
|
||||
|
||||
if (_mobState.IsDead(target))
|
||||
if (_mobState.IsDead(target, mobState))
|
||||
{
|
||||
Popup(Loc.GetString("cult-rites-dead"), args.User);
|
||||
Popup(Loc.GetString("cult-rites-dead"), user);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cultist.RitesBloodAmount <= FixedPoint2.Zero)
|
||||
{
|
||||
Popup(Loc.GetString("cult-rites-heal-no-blood"), args.User);
|
||||
Popup(Loc.GetString("cult-rites-heal-no-blood"), user);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,27 +207,32 @@ public sealed class MagicHandSystem : EntitySystem
|
||||
var totalDamage = damage.GetTotal();
|
||||
if (totalDamage <= FixedPoint2.Zero)
|
||||
{
|
||||
Popup(Loc.GetString("cult-rites-already-healed"), args.User);
|
||||
Popup(Loc.GetString("cult-rites-already-healed"), user);
|
||||
return;
|
||||
}
|
||||
|
||||
QueueDel(uid);
|
||||
|
||||
var coef = FixedPoint2.Min(cultist.RitesBloodAmount * comp.HealModifier, totalDamage) / totalDamage;
|
||||
cultist.RitesBloodAmount =
|
||||
FixedPoint2.Max(FixedPoint2.Zero, cultist.RitesBloodAmount - totalDamage / comp.HealModifier);
|
||||
_damageable.TryChangeDamage(target, -damage * coef, true, false, damageable, args.User);
|
||||
Popup(Loc.GetString("cult-rites-after-heal", ("blood", cultist.RitesBloodAmount)), args.User);
|
||||
_damageable.TryChangeDamage(target, -damage * coef, true, false, damageable, user);
|
||||
Popup(Loc.GetString("cult-rites-after-heal", ("blood", cultist.RitesBloodAmount)), user);
|
||||
_audio.PlayPvs(comp.HealSound, target);
|
||||
Speak(args.User, comp);
|
||||
Speak(user, comp);
|
||||
}
|
||||
|
||||
private void OnStunHit(Entity<CultStunHandComponent> ent, ref MeleeHitEvent args)
|
||||
private void OnStunInteract(Entity<CultStunHandComponent> ent, ref AfterInteractEvent args)
|
||||
{
|
||||
if (args.HitEntities.Count == 0)
|
||||
if (!args.CanReach || args.Target is not { } target)
|
||||
return;
|
||||
|
||||
var target = args.HitEntities[0];
|
||||
var (uid, comp) = ent;
|
||||
|
||||
if (uid == target || !TryComp(target, out StatusEffectsComponent? status) ||
|
||||
HasComp<CultistComponent>(target) || HasComp<ConstructComponent>(target))
|
||||
return;
|
||||
|
||||
QueueDel(uid);
|
||||
Spawn("CultStunFlashEffect", Transform(target).Coordinates);
|
||||
Speak(args.User, comp);
|
||||
@@ -241,8 +248,8 @@ public sealed class MagicHandSystem : EntitySystem
|
||||
var halo = HasComp<PentagramComponent>(args.User);
|
||||
|
||||
_statusEffects.TryAddStatusEffect(target, "Muted", halo ? comp.HaloMuteDuration : comp.MuteDuration, true,
|
||||
"Muted");
|
||||
_stun.TryParalyze(target, halo ? comp.HaloDuration : comp.Duration, true);
|
||||
"Muted", status);
|
||||
_stun.TryParalyze(target, halo ? comp.HaloDuration : comp.Duration, true, status);
|
||||
}
|
||||
|
||||
private void Popup(string msg, EntityUid user, PopupType type = PopupType.Small)
|
||||
|
||||
29
Content.Server/_White/Cult/Pylon/CheckForStructure.cs
Normal file
29
Content.Server/_White/Cult/Pylon/CheckForStructure.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared._White.Cult.Pylon;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Popups;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server._White.Cult.Pylon;
|
||||
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed partial class CheckForStructure : IGraphAction
|
||||
{
|
||||
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
||||
{
|
||||
var xform = entityManager.GetComponent<TransformComponent>(uid);
|
||||
var coords = xform.Coordinates;
|
||||
if (!SharedPylonComponent.CheckForStructure(coords, entityManager, 9f, uid))
|
||||
return;
|
||||
|
||||
entityManager.QueueDeleteEntity(uid);
|
||||
if (userUid != null)
|
||||
{
|
||||
entityManager.System<PopupSystem>()
|
||||
.PopupEntity(Loc.GetString("cult-structure-craft-another-structure-nearby"),
|
||||
userUid.Value, userUid.Value, PopupType.MediumCaution);
|
||||
}
|
||||
entityManager.SpawnEntity("CultRunicMetal4", coords);
|
||||
}
|
||||
}
|
||||
@@ -61,15 +61,6 @@ public sealed class PylonSystem : EntitySystem
|
||||
|
||||
private void OnInit(EntityUid uid, SharedPylonComponent component, ComponentInit args)
|
||||
{
|
||||
var coords = Transform(uid).Coordinates;
|
||||
if (SharedPylonComponent.CheckForStructure(coords, EntityManager, 9f, uid))
|
||||
{
|
||||
QueueDel(uid);
|
||||
_popupSystem.PopupCoordinates(Loc.GetString("cult-structure-craft-another-structure-nearby"),
|
||||
coords, PopupType.MediumCaution);
|
||||
Spawn("CultRunicMetal4", coords);
|
||||
return;
|
||||
}
|
||||
UpdateAppearance(uid, component);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ public partial class CultSystem
|
||||
{
|
||||
_popupSystem.PopupEntity("Цель обезмолвлена.", args.User, args.User);
|
||||
}
|
||||
if (args.Speech != null)
|
||||
_chat.TrySendInGameICMessage(args.User, args.Speech, InGameICChatType.Whisper, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -369,8 +371,8 @@ public partial class CultSystem
|
||||
if (!TryComp(args.Target, out CuffableComponent? cuffs) || cuffs.Container.ContainedEntities.Count > 0)
|
||||
return;
|
||||
|
||||
var doAfterArgs = new DoAfterArgs(EntityManager, args.Performer, TimeSpan.FromSeconds(2), new ShacklesEvent(),
|
||||
args.Performer, args.Target)
|
||||
var doAfterArgs = new DoAfterArgs(EntityManager, args.Performer, TimeSpan.FromSeconds(2),
|
||||
new ShacklesEvent(args.Speech), args.Performer, args.Target)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
BreakOnDamage = true
|
||||
@@ -379,7 +381,6 @@ public partial class CultSystem
|
||||
if (!_doAfterSystem.TryStartDoAfter(doAfterArgs))
|
||||
return;
|
||||
|
||||
Speak(args);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user