Skip to content
Merged
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
4 changes: 4 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,10 @@ 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
24 changes: 24 additions & 0 deletions EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ public uint Attachments
set => Base.Worldmodel.Setup(Base.CurId, Base.Worldmodel.WorldmodelType, value);
}

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

/// <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 thread
louis1706 marked this conversation as resolved.
/// <summary>
/// Initializes the item as if it was spawned naturally by map generation.
/// </summary>
Expand All @@ -135,6 +155,10 @@ internal override void ReadItemInfo(Items.Item item)
{
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