Некоторые балансные изменения (#72)

* - balance: Chainsaw can only be crafted using advanced saw.

* - balance: Tweak some melee weapon damage and sizes.

* - balance: Tweak stun baton.

* - balance: No flash heavy attack.

* - balance: Tweak modifier sets.

* - tweak: Stunprod and snatcherprod tweaks.

* - tweak: Auto cycle tweaks.

* - balance: Nerf flamethrower.

* - tweak: Remove old stunprod construction.

* - balance: Tweak shotgun ammo.

* - tweak: Cartridge ejecting tweaks.

* - fix: Fix stunprod held prefix.

* Revert "Makes external & shuttle airlocks bump-openable (#22706)"

This reverts commit 6a73aed6d5.

* - balance: Tweak modifier sets once again.

* - balance: Tweak IED timer.

* - tweak: Chemical explosions can't create vacuum.
This commit is contained in:
Aviu00
2024-02-16 03:08:42 +09:00
committed by GitHub
parent fe82255139
commit f7edea42cd
39 changed files with 294 additions and 206 deletions

View File

@@ -66,7 +66,8 @@ namespace Content.Server.Chemistry.ReactionEffects
ExplosionType,
intensity,
IntensitySlope,
MaxIntensity);
MaxIntensity,
canCreateVacuum: false); // WD EDIT
}
}
}

View File

@@ -12,9 +12,6 @@ public sealed partial class GunSystem
protected override void Cycle(EntityUid uid, BallisticAmmoProviderComponent component, MapCoordinates coordinates)
{
if (!component.IsCycled)
return;
EntityUid? ent = null;
// TODO: Combine with TakeAmmo

View File

@@ -179,10 +179,12 @@ public sealed partial class GunSystem : SharedGunSystem
{
userImpulse = false;
Audio.PlayPredicted(gun.SoundEmpty, gunUid, user);
break; // WD EDIT
}
// Something like ballistic might want to leave it in the container still
if (!cartridge.DeleteOnSpawn && !Containers.IsEntityInContainer(ent!.Value))
if (!cartridge.DeleteOnSpawn && !Containers.IsEntityInContainer(ent!.Value) &&
(!TryComp(gunUid, out BallisticAmmoProviderComponent? ballistic) || ballistic.AutoCycle)) // WD EDIT
EjectCartridge(ent.Value, angle);
Dirty(ent!.Value, cartridge);

View File

@@ -1,9 +0,0 @@
namespace Content.Server._White.Snatcherprod;
[RegisterComponent, Access(typeof(SnatcherprodSystem))]
public sealed partial class SnatcherprodComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("energyPerUse")]
public float EnergyPerUse { get; set; } = 36;
}

View File

@@ -0,0 +1,6 @@
namespace Content.Server._White.Stunprod;
[RegisterComponent]
public sealed partial class SnatcherprodComponent : Component
{
}

View File

@@ -0,0 +1,56 @@
using System.Linq;
using Content.Shared.Damage.Events;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Item.ItemToggle;
namespace Content.Server._White.Stunprod;
public sealed class SnatcherprodSystem : EntitySystem
{
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedItemToggleSystem _itemToggle = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SnatcherprodComponent, StaminaMeleeHitEvent>(OnHit);
}
private void OnHit(EntityUid uid, SnatcherprodComponent component, StaminaMeleeHitEvent args)
{
if (!_itemToggle.IsActivated(uid) || args.HitList.Count == 0)
return;
var entity = args.HitList.First().Entity;
if (entity == uid || !TryComp(entity, out HandsComponent? hands))
return;
EntityUid? heldEntity = null;
if (hands.ActiveHandEntity != null)
heldEntity = hands.ActiveHandEntity;
else
{
foreach (var hand in hands.Hands)
{
if (hand.Value.HeldEntity == null)
continue;
heldEntity = hand.Value.HeldEntity;
break;
}
if (heldEntity == null)
return;
}
if (!_hands.TryDrop(entity, heldEntity.Value, null, false, false, handsComp: hands))
return;
_hands.PickupOrDrop(args.User, heldEntity.Value, false);
}
}

View File

@@ -0,0 +1,11 @@
namespace Content.Server._White.Stunprod;
[RegisterComponent]
public sealed partial class StunprodComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float EnergyPerUse { get; set; } = 72;
[DataField]
public bool HasHeldPrefix = true;
}

View File

@@ -1,27 +1,25 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Damage.Events;
using Content.Shared.Examine;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Item;
using Content.Shared.Item.ItemToggle;
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Toggleable;
using Robust.Shared.Containers;
namespace Content.Server._White.Snatcherprod;
namespace Content.Server._White.Stunprod;
public sealed class SnatcherprodSystem : EntitySystem
public sealed class StunprodSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedItemToggleSystem _itemToggle = default!;
[Dependency] private readonly SharedItemSystem _item = default!;
private const string CellSlot = "cell_slot";
@@ -29,16 +27,15 @@ public sealed class SnatcherprodSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<SnatcherprodComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<SnatcherprodComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<SnatcherprodComponent, StaminaMeleeHitEvent>(OnHit);
SubscribeLocalEvent<SnatcherprodComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
SubscribeLocalEvent<SnatcherprodComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
SubscribeLocalEvent<SnatcherprodComponent, ItemToggleActivateAttemptEvent>(TryTurnOn);
SubscribeLocalEvent<SnatcherprodComponent, ItemToggledEvent>(ToggleDone);
SubscribeLocalEvent<StunprodComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<StunprodComponent, StaminaDamageOnHitAttemptEvent>(OnStaminaHitAttempt);
SubscribeLocalEvent<StunprodComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
SubscribeLocalEvent<StunprodComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
SubscribeLocalEvent<StunprodComponent, ItemToggleActivateAttemptEvent>(TryTurnOn);
SubscribeLocalEvent<StunprodComponent, ItemToggledEvent>(ToggleDone);
}
private void OnEntInserted(EntityUid uid, SnatcherprodComponent component, EntInsertedIntoContainerMessage args)
private void OnEntInserted(EntityUid uid, StunprodComponent component, EntInsertedIntoContainerMessage args)
{
_itemToggle.TryDeactivate(uid, predicted: false);
@@ -48,7 +45,7 @@ public sealed class SnatcherprodSystem : EntitySystem
}
}
private void OnEntRemoved(EntityUid uid, SnatcherprodComponent component, EntRemovedFromContainerMessage args)
private void OnEntRemoved(EntityUid uid, StunprodComponent component, EntRemovedFromContainerMessage args)
{
if (TerminatingOrDeleted(uid))
return;
@@ -64,42 +61,8 @@ public sealed class SnatcherprodSystem : EntitySystem
_itemToggle.TryDeactivate(uid, predicted: false);
}
private void OnHit(EntityUid uid, SnatcherprodComponent component, StaminaMeleeHitEvent args)
{
if (!_itemToggle.IsActivated(uid) || args.HitList.Count == 0)
return;
var entity = args.HitList.First().Entity;
if (!TryComp(entity, out HandsComponent? hands))
return;
EntityUid? heldEntity = null;
if (hands.ActiveHandEntity != null)
heldEntity = hands.ActiveHandEntity;
else
{
foreach (var hand in hands.Hands)
{
if (hand.Value.HeldEntity == null)
continue;
heldEntity = hand.Value.HeldEntity;
break;
}
if (heldEntity == null)
return;
}
if (!_hands.TryDrop(entity, heldEntity.Value, null, false, false, handsComp: hands))
return;
_hands.PickupOrDrop(args.User, heldEntity.Value, false);
}
private void OnStaminaHitAttempt(EntityUid uid, SnatcherprodComponent component, ref StaminaDamageOnHitAttemptEvent args)
private void OnStaminaHitAttempt(EntityUid uid, StunprodComponent component,
ref StaminaDamageOnHitAttemptEvent args)
{
if (!_itemToggle.IsActivated(uid) || !TryGetBatteryComponent(uid, out var battery, out var batteryUid) ||
!_battery.TryUseCharge(batteryUid.Value, component.EnergyPerUse, battery))
@@ -114,23 +77,26 @@ public sealed class SnatcherprodSystem : EntitySystem
}
}
private void OnExamined(EntityUid uid, SnatcherprodComponent comp, ExaminedEvent args)
private void OnExamined(EntityUid uid, StunprodComponent comp, ExaminedEvent args)
{
var msg = _itemToggle.IsActivated(uid)
? Loc.GetString("comp-snatcherprod-examined-on")
: Loc.GetString("comp-snatcherprod-examined-off");
? Loc.GetString("comp-stunprod-examined-on")
: Loc.GetString("comp-stunprod-examined-off");
args.PushMarkup(msg);
}
private void ToggleDone(Entity<SnatcherprodComponent> entity, ref ItemToggledEvent args)
private void ToggleDone(Entity<StunprodComponent> entity, ref ItemToggledEvent args)
{
if (entity.Comp.HasHeldPrefix && TryComp<ItemComponent>(entity, out var item))
_item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off", component: item);
if (TryGetBatteryComponent(entity, out _, out _) || !TryComp<AppearanceComponent>(entity, out var appearance))
return;
_appearance.SetData(entity, ToggleVisuals.Toggled, "nocell", appearance);
}
private void TryTurnOn(Entity<SnatcherprodComponent> entity, ref ItemToggleActivateAttemptEvent args)
private void TryTurnOn(Entity<StunprodComponent> entity, ref ItemToggleActivateAttemptEvent args)
{
if (TryGetBatteryComponent(entity, out var battery, out _) &&
battery.CurrentCharge >= entity.Comp.EnergyPerUse)