// General swords (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isSword = [
  "sword",
  "shortsword", "gladius", "xiphos", "kopis", "dao", "jian",
  "espada", "kampilan", "khopesh", "katzenbalger", "feder",
  "sawblade", "hawkbrand", "nameless_blade"
];

// Longsword-type swords (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isLongSword = [
  "longsword",
  "broadsword",
  "messer",
  "claymore",
  "zweihander"
];

// Saber-type swords (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isSaber = [
  "sabre",
  "saber",
  "scimitar",
  "shamshir",
  "talwar",
  "yatagan",
  "cutlass",
  "falchion"
];

// Rapier-type swords (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isRapier = [
  "rapier", "bee_stinger", "freezing_foil", "stiletto"
];

// Katana family (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isKatana = [
  "katana", "wakizashi", "tachi", "odachi", "ninjato"
];

// Greatswords & heavy fantasy blades (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isGreatSword = [
  "greatsword", "zweihander", "zweihandler", "claymore",
  "estoc", "flamebladed", "scythe", "axeblade",
  "executioner", "two_handed_messer",
  "heartstealer", "anchor", "cudgel", "starless_night", "fire_akin"
];

// Axes (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isAxe = [
  "axe", "battleaxe", "waraxe", "handaxe", "tomahawk",
  "hatchet", "greataxe", "doubleaxe", "francisca",
  "labrys", "beardedaxe",
  "longaxe", "halberdaxe",
  "firebrand", "whirlwind"
];

// Maces & blunt weapons (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isMace = [
  "mace", "morgenstern", "warhammer", "hammer", "crow_beak"
];

// Shovels (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isShovel = [
  "shovel", "spade", "trencher", "entrenchingtool",
  "mattockspade"
];

// Pickaxes (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isPickaxe = [
  "pickaxe", "pick", "warpick", "minerpick", "mattock",
  "icepick"
];

// Daggers / short blades (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isDaggers = [
  "dagger", "knife", "knives", "sickle", "stylet", "kukri", "kris", "cinquedea", "seax", "sai",
  "breaker", "sponge_striker", "truthseeker", "swift_striker", "the_beginning_and_the_end"
];

// Polearms (use typeId of the item, eg: minecraft:iron_sword === sword)
export const isPolearm = [
  "halberd", "glaive", "naginata", "partisan", "pike",
  "spear", "trident", "lance", "ranseur", "voulge",
  "billhook", "pollaxe", "ahlspiess", "bardiche",
  "guisarme", "lochaber", "yari", "daneaxe",
  "poleaxe", "fauchard", "gallowglass", "fork",
  "grave_bane", "bo_staff"
];


//features
export const ATTACK_SLOWNESS = true;//Apply slowness effect when attack (the level of slowness can be change in the Weapon Type Config)
export const ENABLE_DASHING = true;//Enable dashing feature
export const ENABLE_PARRY = true;//Enable parry feature
export const ENABLE_SLASH_EFFECT = false;//Enable slash effect feature
export const ENABLE_ATTACK_PUSH = true;//Enable push forward feature when attack
export const ENABLE_PLAYER_KNOCKBACK_RESISTANCE = true;//Enable knockback resistance feature when player being attack
export const ENABLE_HIT_CHECK = false;//Enable hit check feature [This is a wip feature (still abit janky)]
export const ENABLE_NON_COMBAT_WEAKNESS = true;//Enable weakness effect when not in combat mode
export const NON_COMBAT_WEAKNESS = 2;//The level of weakness apply when not in combat mode [Min: 0, Max 255]

export const DASH_COOLDOWN = 10; //Dash cooldown times (measure in ticks)
export const DASH_DISTANCE = 2;//The distance travel when dashing (measure in block)
//Parry cooldown config
export const PARRY_WINDOW_TICKS = 20; //the effective time of parry state (measure in ticks: 20 ticks = 1 sec)
export const PARRY_COOLDOWN_TICKS = 40; //the effective time of parry cooldown (measure in ticks: 20 ticks = 1 sec)
export const PARRY_RESISTANCE = 5;//The level of resistance apply when parry [Min: 0, Max 5]

//Weapon Type config
//example: 
// hand: { (Type of the weapon)
//         base: "animation.combat.punch_c", (Animation string [Do not change])
//         combo_stack: 3, (amount of combo need require to trigger the heavy attack)
//         cooldown: 10, (cooldown of the attack [measure in ticks])
//         combo_frame: 20, (the amount of time that available to perform the combo attack [measure in ticks])
//         moveDistance: 1.5, (distance the player will be push forward when attack [measure in blocks])
//         shake_intensity: 0.3, (camerashake amount when attack)
//         slowdown: 5, (level of slowness effect when attack [eg: slowdown 5 => slowness level 6])
//         radius: 3, (radius of the attack [measure in blocks])
//         angle: 60, (sweep angle of the attack [measure in degree])
//         sound: "cpunch" (sound effect of the attack [Do not change])
//     },
export const CombatAnimation = {
    hand: {
        base: "animation.combat.punch_c",
        combo_stack: 3,
        cooldown: 10,
        combo_frame: 20,
        moveDistance: 1.5,
        shake_intensity: 0.3,
        slowdown: 5,
        radius: 3,
        angle: 60,
        sound: "cpunch"
    },
    sword: {
        base: "animation.combat.sword_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 4,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        sound: "sword"
    },
    saber: {
        base: "animation.combat.saber_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 4,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        sound: "sword"
    },
    long_sword: {
        base: "animation.combat.long_sword_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2.5,
        radius: 5,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        sound: "sword"
    },
    axe: {
        base: "animation.combat.axe_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 4,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        duration: 25,
        sound: "sword"
    },
    pickaxe: {
        base: "animation.combat.axe_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 4,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        duration: 25,
        sound: "sword"
    },
    shovel: {
        base: "animation.combat.axe_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 4,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 15,
        duration: 25,
        sound: "sword"
    },
    spear: {
        base: "animation.combat.spear_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2.5,
        radius: 6,
        angle: 60,
        shake_intensity: 0.3,
        slowdown: 15,
        duration: 20,
        sound: "sword"
    },
    greatsword: {
        base: "animation.combat.greatsword_c",
        combo_stack: 2,
        cooldown: 25,
        combo_frame: 35,
        moveDistance: 2,
        radius: 5,
        angle: 100,
        shake_intensity: 0.5,
        slowdown: 20,
        duration: 35,
        sound: "sword"
    },
    katana: {
        base: "animation.combat.katana_c",
        combo_stack: 3,
        cooldown: 20,
        combo_frame: 30,
        moveDistance: 2,
        radius: 5,
        angle: 90,
        shake_intensity: 0.3,
        slowdown: 10,
        duration: 20,
        sound: "sword"
    },
    daggers: {
        base: "animation.combat.daggers_c",
        combo_stack: 3,
        cooldown: 10,
        combo_frame: 30,
        moveDistance: 2,
        shake_intensity: 0.3,
        slowdown: 5,
        radius: 4,
        angle: 60,
        sound: "sword"
    },
    rapier: {
        base: "animation.combat.rapier_c",
        combo_stack: 3,
        cooldown: 10,
        combo_frame: 30,
        moveDistance: 2.2,
        shake_intensity: 0.3,
        slowdown: 5,
        radius: 5,
        angle: 50,
        sound: "sword"
    }
}

//Spell item config
//example:
// "healing_potion": { (Typeid of the item. [CAN ADD NEW ITEMS TO THIS. INCLUDE ITEMS FROM ORTHER ADDONS])
//         useTime: 40, (Time in ticks when use the item [Duration])
//         effectTime: 20, (Time in ticks that the effect will be apply)
//         animation: "animation.combat.use_other", (Animations to play) [Available animations: "animation.combat.use_other", "animation.combat.use_spell", "animation.combat.use_blessing"]
//         sound: "use_spell", (Sound effect of the item when use). [Available sound: "use_spell", "use_blessing"]
//         particle: "imc_pa:heal", (Particle effect when use the item) [Available effect: "imc_pa:heal", "imc_pa:healing", "imc_pa:bless"]
//         effects: [ (List of effect will be apply when use this item)
//             { id: "regeneration", duration: 60, amplifier: 3, showParticles: true }
//         ]
//     },
export const Spell = {
    "healing_potion": { 
        useTime: 40, 
        effectTime: 20,
        animation: "animation.combat.use_other", 
        sound: "use_spell",
        particle: "imc_pa:heal",
        effects: [
            { id: "regeneration", duration: 60, amplifier: 3, showParticles: true }
        ]
    },
    "healing_spell": { 
        useTime: 40, 
        effectTime: 20,
        animation: "animation.combat.use_spell", 
        sound: "use_spell",
        particle: "imc_pa:healing",
        effects: [
            { id: "regeneration", duration: 1200, amplifier: 0, showParticles: true }
        ]
    },
    "divine_blessing": { 
        useTime: 40, 
        effectTime: 20,
        animation: "animation.combat.use_blessing", 
        sound: "use_blessing",
        particle: "imc_pa:bless",
        effects: [
            { id: "speed", duration: 1200, amplifier: 1, showParticles: true },
            { id: "strength", duration: 1200, amplifier: 1, showParticles: true }
        ]
    }
};


//These are list for plant and non solid block that use for wall collision checking (these block will be ignore when checking for wall)
//You can also add custom block or plants from other addon here

export const plantBlocks = new Set([
  // Tall grass & variations
  "tall_grass",
  "short_grass",
  "dead_bush",
  "bush",
  "fern",
  "large_fern",
  "firefly_bush",

  // Flowers
  "dandelion",
  "poppy",
  "blue_orchid",
  "allium",
  "azure_bluet",
  "red_tulip",
  "orange_tulip",
  "white_tulip",
  "pink_tulip",
  "oxeye_daisy",
  "cornflower",
  "lily_of_the_valley",
  "wither_rose",
  "sunflower",
  "lilac",
  "rose_bush",
  "peony",
  "torchflower",

  // Mushrooms
  "red_mushroom",
  "brown_mushroom",

  // Saplings
  "oak_sapling",
  "spruce_sapling",
  "birch_sapling",
  "jungle_sapling",
  "acacia_sapling",
  "dark_oak_sapling",
  "mangrove_propagule",
  "cherry_sapling",

  // Nether plants
  "crimson_fungus",
  "warped_fungus",
  "crimson_roots",
  "warped_roots",
  "nether_sprouts",

  // Other vegetation
  "seagrass",
  "tall_seagrass",
  "kelp",
  "kelp_plant",
  "cactus",
  "sugar_cane",
  "bamboo",
  "bamboo_sapling",
  "vine",
  "cave_vines",
  "cave_vines_plant",
  "weeping_vines",
  "weeping_vines_plant",
  "twisting_vines",
  "twisting_vines_plant",
  "spore_blossom",
  "hanging_roots",
  "small_dripleaf",
  "big_dripleaf",
  "big_dripleaf_stem",
  "moss_carpet",
  "moss_block",
  "pitcher_plant",       // new flower
  "pitcher_crop"         // growth stage
]);