var utils = implement("fiskheroes:external/utils");

function init(hero) {
    hero.setName("Green Goblin/Norman Osborn");
    hero.setTier(8);
    

    hero.setHelmet("Mask");
    hero.setChestplate("Chestpiece");
    hero.setLeggings("Pants");
    hero.setBoots("Boots");
    
    hero.addPowers("tgheroes:oscorp_serum");
    hero.addAttribute("PUNCH_DAMAGE", 8.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.3, 1);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 10.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 2.5, 0);

    hero.addKeyBind("GLIDER", "Glider", 2);	
    hero.addKeyBind("UTILITY_BELT", "Utility Belt", 1);

    hero.setModifierEnabled(isModifierEnabled);
	
    hero.setTickHandler((entity, manager) => {
        if (entity.getData("tgheroes:dyn/oscorp_glider")) {
        manager.setData(entity, "fiskheroes:flying", true);
    }
    });
}

function isModifierEnabled(entity, modifier) {
  switch (modifier.name()) {
    case "fiskheroes:controlled_flight":
        return entity.getData("tgheroes:dyn/oscorp_glider"); 
    default:
        return true;
    }
}

