scoreboard players set @a movement_speed 100
# effect clear @a speed

#characters
execute as @a[tag=brawler] if score .rc_charge brawler matches 1.. run scoreboard players remove @s movement_speed 10
execute as @a[tag=brawler] if score .rc_charge brawler matches 8.. run scoreboard players remove @s movement_speed 10
execute as @a[tag=brawler] if score .rc_charge brawler matches 16.. run scoreboard players remove @s movement_speed 10
execute as @a[tag=assassin] if score .shift_duration_passive assassin matches 1.. run scoreboard players add @s movement_speed 20
execute as @a[tag=knight,scores={rc_duration_t=1..}] run scoreboard players remove @s movement_speed 50
execute as @a[tag=brawler,scores={shift_special_4=1..}] run scoreboard players add @s movement_speed 20
execute as @a[tag=sorcerer] if score .w_w sorcerer matches 1.. run scoreboard players add @s movement_speed 20
execute as @a[tag=archer] if score .shift archer matches 1.. run scoreboard players add @s movement_speed 30

##artifacts
#blue
#id3
execute as @a if score .candle_tick artifact matches 1.. run scoreboard players add @s movement_speed 25
#id18
execute as @a if score .stonebreaker_tick artifact matches 1.. run scoreboard players add @s movement_speed 20

#purple
#id13
execute as @a if score .silent_hill_tick artifact matches 1.. run scoreboard players add @s movement_speed 30

#handicraft
#id1
execute as @a if score .speeding_ticket artifact matches 1.. run scoreboard players add @s movement_speed 20

#sprint
# execute as @a[tag=sprint] run scoreboard players operation @s movement_speed += .100 number

#firework_stars
execute as @a[scores={speed_firework_star_t=1..}] run scoreboard players operation @s movement_speed += .20 number

##artifacts


#enemies
execute if score .slime arena_effect matches 1.. as @a run scoreboard players remove @s movement_speed 15
execute if score .ice_slow boss matches 1.. as @a run scoreboard players remove @s movement_speed 50
#cap
execute as @a if score @s movement_speed matches 301.. run scoreboard players set @s movement_speed 300

#characters
#sniper
execute as @a[tag=sniper,tag=sniper_rc_triggered] run scoreboard players operation @s movement_speed /= .2 number

#end
execute if entity @a[predicate=!main:movement/sprint] store result storage minecraft:movement_speed speed.x float 0.00234 run scoreboard players get @a[limit=1] movement_speed
execute if entity @a[predicate=main:movement/sprint] store result storage minecraft:movement_speed speed.x float 0.001794 run scoreboard players get @a[limit=1] movement_speed
execute store result storage minecraft:movement_speed speed.y float 0.01404 run scoreboard players get @a[limit=1] movement_speed

execute as @a run function main:settings/stats/speed/effect with storage minecraft:movement_speed speed