import * as mc from "@minecraft/server";
import * as abilities from '../abilities/index';
class HeartData {
    get Item() {
        const item = new mc.ItemStack(this.itemName, 1);
        item.setLore(this.heartLore);
        return item;
    }
    constructor(displayName, textureName, itemName, abilityCallback, heartLore) {
        this.displayName = displayName;
        this.textureName = textureName;
        this.itemName = itemName;
        this.heartLore = heartLore;
        this.abilityCallback = abilityCallback;
    }
    performAbility(player) {
        this.abilityCallback(player);
    }
}
export const heartItemNamePrefix = 'ldz:custom_heart_';
export const HEART_DATA = [
    new HeartData("", "blnk", "", () => { }, []),
    new HeartData('bee', 'bees', `${heartItemNamePrefix}bees`, abilities.beesAbility, ['§r§4On heart damage:', '§o§uSpawns a swarm of', '§uangry bees§r',]),
    new HeartData('chicken', 'chic', `${heartItemNamePrefix}chicken`, abilities.chickenAbility, ['§r§4On heart damage:', '§o§uTriggers slow falling', '§uuntil you land§r',]),
    new HeartData('creeper', 'crep', `${heartItemNamePrefix}creeper`, abilities.creeperAbility, ['§r§4On heart damage:', '§o§uSpawns charged', '§ucreeper time bombs§r',]),
    new HeartData('dolphin', 'dolp', `${heartItemNamePrefix}dolphin`, abilities.dolphinAbility, ['§r§4On heart damage:', '§o§uCauses nearby mobs', '§uto rise on bubbles§r',]),
    new HeartData('ender_dragon', 'erdn', `${heartItemNamePrefix}enderdragon`, abilities.enderDragonAbility, ['§r§4On heart damage:', '§o§uActivates Ender Dragon', '§ufire breath§r',]),
    new HeartData('enderman', 'ende', `${heartItemNamePrefix}enderman`, abilities.endermanAbility, ['§r§4On heart damage:', '§o§uInstantly teleports', '§uyou back to your', '§uspawnpoint§r',]),
    new HeartData('pig', 'pigs', `${heartItemNamePrefix}pigs`, abilities.pigsAbility, ['§r§4On heart damage:', '§o§uSpawns a giant pork', '§uchop§r',]),
    new HeartData('slime', 'slim', `${heartItemNamePrefix}slime`, abilities.slimeAbility, ['§r§4On heart damage:', '§o§uFlings you up to', '§utrigger a slime slam§r',]),
    new HeartData('skeleton', 'skel', `${heartItemNamePrefix}skeleton`, abilities.skeletonAbility, ['§r§4On heart damage:', '§o§uShoots a circle of', '§uarrows§r',]),
    new HeartData('wither', 'with', `${heartItemNamePrefix}wither`, abilities.witherAbility, ['§r§4On heart damage:', '§o§uFires a barrage of', '§uwither skulls§r',]),
    new HeartData('anvil', 'anvi', `${heartItemNamePrefix}anvil`, abilities.anvilAbility, ['§r§4On heart damage:', '§o§uCreates an anvil', '§urainfall§r',]),
    new HeartData('crafting_table', 'craf', `${heartItemNamePrefix}crafting_table`, abilities.crafting_tableAbility, ['§r§4On heart damage:', '§o§uSpawns basic tools', '§uor armor§r',]),
    new HeartData('diamond', 'diam', `${heartItemNamePrefix}diamond`, abilities.diamondAbility, ['§r§4On heart damage:', '§o§uActivates a spinning', '§udiamond sword', '§udefense§r',]),
    new HeartData('dirt', 'dirt', `${heartItemNamePrefix}dirt`, abilities.dirtAbility, ['§r§4On heart damage:', '§o§uMines a large area', '§uof dirt, grass, sand,', '§uor stone§r',]),
    new HeartData('fire', 'fire', `${heartItemNamePrefix}fire`, abilities.fireAbility, ['§r§4On heart damage:', '§o§uLaunches out fire', '§ugeysers around you§r',]),
    new HeartData('furnace', 'furn', `${heartItemNamePrefix}furnace`, abilities.furnaceAbility, ['§r§4On heart damage:', '§o§uShoots coal that', '§udrops cooked food', '§uon mob impact§r',]),
    new HeartData('glowstone', 'glow', `${heartItemNamePrefix}glowstone`, abilities.glowstoneAbility, ['§r§4On heart damage:', '§o§uBlinds and stuns', '§unearby mobs,', '§ufreezing them in', '§uplace§r',]),
    new HeartData('piston', 'pist', `${heartItemNamePrefix}piston`, abilities.pistonAbility, ['§r§4On heart damage:', '§o§uKnocks back nearby', '§umobs away from you§r',]),
    new HeartData('sapling', 'sapl', `${heartItemNamePrefix}sapling`, abilities.saplingAbility, ['§r§4On heart damage:', '§o§uGrows a tree under', '§uyour position§r',]),
    new HeartData('tnt', 'tnt_', `${heartItemNamePrefix}tnt_block`, abilities.tnt_blockAbility, ['§r§4On heart damage:', '§o§uRains down primed', '§uTNT§r',]),
    new HeartData('ancient_city', 'anci', `${heartItemNamePrefix}ancient_city`, abilities.ancient_cityAbility, ['§r§4On heart damage:', '§o§uActivates a Warden', '§usonic boom§r',]),
    new HeartData('bastion', 'bast', `${heartItemNamePrefix}bastion`, abilities.bastionAbility, ['§r§4On heart damage:', '§o§uSpawns baby piglin', '§ubrutes and a magic', '§ugold nugget§r',]),
    new HeartData('dungeon', 'dung', `${heartItemNamePrefix}dungeon`, abilities.dungeonAbility, ['§r§4On heart damage:', '§o§uSpawns several', '§udungeon mobs as', '§uminions§r',]),
    new HeartData('fortress', 'neth', `${heartItemNamePrefix}nether_fortress`, abilities.nether_fortressAbility, ['§r§4On heart damage:', '§o§uRains down ghast', '§ufireballs§r',]),
    new HeartData('mansion', 'wood', `${heartItemNamePrefix}woodland_mansion`, abilities.woodland_mansionAbility, ['§r§4On heart damage:', '§o§uSpawns protective', '§uEvoker fangs§r',]),
    new HeartData('mineshaft', 'mine', `${heartItemNamePrefix}mineshaft`, abilities.mineshaftAbility, ['§r§4On heart damage:', '§o§uShoots a minecart', '§uthat mines ores', '§uand logs§r',]),
    new HeartData('monument', 'ocea', `${heartItemNamePrefix}ocean_monument`, abilities.ocean_monumentAbility, ['§r§4On heart damage:', '§o§uLaunches out piercing', '§utimed Guardian mines§r',]),
    new HeartData('stronghold', 'stro', `${heartItemNamePrefix}stronghold`, abilities.strongholdAbility, ['§r§4On heart damage:', '§o§uSpawns a moving', '§uEnder Eye mob magnet§r',]),
    new HeartData('swamp_hut', 'swam', `${heartItemNamePrefix}swamp_hut`, abilities.swamp_hutAbility, ['§r§4On heart damage:', '§o§uGives a random potion', '§ueffect and turns', '§umobs into frogs§r',]),
    new HeartData('village', 'vill', `${heartItemNamePrefix}village`, abilities.villageAbility, ['§r§4On heart damage:', '§o§uSpawns emeralds in', '§ua circle around you§r',]),
    new HeartData('silverfish', 'silv', `${heartItemNamePrefix}super_silverfish`, abilities.silverfishAbility, ['§r§4On heart damage:', '§o§uBurrows you vertically', '§uthrough earth blocks§r',]),
    new HeartData('goat', 'goat', `${heartItemNamePrefix}super_goat`, abilities.goatAbility, ['§r§4On heart damage:', '§o§uDashes you forward', '§uto ram-smash mobs§r', '§uand blocks§r',]),
    new HeartData('igloo', 'iglo', `${heartItemNamePrefix}super_igloo`, abilities.iglooAbility, ['§r§4On heart damage:', '§o§uSpawns a rapid fire', '§uigloo cannon§r',]),
    new HeartData('end_portal', 'endp', `${heartItemNamePrefix}super_end_portal`, abilities.end_portalAbility, ['§r§4On heart damage:', '§o§uSpawns twamping end portal', '§upillars above monsters§r',]),
    new HeartData('dispenser', 'disp', `${heartItemNamePrefix}super_dispenser`, abilities.dispenserAbility, ['§r§4On heart damage:', '§o§uDispenses you in the', '§udirection of where you', '§uare looking§r',]),
    new HeartData('chest', 'chst', `${heartItemNamePrefix}super_chest`, abilities.chestAbility, ['§r§4On heart damage:', '§o§uSpawns a hungry chest', '§uthat eats monsters§r',]),
];
export function getHeartDataIndexFromName(name) {
    if (name === undefined) {
        return 0;
    }
    return HEART_DATA.findIndex(value => value.itemName === name);
}
