Class ISReloadManager

Injects new methods and overrides into PZ’s ISReloadManager

The reason for this is to handle the unloading timed actions, and finer control over the firing sequence.

Info:

  • Copyright: 2018 File: shared/3LoadOrder/ISORGMReloadManager.lua
  • Release: v3.09
  • Author: Fenris_Wolf

Methods

ISReloadManager:isWeaponUnloadable () Checks if the the players weapon can be unloaded.
ISReloadManager:unloadStarted () Checks if the player has started a unload action.
ISReloadManager:stopUnloadSuccess () Triggered at the end of a successful unload action.
ISReloadManager:stopUnload () Triggered at the end of chain unloading.
ISReloadManager:startUnloading () Triggered at the start of the unloading action.
ISReloadManager:startUnloadFromUi (item) Starts the unload timed action when triggered from the UI context menu.
ISReloadManager:startReloadFromUi (item) Starts the reload timed action when triggered from the UI context menu.
ISReloadManager:checkLoaded (character, chargeDelta) Called when the player attempts to attack.


Methods

ISReloadManager:isWeaponUnloadable ()
Checks if the the players weapon can be unloaded.

This is a new injected method.

Returns:

    bool
ISReloadManager:unloadStarted ()
Checks if the player has started a unload action.

This is a new injected method.

Returns:

    bool
ISReloadManager:stopUnloadSuccess ()
Triggered at the end of a successful unload action.

Starts the next one if chain unloading.

This is a new injected method.

ISReloadManager:stopUnload ()
Triggered at the end of chain unloading.

This is a new injected method.

ISReloadManager:startUnloading ()
Triggered at the start of the unloading action.

This is a new injected method.

ISReloadManager:startUnloadFromUi (item)
Starts the unload timed action when triggered from the UI context menu.

This is a new injected method.

Parameters:

  • item InventoryItem
ISReloadManager:startReloadFromUi (item)
Starts the reload timed action when triggered from the UI context menu.

This is a method override.

This method is changed to allow it to check :unloadStarted() as well

Parameters:

  • item InventoryItem
ISReloadManager:checkLoaded (character, chargeDelta)
Called when the player attempts to attack.

This is a method override.

This critical function checks if a weapon has a round loaded.

It calls the DoAttack method triggering the actual attack, or playing the ‘click’ sound on a empty chamber.

This method is changed inject several checks and additional method calls.

It calls reloadable:fireEmpty() when dry firing if the function exists in the reloadable class. This allows us to drop the hammer if its cocked, or rotate the revolver cylinder properly when the shot fails.

It also calls reloadable:preFireShot() and checks the return value if it should halt the attack. Unlike reloadable:isLoaded() which is called even when the gun is still in recoil, reloadable:preFireShot() only calls before the actual shot.

Parameters:

  • character IsoPlayer
  • chargeDelta nil or float
generated by LDoc 1.4.3 Last updated 2019-04-11 18:37:45