5 private readonly Identifier itemIdentifier;
6 private readonly
int amount;
12 if (itemIdentifier.IsEmpty)
14 DebugConsole.ThrowError($
"Error in talent \"{characterAbilityGroup.CharacterTalent.DebugIdentifier}\" - itemIdentifier not defined.",
21 if (itemIdentifier.IsEmpty)
23 DebugConsole.ThrowError(
"Cannot put item in inventory - itemIdentifier not defined.",
29 if (itemPrefab ==
null)
31 DebugConsole.ThrowError(
"Cannot put item in inventory - item prefab " + itemIdentifier +
" not found.",
35 for (
int i = 0; i < amount; i++)
CharacterAbilityPutItem(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement)
override bool AppliesEffectOnIntervalUpdate
override void ApplyEffect()
CharacterInventory Inventory
override bool TryPutItem(Item item, Character user, IEnumerable< InvSlotType > allowedSlots=null, bool createNetworkEvent=true, bool ignoreCondition=false)
If there is room, puts the item in the inventory and returns true, otherwise returns false
readonly TalentPrefab Prefab
ContentPackage? ContentPackage
int GetAttributeInt(string key, int def)
Identifier GetAttributeIdentifier(string key, string def)
static EntitySpawner Spawner
virtual Vector2 WorldPosition
void AddItemToSpawnQueue(ItemPrefab itemPrefab, Vector2 worldPosition, float? condition=null, int? quality=null, Action< Item > onSpawned=null)
static GameSession?? GameSession
IEnumerable< Item > AllItemsMod
All items contained in the inventory. Allows modifying the contents of the inventory while being enum...
ItemInventory OwnInventory
IEnumerable< InvSlotType > AllowedSlots
override bool TryPutItem(Item item, Character user, IEnumerable< InvSlotType > allowedSlots=null, bool createNetworkEvent=true, bool ignoreCondition=false)
If there is room, puts the item in the inventory and returns true, otherwise returns false
static ItemPrefab Find(string name, Identifier identifier)
ContentPackage? ContentPackage