Skip to content

Commit

Permalink
баланс
Browse files Browse the repository at this point in the history
  • Loading branch information
babaevlsdd committed Jan 1, 2025
1 parent 66e2797 commit 66ecbab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Content.Server/_Sunrise/Flip/FlipSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using Content.Shared.Chat.Prototypes;
using Content.Shared.Mobs.Components;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Random;

namespace Content.Server._Sunrise.Flip;

public sealed class FlipSystem : SharedFlipSystem
{
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly IRobustRandom _random = default!;

[ValidatePrototypeId<EmotePrototype>]
private const string EmoteFlipProto = "Flip";
Expand All @@ -22,12 +24,14 @@ public override void Initialize()

private void OnFlipOnAttack(EntityUid uid, FlipOnAttackComponent component, MeleeHitEvent args)
{
Logger.Info("OnFlipOnAttack");
foreach (var entity in args.HitEntities)
{
if (!HasComp<MobStateComponent>(entity))
continue;

if (!_random.Prob(component.Probability))
continue;

PlayEmoteFlip(args.User);
return;
}
Expand Down
6 changes: 5 additions & 1 deletion Content.Shared/_Sunrise/Flip/FlipOnAttackComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
namespace Content.Shared._Sunrise.Flip
{
[NetworkedComponent, RegisterComponent]
public sealed partial class FlipOnAttackComponent : Component;
public sealed partial class FlipOnAttackComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("probability")]
public float Probability = 1.0f;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
spread: 75
needActiveHand: true # Sunrise-Edit
- type: FlipOnAttack # Sunrise-Edit
probability: 0.5 # Sunrise-Edit

- type: entity
suffix: One-Handed, For Borgs
Expand Down

0 comments on commit 66ecbab

Please sign in to comment.