Files
Red 963bdc022f Rethinking equipment (#1711)
* delete all modular content

* clean up

* Update guard.yml

* spear first pass

* Add imperial two-handed sword and update spear

Introduces the imperial two-handed sword with new sprites, prototype, and animations. Refines spear configuration: adjusts damage, animation, and offsets, and updates its sprites and prototype to use a new resource path. Improves melee weapon animation logic for both thrust and slash attacks.

* neck displacement

* Update neck.png

* Update migration.yml

* dagger

* Add sword prototype and refactor melee weapon swing logic

Introduces a new sword entity and associated textures. Refactors melee weapon swing logic by renaming SwingLeft to CPSwingLeft and updating related code. Adjusts animation offsets and rotation values for daggers, spears, and two-handed swords. Moves and updates dagger texture assets to a new directory structure.

* hatchet

* sickle

* Add skimitar sword entity and sprites

Introduced a new 'skimitar' sword entity with description and associated sprite assets, including icon, in-hand, and equipped states. Also updated the imperial sword's name and description for clarity.

* Add rapier weapon and adjust melee weapon balance

Introduced the imperial rapier weapon with associated prototype and textures. Increased the default single-target melee damage modifier to 1.3 and removed per-weapon clickDamageModifier overrides from dagger, spear, sword, and two-handed sword. Also increased sword base damage to 10 for better balance.

* Add iron tool/weapon variants and update wall thresholds

Introduces iron variants for pickaxe, shovel, dagger, rapier, spear, sword, and two-handed sword, including new sprites and YAML prototypes. Adjusts wall and ore vein damage thresholds for destruction and sound triggers. Updates migration.yml to map modular iron weapons to new iron variants and spawns stone blocks on stonebrick wall breakage. Also refactors dagger textures to use an 'iron' directory.

* Refactor ice dagger and adjust blacksmith skills

Replaced CP14IceDagger with CP14WeaponDaggerIce, updating its parent, stats, and components for consistency. Adjusted base dagger damage types. Blacksmith job and related melting skills are now commented out or disabled, reflecting a change in skill progression and job setup.

* Update ice_dagger.yml

* Deprecate sword mastery skills and update melee swing logic

Commented out SwordMastery, RapierMastery, and SkimitarMastery skills and removed their assignment from guard and artisan job prototypes. Renamed CPSwingLeft to SwingLeft in melee weapon code for clarity and updated related logic.

* Remove requiredSkills from anvil and furnace recipes

Eliminated the 'requiredSkills' field from all recipes in Anvil/misc.yml and furnace.yml. This simplifies recipe definitions and removes skill prerequisites for crafting these items.

* Update guard_commander.yml

* Comment out freeLearnedSkills for T1 and T2 skeletons

Disabled the freeLearnedSkills entries, including SwordMastery and SkimitarMastery, in both T1 and T2 DemiplaneAntag skeleton YAML prototypes. This change may be for balancing or testing purposes.

* Update migration.yml

* Update migration.yml

* guidebook

* r

* spear passive + hammer passive

* tool hammer + skimitar refactor

* balance tweak

* kick nerf

* TOWER DEFENCE UPDATE

* default shield refactor

* buckler (only sprites)

* Update migration.yml

* buckler parry

* some fixes

* Update T2.yml

* Update T2.yml

* Update instruments.yml

* Update migration.yml

* M O P

* war axe

* Update migration.yml

* Keen Eye skill

* arrows + bow + loadouts

* Update tools.yml

* trading

* fix

* Update misc.yml

* Update migration.yml
2025-09-06 00:59:58 +03:00

102 lines
3.4 KiB
C#

using System.Numerics;
using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
namespace Content.Shared.Weapons.Melee.Events;
/// <summary>
/// Raised directed on the melee weapon entity used to attack something in combat mode,
/// whether through a click attack or wide attack.
/// </summary>
public sealed class MeleeHitEvent : HandledEntityEventArgs
{
/// <summary>
/// The base amount of damage dealt by the melee hit.
/// </summary>
public readonly DamageSpecifier BaseDamage;
/// <summary>
/// Modifier sets to apply to the hit event when it's all said and done.
/// This should be modified by adding a new entry to the list.
/// </summary>
public List<DamageModifierSet> ModifiersList = new();
/// <summary>
/// Damage to add to the default melee weapon damage. Applied before modifiers.
/// </summary>
/// <remarks>
/// This might be required as damage modifier sets cannot add a new damage type to a DamageSpecifier.
/// </remarks>
public DamageSpecifier BonusDamage = new();
/// <summary>
/// A list containing every hit entity. Can be zero.
/// </summary>
public IReadOnlyList<EntityUid> HitEntities;
/// <summary>
/// Used to define a new hit sound in case you want to override the default GenericHit.
/// Also gets a pitch modifier added to it.
/// </summary>
public SoundSpecifier? HitSoundOverride;
/// <summary>
/// The user who attacked with the melee weapon.
/// </summary>
public readonly EntityUid User;
/// <summary>
/// The melee weapon used.
/// </summary>
public readonly EntityUid Weapon;
/// <summary>
/// The direction of the attack.
/// If null, it was a click-attack.
/// </summary>
public readonly Vector2? Direction;
/// <summary>
/// Check if this is true before attempting to do something during a melee attack other than changing/adding bonus damage. <br/>
/// For example, do not spend charges unless <see cref="IsHit"/> equals true.
/// </summary>
/// <remarks>
/// Examining melee weapons calls this event, but with <see cref="IsHit"/> set to false.
/// </remarks>
public bool IsHit = true;
/// <summary>
/// CP14 Heavy attack flag.
/// </summary>
public bool CP14Heavy;
public MeleeHitEvent(List<EntityUid> hitEntities, EntityUid user, EntityUid weapon, DamageSpecifier baseDamage, Vector2? direction, bool heavy = false)
{
HitEntities = hitEntities;
User = user;
Weapon = weapon;
BaseDamage = baseDamage;
Direction = direction;
CP14Heavy = heavy; //CP14
}
}
/// <summary>
/// Raised on a melee weapon to calculate potential damage bonuses or decreases.
/// </summary>
[ByRefEvent]
public record struct GetMeleeDamageEvent(EntityUid Weapon, DamageSpecifier Damage, List<DamageModifierSet> Modifiers, EntityUid User, bool ResistanceBypass = false);
/// <summary>
/// Raised on a melee weapon to calculate the attack rate.
/// </summary>
[ByRefEvent]
public record struct GetMeleeAttackRateEvent(EntityUid Weapon, float Rate, float Multipliers, EntityUid User);
/// <summary>
/// Raised on a melee weapon to calculate the heavy damage modifier.
/// </summary>
[ByRefEvent]
public record struct GetHeavyDamageModifierEvent(EntityUid Weapon, FixedPoint2 DamageModifier, float Multipliers, EntityUid User);