* base

* remove redudant shit

* implement needed

* doc

* manager

* Commands

* Update AspectManager.cs

* oops, hardcoded!

* fix

* похуй

* да похуй

* увфывфывфывфыв

* Update AspectManager.cs

* RandomAccentAspect

* avoid repeating

* FastAndFuriousAccent

* Update Aspects.yml

* Update FastandFuriousAspect.cs

* RandomAppearanceAspect

* helpers and some shit

* Bombassssssss

* DrunkAspect

* CargoRich

* TraitoredAspect

* require info and feature to force aspect

* add exec only in lobby

* deforce command

* Update TraitoredAspect.cs

* Prepare for Bloody and Weak Aspects.

* comments

* WeakWallsAspect

* tweak

* NoEngineAspect

* airunlock aspect

* BloodyAspect

* WeakAspect

* BattledAspect

* I Have Two Butts But I must Seat

* веса

* Update WhiteCVars.cs
This commit is contained in:
rhailrake
2023-09-17 18:51:42 +06:00
committed by Aviu00
parent 015bb02e86
commit 6db5d91e1c
52 changed files with 1902 additions and 9 deletions

View File

@@ -21,15 +21,16 @@ using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
using Content.Shared.Weapons.Ranged.Systems;
using Content.Shared.White;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Toolshed.Syntax;
using ItemToggleMeleeWeaponComponent = Content.Shared.Item.ItemToggle.Components.ItemToggleMeleeWeaponComponent;
namespace Content.Shared.Weapons.Melee;
@@ -50,6 +51,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
[Dependency] private readonly StaminaSystem _stamina = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
public const float DamagePitchVariation = 0.05f;
private const int AttackMask = (int) (CollisionGroup.MobMask | CollisionGroup.Opaque);
@@ -59,6 +61,10 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
/// </summary>
public const int MaxTargets = 5;
private float DamageModifier { get; set; }
private void SetDamage(float value) => DamageModifier = value;
/// <summary>
/// If an attack is released within this buffer it's assumed to be full damage.
/// </summary>
@@ -68,6 +74,8 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
{
base.Initialize();
_cfg.OnValueChanged(WhiteCVars.DamageModifier, SetDamage, true);
SubscribeLocalEvent<MeleeWeaponComponent, EntityUnpausedEvent>(OnMeleeUnpaused);
SubscribeLocalEvent<MeleeWeaponComponent, HandSelectedEvent>(OnMeleeSelected);
SubscribeLocalEvent<MeleeWeaponComponent, ShotAttemptedEvent>(OnMeleeShotAttempted);
@@ -238,7 +246,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
var ev = new GetMeleeDamageEvent(uid, new (component.Damage), new(), user);
RaiseLocalEvent(uid, ref ev);
return DamageSpecifier.ApplyModifierSets(ev.Damage, ev.Modifiers);
var modifiedDamage = ev.Damage * DamageModifier;
return DamageSpecifier.ApplyModifierSets(modifiedDamage, ev.Modifiers);
}
public float GetAttackRate(EntityUid uid, EntityUid user, MeleeWeaponComponent? component = null)