Mining tweaks (#18686)

So we have pickaxe, drill, crusher, and PKA (projectiles).
The tier list in terms of mining speed should go:
- PKA
- Crusher
- Pickaxe
- Drill

As a result:
- Nerfed PKA firerate to 0.5 and bumped damage (slight DPS nerf due to meta).
- Crusher bumped to 1 hit per second as PKA is still more common and also to make it better at mining.
- Pickaxe is 1 hit per second and also gets structural (fireaxe should still beat it by a little bit) so it's better to break stuff than crusher but worse in combat.
- Drill is 1.5 hits per second but otherwise weak.
This commit is contained in:
metalgearsloth
2023-08-06 11:23:38 +10:00
committed by GitHub
parent 9a20a73f33
commit fb4d980848
9 changed files with 32 additions and 130 deletions

View File

@@ -1,38 +0,0 @@
using System.Threading;
using Content.Shared.Damage;
using Robust.Shared.Audio;
namespace Content.Server.Gatherable.Components
{
/// <summary>
/// When interacting with an <see cref="GatherableComponent"/> allows it to spawn entities.
/// </summary>
[RegisterComponent]
public sealed class GatheringToolComponent : Component
{
/// <summary>
/// Sound that is made once you completed gathering
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sound")]
public SoundSpecifier GatheringSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Mining/pickaxe.ogg");
/// <summary>
/// What damage should be given to objects when
/// gathered using this tool? (0 for infinite gathering)
/// </summary>
[DataField("damage", required: true)]
public DamageSpecifier Damage { get; set; } = default!;
/// <summary>
/// How many entities can this tool gather from at once?
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxEntities")]
public int MaxGatheringEntities = 1;
[ViewVariables]
[DataField("gatheringEntities")]
public readonly List<EntityUid> GatheringEntities = new();
}
}

View File

@@ -1,10 +1,9 @@
using Content.Server.Destructible;
using Content.Server.Gatherable.Components;
using Content.Shared.DoAfter;
using Content.Shared.EntityList;
using Content.Shared.Gatherable;
using Content.Shared.Interaction;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -16,9 +15,7 @@ public sealed partial class GatherableSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly DestructibleSystem _destructible = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
public override void Initialize()
@@ -26,59 +23,21 @@ public sealed partial class GatherableSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<GatherableComponent, ActivateInWorldEvent>(OnActivate);
SubscribeLocalEvent<GatherableComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<GatherableComponent, GatherableDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<GatherableComponent, AttackedEvent>(OnAttacked);
InitializeProjectile();
}
private void Gather(EntityUid gatheredUid, EntityUid user, EntityUid used, GatheringToolComponent? tool = null, GatherableComponent? component = null)
private void OnAttacked(EntityUid uid, GatherableComponent component, AttackedEvent args)
{
if (!Resolve(used, ref tool, false) || !Resolve(gatheredUid, ref component, false) ||
component.ToolWhitelist?.IsValid(used) == false)
{
return;
}
// Can't gather too many entities at once.
if (tool.MaxGatheringEntities < tool.GatheringEntities.Count + 1)
if (component.ToolWhitelist?.IsValid(args.Used, EntityManager) != true)
return;
var damageRequired = _destructible.DestroyedAt(gatheredUid);
var damageTime = (damageRequired / tool.Damage.Total).Float();
damageTime = Math.Max(1f, damageTime);
var doAfter = new DoAfterArgs(user, damageTime, new GatherableDoAfterEvent(), gatheredUid, target: gatheredUid, used: used)
{
BreakOnDamage = true,
BreakOnTargetMove = true,
BreakOnUserMove = true,
MovementThreshold = 0.25f,
};
_doAfterSystem.TryStartDoAfter(doAfter);
Gather(uid, args.User, component);
}
private void OnActivate(EntityUid uid, GatherableComponent component, ActivateInWorldEvent args)
{
Gather(uid, args.User, args.User);
}
private void OnInteractUsing(EntityUid uid, GatherableComponent component, InteractUsingEvent args)
{
Gather(uid, args.User, args.Used, component: component);
}
private void OnDoAfter(EntityUid uid, GatherableComponent component, GatherableDoAfterEvent args)
{
if(!TryComp<GatheringToolComponent>(args.Args.Used, out var tool))
return;
tool.GatheringEntities.Remove(uid);
if (args.Handled || args.Cancelled)
return;
Gather(uid, args.Args.Used, component, tool.GatheringSound);
args.Handled = true;
Gather(uid, args.User, component);
}
public void Gather(EntityUid gatheredUid, EntityUid? gatherer = null, GatherableComponent? component = null, SoundSpecifier? sound = null)

View File

@@ -1,9 +0,0 @@
using Content.Shared.DoAfter;
using Robust.Shared.Serialization;
namespace Content.Shared.Gatherable;
[Serializable, NetSerializable]
public sealed class GatherableDoAfterEvent : SimpleDoAfterEvent
{
}

View File

@@ -34,10 +34,6 @@
- type: Polymorphable
- type: Identity
- type: Hands
- type: GatheringTool
damage:
types:
Structural: 50
- type: MovementSpeedModifier
- type: MovedByPressure
- type: Barotrauma

View File

@@ -14,7 +14,7 @@
- type: Wieldable
wieldedInhandPrefix: null
- type: Gun
fireRate: 0.75
fireRate: 0.5
selectedMode: SemiAuto
angleDecay: 45
minAngle: 44

View File

@@ -339,7 +339,7 @@
impactEffect: BulletImpactEffectKinetic
damage:
types:
Blunt: 20
Blunt: 25
# Short lifespan
- type: TimedDespawn
lifetime: 0.4

View File

@@ -23,23 +23,26 @@
parent: BaseWeaponCrusher
id: WeaponCrusher
components:
- type: Tag
tags:
- Pickaxe
- type: Sprite
sprite: Objects/Weapons/Melee/crusher.rsi
state: icon
- type: AmmoCounter
- type: UseDelayOnShoot
- type: UseDelay
delay: 1.9
delay: 0.9
- type: LeechOnMarker
leech:
groups:
Brute: -10
- type: Gun
soundGunshot: /Audio/Weapons/plasma_cutter.ogg
fireRate: 0.5
fireRate: 1
useKey: false
- type: RechargeBasicEntityAmmo
rechargeCooldown: 1.5
rechargeCooldown: 0.5
rechargeSound:
path: /Audio/Weapons/Guns/MagIn/kinetic_reload.ogg
- type: BasicEntityAmmoProvider
@@ -47,7 +50,6 @@
capacity: 1
count: 1
- type: MeleeWeapon
attackRate: 0.75
damage:
types:
Blunt: 10
@@ -86,6 +88,9 @@
id: WeaponCrusherGlaive
description: An early design of the proto-kinetic accelerator, in glaive form.
components:
- type: Tag
tags:
- Pickaxe
- type: UseDelayOnShoot
- type: UseDelay
delay: 1.9

View File

@@ -10,16 +10,21 @@
- type: Sprite
sprite: Objects/Weapons/Melee/pickaxe.rsi
state: pickaxe
- type: GatheringTool
damage:
types:
Structural: 50
- type: ItemCooldown
- type: MeleeWeapon
damage:
types:
Piercing: 10
Blunt: 4
Piercing: 5
Blunt: 5
Structural: 15
- type: Wieldable
wieldedInhandPrefix: null
- type: IncreaseDamageOnWield
damage:
types:
Blunt: 5
Piercing: 5
Structural: 15
- type: Item
size: 24
sprite: Objects/Weapons/Melee/pickaxe.rsi
@@ -36,21 +41,11 @@
- type: Sprite
sprite: Objects/Tools/handdrill.rsi
state: handdrill
- type: GatheringTool
damage:
types:
Structural: 75
gatheringTime: 0.50
MaxGatheringEntities: 2
- type: ItemCooldown
- type: MeleeWeapon
attackRate: 1.5
damage:
types:
Piercing: 10
Blunt: 4
Structural: 7
- type: Wieldable
- type: IncreaseDamageOnWield
damage:
types:
Structural: 30
Blunt: 5
Piercing: 5
Structural: 15

View File

@@ -113,12 +113,6 @@
components:
- Item
permanentComponents:
- type: GatheringTool
damage:
types:
Structural: 125
gatheringTime: 0.50
MaxGatheringEntities: 3
- type: ItemCooldown
- type: MeleeWeapon
damage: