Skip to content

Commit

Permalink
Rework (sound) effects of valuable tactical missiles (FAForever#5961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored Mar 10, 2024
1 parent 4beca38 commit 3b80c07
Show file tree
Hide file tree
Showing 24 changed files with 256 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@

--******************************************************************************************************
--** Copyright (c) 2024 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 AMissileSerpentineProjectile = import("/lua/aeonprojectiles.lua").AMissileSerpentineProjectile

--- Used by ual0111 (T2 Mobile Missile Launcher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ ProjectileBlueprint {
MaxZigZag = 4,
ZigZagFrequency = 0.4,
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
--******************************************************************************************************
--** Copyright (c) 2024 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 AMissileSerpentineProjectile = import("/lua/aeonprojectiles.lua").AMissileSerpentineProjectile
local AMissileSerpentineProjectileOnImpact = AMissileSerpentineProjectile.OnImpact

local EffectTemplate = import("/lua/effecttemplates.lua")

--- Used by UAS0304 (T3 Stategic Missile Submarine)
---@class AIFMissileSerpentine02 : AMissileSerpentineProjectile
AIFMissileSerpentine02 = ClassProjectile(AMissileSerpentineProjectile) {
FxImpactUnit = EffectTemplate.AMissileHit02,
FxImpactProp = EffectTemplate.AMissileHit02,
FxImpactLand = EffectTemplate.AMissileHit02,

FxLandHitScale = 1.65,
FxPropHitScale = 1.65,
FxUnitHitScale = 1.65,
FxWaterHitScale = 1.65,

TerminalZigZagMultiplier = 0.5,

--- Called by the engine when the projectile impacts something
---@param self Projectile
---@param targetType string
---@param targetEntity Unit | Prop
OnImpact = function(self, targetType, targetEntity)
AMissileSerpentineProjectileOnImpact(self, targetType, targetEntity)

local army = self.Army

-- create light flashes
CreateLightParticleIntel(self, -1, army, 8, 2, 'flare_lens_add_02', 'ramp_green_02')
CreateLightParticleIntel(self, -1, army, 12, 4, 'flare_lens_add_02', 'ramp_green_12')
end
}
TypeClass = AIFMissileSerpentine02
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@

--******************************************************************************************************
--** Copyright (c) 2024 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 AMissileSerpentine02Projectile = import("/lua/aeonprojectiles.lua").AMissileSerpentine02Projectile

--- Serpentine Missile 03 : XAS0306
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ ProjectileBlueprint {
MaxZigZag = 4,
ZigZagFrequency = 0.2,
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.png',
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
23 changes: 23 additions & 0 deletions projectiles/AIFMissileTactical02/AIFMissileTactical02_Script.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@

--******************************************************************************************************
--** Copyright (c) 2024 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 AMissileSerpentineProjectile = import("/lua/aeonprojectiles.lua").AMissileSerpentineProjectile

-- Aeon Land-Based Tactical Missile
Expand Down
4 changes: 2 additions & 2 deletions projectiles/AIFMissileTactical02/AIFMissileTactical02_proj.bp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ ProjectileBlueprint {
Audio = {
Impact = Sound {
Bank = 'Impacts',
Cue = 'AEON_Expl_Med_Impact',
Cue = 'AEON_Expl_Lrg_Naval',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactTerrain = Sound {
Bank = 'Impacts',
Cue = 'Impact_Land_Gen_AEON',
Cue = 'AEON_Expl_Lrg_Naval',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactWater = Sound {
Expand Down
58 changes: 56 additions & 2 deletions projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
--******************************************************************************************************
--** Copyright (c) 2024 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 CLOATacticalMissileProjectile = import("/lua/cybranprojectiles.lua").CLOATacticalMissileProjectile
local CLOATacticalMissileProjectileOnImpact = CLOATacticalMissileProjectile.OnImpact
local CLOATacticalMissileProjectileOnCreate = CLOATacticalMissileProjectile.OnCreate
local CLOATacticalMissileProjectileOnExitWater = CLOATacticalMissileProjectile.OnExitWater

-- upvalue scope for performance
local Random = Random
local CreateLightParticleIntel = CreateLightParticleIntel

local TableRandom = table.random

--- URS0304 : cybran nuke sub
--- Cybran "Loa" Tactical Missile, structure unit and sub launched variant of this projectile,
Expand All @@ -10,14 +41,37 @@ CIFMissileTactical02 = ClassProjectile(CLOATacticalMissileProjectile) {

---@param self CIFMissileTactical02
OnCreate = function(self)
CLOATacticalMissileProjectile.OnCreate(self)
CLOATacticalMissileProjectileOnCreate(self)
self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self))
end,

---@param self CIFMissileTactical02
OnExitWater = function(self)
CLOATacticalMissileProjectile.OnExitWater(self)
CLOATacticalMissileProjectileOnExitWater(self)
self:SetDestroyOnWater(true)
end,

--- Called by the engine when the projectile impacts something
---@param self CIFMissileTactical02
---@param targetType string
---@param targetEntity Unit | Prop
OnImpact = function(self, targetType, targetEntity)
CLOATacticalMissileProjectileOnImpact(self, targetType, targetEntity)

local army = self.Army

-- create light flashes
CreateLightParticleIntel(self, -1, army, 5, 12, 'glow_03', 'ramp_red_06')
CreateLightParticleIntel(self, -1, army, 5, 22, 'glow_03', 'ramp_antimatter_02')

-- create flying and burning debris for the child projectiles
local vx, _, vz = self:GetVelocity()
for k = 1, self.ChildCount do
local blueprint = TableRandom(self.DebrisBlueprints)
local pvx = 0.5 * (vx + Random() - 0.5)
local pvz = 0.5 * (vz + Random() - 0.5)
self:CreateProjectile(blueprint, 0, 0.2, 0, pvx, 0.75, pvz)
end
end
}
TypeClass = CIFMissileTactical02
9 changes: 5 additions & 4 deletions projectiles/CIFMissileTactical02/CIFMissileTactical02_proj.bp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ProjectileBlueprint {
Audio = {
Impact = Sound {
Bank = 'Impacts',
Cue = 'CYB_Expl_Med_Impact',
Bank = 'Explosions',
Cue = 'Explosion_Bomb',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactTerrain = Sound {
Bank = 'Impacts',
Cue = 'Impact_Land_Gen_CYBRAN',
Bank = 'Explosions',
Cue = 'Explosion_Bomb',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactWater = Sound {
Expand Down Expand Up @@ -63,4 +63,5 @@ ProjectileBlueprint {
ZigZagFrequency = 1,
MaxZigZag = 1,
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CIFMissileTactical03 = ClassProjectile(CLOATacticalMissileProjectile) {
end,

--- Called by the engine when the projectile impacts something
---@param self Projectile
---@param self CIFMissileTactical02
---@param targetType string
---@param targetEntity Unit | Prop
OnImpact = function(self, targetType, targetEntity)
Expand All @@ -59,7 +59,7 @@ CIFMissileTactical03 = ClassProjectile(CLOATacticalMissileProjectile) {

-- create flying and burning debris for the child projectiles
local vx, _, vz = self:GetVelocity()
for k = 1, 3 do
for k = 1, self.ChildCount do
local blueprint = TableRandom(self.DebrisBlueprints)
local pvx = 0.5 * (vx + Random() - 0.5)
local pvz = 0.5 * (vz + Random() - 0.5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ ProjectileBlueprint {
ZigZagFrequency = 1,
MaxZigZag = 1,
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.png',
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ ProjectileBlueprint {
ZigZagFrequency = 1,
MaxZigZag = 1,
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.png',
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ ProjectileBlueprint {
ZigZagFrequency = 1,
MaxZigZag = 1
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

--******************************************************************************************************
--** Copyright (c) 2022 Willem 'Jip' Wijnia
--** Copyright (c) 2024 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
Expand All @@ -22,6 +22,10 @@
--******************************************************************************************************

local SLaanseTacticalMissile = import("/lua/seraphimprojectiles.lua").SLaanseTacticalMissile
local SLaanseTacticalMissileOnImpact = SLaanseTacticalMissile.OnImpact
local SLaanseTacticalMissileOnCreate = SLaanseTacticalMissile.OnCreate
local SLaanseTacticalMissileOnExitWater = SLaanseTacticalMissile.OnExitWater

local TacticalMissileComponent = import('/lua/sim/DefaultProjectiles.lua').TacticalMissileComponent

--- Used by XSL0001
Expand All @@ -45,7 +49,7 @@ SIFLaanseTacticalMissileCDR = ClassProjectile(SLaanseTacticalMissile, TacticalMi
---@param self SIFLaanseTacticalMissileCDR
---@param inWater boolean
OnCreate = function(self, inWater)
SLaanseTacticalMissile.OnCreate(self)
SLaanseTacticalMissileOnCreate(self)
if not inWater then
self:SetDestroyOnWater(true)
end
Expand All @@ -54,9 +58,23 @@ SIFLaanseTacticalMissileCDR = ClassProjectile(SLaanseTacticalMissile, TacticalMi

---@param self SIFLaanseTacticalMissileCDR
OnExitWater = function(self)
SLaanseTacticalMissile.OnExitWater(self)
SLaanseTacticalMissileOnExitWater(self)
self:SetDestroyOnWater(true)
end,

--- Called by the engine when the projectile impacts something
---@param self Projectile
---@param targetType string
---@param targetEntity Unit | Prop
OnImpact = function(self, targetType, targetEntity)
SLaanseTacticalMissileOnImpact(self, targetType, targetEntity)

local army = self.Army

-- create light flashes
CreateLightParticleIntel(self, -1, army, 6, 2, 'flare_lens_add_02', 'ramp_blue_build_spray')
CreateLightParticleIntel(self, -1, army, 10, 4, 'flare_lens_add_02', 'ramp_ser_11')
end
}
TypeClass = SIFLaanseTacticalMissileCDR

Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ ProjectileBlueprint {
ZigZagFrequency = 1,
MaxZigZag = 1
},
StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds',
}
Loading

0 comments on commit 3b80c07

Please sign in to comment.