Corgi Engine v9.4
Loading...
Searching...
No Matches
MoreMountains.CorgiEngine.InventoryEngineWeapon Class Reference

Weapon item in the Corgi Engine. More...

Inheritance diagram for MoreMountains.CorgiEngine.InventoryEngineWeapon:
MoreMountains.InventoryEngine.InventoryItem

Public Types

enum  AutoEquipModes { NoAutoEquip , AutoEquip , AutoEquipIfEmptyHanded }
 the possible auto equip modes More...

Public Member Functions

override bool Equip (string playerID)
 When we grab the weapon, we equip it.
override bool UnEquip (string playerID)
 When dropping or unequipping the weapon, we remove it.
Public Member Functions inherited from MoreMountains.InventoryEngine.InventoryItem
virtual Inventory TargetInventory (string playerID)
 Gets the target inventory.
virtual Inventory TargetEquipmentInventory (string playerID)
 Gets the target equipment inventory.
virtual InventoryItem Copy ()
 Copies an item into a new one.
virtual GameObject SpawnPrefab (string playerID)
 Spawns the associated prefab.
virtual bool Pick (string playerID)
 What happens when the object is picked - override this to add your own behaviors.
virtual bool Use (string playerID)
 What happens when the object is used - override this to add your own behaviors.
virtual void Swap (string playerID)
 What happens when the object gets swapped for another object.
virtual bool Drop (string playerID)
 What happens when the object is dropped - override this to add your own behaviors.

Public Attributes

Weapon EquippableWeapon
 the weapon to equip
AutoEquipModes AutoEquipMode = AutoEquipModes.NoAutoEquip
 how to equip this weapon when picked : not equip it, automatically equip it, or only equip it if no weapon is currently equipped
int HandleWeaponID = 1
 the ID of the CharacterHandleWeapon you want this weapon to be equipped to
Public Attributes inherited from MoreMountains.InventoryEngine.InventoryItem
string ItemID
 the (unique) ID of the item
string TargetInventoryName = "MainInventory"
 the inventory name into which this item will be stored
bool ForceSlotIndex = false
 if this is true, the item won't be added anywhere's there's room in the inventory, but instead at the specified TargetIndex slot
int TargetIndex = 0
 if ForceSlotIndex is true, this is the index at which the item will be added in the target inventory
bool Usable = false
 whether or not this item can be "used" (via the Use method) - important, this is only the INITIAL state of this object, IsUsable is to be used anytime after that
bool Consumable = true
 if this is true, calling Use on that object will consume one unit of it
int ConsumeQuantity = 1
 if this item is consumable, determines how many will be consumed per use (usually one)
bool Equippable = false
 whether or not this item can be equipped - important, this is only the INITIAL state of this object, IsEquippable is to be used anytime after that
bool EquippableIfInventoryIsFull = true
 whether or not this item can be equipped if its target inventory is full
bool MoveWhenEquipped = true
 if this is true, this item will be removed from its original inventory when equipped, and moved to its EquipmentInventory
bool Droppable = true
 if this is true, this item can be dropped
bool CanMoveObject = true
 if this is true, objects can be moved
bool CanSwapObject = true
 if this is true, objects can be swapped with another object
InventoryItemDisplayProperties DisplayProperties
 a set of properties defining whether or not to show inventory action buttons when that item is selected
int Quantity = 1
 the base quantity of this item
string ItemName
 the name of the item - will be displayed in the details panel
string ShortDescription
 the item's short description to display in the details panel
string Description
 the item's long description to display in the details panel
Sprite Icon
 the icon that will be shown on the inventory's slot
GameObject Prefab
 the prefab to instantiate when the item is dropped
bool ForcePrefabDropQuantity = false
 if this is true, the quantity of the object will be forced to PrefabDropQuantity when dropped
int PrefabDropQuantity = 1
 the quantity to force on the spawned item if ForcePrefabDropQuantity is true
MMSpawnAroundProperties DropProperties
 the minimal distance at which the object should be spawned when dropped
int MaximumStack = 1
 If this object can be stacked (multiple instances in a single inventory slot), you can specify here the maximum size of that stack.
int MaximumQuantity = 999999999
 the maximum quantity allowed of this item in the target inventory
ItemClasses ItemClass
 the class of the item
string TargetEquipmentInventoryName
 If this item is equippable, you can set here its target inventory name (for example ArmorInventory). Of course you'll need an inventory with a matching name in your scene.
AudioClip EquippedSound
 the sound the item should play when equipped (optional)
AudioClip UsedSound
 If this item can be used, you can set here a sound to play when it gets used, if you don't a default sound will be played.
AudioClip MovedSound
 the sound the item should play when moved (optional)
AudioClip DroppedSound
 the sound the item should play when dropped (optional)
bool UseDefaultSoundsIfNull = true
 if this is set to false, default sounds won't be used and no sound will be played

Protected Member Functions

virtual void EquipWeapon (Weapon newWeapon, string playerID)
 Grabs the CharacterHandleWeapon component and sets the weapon.

Additional Inherited Members

Static Public Member Functions inherited from MoreMountains.InventoryEngine.InventoryItem
static bool IsNull (InventoryItem item)
 Determines if an item is null or not.
Protected Attributes inherited from MoreMountains.InventoryEngine.InventoryItem
Inventory _targetInventory = null
Inventory _targetEquipmentInventory = null
Properties inherited from MoreMountains.InventoryEngine.InventoryItem
virtual bool IsUsable [get]
 whether or not this object can be used
virtual bool IsEquippable [get]
 whether or not this object can be equipped

Detailed Description

Weapon item in the Corgi Engine.

Member Enumeration Documentation

◆ AutoEquipModes

the possible auto equip modes

Enumerator
NoAutoEquip 
AutoEquip 
AutoEquipIfEmptyHanded 

Member Function Documentation

◆ Equip()

override bool MoreMountains.CorgiEngine.InventoryEngineWeapon.Equip ( string playerID)
virtual

When we grab the weapon, we equip it.

Reimplemented from MoreMountains.InventoryEngine.InventoryItem.

◆ EquipWeapon()

virtual void MoreMountains.CorgiEngine.InventoryEngineWeapon.EquipWeapon ( Weapon newWeapon,
string playerID )
protectedvirtual

Grabs the CharacterHandleWeapon component and sets the weapon.

Parameters
newWeaponNew weapon.

◆ UnEquip()

override bool MoreMountains.CorgiEngine.InventoryEngineWeapon.UnEquip ( string playerID)
virtual

When dropping or unequipping the weapon, we remove it.

Reimplemented from MoreMountains.InventoryEngine.InventoryItem.

Member Data Documentation

◆ AutoEquipMode

AutoEquipModes MoreMountains.CorgiEngine.InventoryEngineWeapon.AutoEquipMode = AutoEquipModes.NoAutoEquip

how to equip this weapon when picked : not equip it, automatically equip it, or only equip it if no weapon is currently equipped

◆ EquippableWeapon

Weapon MoreMountains.CorgiEngine.InventoryEngineWeapon.EquippableWeapon

the weapon to equip

◆ HandleWeaponID

int MoreMountains.CorgiEngine.InventoryEngineWeapon.HandleWeaponID = 1

the ID of the CharacterHandleWeapon you want this weapon to be equipped to


The documentation for this class was generated from the following file: