dofile( "data/scripts/lib/utilities.lua" )

local entity_id    = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )

local projectileComp = EntityGetFirstComponentIncludingDisabled(entity_id, "ProjectileComponent")
local player = ComponentGetValue2( projectileComp, "mWhoShot" ) or 0

local how_many = 1

local length = 1200

SetRandomSeed(pos_x + GameGetFrameNum(), pos_y + GameGetFrameNum())

for i=1,how_many do
    local vel_x = Random() * length
    local vel_y = Random() * length

    if(Random(0,1) == 1)then
        vel_x = -vel_x
    end

    if(Random(0,1) == 1)then
        vel_y = -vel_y
    end


   -- shoot_projectile( player, "data/entities/projectiles/deck/light_bullet.xml", pos_x + vel_x * 0.05, pos_y + vel_y * 0.05, vel_x, vel_y, false )
   local ourProjectile = shoot_projectile( player, "mods/spellbound_bundle/files/entities/projectiles/lightning_projectile.xml", pos_x, pos_y, vel_x, vel_y, false )
    
end