Added IEnumerable<Player> GetPlayers(RoleTypeId roleType): Gets a filtered collection of players based on their role type.
Added IEnumerable<Player> GetPlayers(Team team): Gets a filtered collection of players based on their team.
Added Player Get(Collider collider) and TryGet(Collider collider, out Player player): Methods to get or try getting the player associated with a collider.
Added Player Get(Footprint footprint) and TryGet(Footprint footprint, out Player player): Methods to get or try getting the player associated with a footprint.
Added Footprint Footprint: Property to get the player's footprint.
Modified DropAmmo(ItemType item, ushort amount, bool checkMinimals = false): Un-commented the method to allow the player to drop ammo.
Modified SetRole(RoleTypeId newRole, RoleChangeReason reason = RoleChangeReason.RemoteAdmin): Added an optional parameter to specify the role spawn flags for the role change.
Facility doors
Added a method to try getting a FacilityDoor from a DoorVariant.
TryGet(DoorVariant baseDoor, out FacilityDoor facilityDoor): Tries to get the FacilityDoor associated with the provided DoorVariant. If found, the facilityDoor parameter will be set; otherwise, it will be null.
ItemExtensions
Created an ItemExtensions class with various extension methods for ItemType and Firearm.
Added methods to check if an ItemType is of a specific category: IsAmmo, IsFirearm, IsMedical, IsUtility, IsArmor, IsKeycard, IsThrowable.
Implemented a method to get a Firearm's ItemBase using InventoryItemLoader.
Added a method to get a random attachments code for a given ItemType.
Introduced a method to apply attachments to a Firearm.
Provided a method to apply a set of random attachments directly to a Firearm.
Implemented a method to attempt applying a player's attachments preferences to a Firearm.
Implemented a method to gets the maximum ammunition a Firearm can have.
You can also use it by giving an ItemType
Implemented a method to refill the magazine of a weapon
Implemented a method to remove ammunition from the magazine of a gun.
Note: This was originally just going to add the Footprint to Player but then I started doing the Get methods and by the time I realized I had already made 1 new extension class and modified 3 classes.
Player
IEnumerable<Player> GetPlayers(RoleTypeId roleType)
: Gets a filtered collection of players based on their role type.IEnumerable<Player> GetPlayers(Team team)
: Gets a filtered collection of players based on their team.Player Get(Collider collider)
andTryGet(Collider collider, out Player player)
: Methods to get or try getting the player associated with a collider.Player Get(Footprint footprint)
andTryGet(Footprint footprint, out Player player)
: Methods to get or try getting the player associated with a footprint.Footprint Footprint
: Property to get the player's footprint.DropAmmo(ItemType item, ushort amount, bool checkMinimals = false)
: Un-commented the method to allow the player to drop ammo.SetRole(RoleTypeId newRole, RoleChangeReason reason = RoleChangeReason.RemoteAdmin)
: Added an optional parameter to specify the role spawn flags for the role change.Facility doors
FacilityDoor
from aDoorVariant
.TryGet(DoorVariant baseDoor, out FacilityDoor facilityDoor)
: Tries to get theFacilityDoor
associated with the providedDoorVariant
. If found, thefacilityDoor
parameter will be set; otherwise, it will benull
.ItemExtensions
ItemExtensions
class with various extension methods forItemType
andFirearm
.ItemType
is of a specific category:IsAmmo
,IsFirearm
,IsMedical
,IsUtility
,IsArmor
,IsKeycard
,IsThrowable
.Firearm
'sItemBase
usingInventoryItemLoader
.ItemType
.Firearm
.Firearm
.Firearm
.Note: This was originally just going to add the Footprint to Player but then I started doing the Get methods and by the time I realized I had already made 1 new extension class and modified 3 classes.