Paste #47457: Untitled Paste

Date: 2018/05/16 20:45:56 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]>
        {
            - yaml id:super-counter set energy.<player.uuid>:0
            - yaml id:super-counter set super-ready.<player.uuid>:0
            - yaml id:super-counter set super-activated.<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
            - yaml id:super-counter set super-ready.<player.uuid>:0
            - yaml id:super-counter set super-activated.<player.uuid>:0
            - 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 "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[300.0]>"
                - bossbar update super-bar.<player.uuid> "title:Super Energy" "progress:<yaml[super-counter].read[energy.<player.uuid>].div[300.0]>"
            }

            - if <yaml[super-counter].read[energy.<player.uuid>]||0> > 300
            {
                - yaml id:super-counter set energy.<player.uuid>:300
                - bossbar update super-bar.<player.uuid> "title:<yellow>SUPER CHARGED!" progress:1.0 color:YELLOW style:SOLID
                - yaml id:super-counter set super-ready.<player.uuid>:1
                - yaml id:super-counter set super-activated.<player.uuid>:0
            }

            - if <yaml[super-counter].read[energy.<player.uuid>]||0> = 300
            {
                - yaml id:super-counter set energy.<player.uuid>:300
                - bossbar update super-bar.<player.uuid> "title:<yellow>SUPER CHARGED!" progress:1.0 color:YELLOW style:SOLID
                - yaml id:super-counter set super-ready.<player.uuid>:1
                - yaml id:super-counter set super-activated.<player.uuid>:0
            }
        }

"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[super-ready.<context.entity.uuid>]||0> < 1
                {
                    - determine false
                }
            }

"Super Activation Mechanic":
    type: world
    events:
        on mm denizen mechanic:
            - narrate "<context.skill>"
            - narrate "<context.args>"
            - if <context.skill> = "super-activate"
            {
                - if <yaml[super-counter].read[super-activated.<context.entity.uuid>]> = 0
                {
                    - bossbar update super-bar.<context.entity.uuid> "title:<yellow>SUPER ACTIVE!" progress 1.0 color:YELLOW style:SOLID
                    - yaml id:super-counter set super-activated.<context.entity.uuid>:1
                    - if <yaml[super-counter].read[energy.<context.entity.uuid>]> = 0
                    {
                        - bossbar update super-bar.<context.entity.uuid> "title:Super Energy" "progress:0.0" color:BLUE style: SEGMENTED_10
                        - yaml id:super-counter set energy.<player.uuid>:0
                        - yaml id:super-counter set super-ready.<player.uuid>:0
                        - yaml id:super-counter set super-activated.<player.uuid>:0
                    }
                    - while <yaml[super-counter].read[energy.<context.entity.uuid>]> > 0
                    {
                        - bossbar update super-bar.<context.entity.uuid> "title:<yellow>SUPER ACTIVE!" "progress:<yaml[super-counter].read[energy.<player.uuid>].div[300.0]>"
                        - yaml id:super-counter set energy.<player.uuid>:<yaml[super-counter].read[energy.<player.uuid>].sub[1.0]>
                        - wait 5t
                    }
                }
            }
            - if <context.skill> = "super-swing"
            {
                - yaml id:super-counter set energy.<player.uuid>:<yaml[super-counter].read[energy.<player.uuid>].sub[<context.args>]>
            }