[][src]Struct sulis_state::script::ScriptInventory

pub struct ScriptInventory { /* fields omitted */ }

The inventory of a particular creature, including equipped items and quickslots.

set_locked(locked: Bool)

Sets whether this inventory is locked. The player will be unable to equip or unequip any items in a locked inventory.

is_locked() -> Bool

Returns whether or not this inventory is locked. See set_locked

has_equipped(slot: String) -> Bool

Returns true if the owning entity has an item equipped in the given slot, false otherwise. Valid slots are cloak, head, torso, hands, held_main, held_off, legs, feet, waist, neck, fingerMain, fingerOff

equipped_stats(slot: String) -> Table

Returns a table describing the stats of the item in the given slot, or errors if there is no item or the slot is invalid. See has_equipped for valid slots. The table stats includes stats.name, stats.value, stats.weight, stats.kind, and stats.armor_kind for armor or stats.weapon_kind for weapons.

equip_item(item: ScriptStashItem)

Equips the given item from the stash into the appropriate inventory slot of the parent.

unequip_item(slot: String) -> ScriptStashItem

Unequips the item in the specified inventory slot of the parent. Slot must be one of cloak, head, torso, hands, held_main, held_off, legs, feet, waist, neck, finger_main, finger_off. Returns the ScriptStashItem representing the unequipped item in the stash, or the invalid item if no item was in the slot

has_equipped_weapon() -> Bool

Returns true if the parent entity currently has a weapon equipped, false otherwise.

has_equipped_shield() -> Bool

Returns true if the parent entity currently has a shield equipped, false otherwise.

has_alt_weapons() -> Bool

Returns true if the parent entity has an item in at least one of its alt weapon slots, meaning it can switch to an alt weapon set.

alt_weapon_style() -> String

Returns the weapon style of the alt weapons that are in the quick slots of the parent creature. Valid values are Ranged, TwoHanded, Single, Shielded, and DualWielding

weapon_style() -> String

Returns the weapon style of the currently equipped weapons of the parent creature. Valid values are Ranged, TwoHanded, Single, Shielded, and DualWielding

usable_items() -> Table

Returns a table of all items currently in Use QuickSlots for the parent entity. Each item is represented by a ScriptUsableItem in the table.

Implementations

impl ScriptInventory[src]

pub fn new(parent: ScriptEntity) -> ScriptInventory[src]

Trait Implementations

impl Clone for ScriptInventory[src]

impl UserData for ScriptInventory[src]

Auto Trait Implementations

impl RefUnwindSafe for ScriptInventory

impl Send for ScriptInventory

impl Sync for ScriptInventory

impl Unpin for ScriptInventory

impl UnwindSafe for ScriptInventory

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<'lua, T> FromLua<'lua> for T where
    T: 'static + UserData + Clone
[src]

impl<'lua, T> FromLuaMulti<'lua> for T where
    T: FromLua<'lua>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'lua, T> ToLua<'lua> for T where
    T: 'static + UserData + Send
[src]

impl<'lua, T> ToLuaMulti<'lua> for T where
    T: ToLua<'lua>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]