function init(hero) {
    hero.setName("Beast Boy");
    hero.setTier(2);
    hero.setVersion("\u00A74\u00A7lT\u00A76\u00A7le\u00A7a\u00A7le\u00A7d\u00A7ln \u00A7b\u00A7lT\u00A7a\u00A7li\u00A76\u00A7lt\u00A7d\u00A7la\u00A7b\u00A7ln\u00A74\u00A7ls\u00A7r");
    
    hero.setHelmet("Head");
    hero.setChestplate("Jacket");
    hero.setLeggings("Leggings");
    hero.setBoots("Boots");
    
    hero.addPowers("mvh:tt_beastboy");
    hero.addAttribute("PUNCH_DAMAGE", 2.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 2.0, 0);
    hero.addAttribute("BASE_SPEED_LEVELS", 0.0, 0);

    hero.addKeyBind("REX", "Morph-Toggle: T-Rex", 1); 
    hero.addKeyBind("TENTACLES", "Morph-Toggle: Octopus", 2);
    hero.addKeyBind("ENDER", "Morph-Toggle: Enderman", 3);
    hero.addKeyBind("APE", "Morph-Toggle: Gorilla", 4);
    hero.addKeyBind("EXTRA", "Other Morph's", 5);

    hero.addKeyBind("BIRD", "Morph-Toggle: Pterodactyl", 1); 
    hero.addKeyBind("TIGER", "Morph-Toggle: Tiger", 2);
    hero.addKeyBind("FLY", "Morph-Toggle: A Fly", 3);
    hero.addKeyBind("SHARK", "Morph-Toggle: Shark", 4);

    hero.addKeyBind("EARTHQUAKE", "key.earthquake", 2);
    hero.addKeyBind("SONIC_WAVES", "ROAR", 3);

    hero.addKeyBind("TENTACLE_JAB", "key.tentacleJab", 1);
    hero.addKeyBind("TENTACLE_GRAB", "key.tentacleGrab", 3);

    hero.addKeyBind("TELEPORT", "Teleport", 2);

    hero.addKeyBind("SUPER_SPEED", "key.superSpeed", 1);

    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setDefaultScale(defaultScale);
    hero.setTierOverride(getTierOverride);
    hero.addAttributeProfile("REX", rexProfile);
    hero.addAttributeProfile("OCTO", octoProfile);
    hero.addAttributeProfile("END", endProfile);
    hero.addAttributeProfile("APE", apeProfile);
    hero.addAttributeProfile("BIRD", birdProfile);
    hero.addAttributeProfile("TIGER", tigerProfile);
    hero.addAttributeProfile("FLY", flyProfile);
    hero.addAttributeProfile("SHARK", sharkProfile);
    hero.setAttributeProfile(getAttributeProfile);
}
function rexProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 5, 1);
    profile.addAttribute("PUNCH_DAMAGE", 6, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("REACH_DISTANCE", 0.8, 1);
    profile.addAttribute("MAX_HEALTH", 6.0, 0);
}
function octoProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 50, 1);
    profile.addAttribute("PUNCH_DAMAGE", 1, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
}
function endProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 50, 1);
    profile.addAttribute("PUNCH_DAMAGE", 5, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
}
function apeProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 7, 1);
    profile.addAttribute("PUNCH_DAMAGE", 7, 0);
    profile.addAttribute("SPRINT_SPEED", 0.9, 1);
    profile.addAttribute("MAX_HEALTH", 2.0, 0);
}
function birdProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 50, 1);
    profile.addAttribute("PUNCH_DAMAGE", 3, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("IMPACT_DAMAGE", 0.6, 1);
}
function tigerProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 5, 1);
    profile.addAttribute("PUNCH_DAMAGE", 5, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("BASE_SPEED_LEVELS", 1.0, 0);
}
function flyProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 50, 1);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("MAX_HEALTH", -16.0, 0);
}
function sharkProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", -5, 1);
    profile.addAttribute("PUNCH_DAMAGE", 3, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
}
function getTierOverride(entity) {
    if (entity.getData("mvh:dyn/rex")) {
        return 7;
    }
    if (entity.getData("mvh:dyn/bird")) {
        return 5;
    }
    if (entity.getData("mvh:dyn/tiger")) {
        return 4;
    }
    if (entity.getData("mvh:dyn/enderman")) {
        return 2;
    }
    if (entity.getData("mvh:dyn/fly")) {
        return 1;
    }
    if (entity.getData("mvh:dyn/rex")) {
        return 6;
    }
    if (entity.getData("fiskheroes:tentacles")) {
        return 4;
    }
    if (entity.getData("mvh:dyn/shark")) {
        return 5;
    }
    
    return 2;
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:gliding":
        return entity.getData("mvh:dyn/bird") && !entity.isInWater() || entity.getData("mvh:dyn/shark") && entity.isInWater();
    case "fiskheroes:leaping":
        return entity.getData("mvh:dyn/ape");
    case "fiskheroes:regeneration":
        return entity.getData("mvh:dyn/tiger");
    case "fiskheroes:arrow_catching":
        return entity.getData("mvh:dyn/ape");
    case "fiskheroes:water_breathing":
        return entity.getData("mvh:dyn/shark");
    case "fiskheroes:super_speed":
        return entity.getData("mvh:dyn/tiger");
    case "fiskheroes:flight":
        return entity.getData("mvh:dyn/fly");
    default:
        return true;
    }
}
function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "EARTHQUAKE":
        return entity.getData("mvh:dyn/rex") && !entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/ape") != null;
    case "SONIC_WAVES":
        return entity.getData("mvh:dyn/rex") && !entity.getData("mvh:dyn/bird") != null;

    case "TENTACLE_JAB":
        return entity.getData("fiskheroes:tentacles") != null;
    case "TENTACLE_GRAB":
        return entity.getData("fiskheroes:tentacles") != null;

    case "TELEPORT":
        return entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/exrta") != null;

    case "TELEKINESIS":
        return entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/exrta") != null;

    case "SUPER_SPEED":
        return entity.getData("mvh:dyn/tiger") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/exrta") != null;

    case "BIRD":
        return entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/tiger") && !entity.getData("mvh:dyn/fly") && !entity.getData("mvh:dyn/shark") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "TIGER":
        return entity.getData("mvh:dyn/exrta") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/bird") && !entity.getData("mvh:dyn/fly") && !entity.getData("mvh:dyn/shark") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "FLY":
        return entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/rex") && !entity.getData("mvh:dyn/bird") && !entity.getData("mvh:dyn/tiger") && !entity.getData("mvh:dyn/shark") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "SHARK":
        return entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/rex") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/bird") && !entity.getData("mvh:dyn/tiger") && !entity.getData("mvh:dyn/fly") && !entity.getData("mvh:dyn/bloodlust") != null;

    case "EXTRA":
        return !entity.getData("mvh:dyn/rex") && !entity.getData("mvh:dyn/shark") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/bird") && !entity.getData("mvh:dyn/tiger") && !entity.getData("mvh:dyn/fly") && !entity.getData("mvh:dyn/bloodlust") != null;

    case "REX":
        return !entity.getData("mvh:dyn/exrta") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "TENTACLES":
        return !entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/tiger") && !entity.getData("mvh:dyn/rex") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "ENDER":
        return !entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/fly") && !entity.getData("mvh:dyn/rex") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/ape") && !entity.getData("mvh:dyn/bloodlust") != null;
    case "APE":
        return !entity.getData("mvh:dyn/exrta") && !entity.getData("mvh:dyn/shark") && !entity.getData("mvh:dyn/rex") && !entity.getData("fiskheroes:tentacles") && !entity.getData("mvh:dyn/enderman") && !entity.getData("mvh:dyn/bloodlust") != null;
    default:
        return true;
    }
}
function defaultScale(entity) {
    if (entity.getData("mvh:dyn/rex")) {
        return 2.5;
    }
    if (entity.getData("mvh:dyn/enderman")) {
        return 1.5;
    }
    if (entity.getData("mvh:dyn/ape")) {
        return 1.5;
    }
    if (entity.getData("mvh:dyn/fly")) {
        return 0.06;
    }
    if (entity.getData("mvh:dyn/tiger")) {
        return 1.4;
    }
    if (entity.getData("fiskheroes:tentacles")) {
        return 1.1;
    }
    if (entity.getData("mvh:dyn/shark")) {
        return 0.4;
    }
    return 1.0;
}
function getAttributeProfile(entity) {
    if (entity.getData("mvh:dyn/rex")) {
        return "REX";
    }
    else if (entity.getData("fiskheroes:tentacles")) {
        return "OCTO";
    }
    else if (entity.getData("mvh:dyn/enderman")) {
        return "END";
    }
    else if (entity.getData("mvh:dyn/ape")) {
        return "APE";
    }
    else if (entity.getData("mvh:dyn/bird")) {
        return "BIRD";
    }
    else if (entity.getData("mvh:dyn/tiger")) {
        return "TIGER";
    }
    else if (entity.getData("mvh:dyn/fly")) {
        return "FLY";
    }
    else if (entity.getData("mvh:dyn/shark")) {
        return "SHARK";
    }
    return true;
}