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:
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
using Content.Server.Destructible;
|
using Content.Server.Destructible;
|
||||||
using Content.Server.Gatherable.Components;
|
using Content.Server.Gatherable.Components;
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.EntityList;
|
using Content.Shared.EntityList;
|
||||||
using Content.Shared.Gatherable;
|
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
@@ -16,9 +15,7 @@ public sealed partial class GatherableSystem : EntitySystem
|
|||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly DestructibleSystem _destructible = default!;
|
[Dependency] private readonly DestructibleSystem _destructible = default!;
|
||||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
|
||||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -26,59 +23,21 @@ public sealed partial class GatherableSystem : EntitySystem
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<GatherableComponent, ActivateInWorldEvent>(OnActivate);
|
SubscribeLocalEvent<GatherableComponent, ActivateInWorldEvent>(OnActivate);
|
||||||
SubscribeLocalEvent<GatherableComponent, InteractUsingEvent>(OnInteractUsing);
|
SubscribeLocalEvent<GatherableComponent, AttackedEvent>(OnAttacked);
|
||||||
SubscribeLocalEvent<GatherableComponent, GatherableDoAfterEvent>(OnDoAfter);
|
|
||||||
InitializeProjectile();
|
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) ||
|
if (component.ToolWhitelist?.IsValid(args.Used, EntityManager) != true)
|
||||||
component.ToolWhitelist?.IsValid(used) == false)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can't gather too many entities at once.
|
|
||||||
if (tool.MaxGatheringEntities < tool.GatheringEntities.Count + 1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var damageRequired = _destructible.DestroyedAt(gatheredUid);
|
Gather(uid, args.User, component);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnActivate(EntityUid uid, GatherableComponent component, ActivateInWorldEvent args)
|
private void OnActivate(EntityUid uid, GatherableComponent component, ActivateInWorldEvent args)
|
||||||
{
|
{
|
||||||
Gather(uid, args.User, args.User);
|
Gather(uid, args.User, component);
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Gather(EntityUid gatheredUid, EntityUid? gatherer = null, GatherableComponent? component = null, SoundSpecifier? sound = null)
|
public void Gather(EntityUid gatheredUid, EntityUid? gatherer = null, GatherableComponent? component = null, SoundSpecifier? sound = null)
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
using Content.Shared.DoAfter;
|
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
|
|
||||||
namespace Content.Shared.Gatherable;
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public sealed class GatherableDoAfterEvent : SimpleDoAfterEvent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -34,10 +34,6 @@
|
|||||||
- type: Polymorphable
|
- type: Polymorphable
|
||||||
- type: Identity
|
- type: Identity
|
||||||
- type: Hands
|
- type: Hands
|
||||||
- type: GatheringTool
|
|
||||||
damage:
|
|
||||||
types:
|
|
||||||
Structural: 50
|
|
||||||
- type: MovementSpeedModifier
|
- type: MovementSpeedModifier
|
||||||
- type: MovedByPressure
|
- type: MovedByPressure
|
||||||
- type: Barotrauma
|
- type: Barotrauma
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
- type: Wieldable
|
- type: Wieldable
|
||||||
wieldedInhandPrefix: null
|
wieldedInhandPrefix: null
|
||||||
- type: Gun
|
- type: Gun
|
||||||
fireRate: 0.75
|
fireRate: 0.5
|
||||||
selectedMode: SemiAuto
|
selectedMode: SemiAuto
|
||||||
angleDecay: 45
|
angleDecay: 45
|
||||||
minAngle: 44
|
minAngle: 44
|
||||||
|
|||||||
@@ -339,7 +339,7 @@
|
|||||||
impactEffect: BulletImpactEffectKinetic
|
impactEffect: BulletImpactEffectKinetic
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Blunt: 20
|
Blunt: 25
|
||||||
# Short lifespan
|
# Short lifespan
|
||||||
- type: TimedDespawn
|
- type: TimedDespawn
|
||||||
lifetime: 0.4
|
lifetime: 0.4
|
||||||
|
|||||||
@@ -23,23 +23,26 @@
|
|||||||
parent: BaseWeaponCrusher
|
parent: BaseWeaponCrusher
|
||||||
id: WeaponCrusher
|
id: WeaponCrusher
|
||||||
components:
|
components:
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- Pickaxe
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Weapons/Melee/crusher.rsi
|
sprite: Objects/Weapons/Melee/crusher.rsi
|
||||||
state: icon
|
state: icon
|
||||||
- type: AmmoCounter
|
- type: AmmoCounter
|
||||||
- type: UseDelayOnShoot
|
- type: UseDelayOnShoot
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 1.9
|
delay: 0.9
|
||||||
- type: LeechOnMarker
|
- type: LeechOnMarker
|
||||||
leech:
|
leech:
|
||||||
groups:
|
groups:
|
||||||
Brute: -10
|
Brute: -10
|
||||||
- type: Gun
|
- type: Gun
|
||||||
soundGunshot: /Audio/Weapons/plasma_cutter.ogg
|
soundGunshot: /Audio/Weapons/plasma_cutter.ogg
|
||||||
fireRate: 0.5
|
fireRate: 1
|
||||||
useKey: false
|
useKey: false
|
||||||
- type: RechargeBasicEntityAmmo
|
- type: RechargeBasicEntityAmmo
|
||||||
rechargeCooldown: 1.5
|
rechargeCooldown: 0.5
|
||||||
rechargeSound:
|
rechargeSound:
|
||||||
path: /Audio/Weapons/Guns/MagIn/kinetic_reload.ogg
|
path: /Audio/Weapons/Guns/MagIn/kinetic_reload.ogg
|
||||||
- type: BasicEntityAmmoProvider
|
- type: BasicEntityAmmoProvider
|
||||||
@@ -47,7 +50,6 @@
|
|||||||
capacity: 1
|
capacity: 1
|
||||||
count: 1
|
count: 1
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
attackRate: 0.75
|
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Blunt: 10
|
Blunt: 10
|
||||||
@@ -86,6 +88,9 @@
|
|||||||
id: WeaponCrusherGlaive
|
id: WeaponCrusherGlaive
|
||||||
description: An early design of the proto-kinetic accelerator, in glaive form.
|
description: An early design of the proto-kinetic accelerator, in glaive form.
|
||||||
components:
|
components:
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- Pickaxe
|
||||||
- type: UseDelayOnShoot
|
- type: UseDelayOnShoot
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 1.9
|
delay: 1.9
|
||||||
|
|||||||
@@ -10,16 +10,21 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Weapons/Melee/pickaxe.rsi
|
sprite: Objects/Weapons/Melee/pickaxe.rsi
|
||||||
state: pickaxe
|
state: pickaxe
|
||||||
- type: GatheringTool
|
|
||||||
damage:
|
|
||||||
types:
|
|
||||||
Structural: 50
|
|
||||||
- type: ItemCooldown
|
- type: ItemCooldown
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Piercing: 10
|
Piercing: 5
|
||||||
Blunt: 4
|
Blunt: 5
|
||||||
|
Structural: 15
|
||||||
|
- type: Wieldable
|
||||||
|
wieldedInhandPrefix: null
|
||||||
|
- type: IncreaseDamageOnWield
|
||||||
|
damage:
|
||||||
|
types:
|
||||||
|
Blunt: 5
|
||||||
|
Piercing: 5
|
||||||
|
Structural: 15
|
||||||
- type: Item
|
- type: Item
|
||||||
size: 24
|
size: 24
|
||||||
sprite: Objects/Weapons/Melee/pickaxe.rsi
|
sprite: Objects/Weapons/Melee/pickaxe.rsi
|
||||||
@@ -36,21 +41,11 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Tools/handdrill.rsi
|
sprite: Objects/Tools/handdrill.rsi
|
||||||
state: handdrill
|
state: handdrill
|
||||||
- type: GatheringTool
|
|
||||||
damage:
|
|
||||||
types:
|
|
||||||
Structural: 75
|
|
||||||
gatheringTime: 0.50
|
|
||||||
MaxGatheringEntities: 2
|
|
||||||
- type: ItemCooldown
|
- type: ItemCooldown
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
|
attackRate: 1.5
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Piercing: 10
|
Blunt: 5
|
||||||
Blunt: 4
|
Piercing: 5
|
||||||
Structural: 7
|
Structural: 15
|
||||||
- type: Wieldable
|
|
||||||
- type: IncreaseDamageOnWield
|
|
||||||
damage:
|
|
||||||
types:
|
|
||||||
Structural: 30
|
|
||||||
|
|||||||
@@ -113,12 +113,6 @@
|
|||||||
components:
|
components:
|
||||||
- Item
|
- Item
|
||||||
permanentComponents:
|
permanentComponents:
|
||||||
- type: GatheringTool
|
|
||||||
damage:
|
|
||||||
types:
|
|
||||||
Structural: 125
|
|
||||||
gatheringTime: 0.50
|
|
||||||
MaxGatheringEntities: 3
|
|
||||||
- type: ItemCooldown
|
- type: ItemCooldown
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
damage:
|
damage:
|
||||||
|
|||||||
Reference in New Issue
Block a user