@@ -17,17 +17,21 @@

WPN.MaxTier = 1

WPN.MaxPower = { 1, 1 }
WPN.MaxCharge = { 1, 1 }
WPN.ShotCharge = { 1, 1 }
WPN.MaxPower = 1
WPN.MaxCharge = 1
WPN.ShotCharge = 1

WPN.Projectile = false

WPN.BaseDamage = { 0, 0 }
WPN.PierceRatio = { 0, 0 }
WPN.ShieldMult = { 0, 0 }
WPN.BaseDamage = 0
WPN.PierceRatio = 0
WPN.ShieldMult = 0

WPN.CanSpawn = false
WPN.PersonnelMult = 1

WPN.LifeSupportModuleMult = 1
WPN.ShieldModuleMult = 1
WPN.PowerModuleMult = 1

if CLIENT then
WPN.FullName = "Unnamed"
@@ -36,8 +40,14 @@ end

function WPN:_FindValue(values)
if type(values) == "number" then return values end
if #values == 1 then return values[1] end
if self.MaxTier == 1 then return (values[1] + values[2]) * 0.5 end
local t = (self:GetTier() - 1) / (self.MaxTier - 1)

if #values == 3 then
t = math.pow(t, values[3])
end

return values[1] + t * (values[2] - values[1])
end

@@ -69,6 +79,22 @@ function WPN:GetShieldMultiplier()
return self:_FindValue(self.ShieldMult)
end

function WPN:GetPersonnelMultiplier()
return self:_FindValue(self.PersonnelMult)
end

function WPN:GetLifeSupportModuleMultiplier()
return self:_FindValue(self.LifeSupportModuleMult)
end

function WPN:GetShieldModuleMultiplier()
return self:_FindValue(self.ShieldModuleMult)
end

function WPN:GetPowerModuleMultiplier()
return self:_FindValue(self.PowerModuleMult)
end

if SERVER then
local shieldedSounds = {
"weapons/physcannon/energy_disintegrate4.wav",
@@ -82,6 +108,19 @@ if SERVER then
dmg:SetDamageType(DMG_BLAST)
dmg:SetDamage(damage)

if target:IsPlayer() then
dmg:ScaleDamage(self:GetPersonnelMultiplier())
elseif target:GetClass() == "prop_ff_module" then
local t = target:GetModuleType()
if t == moduletype.LIFE_SUPPORT then
dmg:ScaleDamage(self:GetLifeSupportModuleMultiplier())
elseif t == moduletype.SHIELDS then
dmg:ScaleDamage(self:GetShieldModuleMultiplier())
elseif t == moduletype.SYSTEM_POWER then
dmg:ScaleDamage(self:GetPowerModuleMultiplier())
end
end

return dmg
end

@@ -116,14 +155,7 @@ if SERVER then

self:OnHit(closest)
elseif obj:GetObjectType() == objtype.MODULE then
local mdl = obj:GetModule()
if IsValid(mdl) and mdl:GetClass() == "prop_ff_module" then
mdl:DamageRandomTiles(math.ceil(self:GetBaseDamage() / 10))
end
if not IsValid(mdl) or mdl:GetClass() == "prop_ff_weaponmodule" or mdl:GetDamaged() >= 16 then
if IsValid(mdl) then mdl:Remove() end
obj:Remove()
end
obj:Remove()
elseif obj:GetObjectType() == objtype.MISSILE then
obj:Remove()
end
@@ -0,0 +1,55 @@
-- Copyright (c) 2014 Alex Wlach (nightmarex91@gmail.com)
--
-- This file is part of Final Frontier.
--
-- Final Frontier is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- Final Frontier is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with Final Frontier. If not, see <http://www.gnu.org/licenses/>.

local BASE = "base"

WPN.BaseName = BASE

WPN.Projectile = true

WPN.Homing = true
WPN.Speed = { 1 / 8, 1 / 4 }
WPN.Lateral = { 0.4, 1 }
WPN.LifeTime = { 12, 24 }

WPN.PersonnelMult = 0

WPN.LifeSupportModuleMult = 0
WPN.ShieldModuleMult = 4
WPN.PowerModuleMult = 0

function WPN:IsHoming()
return self.Homing
end

function WPN:GetSpeed()
return self:_FindValue(self.Speed)
end

function WPN:GetLateral()
return self:_FindValue(self.Lateral)
end

function WPN:GetLifeTime()
return self:_FindValue(self.LifeTime)
end

if SERVER then
function WPN:OnShoot(ship, target, rot)
weapon.LaunchMissile(ship, self, target, rot)
end
end
@@ -0,0 +1,49 @@
-- Copyright (c) 2014 Alex Wlach (nightmarex91@gmail.com)
--
-- This file is part of Final Frontier.
--
-- Final Frontier is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- Final Frontier is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with Final Frontier. If not, see <http://www.gnu.org/licenses/>.

local BASE = "base"

WPN.BaseName = BASE

WPN.Projectile = true

WPN.Homing = true
WPN.Speed = { 1 / 2, 1 / 2 }
WPN.Lateral = { 1, 1 }
WPN.LifeTime = { 64, 64 }

function WPN:IsHoming()
return self.Homing
end

function WPN:GetSpeed()
return self:_FindValue(self.Speed)
end

function WPN:GetLateral()
return self:_FindValue(self.Lateral)
end

function WPN:GetLifeTime()
return self:_FindValue(self.LifeTime)
end

if SERVER then
function WPN:OnShoot(ship, target, rot)
weapon.LaunchMissile(ship, self, target, rot)
end
end
@@ -0,0 +1,46 @@
-- Copyright (c) 2014 Alex Wlach (nightmarex91@gmail.com)
--
-- This file is part of Final Frontier.
--
-- Final Frontier is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- Final Frontier is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with Final Frontier. If not, see <http://www.gnu.org/licenses/>.

local BASE = "shieldbusterbase"

WPN.BaseName = BASE
WPN.CanSpawn = true

WPN.MaxTier = 10

WPN.MaxPower = { 0.5, 4 }
WPN.MaxCharge = { 8, 16 }
WPN.ShotCharge = { 2, 4 }

WPN.Homing = true
WPN.Speed = { 1 / 6, 1 / 1 }
WPN.Lateral = { 0.1, 1 }
WPN.LifeTime = { 64, 128 }

WPN.BaseDamage = { 1, 10 }
WPN.PierceRatio = { 0, 0 }

WPN.PersonnelMult = { 0, 0 }

WPN.LifeSupportModuleMult = { 0, 0 }
WPN.ShieldModuleMult = { 0, 0 }
WPN.ShieldMult = { 8, 32 }

if CLIENT then
WPN.FullName = "Project Thor"
WPN.Color = Color(231, 76, 60, 255)
end
@@ -0,0 +1,47 @@
-- Copyright (c) 2014 Alex Wlach (nightmarex91@gmail.com)
--
-- This file is part of Final Frontier.
--
-- Final Frontier is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as
-- published by the Free Software Foundation, either version 3 of
-- the License, or (at your option) any later version.
--
-- Final Frontier is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with Final Frontier. If not, see <http://www.gnu.org/licenses/>.

local BASE = "empbase"

WPN.BaseName = BASE
WPN.CanSpawn = true

WPN.MaxTier = 10

WPN.MaxPower = { 1, 4 }
WPN.MaxCharge = { 8, 16 }
WPN.ShotCharge = { 8, 16 }

WPN.Homing = true
WPN.Speed = { 1 / 10, 1 / 4 }
WPN.Lateral = { 0.4, 1 }
WPN.LifeTime = { 12, 24 }

WPN.BaseDamage = { 1, 10 }
WPN.PierceRatio = { 1, 4 }
WPN.ShieldMult = { 4, 4 }

WPN.PersonnelMult = { 0, 0 }

WPN.LifeSupportModuleMult = { 0, 0 }
WPN.ShieldModuleMult = { 0, 0 }
WPN.PowerModuleMult = { 12, 48 }

if CLIENT then
WPN.FullName = "Zeus EMP"
WPN.Color = Color(52, 152, 219, 255)
end