#attack speed
function main:settings/stats/attack_speed/calculation {"max":10}
scoreboard players set @s weapon_combo_reset 30
scoreboard players operation @s attack_speed = @s attack_speed_max
execute at @s run teleport @s ~ ~ ~ ~ ~-5
scoreboard players set @s recoil 10
function main:mechanics/damage/enemy/calculation {"id":id1,"character":engineer,"type":"weapon","damage":25,"stat":"attack","local_bonus":0,"indicator":12}

execute if entity @s[tag=upgrade_4] run scoreboard players set .upgrade_4 engineer 0
execute at @s run playsound atmos:cannon_2 master @a ~ ~ ~ 10 1

execute at @s run function main:mechanics/raycast/raycast {"folder_location":"characters/engineer/weapon/id1","radius":"~ ~-0.15 ~ 0 0 0 5 0 force","id":id1,"particle_1":ash,"particle_2":"smoke","distance":100,"type":weapon,"positioned":"as @e[type=#main:enemies,tag=enemy,tag=!fake,dx=0] positioned ~-0.125 ~-0.125 ~-0.125 if entity @s[dx=0] positioned ~-0.75 ~-0.75 ~-0.75 if entity @s[dx=0] positioned ~0.875 ~0.875 ~0.875","character":engineer,"x":"~","y":"~","offset":"","offset_2":"","pierce":1}

function main:characters/engineer/weapon/id1/random with storage player_data 1
function main:characters/engineer/weapon/id1/random with storage player_data 1
function main:characters/engineer/weapon/id1/random with storage player_data 1
function main:characters/engineer/weapon/id1/random with storage player_data 1


execute at @s anchored eyes run function main:mechanics/particles/start {"start":"^ ^ ^","id":id1,"character":engineer,"type":weapon,"transformation":",transformation:[-2.0000f,0.0000f,-0.0000f,0.0000f,0.0000f,2.0000f,0.0000f,1.0000f,0.0000f,0.0000f,-0.1000f,0.9375f,0.0000f,0.0000f,0.0000f,1.0000f]","frames":6}
execute at @s positioned ^ ^ ^1 run function main:particles/circle_small {particle:smoke}

function main:mechanics/effects/screenshake/start {duration:3,strength:500}