Paste #47455: Untitled Paste

Date: 2018/05/16 17:03:43 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"Super YAML Handler":
    type: world
    events:
        on server start:
        - yaml create id:super-counter
        on shutdown:
        - yaml unload id:super-counter

"Super Reset on Equip":
    type: world
    events:
        on player equips chestplate:
        - if <context.armor.contains[SuperIndicatorPhrase]>
        {
#            - mmcastplayer caster:<player.entity> skill:SuperReset target:<player.entity> repeat:0 delay:0
            - yaml id:super-counter set energy.<player.uuid>:0
            - narrate "Super energy reset"
            - narrate "Super energy is <yaml[super-counter].read[energy.<player.uuid>]>"
        }

"Super Enable on Login":
    type: world
    events:
        on player joins:
        - wait 20t
        - if <player.equipment.chestplate.contains[SuperIndicatorPhrase]>
        {
            - wait 100t
            - yaml id:super-counter set energy.<player.uuid>:0
            - bossbar create super-bar.<player.uuid> players:<player> "title:Super Energy" progress:0 color:BLUE style:SEGMENTED_10
            - narrate "Super energy reset"
            - narrate "Super energy is <yaml[super-counter].read[energy.<player.uuid>]>"
        }
        on player quits:
        - if <context.armor.contains[SuperIndicatorPhrase]> 
        {
            - bossbar remove super-bar.<player.uuid>
        }

"Damage Super Charge":
    type: world
    events:
        on player damages entity:
        - if <context.damager.equipment.chestplate.contains[SuperIndicatorPhrase]>
        {
            - if <yaml[super-counter].read[energy.<player.uuid>]||0> < 300
            {
                - narrate "YAML super energy below 300"
                - narrate "Damage logged as <context.final_damage>"
                - narrate "Super energy calculated as <context.final_damage.div[5.0].add[<yaml[super-counter].read[energy.<player.uuid>]||0>]>"
                - yaml id:super-counter set energy.<player.uuid>:<context.final_damage.div[5.0].add[<yaml[super-counter].read[energy.<player.uuid>||0]>]>
                - narrate "Super energy is <yaml[super-counter].read[energy.<player.uuid>]>"
                - narrate "Bossbar updated to <yaml[super-counter].read[energy.<player.uuid>].div[3.0]>"
                - bossbar update super-bar.<player.uuid> "title:Super Energy" "progress:<yaml[super-counter].read[energy.<player.uuid>].div[3.0]>"
                - narrate "bossbar update super-bar.<player.uuid> title:Super Energy progress:<yaml[super-counter].read[energy.<player.uuid>].div[3.0]>"
            }
            - if <yaml[super-counter].read[energy.<player.uuid>]||0> > 300
            {
                - yaml id:super-counter set energy.<player.uuid>:300
            }

            - if <yaml[super-counter].read[energy.<player.uuid>]||0> > 300
            {
                - yaml id:super-counter set energy.<player.uuid>:300
            }
        }

"Super Bossbar":
    type: world
    events:
        on player equips chestplate:
        - if <context.armor.contains[SuperIndicatorPhrase]>
        {
            - bossbar create super-bar.<player.uuid> players:<player.name> "title:Super Energy" progress:0.0 color:BLUE style:SEGMENTED_10
        }
        on player unequips chestplate:
        - if <context.armor.contains[SuperIndicatorPhrase]> 
        {
            - bossbar remove super-bar.<player.uuid> players:<player.name>
        }

"Super Charged Condition":
    type: world
    events:
        on mm denizen condition:
            - if <context.condition> == "super-charged"
            {
                - if <yaml[super-counter].read[energy.<context.entity.uuid>]||0> < 300
                {
                    - narrate "<red>Your Super isn't ready yet!"
                    - determine false
                }
            }