Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions EXILED/Exiled.API/Features/Items/Firearm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,11 @@ internal override void ReadPickupInfoBefore(Pickup pickup)
{
PrimaryMagazine.MaxAmmo = firearmPickup.MaxAmmo;
AmmoDrain = firearmPickup.AmmoDrain;

Damage = firearmPickup.Damage;
Inaccuracy = firearmPickup.Inaccuracy;
Penetration = firearmPickup.Penetration;
DamageFalloffDistance = firearmPickup.DamageFalloffDistance;
}
}
}
Expand Down
25 changes: 25 additions & 0 deletions EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,38 @@
/// <returns>A string containing FirearmPickup related data.</returns>
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}*";

/// <summary>
/// Gets or sets the damage for this <see cref="FirearmPickup"/>.
/// </summary>
public float Damage { get; set; }

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build

Check failure on line 134 in EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs

View workflow job for this annotation

GitHub Actions / build


/// <summary>
/// Gets or sets the inaccuracy for this <see cref="FirearmPickup"/>.
/// </summary>
public float Inaccuracy { get; set; }

/// <summary>
/// Gets or sets the penetration for this <see cref="FirearmPickup"/>.
/// </summary>
public float Penetration { get; set; }

/// <summary>
/// Gets or sets how much fast the value drop over the distance.
/// </summary>
public float DamageFalloffDistance { get; set; }

Comment on lines +131 to +150
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place these on top of the methods

/// <inheritdoc/>
internal override void ReadItemInfo(Items.Item item)
{
if (item is Items.Firearm firearm)
{
MaxAmmo = firearm.PrimaryMagazine.ConstantMaxAmmo;
AmmoDrain = firearm.AmmoDrain;

Damage = firearm.Damage;
Inaccuracy = firearm.Inaccuracy;
Penetration = firearm.Penetration;
DamageFalloffDistance = firearm.DamageFalloffDistance;
}

base.ReadItemInfo(item);
Expand Down
Loading