Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Armor

Module used to manage armor's behavior

Index

Functions

preventDamaging

  • preventDamaging(id: string): void
  • Prevents armor from being damaged

    deprecated

    Currently not implemented

    Parameters

    • id: string

      armor item string id

    Returns void

registerFuncs

  • registerFuncs(id: string, funcs: { hurt: (params: { attacker: number; b1: boolean; b2: boolean; damage: number; type: number }, item: ItemInstance, index: number, maxDamage: number) => boolean; tick: (item: ItemInstance, index: number, maxDamage: number) => boolean }): void
  • Registers armor's hurt and tick functions

    Parameters

    • id: string

      armor item string id

    • funcs: { hurt: (params: { attacker: number; b1: boolean; b2: boolean; damage: number; type: number }, item: ItemInstance, index: number, maxDamage: number) => boolean; tick: (item: ItemInstance, index: number, maxDamage: number) => boolean }
      • hurt: (params: { attacker: number; b1: boolean; b2: boolean; damage: number; type: number }, item: ItemInstance, index: number, maxDamage: number) => boolean
          • (params: { attacker: number; b1: boolean; b2: boolean; damage: number; type: number }, item: ItemInstance, index: number, maxDamage: number): boolean
          • Called when player deals damage if player wears the armor

            Parameters

            • params: { attacker: number; b1: boolean; b2: boolean; damage: number; type: number }

              additional data about damage

              • attacker: number

                attacker entity or -1 if the damage was not caused by an entity

              • b1: boolean

                unknown param

              • b2: boolean

                unknown param

              • damage: number

                damage amout that was applied to the player

              • type: number

                damage type

            • item: ItemInstance

              current armor item instance

            • index: number

              armor slot, one of the Native.ArmorType values

            • maxDamage: number

              maximum damage the armor

            Returns boolean

            true, if changes to the item parameter should be applied, false otherwise

      • tick: (item: ItemInstance, index: number, maxDamage: number) => boolean
          • (item: ItemInstance, index: number, maxDamage: number): boolean
          • Called every tick if player wears the armor

            Parameters

            • item: ItemInstance

              current armor item instance

            • index: number

              armor slot, one of the Native.ArmorType values

            • maxDamage: number

              maximum damage the armor

            Returns boolean

            true, if changes to the item parameter should be applied, false otherwise

    Returns void

Generated using TypeDoc