Paste #47467: Untitled Paste

Date: 2018/05/17 08:00:14 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
                }
                - if <yaml[super-counter].read[energy.<context.entity.uuid>]||0> < 1
                {
                    - determine false
                }
            }

"Super Activation Mechanic":
    type: world
    events:
        on mm denizen mechanic:
            - if <context.skill> == "super-activate"
            { 
                - if <yaml[super-counter].read[super-activated.<context.caster.uuid>]> == 0
                {
                    - announce to_console "Super activation event running"
                    - bossbar update super-bar.<context.caster.uuid> "title:<yellow>SUPER ACTIVE!"
                    - yaml id:super-counter set super-activated.<context.caster.uuid>:1
                    - if <yaml[super-counter].read[energy.<context.caster.uuid>]> < 1
                    {
                        - announce to_console "Super energy less than one, resetting"
                        - bossbar update super-bar.<context.caster.uuid> "title:Super Energy" progress:0.0 color:BLUE style:SEGMENTED_10
                        - yaml id:super-counter set energy.<context.caster.uuid>:0
                        - yaml id:super-counter set super-ready.<context.caster.uuid>:0
                        - yaml id:super-counter set super-activated.<context.caster.uuid>:0
                    }
                    - while <yaml[super-counter].read[energy.<context.caster.uuid>].is[greater].than[0]>
                    {
                        - announce to_console "While loop run"
                        - bossbar update super-bar.<context.caster.uuid> "title:<yellow>SUPER ACTIVE!" progress:<yaml[super-counter].read[energy.<context.caster.uuid>].div[300.0]>
                        - yaml id:super-counter set energy.<context.entity.uuid>:<yaml[super-counter].read[energy.<context.entity.uuid>].sub[1.0]>
                        - if <yaml[super-counter].read[energy.<context.caster.uuid>]> < 1
                        {
                            - announce to_console "Super energy less than one in while loop, resetting"
                            - bossbar update super-bar.<context.caster.uuid> "title:Super Energy" progress:0.0 color:BLUE style:SEGMENTED_10
                            - yaml id:super-counter set energy.<context.caster.uuid>:0
                            - yaml id:super-counter set super-ready.<context.caster.uuid>:0
                            - yaml id:super-counter set super-activated.<context.caster.uuid>:0
                        }
                        - wait 5t
                    }
                }
                - if <yaml[super-counter].read[energy.<context.caster.uuid>]> < 1
                {
                    - announce to_console "Super energy less than one, resetting"
                    - bossbar update super-bar.<context.caster.uuid> "title:Super Energy" progress:0.0 color:BLUE style:SEGMENTED_10
                    - yaml id:super-counter set energy.<context.caster.uuid>:0
                    - yaml id:super-counter set super-ready.<context.caster.uuid>:0
                    - yaml id:super-counter set super-activated.<context.caster.uuid>:0
                }
            }
            - if <context.skill> == "super-swing" 
            { 
                - yaml id:super-counter set energy.<context.caster.uuid>:<yaml[super-counter].read[energy.<context.caster.uuid>].sub[<context.args>]> 
            }