Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move classes of Cybran projectiles to separate files #5669

Closed
wants to merge 10 commits into from
1 change: 1 addition & 0 deletions changelog/snippets/other.5669.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#5669) Move the Classes of Cybran Projectiles to separate Files.
894 changes: 67 additions & 827 deletions lua/cybranprojectiles.lua

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions lua/sim/projectiles/cybran/CAADissidentProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local SinglePolyTrailProjectile = import('/lua/sim/defaultprojectiles.lua').SinglePolyTrailProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- CYBRAN DISSIDENT PROJECTILE
---@class CAADissidentProjectile : SinglePolyTrailProjectile
CAADissidentProjectile = ClassProjectile(SinglePolyTrailProjectile) {
PolyTrail = '/effects/emitters/electron_bolter_trail_01_emit.bp',
FxTrails = {'/effects/emitters/electron_bolter_munition_01_emit.bp',},
FxImpactUnit = EffectTemplate.TMissileHit01,
FxImpactProp = EffectTemplate.TMissileHit01,
FxImpactLand = EffectTemplate.TMissileHit01,
FxImpactProjectile = EffectTemplate.TMissileHit01,
}
32 changes: 32 additions & 0 deletions lua/sim/projectiles/cybran/CAAElectronBurstCloudProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local SinglePolyTrailProjectile = import("/lua/sim/defaultprojectiles.lua").SinglePolyTrailProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- ELECTRON BURST CLOUD PROJECTILE
---@class CAAElectronBurstCloudProjectile : SinglePolyTrailProjectile
CAAElectronBurstCloudProjectile = ClassProjectile(SinglePolyTrailProjectile) {
PolyTrail = '/effects/emitters/default_polytrail_02_emit.bp',
FxImpactAirUnit = EffectTemplate.CElectronBurstCloud01,
FxImpactNone = EffectTemplate.CElectronBurstCloud01,
}
39 changes: 39 additions & 0 deletions lua/sim/projectiles/cybran/CAAMissileNaniteProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local EffectTemplate = import("/lua/effecttemplates.lua")
local SingleCompositeEmitterProjectile = import("/lua/sim/defaultprojectiles.lua").SingleCompositeEmitterProjectile

--- NANITE MISSILE PROJECTILE
---@class CAAMissileNaniteProjectile : SingleCompositeEmitterProjectile
CAAMissileNaniteProjectile = ClassProjectile(SingleCompositeEmitterProjectile) {
FxTrailOffset = -0.05,
PolyTrail = EffectTemplate.CNanoDartPolyTrail01,
BeamName = '/effects/emitters/missile_nanite_exhaust_beam_01_emit.bp',
FxUnitHitScale = 0.5,
FxImpactAirUnit = EffectTemplate.CNanoDartUnitHit01,
FxImpactNone = EffectTemplate.CNanoDartUnitHit01,
FxImpactUnit = EffectTemplate.CNanoDartUnitHit01,
FxImpactProp = EffectTemplate.CNanoDartUnitHit01,
FxLandHitScale = 0.5,
FxImpactLand = EffectTemplate.CMissileHit01,
}
27 changes: 27 additions & 0 deletions lua/sim/projectiles/cybran/CAAMissileNaniteProjectile03.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local CAAMissileNaniteProjectile = import('/lua/sim/projectiles/cybran/CAAMissileNaniteProjectile.lua')

--- NANITE MISSILE PROJECTILE
---@class CAAMissileNaniteProjectile03 : CAAMissileNaniteProjectile
CAAMissileNaniteProjectile03 = ClassProjectile(CAAMissileNaniteProjectile) {}
34 changes: 34 additions & 0 deletions lua/sim/projectiles/cybran/CAANanoDartProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local SinglePolyTrailProjectile = import('/lua/sim/defaultprojectiles.lua').SinglePolyTrailProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- NANODART PROJECTILE
---@class CAANanoDartProjectile : SinglePolyTrailProjectile
CAANanoDartProjectile = ClassProjectile(SinglePolyTrailProjectile) {
FxImpactTrajectoryAligned = false,
PolyTrail= EffectTemplate.CNanoDartPolyTrail01,
FxImpactAirUnit = EffectTemplate.CNanoDartUnitHit01,
FxImpactUnit = EffectTemplate.CNanoDartUnitHit01,
FxImpactLand = EffectTemplate.CNanoDartLandHit01,
}
30 changes: 30 additions & 0 deletions lua/sim/projectiles/cybran/CAANanoDartProjectile02.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local CAANanoDartProjectile = import('/lua/sim/projectiles/cybran/CAANanoDartProjectile.lua').CAANanoDartProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- NANODART PROJECTILE
---@class CAANanoDartProjectile02 : CAANanoDartProjectile
CAANanoDartProjectile02 = ClassProjectile(CAANanoDartProjectile) {
PolyTrail= EffectTemplate.CNanoDartPolyTrail02,
}
33 changes: 33 additions & 0 deletions lua/sim/projectiles/cybran/CAANanoDartProjectile03.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local CAANanoDartProjectile = import('/lua/sim/projectiles/cybran/CAANanoDartProjectile.lua').CAANanoDartProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- NANODART PROJECTILE
--- adjustment to make the effects for URL0104 cheaper
---@class CAANanoDartProjectile03 : CAANanoDartProjectile
CAANanoDartProjectile03 = ClassProjectile(CAANanoDartProjectile) {
FxImpactAirUnit = EffectTemplate.CNanoDartUnitHit02,
FxImpactUnit = EffectTemplate.CNanoDartUnitHit02,
FxImpactLand = EffectTemplate.CNanoDartLandHit02,
}
33 changes: 33 additions & 0 deletions lua/sim/projectiles/cybran/CArtilleryProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local EmitterProjectile = import('/lua/sim/defaultprojectiles.lua').EmitterProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")

--- CYBRAN ARTILLERY PROJECILES
---@class CArtilleryProjectile : EmitterProjectile
CArtilleryProjectile = ClassProjectile(EmitterProjectile) {
FxTrails = {'/effects/emitters/mortar_munition_03_emit.bp',},
FxImpactUnit = EffectTemplate.CNanoDartUnitHit01,
FxImpactProp = EffectTemplate.CArtilleryHit01,
FxImpactLand = EffectTemplate.CArtilleryHit01,
}
46 changes: 46 additions & 0 deletions lua/sim/projectiles/cybran/CArtilleryProtonProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local SinglePolyTrailProjectile = import('/lua/sim/defaultprojectiles.lua').SinglePolyTrailProjectile
local EffectTemplate = import("/lua/effecttemplates.lua")
local EmitterProjectile = import('/lua/sim/defaultprojectiles.lua').EmitterProjectile

--- CYBRAN ARTILLERY PROJECILES
---@class CArtilleryProtonProjectile : SinglePolyTrailProjectile
CArtilleryProtonProjectile = ClassProjectile(SinglePolyTrailProjectile) {
FxImpactTrajectoryAligned = false,
PolyTrail = '/effects/emitters/default_polytrail_01_emit.bp',
FxImpactUnit = EffectTemplate.CProtonArtilleryHit01,
FxImpactProp = EffectTemplate.CProtonArtilleryHit01,
FxImpactLand = EffectTemplate.CProtonArtilleryHit01,

---@param self CArtilleryProtonProjectile
---@param targetType string
---@param targetEntity Unit
OnImpact = function(self, targetType, targetEntity)
local army = self.Army

EmitterProjectile.OnImpact(self, targetType, targetEntity)
CreateLightParticle( self, -1, army, 7, 12, 'glow_03', 'ramp_red_06' )
CreateLightParticle( self, -1, army, 7, 22, 'glow_03', 'ramp_antimatter_02' )
end,
}
33 changes: 33 additions & 0 deletions lua/sim/projectiles/cybran/CBeamProjectile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
------------------------------------------------------------------------------------
-- Copyright (c) 2023 FAForever
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
------------------------------------------------------------------------------------

local NullShell = import('/lua/sim/defaultprojectiles.lua').NullShell
local EffectTemplate = import("/lua/effecttemplates.lua")

--- CYBRAN BEAM PROJECILES
---@class CBeamProjectile : NullShell
CBeamProjectile = ClassProjectile(NullShell) {
FxUnitHitScale = 0.5,
FxImpactUnit = EffectTemplate.CBeamHitUnit01,
FxImpactProp = EffectTemplate.CBeamHitUnit01,
FxImpactLand = EffectTemplate.CBeamHitLand01,
}
Loading