SiliconGhetto Engine API
    Preparing search index...

    Function createArmorAPI

    • Returns {
          equip(slot: string, opts?: ArmorOpts): void;
          remove(slot: string): void;
          getDefense(slot: string): number;
          get totalDefense(): number;
      }

      • equip: function
        • Equip an armor piece in the given slot.

          Parameters

          • slot: string

            Armor slot name: "head", "chest", "legs", or "feet"

          • opts: ArmorOpts = {}

            Armor properties (itemId, defense value, color)

          Returns void

      • remove: function
        • Remove the armor piece from the given slot.

          Parameters

          • slot: string

            Armor slot name: "head", "chest", "legs", or "feet"

          Returns void

      • getDefense: function
        • Get the defense value of the armor in a specific slot.

          Parameters

          • slot: string

            Armor slot name: "head", "chest", "legs", or "feet"

          Returns number

          Defense value (0 if slot is empty)

      • get totalDefense(): number

        Get the combined defense value from all equipped armor pieces.