Paste #48840: Untitled Paste

Date: 2018/08/05 11:45:17 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


AirShield:
    type: world
    debug: false
    events:
        on player right clicks with item:
            - if !<player.is_on_ground> && <player.flag[element]> == air && <player.flag[sprinting]> == false && <player.location.cursor_on.material> == m@air && !<player.has_flag[OnSpout]> {
                - flag <player> AirShieldHealth:9
                - repeat 90 {
                    - foreach <player.location.find.entities.within[1.5].exclude[<player>]> {
                        - adjust <def[value]> "velocity:0,-4,0"
                    }
                    - playeffect <player.location> effect:cloud quantity:777
                    - wait 2t
                }
                - flag <player> AirShieldHealth:!
            }
        on player damaged:
            - if <player.has_flag[AirShieldHealth]> {
                - announce "<player> IS SHIELDED"
                - flag <player> AirShieldHealth:-:<context.damage>
                - announce "AIRSHIELD (<player.flag[AirShieldHealth]>) has absorbed <context.damage>"
                - if <player.flag[AirShieldHealth]> >= 0 {
                    - determine passively cancelled
                }
                else {
                    - flag <player> AirShieldHealth:!
                }
            }
        on player walks:
            - if <player.flag[AirShieldHealth]> < 1 {
                - flag <player> AirShieldHealth:!
            }