Апдейт ближнего боя (#37)

* Dagger update

* Light weapons

* HandheldAxe update

* Update handheldAxe.yml

* +sickle
+dart

* two handed update

* add Link LightHammer sprite

* pipi

* . Add Weapons prototypes

* fixes
This commit is contained in:
Ed
2024-04-05 20:19:33 +03:00
committed by GitHub
parent bdfb5a72b9
commit 492176a8c3
51 changed files with 489 additions and 66 deletions

View File

@@ -114,11 +114,29 @@ public sealed partial class MeleeWeaponComponent : Component
public bool SwingLeft;
/// <summary>
/// CrystallPunk Melee improvment. Allows each attack to take turns being either left or right
/// CrystallPunk Melee upgrade. Allows each attack to take turns being either left or right
/// </summary>
[DataField]
public bool CPSwingBeverage = true;
/// <summary>
/// CrystallPunk Melee upgrade. Modifier of wide attack animation speed
/// </summary>
[DataField]
public float CPAnimationLength = 0.5f;
/// <summary>
/// CrystallPunk Melee upgrade. Scale arc (for small knife ex.)
/// </summary>
[DataField]
public float CPAnimationScale = 1f;
/// <summary>
/// CrystallPunk Melee upgrade. how far away from the player the animation should be played.
/// </summary>
[DataField]
public float CPAnimationOffset = -1f;
// Sounds
/// <summary>

View File

@@ -385,6 +385,11 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
var ev = new AttemptMeleeEvent();
RaiseLocalEvent(weaponUid, ref ev);
//CrystallPun melee improvment
if (weapon.CPSwingBeverage)
weapon.SwingLeft = !weapon.SwingLeft;
//CrystallPun melee improvment end
if (ev.Cancelled)
{
if (ev.Message != null)
@@ -428,11 +433,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
var attackEv = new MeleeAttackEvent(weaponUid);
RaiseLocalEvent(user, ref attackEv);
//CrystallPun melee improvment
if (weapon.CPSwingBeverage)
weapon.SwingLeft = !weapon.SwingLeft;
//CrystallPun melee improvment end
weapon.Attacking = true;
return true;
}