Paste #76785: Shield skill go boom

Date: 2020/10/22 13:51:08 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


barrage_shield:
  type: item
  material: shield
  display name: Barrage Shield
  lore:
  - A shield used to siege castle walls and break vault doors
  skills:
    shield: barrage_shield_explode

barrage_shield_explode:
  type: task
  definitions: state|player
  script:
  - if <[state]>:
    - wait 1t
    - ~inject locally charge
    - ~inject locally push
    - inject locally explode
  charge:
  - wait 5t
  - narrate "Charging shield"
  - repeat 10:
    - if !<[player].is_blocking>:
      - narrate "Charging stopped"
      - stop
    - narrate "Charging shield <[value].mul[10]>/100"
    - wait 5t
  push:
  - adjust <player> velocity:<player.location.direction.vector.mul[10]>
  - repeat 10:
    - if <[value].mod[2]> == 0:
      - wait 1t
    - playeffect effect:lava at:<[player].location> quantity:10 offset:1
  explode:
  - wait 5t
  - explode power:15 <[player].location> breakblocks source:<[player]>