@@ -2335,6 +2335,16 @@ public void Broadcast(ushort duration, string message, global::Broadcast.Broadca
23352335 public void AddAmmo ( AmmoType ammoType , ushort amount ) =>
23362336 Inventory . ServerAddAmmo ( ammoType . GetItemType ( ) , amount ) ;
23372337
2338+ /// <summary>
2339+ /// Adds the amount of a specified ammo to player's inventory.
2340+ /// </summary>
2341+ /// <param name="ammo">A dictionary of ItemType and ushort of ammo and amount.</param>
2342+ public void AddAmmo ( Dictionary < ItemType , ushort > ammo )
2343+ {
2344+ foreach ( KeyValuePair < ItemType , ushort > kvp in ammo )
2345+ AddAmmo ( kvp . Key . GetAmmoType ( ) , kvp . Value ) ;
2346+ }
2347+
23382348 /// <summary>
23392349 /// Adds the amount of a specified <see cref="AmmoType">ammo type</see> to player's inventory.
23402350 /// </summary>
@@ -2578,6 +2588,23 @@ public void ResetCategoryLimit(ItemCategory category)
25782588 /// <returns>If the player has a custom limit for the specific <see cref="ItemCategory"/>.</returns>
25792589 public bool HasCustomCategoryLimit ( ItemCategory category ) => CustomCategoryLimits . ContainsKey ( category ) ;
25802590
2591+ /// <summary>
2592+ /// Grants the player their current role's loadout.
2593+ /// </summary>
2594+ public void GrantLoadout ( ) => GrantLoadout ( Role . Type ) ;
2595+
2596+ /// <summary>
2597+ /// Grants a player a role's loadout.
2598+ /// </summary>
2599+ /// <param name="roleType">The role loadout to give.</param>
2600+ public void GrantLoadout ( RoleTypeId roleType )
2601+ {
2602+ InventoryRoleInfo info = roleType . GetInventory ( ) ;
2603+
2604+ AddItem ( info . Items ) ;
2605+ AddAmmo ( info . Ammo ) ;
2606+ }
2607+
25812608 /// <summary>
25822609 /// Adds an item of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
25832610 /// </summary>
@@ -3305,6 +3332,14 @@ public void SyncEffects(IEnumerable<Effect> effects)
33053332 SyncEffect ( effect ) ;
33063333 }
33073334
3335+ /// <summary>
3336+ /// Gets an effect of a player.
3337+ /// </summary>
3338+ /// <typeparam name="T">The <see cref="StatusEffectBase"/> to get.</typeparam>
3339+ /// <returns>The <see cref="StatusEffectBase"/> found.</returns>
3340+ public T GetEffect < T > ( )
3341+ where T : StatusEffectBase => ReferenceHub . playerEffectsController . GetEffect < T > ( ) ;
3342+
33083343 /// <summary>
33093344 /// Gets an instance of <see cref="StatusEffectBase"/> by <see cref="EffectType"/>.
33103345 /// </summary>
0 commit comments