Paste #124147: attributes proc

Date: 2024/06/27 15:03:02 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Attributes_Lore_Proc:
  type: procedure
  definitions: item
  debug: false
  script:
  - define attributes <[item].attribute_modifiers>
  - foreach <[attributes]> as:map:
    - define key <[map].get[1].get[name]>
    - choose <[key]>:
      - case GENERIC_ATTACK_DAMAGE:
        - define text_replace Attack_Damage
      - case GENERIC_ATTACK_Speed:
        - define text_replace Attack_Speed
      - case GENERIC_ARMOR:
        - define text_replace Armor
    - define amount <[map].get[1].get[amount]>
    - if <[text_replace]> == attack_speed:
      - define amount <[amount].add[4]>
    - define slot <[map].get[1].get[slot]>
    - define formatted:->:<n><&sp><&sp><dark_green><[amount]><&sp><[text_replace].replace[_].with[ ]>
  - define format_combine <[formatted].comma_separated.replace[,].with[]>
  - define lore "<n><gray>When on <[slot].to_titlecase><&co><[format_combine]>"
  - determine <[lore]>