Фиксы (#332)
* - fix: Fix desword flipping on server. * - fix: Fix invalid cult target. * - fix: Fix narsie summon. * - tweak: Weaker heavy attack. * - tweak: Less toy desword stamina damage. * - fix: FrameUpdate. * - tweak: Less blunt bleed.
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
using Content.Shared._White.Animations;
|
using Content.Shared._White.Animations;
|
||||||
using Content.Shared.Item.ItemToggle.Components;
|
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
|
||||||
using Robust.Client.Animations;
|
using Robust.Client.Animations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Animations;
|
using Robust.Shared.Animations;
|
||||||
@@ -8,7 +6,7 @@ using Robust.Shared.Timing;
|
|||||||
|
|
||||||
namespace Content.Client._White.Animations;
|
namespace Content.Client._White.Animations;
|
||||||
|
|
||||||
public sealed class FlipOnHitSystem : EntitySystem
|
public sealed class FlipOnHitSystem : SharedFlipOnHitSystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
|
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
@@ -17,8 +15,8 @@ public sealed class FlipOnHitSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<FlipOnHitComponent, MeleeHitEvent>(OnHit);
|
|
||||||
SubscribeLocalEvent<FlippingComponent, AnimationCompletedEvent>(OnAnimationComplete);
|
SubscribeLocalEvent<FlippingComponent, AnimationCompletedEvent>(OnAnimationComplete);
|
||||||
|
SubscribeAllEvent<FlipOnHitEvent>(ev => PlayAnimation(GetEntity(ev.User)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAnimationComplete(Entity<FlippingComponent> ent, ref AnimationCompletedEvent args)
|
private void OnAnimationComplete(Entity<FlippingComponent> ent, ref AnimationCompletedEvent args)
|
||||||
@@ -29,28 +27,17 @@ public sealed class FlipOnHitSystem : EntitySystem
|
|||||||
PlayAnimation(ent);
|
PlayAnimation(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHit(Entity<FlipOnHitComponent> ent, ref MeleeHitEvent args)
|
protected override void PlayAnimation(EntityUid user)
|
||||||
{
|
{
|
||||||
if (!_timing.IsFirstTimePredicted)
|
if (!_timing.IsFirstTimePredicted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (args.HitEntities.Count == 0)
|
if (_animationSystem.HasRunningAnimation(user, EmoteAnimationSystem.AnimationKey))
|
||||||
return;
|
|
||||||
|
|
||||||
if (TryComp(ent, out ItemToggleComponent? itemToggle) && !itemToggle.Activated)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_animationSystem.HasRunningAnimation(args.User, EmoteAnimationSystem.AnimationKey))
|
|
||||||
{
|
{
|
||||||
EnsureComp<FlippingComponent>(args.User);
|
EnsureComp<FlippingComponent>(user);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayAnimation(args.User);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PlayAnimation(EntityUid user)
|
|
||||||
{
|
|
||||||
RemComp<FlippingComponent>(user);
|
RemComp<FlippingComponent>(user);
|
||||||
|
|
||||||
var baseAngle = Angle.Zero;
|
var baseAngle = Angle.Zero;
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ public sealed class TelescopeSystem : SharedTelescopeSystem
|
|||||||
|
|
||||||
private ScalingViewport? _viewport;
|
private ScalingViewport? _viewport;
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void FrameUpdate(float frameTime)
|
||||||
{
|
{
|
||||||
base.Update(frameTime);
|
base.FrameUpdate(frameTime);
|
||||||
|
|
||||||
if (_timing.ApplyingState || !_timing.IsFirstTimePredicted || !_input.MouseScreenPosition.IsValid)
|
if (_timing.ApplyingState || !_timing.IsFirstTimePredicted || !_input.MouseScreenPosition.IsValid)
|
||||||
return;
|
return;
|
||||||
|
|||||||
17
Content.Server/_White/Animations/FlipOnHitSystem.cs
Normal file
17
Content.Server/_White/Animations/FlipOnHitSystem.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Content.Shared._White.Animations;
|
||||||
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
|
namespace Content.Server._White.Animations;
|
||||||
|
|
||||||
|
public sealed class FlipOnHitSystem : SharedFlipOnHitSystem
|
||||||
|
{
|
||||||
|
protected override void PlayAnimation(EntityUid user)
|
||||||
|
{
|
||||||
|
var filter = Filter.Pvs(user, entityManager: EntityManager);
|
||||||
|
|
||||||
|
if (TryComp<ActorComponent>(user, out var actor))
|
||||||
|
filter.RemovePlayer(actor.PlayerSession);
|
||||||
|
|
||||||
|
RaiseNetworkEvent(new FlipOnHitEvent(GetNetEntity(user)), filter);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -123,25 +123,34 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
|||||||
|
|
||||||
private void OnNarsieSummon(CultNarsieSummoned ev)
|
private void OnNarsieSummon(CultNarsieSummoned ev)
|
||||||
{
|
{
|
||||||
var query = EntityQueryEnumerator<MobStateComponent, MindContainerComponent, CultistComponent>();
|
var query =
|
||||||
|
EntityQueryEnumerator<MobStateComponent, MindContainerComponent, CultistComponent, TransformComponent>();
|
||||||
|
|
||||||
|
List<Entity<MindContainerComponent, TransformComponent>> cultists = new();
|
||||||
|
|
||||||
|
while (query.MoveNext(out var uid, out _, out var mindContainer, out _, out var transform))
|
||||||
|
{
|
||||||
|
cultists.Add((uid, mindContainer, transform));
|
||||||
|
}
|
||||||
|
|
||||||
var rulesQuery = QueryActiveRules();
|
var rulesQuery = QueryActiveRules();
|
||||||
while (rulesQuery.MoveNext(out _, out var cult, out _))
|
while (rulesQuery.MoveNext(out _, out var cult, out _))
|
||||||
{
|
{
|
||||||
cult.WinCondition = CultWinCondition.Win;
|
cult.WinCondition = CultWinCondition.Win;
|
||||||
_roundEndSystem.EndRound();
|
_roundEndSystem.EndRound();
|
||||||
|
|
||||||
while (query.MoveNext(out var uid, out _, out var mindContainer, out _))
|
foreach (var ent in cultists)
|
||||||
{
|
{
|
||||||
if (!mindContainer.HasMind || mindContainer.Mind is null)
|
if (ent.Comp1.Mind is null)
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
var reaper = Spawn(cult.ReaperPrototype, Transform(uid).Coordinates);
|
var reaper = Spawn(cult.ReaperPrototype, ent.Comp2.Coordinates);
|
||||||
_mindSystem.TransferTo(mindContainer.Mind.Value, reaper);
|
_mindSystem.TransferTo(ent.Comp1.Mind.Value, reaper);
|
||||||
|
|
||||||
_bodySystem.GibBody(uid);
|
_bodySystem.GibBody(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,13 +220,13 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
|||||||
|
|
||||||
var selectedCultists = _antagSelection.ChooseAntags(cultistsToSelect, eligiblePlayers);
|
var selectedCultists = _antagSelection.ChooseAntags(cultistsToSelect, eligiblePlayers);
|
||||||
|
|
||||||
|
var potentialTargets = FindPotentialTargets(selectedCultists);
|
||||||
|
rule.CultTarget = _random.PickAndTake(potentialTargets).Mind;
|
||||||
|
|
||||||
foreach (var cultist in selectedCultists)
|
foreach (var cultist in selectedCultists)
|
||||||
{
|
{
|
||||||
MakeCultist(cultist, rule);
|
MakeCultist(cultist, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
var potentialTargets = FindPotentialTargets(selectedCultists);
|
|
||||||
rule.CultTarget = _random.PickAndTake(potentialTargets).Mind;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MindComponent? GetTarget()
|
public MindComponent? GetTarget()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public sealed class RandomDamageSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
var damage = _random.NextFloat() * ent.Comp.Max;
|
var damage = _random.NextFloat() * ent.Comp.Max;
|
||||||
if (args.Direction != null) // Heavy attack
|
if (args.Direction != null) // Heavy attack
|
||||||
damage *= 0.7f;
|
damage *= 0.5f;
|
||||||
args.BonusDamage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Slash"), damage);
|
args.BonusDamage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Slash"), damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
var direction = targetMap.Position - userPos;
|
var direction = targetMap.Position - userPos;
|
||||||
var distance = Math.Min(component.Range, direction.Length());
|
var distance = Math.Min(component.Range, direction.Length());
|
||||||
|
|
||||||
var damage = GetDamage(meleeUid, user, component) * 0.70f;
|
var damage = GetDamage(meleeUid, user, component) * 0.5f;
|
||||||
var entities = GetEntityList(ev.Entities);
|
var entities = GetEntityList(ev.Entities);
|
||||||
|
|
||||||
// WD EDIT
|
// WD EDIT
|
||||||
|
|||||||
40
Content.Shared/_White/Animations/SharedFlipOnHitSystem.cs
Normal file
40
Content.Shared/_White/Animations/SharedFlipOnHitSystem.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
using Content.Shared.Item.ItemToggle.Components;
|
||||||
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
|
namespace Content.Shared._White.Animations;
|
||||||
|
|
||||||
|
public abstract class SharedFlipOnHitSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<FlipOnHitComponent, MeleeHitEvent>(OnHit);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnHit(Entity<FlipOnHitComponent> ent, ref MeleeHitEvent args)
|
||||||
|
{
|
||||||
|
if (!_timing.IsFirstTimePredicted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (args.HitEntities.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (TryComp(ent, out ItemToggleComponent? itemToggle) && !itemToggle.Activated)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PlayAnimation(args.User);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void PlayAnimation(EntityUid user);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable, NetSerializable]
|
||||||
|
public sealed class FlipOnHitEvent(NetEntity user) : EntityEventArgs
|
||||||
|
{
|
||||||
|
public NetEntity User = user;
|
||||||
|
}
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
- type: damageModifierSet
|
- type: damageModifierSet
|
||||||
id: BloodlossHuman
|
id: BloodlossHuman
|
||||||
coefficients:
|
coefficients:
|
||||||
Blunt: 0.08
|
Blunt: 0.05
|
||||||
Slash: 0.25
|
Slash: 0.25
|
||||||
Piercing: 0.2
|
Piercing: 0.2
|
||||||
Shock: 0.0
|
Shock: 0.0
|
||||||
|
|||||||
@@ -1281,8 +1281,6 @@
|
|||||||
sprite: Objects/Weapons/Melee/double_esword.rsi
|
sprite: Objects/Weapons/Melee/double_esword.rsi
|
||||||
- type: Wieldable
|
- type: Wieldable
|
||||||
- type: ToggleableWielded
|
- type: ToggleableWielded
|
||||||
- type: StaminaDamageOnHit
|
|
||||||
damage: 16
|
|
||||||
- type: FlipOnHit
|
- type: FlipOnHit
|
||||||
- type: Construction
|
- type: Construction
|
||||||
deconstructionTarget: null
|
deconstructionTarget: null
|
||||||
|
|||||||
Reference in New Issue
Block a user