Class LootSystem
LootSystem is responsible for generating item drops based on the configured loot rules.
public class LootSystem : System<LootSystemConfig>, ISystem, IManageableLifecycle<SystemManager>, IManageableLifecycle, IReloadable, IManageable<SystemManager>, IManageable
- Inheritance
-
LootSystem
- Implements
- Inherited Members
- Extension Methods
Methods
DropItemsNearby<T>(Entity, List<T>, string)
public static List<IItemDrop> DropItemsNearby<T>(Entity entity, List<T> itemsToDrop, string sourceName = "") where T : class, IItemDrop
Parameters
Returns
Type Parameters
T
GenerateAndDropItems<T>(IEnumerable<T>, Entity, string)
public static List<IItemDrop> GenerateAndDropItems<T>(IEnumerable<T> hasDrops, Entity entity, string sourceName = "") where T : IItem, IItemDroppable
Parameters
hasDrops
IEnumerable<T>entity
EntitysourceName
string
Returns
Type Parameters
T
GenerateItemDrops<T>(IHasItemDrops<T>, Func<T, float>?, Func<T, float>?, RangeInt?)
public static List<IItemDrop> GenerateItemDrops<T>(IHasItemDrops<T> hasDrops, Func<T, float>? calculateDropScaleFunc = null, Func<T, float>? calculateAmountScaleFunc = null, RangeInt? defaultAmountRange = null) where T : IItem, IItemDroppable
Parameters
hasDrops
IHasItemDrops<T>calculateDropScaleFunc
Func<T, float>calculateAmountScaleFunc
Func<T, float>defaultAmountRange
RangeInt
Returns
Type Parameters
T
GenerateItemDrops<T>(IEnumerable<T>, Func<T, float>?, Func<T, float>?, RangeInt?, LootRollMode, LootCompletionMode, LootSelectionMode, LootShuffleMode, uint)
public static List<IItemDrop> GenerateItemDrops<T>(IEnumerable<T> hasDrops, Func<T, float>? calculateDropScaleFunc = null, Func<T, float>? calculateAmountScaleFunc = null, RangeInt? defaultAmountRange = null, LootRollMode rollMode = LootRollMode.Always, LootCompletionMode completionMode = LootCompletionMode.OneIteration, LootSelectionMode selectionMode = LootSelectionMode.AllSuccess, LootShuffleMode shuffleMode = LootShuffleMode.Shuffle, uint indent = 0) where T : IItem, IItemDroppable
Parameters
hasDrops
IEnumerable<T>calculateDropScaleFunc
Func<T, float>calculateAmountScaleFunc
Func<T, float>defaultAmountRange
RangeIntrollMode
LootRollModecompletionMode
LootCompletionModeselectionMode
LootSelectionModeshuffleMode
LootShuffleModeindent
uint
Returns
Type Parameters
T
Initialize(SystemManager, List<IPlugin>)
Initializes the lifecycle of the manager with a specific type.
public override void Initialize(SystemManager systemManager, List<IPlugin> plugins)
Parameters
systemManager
SystemManagerplugins
List<IPlugin>
Load(SystemManager, List<IPlugin>)
Loads the manager and its dependencies with a specific type.
public override void Load(SystemManager systemManager, List<IPlugin> plugins)
Parameters
systemManager
SystemManagerplugins
List<IPlugin>
Terminate(SystemManager, List<IPlugin>)
Terminates the manager and cleans up resources with a specific type.
public override void Terminate(SystemManager systemManager, List<IPlugin> plugins)
Parameters
systemManager
SystemManagerplugins
List<IPlugin>