function init(hero) {
    hero.setName("Venom");
	hero.setVersion("The One With Webswinging and everything that i don't like since in the movie we never really see him swing but whatever");
    hero.setTier(8);
	

    hero.setChestplate("Symbiote");


    hero.addPowers("pack:symbiot_venom_comics");
    hero.addAttribute("PUNCH_DAMAGE", 9.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 3.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 20.0, 0);
	hero.addAttribute("KNOCKBACK", 3.0, 0);
	hero.addAttribute("BASE_SPEED", 0.3, 1);
	hero.addAttribute("MAX_HEALTH", 4.0, 0);
	hero.addAttribute("SPRINT_SPEED", 0.15, 0);
    hero.addAttribute("IMPACT_DAMAGE", 0.5, 1);
    
    hero.addKeyBind("UTILITY_BELT", "key.webShooters", 1);
    hero.addKeyBind("WEB_ZIP", "key.webZip", 2);
	hero.addKeyBind("TENTACLE_JAB", "key.tentacleJab", 1);
    hero.addKeyBind("TENTACLE_GRAB", "key.tentacleGrab", 2);
    hero.addKeyBindFunc("func_WEB_SWINGING", webSwingingKey, "key.webSwinging", 3);
 
	hero.addKeyBind("TENTACLES", "key.tentacles", 5);
	hero.addKeyBindFunc("func_GIANT_MODE", giantModeKey, "Symbiot", 5);
	
    hero.addAttributeProfile("INACTIVE", inactiveProfile);
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
	hero.setAttributeProfile(getProfile);
	hero.setTierOverride(getTierOverride);
	hero.setHasProperty(hasProperty);
}


function giantModeKey(player, manager) {

	
    var flag = player.getData("pack:dyn/symbiot");
    manager.setData(player, "pack:dyn/symbiot", !flag);
    manager.setData(player, "fiskheroes:size_state", flag ? -1 : 1);
    return true;
}

function webSwingingKey(player, manager) {
    var flag = player.getData("fiskheroes:web_swinging");
    
    if (!flag) {
        manager.setDataWithNotify(player, "fiskheroes:prev_utility_belt_type", player.getData("fiskheroes:utility_belt_type"));
        manager.setDataWithNotify(player, "fiskheroes:utility_belt_type", -1);
    }

    
	manager.setDataWithNotify(player, "fiskheroes:tentacles_retracting", !flag);
    manager.setDataWithNotify(player, "fiskheroes:web_swinging", !flag);
    return true;
}

function getTierOverride(entity) {
    return entity.getData("pack:dyn/symbiot") ? 8 : 0;
}


function hasProperty(entity, property) {
    switch (property) {
    case "MASK_TOGGLE":
        return entity.getData("pack:dyn/symbiot_timer") == 1;
    case "BREATHE_SPACE":
        return !entity.getData("fiskheroes:mask_open") && entity.getData("pack:dyn/symbiot");
    default:
        return false;
    }
}

function getProfile(entity) {
	if (entity.getData("pack:dyn/symbiot_timer") < 1 ) {
        return "INACTIVE";
    }
    return null;
}

function inactiveProfile(profile) {
	profile.revokeAugments();
}

function isModifierEnabled(entity, modifier) {

	if (modifier.name() == "fiskheroes:size_manipulation") {
        var giant = entity.getData("pack:dyn/symbiot_timer") > 0;
        return modifier.id() == "giant" ? giant : !giant;
    }
    switch (modifier.name()) {
    case "fiskheroes:web_swinging":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:utility_belt_type") == -1 && entity.getData("pack:dyn/symbiot");
    case "fiskheroes:leaping":
        return modifier.id() == "springboard" == (entity.getData("fiskheroes:ticks_since_swinging") < 5) && entity.getData("pack:dyn/symbiot");
	case "fiskheroes:tentacles":
        return entity.getData("pack:dyn/symbiot") ;
	case "fiskheroes:water_breathing":
        return entity.getData("pack:dyn/symbiot") && !entity.getData("fiskheroes:mask_open");
	case "fiskheroes:wall_crawling":
        return entity.getData("pack:dyn/symbiot");
	case "fiskheroes:potion_immunity":
        return entity.getData("pack:dyn/symbiot");
	case "fiskheroes:arrow_catching":
        return entity.getData("pack:dyn/symbiot");
	case "fiskheroes:equipment":
        return entity.getData("pack:dyn/symbiot") && entity.getData("fiskheroes:tentacles") == null;

	case "fiskheroes:blade":
        return entity.getData("pack:dyn/symbiot");
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
	if (keyBind == "func_GIANT_MODE") {
        return (entity.getData("pack:dyn/symbiot") || entity.getData("pack:dyn/symbiot_cooldown") >= 0) && !entity.isSneaking() && entity.getData("fiskheroes:mask_open_timer") == 0;
    }
	if (keyBind == "SIZE_MANIPULATION") {
        return !entity.getData("pack:dyn/symbiot");
    }
    else if (!entity.getData("pack:dyn/symbiot")) {
        return false;
    }
	
	
    switch (keyBind) {

	case "TENTACLES":
        return entity.getData("pack:dyn/symbiot") && entity.isSneaking()  && !entity.getData("fiskheroes:web_swinging") ||  entity.isBookPlayer();
	case "WEB_ZIP":
        return entity.getData("fiskheroes:tentacles") == null ;
	case "UTILITY_BELT":
        return entity.getData("fiskheroes:tentacles") == null ;
    case "func_WEB_SWINGING":
        return entity.getHeldItem().isEmpty();
    default:
        return true;
    }
}
