--TheNexusAvenger
--Runs the rocket projectile.


local Configuration = require(script:WaitForChild("Configuration"))

local FORCE_GRANULARITY = Configuration.FORCE_GRANULARITY
local BLAST_RADIUS = Configuration.BLAST_RADIUS
local BLAST_PRESSURE = Configuration.BLAST_PRESSURE * FORCE_GRANULARITY
local ROCKET_DECAY_TIME = Configuration.ROCKET_DECAY_TIME
local MAX_DAMAGE = Configuration.MAX_DAMAGE
local MIN_DAMAGE = Configuration.MIN_DAMAGE
local IGNORE_LIST = Configuration.IGNORE_LIST



local Rocket = script.Parent
local SwooshSound = Rocket:WaitForChild("SwooshSound")

local Debris = game:GetService("Debris")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ExplodeEvent = Instance.new("RemoteEvent")
ExplodeEvent.Name = "Explode"
ExplodeEvent.Parent = Rocket

local PlayerDamager = require(script:WaitForChild("PlayerDamager"))
local FiredByValue = Rocket:WaitForChild("FiredBy",10^99)
while FiredByValue.Value == nil do FiredByValue.Changed:Wait() end

local FiredPlayer = FiredByValue.Value
local FiredCharacter = FiredPlayer.Character
local Exploded = false

SwooshSound:Play()
Debris:AddItem(Rocket,ROCKET_DECAY_TIME)

for Key,Value in pairs(IGNORE_LIST) do
	if type(Key) == "string" then
		IGNORE_LIST[string.lower(Key)] = Value
	end
end


