Introduction
This plugin allows items to consume ammo and show reload states
Fields#
| Name | Description |
|---|---|
| Accepted Ammo Ids | Types of ammo this item can use (first in list is used by default) |
| Rounds Per Shot Stat | Amount of ammo used on each ConsumeAmmo() call |
| Loaded Count Stat | Update stat with the loaded count |
| Magazine Size Stat | Maximum ammo this item can store at one time |
| Starting Ammo Count | Amount of starting ammo |
| Auto Reload | Automaticaly reload on empty if able |
| On Action State Changed | Event raised whenever the action state changes |
Properties#
| Name | Description |
|---|---|
| instanceId | Get the id of this instance of the object |
| title | Title of the plugin |
| description | Description of the plugin |
| actionKeys | Action keys the plugin responds to |
| host | Inventory hosting the plugin |
| isAction | Gets if the plugin is an action |
| item | Gets the item associated with the plugin |
| icon | Icon associated with the plugin |
| titlebarText | Text to display in the titlebar for the plugin |
Methods#
| Name | Description |
|---|---|
| ConsumeAmmo | Consumes ammo needed to fire. Returns false if insufficient ammo in magazine. |
| GetCanFire | Check if the weapon can be fired. |
| Initialize | Initialize the plugin |
| Reload | Reload the weapon. Returns false if fully loaded or no available ammo is found. |
| SwitchAmmoType | Set the type of ammo to use when firing. |
| UnloadAmmo | Unload any ammo already in the weapon |
| AfterAdd | Method run after item is added to inventory |
| AllowAction | Check if an action is allowed |
| BeforeAdd | Method run before item is added to inventory |
| DataSave | Prepare data for serialization and saving |
| HasActionKey | Check if plugin has action key |
| IsActionReady | Get if a specific action is ready to perform |
| OnItemDropped | Method called when another item is dropped onto this one (return true if event handled) |
| OnAfterAttack | Method to call whenever the player deals damage to another object |
| PerformAction | Perform the default action |
| RunCommand | Run a command |
| Shutdown | Shuts down the object |