import { world, system, EquipmentSlot} from "@minecraft/server";
import { launchPlayer } from "./../../util/movements.js";
import { weaponDamageIndicator, generateUniqueId, stunDamageIndicator } from "./../../util/utils.js";
import { attackPlayerMeikyu, executer } from "./../../util/attackMethods.js";
import { attackFramerMeikyu } from "./../../util/cameraMoves.js";

const animations =[ 
    [
        {
            animation: "minced.longsword.attack_sprint",
            knockback: [2,0.75],
            Player_Knockback: [2,0],
            type: "slash",
            attack_speed: 9,
            hit_number: 1,
            stun_type: "long",
            range: 3,
            distance: 1,
            targetNum: 3,
            damage_multiplier: 1.75,
            stun_damage_multiplier: 1,
            next_attack_time: 15,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack0",
            knockback: [0,0],
            Player_Knockback: [0.5,0],
            type: "slash",
            attack_speed: 9,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1,
            targetNum: 5,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 8,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack1",
            knockback: [0,0.25],
            Player_Knockback: [0.5,0],
            type: "slash",
            attack_speed: 9,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1,
            targetNum: 5,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 8,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack2",
            knockback: [0,0.25],
            Player_Knockback: [0.75,0.25],
            type: "pierce",
            attack_speed: 9,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1,
            targetNum: 3,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 8,
            Unbreakable: false
        }
    ]
]

const offhand =[ 
    [
        {
            animation: "minced.longsword.attack_sprint",
            knockback: [1.5,0],
            Player_Knockback: [2,0.1],
            type: "slash",
            attack_speed: 8,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 2,
            targetNum: 10,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand0",
            knockback: [0.5,0],
            Player_Knockback: [1,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand1",
            knockback: [1,0],
            Player_Knockback: [1.5,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 1.5,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand2",
            knockback: [0.25,0],
            Player_Knockback: [1,0],
            type: "pierce",
            attack_speed: 10,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 1.5,
            targetNum: 3,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        }
    ]
]

const onehand =[ 
    [
        {
            animation: "minced.longsword.attack_sprint",
            knockback: [1,0],
            Player_Knockback: [2,0.2],
            type: "slash",
            attack_speed: 8,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 2,
            targetNum: 10,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_onehand0",
            knockback: [0.5,0],
            Player_Knockback: [1,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_onehand1",
            knockback: [1,0],
            Player_Knockback: [1.5,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 1.5,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_onehand2",
            knockback: [0.25,0],
            Player_Knockback: [1,0],
            type: "pierce",
            attack_speed: 10,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 1.5,
            targetNum: 3,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        }
    ]
]

const offhandShield =[ 
    [
        {
            animation: "minced.longsword.attack_sprint",
            knockback: [1,0],
            Player_Knockback: [2,0.2],
            type: "slash",
            attack_speed: 8,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 2,
            targetNum: 10,
            damage_multiplier: 1,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand_shield",
            knockback: [0.5,0],
            Player_Knockback: [1,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand_shield1",
            knockback: [0.5,0],
            Player_Knockback: [1.5,0],
            type: "slash",
            attack_speed: 11,
            hit_number: 1,
            stun_type: "medium",
            range: 3,
            distance: 1.5,
            targetNum: 5,
            damage_multiplier: 1.5,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        },
        {
            animation: "minced.longsword.attack_offhand_shield2",
            knockback: [0.25,0],
            Player_Knockback: [1,0],
            type: "pierce",
            attack_speed: 10,
            hit_number: 1,
            stun_type: "short",
            range: 3,
            distance: 1.5,
            targetNum: 3,
            damage_multiplier: 0.75,
            stun_damage_multiplier: 1,
            next_attack_time: 5,
            Unbreakable: false
        }
    ]
]

const dual_wield =[ 
    [
        {
            attackTime: 15,
            animation: "minced.longsword.attack_sprint_longsword",
            ShowFrames: false,
            next_attack_time: 6,
            attackFrameNumber: 3,
            frames: [
                {
                    timeStamp: "checkParry",
                    FrameMode: "normal",
                    knockback: [0,1.5],
                    attack_timeFrame: 1
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 7,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 3,
                    distanceOffset: {x:0, y: 1, z: 0},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 13,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 3,
                    distanceOffset: {x:0, y: 1, z: 0},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 10,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 5,
                    distanceOffset: {x:-1, y: 1, z: -0.5},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "restore_movement",
                    FrameMode: "normal",
                    attack_timeFrame: 20
                },
            ] 
        },
        {
            attackTime: 10,
            animation: "minced.longsword.attack_longsword_0",
            ShowFrames: false,
            next_attack_time: 6,
            attackFrameNumber: 3,
            frames: [
                {
                    timeStamp: "checkParry",
                    FrameMode: "normal",
                    knockback: [0,0],
                    attack_timeFrame: 1
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 6,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:1, y: 1, z: -0.5},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 0.75,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 8,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:0, y: 1, z: 2},
                    targetNum: 10,
                    damage_multiplier: 0.75,
                    stun_damage_multiplier: 0.75,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 10,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:-1, y: 1, z: -0.5},
                    targetNum: 10,
                    damage_multiplier: 0.5,
                    stun_damage_multiplier: 1.25,
                    Unbreakable: true
                },
                {
                    timeStamp: "restore_movement",
                    FrameMode: "normal",
                    attack_timeFrame: 20
                },
            ] 
        },
        {
            attackTime: 14,
            animation: "minced.longsword.attack_longsword_1",
            ShowFrames: false,
            next_attack_time: 6,
            attackFrameNumber: 3,
            frames: [
                {
                    timeStamp: "checkParry",
                    FrameMode: "normal",
                    knockback: [0,0],
                    attack_timeFrame: 1
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 10,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:-0.5, y: 1, z: 0},
                    targetNum: 1,
                    damage_multiplier: 0.75,
                    stun_damage_multiplier: 0.75,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 12,
                    hit_number: 2,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:0, y: 1, z: 2},
                    targetNum: 2,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 14,
                    hit_number: 3,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:-0.5, y: 1, z: 0},
                    targetNum: 5,
                    damage_multiplier: 0.75,
                    stun_damage_multiplier: 0.75,
                    Unbreakable: true
                },
                {
                    timeStamp: "restore_movement",
                    FrameMode: "normal",
                    attack_timeFrame: 20
                },
            ] 
        },
        {
            attackTime: 10,
            animation: "minced.longsword.attack_longsword_2",
            ShowFrames: false,
            attackFrameNumber: 3,
            next_attack_time: 6,
            frames: [
                {
                    timeStamp: "checkParry",
                    FrameMode: "normal",
                    knockback: [0,0],
                    attack_timeFrame: 1
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 6,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2,
                    distanceOffset: {x:0, y: 2, z: 0.5},
                    targetNum: 10,
                    damage_multiplier: 0.85,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 8,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 2.5,
                    distanceOffset: {x:0, y: 1, z: 1},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 0.85,
                    Unbreakable: true
                },
                {
                    timeStamp: "add_frame",
                    FrameMode: "normal",
                    knockback: [0,0.5],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_timeFrame: 9,
                    hit_number: 1,
                    stun_type: "short",
                    knockCheck: "mp",
                    range: 5,
                    distanceOffset: {x:0, y: 1, z: 2},
                    targetNum: 10,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    Unbreakable: true
                },
                {
                    timeStamp: "restore_movement",
                    FrameMode: "normal",
                    attack_timeFrame: 10
                },
            ] 
        }
    ]
]

const weapon = {
    name: 'longsword',
    display_name: "Longsword",
    dual_wield: ["dagger","sword","longsword","rapier","shield","hand_cannon","greatsword","grand_cross"],
    type: "sword",
    can_block: true,
    block_damage: 25,
    block_power: 70,
    block_time: 4,
    clash_power: 90,
    front_dodge: [2, 0.1],
    back_dodge:[-3, 0.25],
    left_dodge:"none",
    right_dodge:"none",
    stylePrefixes: ["minced.longsword"],
    weaponSize: "medium",
    cd: 14,
    available_moves: ["flying"],
    execute(player, weapon, effect, mode, burn) {
        const cd = this.cd
        const blckdmg = this.block_damage
        let atkspd
        let lavander = weaponDamageIndicator(weapon)
        let stundamage = stunDamageIndicator(weapon.getTags())
        let critChance = Math.floor(Math.random()*9)
        let critDamage = 0
        critChance == 2 ? critDamage = Math.floor(Math.random() * lavander) : critDamage = 0
        lavander = JSON.parse(lavander) + critDamage
        let animChecker
        for(let i = animations[0].length - 1; i > 0; i--) {
            if(player.getDynamicProperty("combo") % i == 0) {
                animChecker = i
                break;
            }
        }
        let attackEffect = []
        attackEffect.push(effect)
        switch(mode) {
            case "sprint":{
                let propCheck = animations[0][0]
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback 
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                system.runTimeout(()=>{
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },atkspd)
                if(animChecker == 3) {
                    player.addEffect("slow_falling", 16, { amplifier: 3, showParticles: false })
                }
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, (animations[0].length - 1), stunD, NAT, breakable, "no cooldown",weapon, hitCount, true)
            } break;
            case "jump": {
                let propCheck = {
                    animation: "minced.longsword.attack_jump",
                    knockback: [2,0.75],
                    Player_Knockback: [1,0],
                    type: "slash",
                    attack_speed: 9,
                    hit_number: 1,
                    stun_type: "long",
                    range: 3,
                    distance: 1,
                    targetNum: 1,
                    damage_multiplier: 1,
                    stun_damage_multiplier: 1,
                    next_attack_time: 20,
                    Unbreakable: false
                }
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback 
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                system.runTimeout(()=>{
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },atkspd)
                if(animChecker == 3) {
                    player.addEffect("slow_falling", 16, { amplifier: 3, showParticles: false })
                }
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, (animations[0].length - 1), stunD, NAT, breakable, "no cooldown",weapon, hitCount, true)
            } break;
            case "offhand_shield":{
                let propCheck = offhandShield[0][animChecker]
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback
                system.runTimeout(() => {
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },3)
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, offhand[0].length - 1, stunD, NAT, breakable, "normal",weapon, hitCount, true)
            } break;
            case "offhand":{
                let propCheck = offhand[0][animChecker]
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback
                system.runTimeout(() => {
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },3)
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, offhand[0].length - 1, stunD, NAT, breakable, "normal",weapon, hitCount, false)     
            } break;
            case "onehand":{
                let propCheck = onehand[0][animChecker]
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback
                system.runTimeout(() => {
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },3)
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, offhand[0].length - 1, stunD, NAT, breakable, "normal",weapon, hitCount, false)     
            } break;
            case "dual_wield":{
                let propCheck = dual_wield[0][animChecker]
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let NAT = propCheck.next_attack_time
                if(animChecker == 3) {
                    player.addEffect("slow_falling", 16, { amplifier: 3, showParticles: false })
                }
                attackFramerMeikyu(player, propCheck, lavander, blckdmg, cd, attackEffect, (dual_wield[0].length - 1), stundamage, NAT, weapon, true)
            } break;
            case "dual_wield_sprint":{
                let propCheck = dual_wield[0][0]
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let NAT = propCheck.next_attack_time
                let leCount = 0
                let chocolat = system.runInterval(() => {
                    leCount++
                    if (leCount == 2) {
                        system.clearRun(chocolat)
                    }
                    launchPlayer(player, 2, 0.1)
                },5)
                if(animChecker == 3) {
                    player.addEffect("slow_falling", 16, { amplifier: 3, showParticles: false })
                }
                attackFramerMeikyu(player, propCheck, lavander, blckdmg, cd, attackEffect, (dual_wield[0].length - 1), stundamage, NAT, weapon, true)
            } break;
            case "execute": {
                executer(player, burn, (lavander * 200), this.name, 44)
            } break;
            default: {
                let propCheck = animations[0][animChecker]
                let knockback = propCheck.knockback
                player.playAnimation(`animation.${propCheck.animation}`)
                atkspd = propCheck.attack_speed
                let Pknockback = propCheck.Player_Knockback 
                let effects = propCheck.type
                let stun = propCheck.stun_type
                let ranger = propCheck.range
                let distil = propCheck.distance
                let tgtnm = propCheck.targetNum
                let NAT = propCheck.next_attack_time
                let stunD = stundamage * propCheck.stun_damage_multiplier
                let breakable = propCheck.Unbreakable
                let hitCount = propCheck.hit_number
                system.runTimeout(()=>{
                    launchPlayer(player, Pknockback[0], Pknockback[1])
                },atkspd)
                if(animChecker == 3) {
                    player.addEffect("slow_falling", 16, { amplifier: 3, showParticles: false })
                }
                attackPlayerMeikyu(player, ranger, (lavander * propCheck.damage_multiplier), blckdmg, cd, atkspd, distil, tgtnm, "line_target", attackEffect, knockback, stun, "", effects, (animations[0].length - 1), stunD, NAT, breakable, "no cooldown",weapon, hitCount, true)
            }
            break;
        }
    },
    setCore(player, item) {
        let Abilities = [
            {
              Id: "S1",
            },
            {
              Id: "P3",
            },
            {
              Id: "G1",
            },
            {
              Id: "B3",
            },
            {
              Id: "O0",
            }
          ]
          item.setDynamicProperty("abilities", JSON.stringify(Abilities))
          item.setDynamicProperty("fightStyle", 1)
        player.getComponent('equippable')?.setEquipment(EquipmentSlot.Mainhand, item)
    },
    getCurrentAtkspd(player) {
        let animChecker
        for(let i = (animations[0].length - 1); i > 0; i--) {
            if(player.getDynamicProperty("combo") % i == 0) {
                animChecker = i
                break;
            }
        }
        return animations[0][animChecker].attack_speed
    } 
}

export default weapon


