Module BaseShieldGeneratorUnit

Generates a protective shield around the space construct.

Note: This is generated from patch notes and in-game codex and has not yet been tested against the actual element. Accuracy not guaranteed.

Element class: BaseShieldGeneratorUnit

Extends: Element > ElementWithState > ElementWithToggle

Functions

activate () Activate the shield.
deactivate () Deactivate the shield.
isActive () Returns the activation state of the shield.
getShieldHitpoints () Returns the current hit points of the shield.
getMaxShieldHitpoints () Returns the maximal hit points of the shield.
getResistances () Returns distribution of resistance pool over resistance types.
setResistances (antimatter, electromagnetic, kinetic, thermic) Distribute the resistance pool according to damage type.
getResistancesCooldown () Returns time after which adjusting resistances is possible again.
getResistancesMaxCooldown () Returns maximal cooldown between adjusting resistances.
getResistancesPool () Returns total resistance pool that may be distributed.
getResistancesRemaining () Returns the remaining amount of the resistance pool that can be distributed.
getStressRatio () Returns ratio per damage type of recent weapon impacts after applying resistances.
getStressRatioRaw () Returns ratio per damage type of recent weapon impacts without resistance.
getStressHitpoints () Returns stress, that is the total hit points of recent weapon impacts after applying resistances.
getStressHitpointsRaw () Returns stress, that is the total hit points of recent weapon impacts without resistances.
inLockdown () Returns whether the base shield is currently in lockdown.
getLockdownRemaining () Returns the remaining time of the base shield lockdown.
getLockdownExitTime () Returns the hour since midnight of the preferred lockdown exit.
setLockdownExitTime (hour) Set hour since midnight for preferred lockdown exit.
EVENT_onToggled (active) Event: Emitted when we started or stopped the shield generator.
EVENT_absorbed (hitpoints, rawHitpoints) Deprecated: Event: Emitted when the shield absorbed incoming damage.
EVENT_onAbsorbed (hitpoints, rawHitpoints) Event: Emitted when the shield absorbed incoming damage.
EVENT_down () Deprecated: Event: Emitted when the shield hit points reached 0 due to damages.
EVENT_onDown () Event: Emitted when the shield hit points reached 0 due to damages.
EVENT_restored () Deprecated: Event: Emitted when the shield hit points were fully restored.
EVENT_onRestored () Event: Emitted when the shield hit points were fully restored.
EVENT_enterLockdown () Deprecated: Event: Emitted when the shield enters lockdown.
EVENT_onEnterLockdown () Event: Emitted when the shield enters lockdown.
EVENT_leaveLockdown () Deprecated: Event: Emitted when the shield exits the lockdown.
EVENT_onLeaveLockdown () Event: Emitted when the shield exits the lockdown.
mockRegisterAbsorbed (callback, hitpoints, rawHitpoints) Mock only, not in-game: Register a handler for the in-game `absorbed(hitpoints, rawHitpoints)` event.
mockDoAbsorbed (hitpoints, rawHitpoints) Mock only, not in-game: Simulates the shield absorbing damage.
mockRegisterDown (callback) Mock only, not in-game: Register a handler for the in-game `down()` event.
mockDoDown () Mock only, not in-game: Simulates the shield going down, either from damage or deactivation.
mockRegisterRestored (callback) Mock only, not in-game: Register a handler for the in-game `restored()` event.
mockDoRestored () Mock only, not in-game: Simulates the shield becoming active.
mockGetClosure () Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".


Functions

activate ()
Activate the shield.
deactivate ()
Deactivate the shield.
isActive ()
Returns the activation state of the shield.

Returns:

    0/1 1 when the shield is active, 0 otherwise.
getShieldHitpoints ()
Returns the current hit points of the shield.

Returns:

    float The current hit points of the shield.
getMaxShieldHitpoints ()
Returns the maximal hit points of the shield.

Returns:

    float The maximal hit points of the shield.
getResistances ()
Returns distribution of resistance pool over resistance types.

Returns:

    table Resistance to damage type {antimatter, electromagnetic, kinetic, thermic}.
setResistances (antimatter, electromagnetic, kinetic, thermic)
Distribute the resistance pool according to damage type.

Parameters:

  • antimatter float Antimatter damage resistance.
  • electromagnetic float Electromagnetic damage resistance.
  • kinetic float Kinetic damage resistance.
  • thermic float Thermic damage resistance.

Returns:

    0/1 1 if resistance was distributed, 0 if an error occurred.
getResistancesCooldown ()
Returns time after which adjusting resistances is possible again.

Returns:

    float Remaining seconds of the resistance cooldown.
getResistancesMaxCooldown ()
Returns maximal cooldown between adjusting resistances.

Returns:

    float Maximal seconds of the resistance cooldown.
getResistancesPool ()
Returns total resistance pool that may be distributed.

Returns:

    float Total pool of resistances.
getResistancesRemaining ()
Returns the remaining amount of the resistance pool that can be distributed.

Returns:

    float Remaining resistance pool.
getStressRatio ()
Returns ratio per damage type of recent weapon impacts after applying resistances.

Returns:

    table Stress ratio due to damage type {antimatter, electromagnetic, kinetic, thermic}.
getStressRatioRaw ()
Returns ratio per damage type of recent weapon impacts without resistance.

Returns:

    table Stress ratio due to damage type {antimatter, electromagnetic, kinetic, thermic}.
getStressHitpoints ()
Returns stress, that is the total hit points of recent weapon impacts after applying resistances.

Returns:

    float Total stress hit points due to recent weapon impacts.
getStressHitpointsRaw ()
Returns stress, that is the total hit points of recent weapon impacts without resistances.

Returns:

    float Total stress hit points due to recent weapon impacts.
inLockdown ()
Returns whether the base shield is currently in lockdown.

Returns:

    0/1 Whether the base shield is in lockdown.
getLockdownRemaining ()
Returns the remaining time of the base shield lockdown.

Returns:

    float Remaining lockdown time in seconds.
getLockdownExitTime ()
Returns the hour since midnight of the preferred lockdown exit.

Returns:

    0-23 Preferred lockdown exit hour UTC.
setLockdownExitTime (hour)
Set hour since midnight for preferred lockdown exit.

Parameters:

  • hour 0-23 Preferred lockdown exit hour UTC.

Returns:

    0/1 1 if lockdown exit was set, 0 if an error occurred.
EVENT_onToggled (active)
Event: Emitted when we started or stopped the shield generator.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • active 0/1 1 if the element was activated, 0 otherwise.
EVENT_absorbed (hitpoints, rawHitpoints)
Deprecated: Event: Emitted when the shield absorbed incoming damage.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onAbsorbed should be used instead.

Parameters:

  • hitpoints float Hit points the shield lost.
  • rawHitpoints float Total damage without taking resistances into account.

See also:

EVENT_onAbsorbed (hitpoints, rawHitpoints)
Event: Emitted when the shield absorbed incoming damage.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • hitpoints float Hit points the shield lost.
  • rawHitpoints float Total damage without taking resistances into account.
EVENT_down ()
Deprecated: Event: Emitted when the shield hit points reached 0 due to damages.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onDown should be used instead.

See also:

EVENT_onDown ()
Event: Emitted when the shield hit points reached 0 due to damages.

Note: This is documentation on an event handler, not a callable method.

EVENT_restored ()
Deprecated: Event: Emitted when the shield hit points were fully restored.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onRestored should be used instead.

See also:

EVENT_onRestored ()
Event: Emitted when the shield hit points were fully restored.

Note: This is documentation on an event handler, not a callable method.

EVENT_enterLockdown ()
Deprecated: Event: Emitted when the shield enters lockdown.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onEnterLockdown should be used instead.

See also:

EVENT_onEnterLockdown ()
Event: Emitted when the shield enters lockdown.

Note: This is documentation on an event handler, not a callable method.

EVENT_leaveLockdown ()
Deprecated: Event: Emitted when the shield exits the lockdown.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onLeaveLockdown should be used instead.

See also:

EVENT_onLeaveLockdown ()
Event: Emitted when the shield exits the lockdown.

Note: This is documentation on an event handler, not a callable method.

mockRegisterAbsorbed (callback, hitpoints, rawHitpoints)
Mock only, not in-game: Register a handler for the in-game `absorbed(hitpoints, rawHitpoints)` event.

Parameters:

  • callback function The function to call when the shield absorbs damage.
  • hitpoints string The hit points to filter for or "*" for all.
  • rawHitpoints string The raw hit points to filter for or "*" for all.

Returns:

    int The index of the callback.

See also:

mockDoAbsorbed (hitpoints, rawHitpoints)
Mock only, not in-game: Simulates the shield absorbing damage.

Note: The state updates to true before the event handlers are called.

Parameters:

  • hitpoints int The amount of damage to deal.
  • rawHitpoints int The amount of damage to deal before taking resistances into account.
mockRegisterDown (callback)
Mock only, not in-game: Register a handler for the in-game `down()` event.

Parameters:

  • callback function The function to call when the shield goes down.

Returns:

    int The index of the callback.

See also:

mockDoDown ()
Mock only, not in-game: Simulates the shield going down, either from damage or deactivation.

Note: The state updates to false before the event handlers are called.

mockRegisterRestored (callback)
Mock only, not in-game: Register a handler for the in-game `restored()` event.

Parameters:

  • callback function The function to call when the shield comes up.

Returns:

    int The index of the callback.

See also:

mockDoRestored ()
Mock only, not in-game: Simulates the shield becoming active.

Note: The state updates to true before the event handlers are called.

mockGetClosure ()
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".

Returns:

    table A table encompasing the api calls of object.

See also:

generated by LDoc 1.4.6 Last updated 2022-12-01 00:35:59