diff --git a/projectiles/AIFMissileSerpentine01/AIFMissileSerpentine01_script.lua b/projectiles/AIFMissileSerpentine01/AIFMissileSerpentine01_script.lua index 378341c70f..ca172fd149 100644 --- a/projectiles/AIFMissileSerpentine01/AIFMissileSerpentine01_script.lua +++ b/projectiles/AIFMissileSerpentine01/AIFMissileSerpentine01_script.lua @@ -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) diff --git a/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_proj.bp b/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_proj.bp index 0b6db157b2..4e57519b4a 100644 --- a/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_proj.bp +++ b/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_proj.bp @@ -65,4 +65,5 @@ ProjectileBlueprint { MaxZigZag = 4, ZigZagFrequency = 0.4, }, + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds', } diff --git a/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_script.lua b/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_script.lua index c3f9792f55..6bf12d6377 100644 --- a/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_script.lua +++ b/projectiles/AIFMissileSerpentine02/AIFMissileSerpentine02_script.lua @@ -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 diff --git a/projectiles/AIFMissileSerpentine03/AIFMissileSerpentine03_Script.lua b/projectiles/AIFMissileSerpentine03/AIFMissileSerpentine03_Script.lua index d1b8aa269a..c28b188005 100644 --- a/projectiles/AIFMissileSerpentine03/AIFMissileSerpentine03_Script.lua +++ b/projectiles/AIFMissileSerpentine03/AIFMissileSerpentine03_Script.lua @@ -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 diff --git a/projectiles/AIFMissileTactical01/AIFMissileTactical01_proj.bp b/projectiles/AIFMissileTactical01/AIFMissileTactical01_proj.bp index ba056f1555..b04e46fb1a 100644 --- a/projectiles/AIFMissileTactical01/AIFMissileTactical01_proj.bp +++ b/projectiles/AIFMissileTactical01/AIFMissileTactical01_proj.bp @@ -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', } diff --git a/projectiles/AIFMissileTactical02/AIFMissileTactical02_Script.lua b/projectiles/AIFMissileTactical02/AIFMissileTactical02_Script.lua index 08b54c46f9..898b69c6d8 100644 --- a/projectiles/AIFMissileTactical02/AIFMissileTactical02_Script.lua +++ b/projectiles/AIFMissileTactical02/AIFMissileTactical02_Script.lua @@ -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 diff --git a/projectiles/AIFMissileTactical02/AIFMissileTactical02_proj.bp b/projectiles/AIFMissileTactical02/AIFMissileTactical02_proj.bp index c0708d1c93..752eb89530 100644 --- a/projectiles/AIFMissileTactical02/AIFMissileTactical02_proj.bp +++ b/projectiles/AIFMissileTactical02/AIFMissileTactical02_proj.bp @@ -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 { diff --git a/projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua b/projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua index a45b2e9481..9e24e091ad 100644 --- a/projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua +++ b/projectiles/CIFMissileTactical02/CIFMissileTactical02_Script.lua @@ -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, @@ -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 diff --git a/projectiles/CIFMissileTactical02/CIFMissileTactical02_proj.bp b/projectiles/CIFMissileTactical02/CIFMissileTactical02_proj.bp index 1adaa20660..e449a9fd88 100644 --- a/projectiles/CIFMissileTactical02/CIFMissileTactical02_proj.bp +++ b/projectiles/CIFMissileTactical02/CIFMissileTactical02_proj.bp @@ -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 { @@ -63,4 +63,5 @@ ProjectileBlueprint { ZigZagFrequency = 1, MaxZigZag = 1, }, + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds', } diff --git a/projectiles/CIFMissileTactical03/CIFMissileTactical03_Script.lua b/projectiles/CIFMissileTactical03/CIFMissileTactical03_Script.lua index 455b599fee..16c1985a37 100644 --- a/projectiles/CIFMissileTactical03/CIFMissileTactical03_Script.lua +++ b/projectiles/CIFMissileTactical03/CIFMissileTactical03_Script.lua @@ -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) @@ -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) diff --git a/projectiles/CIFMissileTactical03/CIFMissileTactical03_proj.bp b/projectiles/CIFMissileTactical03/CIFMissileTactical03_proj.bp index 6ad1f1f24a..50c7b78b75 100644 --- a/projectiles/CIFMissileTactical03/CIFMissileTactical03_proj.bp +++ b/projectiles/CIFMissileTactical03/CIFMissileTactical03_proj.bp @@ -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', } diff --git a/projectiles/SIFLaanseTacticalMissile04/SIFLaanseTacticalMissile04_proj.bp b/projectiles/SIFLaanseTacticalMissile04/SIFLaanseTacticalMissile04_proj.bp index 0679a2dac0..e15290a173 100644 --- a/projectiles/SIFLaanseTacticalMissile04/SIFLaanseTacticalMissile04_proj.bp +++ b/projectiles/SIFLaanseTacticalMissile04/SIFLaanseTacticalMissile04_proj.bp @@ -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', } diff --git a/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_proj.bp b/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_proj.bp index 0fed6922b2..954f10d7ac 100644 --- a/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_proj.bp +++ b/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_proj.bp @@ -66,4 +66,5 @@ ProjectileBlueprint { ZigZagFrequency = 1, MaxZigZag = 1 }, + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds', } diff --git a/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_script.lua b/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_script.lua index 63e29637ca..3dcfddc39c 100644 --- a/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_script.lua +++ b/projectiles/SIFLaanseTacticalMissileCDR/SIFLaanseTacticalMissileCDR_script.lua @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_proj.bp b/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_proj.bp index f79e3b7666..ac93970033 100644 --- a/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_proj.bp +++ b/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_proj.bp @@ -66,4 +66,5 @@ ProjectileBlueprint { ZigZagFrequency = 1, MaxZigZag = 1 }, + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds', } diff --git a/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_script.lua b/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_script.lua index 5b1776f28e..6e46f74e06 100644 --- a/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_script.lua +++ b/projectiles/SIFLaanseTacticalMissileSCU/SIFLaanseTacticalMissileSCU_script.lua @@ -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 XSL0301 @@ -45,7 +49,7 @@ SIFLaanseTacticalMissileSCU = ClassProjectile(SLaanseTacticalMissile, TacticalMi ---@param self SIFLaanseTacticalMissileSCU ---@param inWater boolean OnCreate = function(self, inWater) - SLaanseTacticalMissile.OnCreate(self) + SLaanseTacticalMissileOnCreate(self) if not inWater then self:SetDestroyOnWater(true) end @@ -54,8 +58,22 @@ SIFLaanseTacticalMissileSCU = ClassProjectile(SLaanseTacticalMissile, TacticalMi ---@param self SIFLaanseTacticalMissileSCU 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 = SIFLaanseTacticalMissileSCU diff --git a/projectiles/TIFMissileCruise01/TIFMissileCruise01_Script.lua b/projectiles/TIFMissileCruise01/TIFMissileCruise01_Script.lua index 72958a57b7..378054e419 100644 --- a/projectiles/TIFMissileCruise01/TIFMissileCruise01_Script.lua +++ b/projectiles/TIFMissileCruise01/TIFMissileCruise01_Script.lua @@ -54,12 +54,13 @@ TIFMissileCruise01 = ClassProjectile(TMissileCruiseProjectile) { FinalBoostAngle = 30, --- Called by the engine when the projectile impacts something - ---@param self Projectile + ---@param self TIFMissileCruise01 ---@param targetType string ---@param targetEntity Unit | Prop OnImpact = function(self, targetType, targetEntity) TMissileCruiseProjectileOnImpact(self, targetType, targetEntity) + -- create light flashes CreateLightParticleIntel(self, -1, self.Army, 7, 4, 'glow_02', 'ramp_antimatter_02') end } diff --git a/projectiles/TIFMissileCruise01/TIFMissileCruise01_proj.bp b/projectiles/TIFMissileCruise01/TIFMissileCruise01_proj.bp index a93dff3aa3..297f4babe3 100644 --- a/projectiles/TIFMissileCruise01/TIFMissileCruise01_proj.bp +++ b/projectiles/TIFMissileCruise01/TIFMissileCruise01_proj.bp @@ -75,5 +75,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', } diff --git a/projectiles/TIFMissileCruise02/TIFMissileCruise02_proj.bp b/projectiles/TIFMissileCruise02/TIFMissileCruise02_proj.bp index d4a22e9c91..d21dc3d632 100644 --- a/projectiles/TIFMissileCruise02/TIFMissileCruise02_proj.bp +++ b/projectiles/TIFMissileCruise02/TIFMissileCruise02_proj.bp @@ -2,12 +2,12 @@ ProjectileBlueprint { Audio = { Impact = Sound { Bank = 'Impacts', - Cue = 'UEF_Expl_Med_Impact', + Cue = 'UEF_Expl_Lrg_Naval', LodCutoff = 'Weapon_LodCutoff', }, ImpactTerrain = Sound { Bank = 'Impacts', - Cue = 'Impact_Land_Gen_UEF', + Cue = 'UEF_Expl_Lrg_Naval', LodCutoff = 'Weapon_LodCutoff', }, ImpactWater = Sound { @@ -80,4 +80,5 @@ ProjectileBlueprint { ZigZagFrequency = 1, MaxZigZag = 1 }, + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_missile.dds', } diff --git a/projectiles/TIFMissileCruise02/TIFMissileCruise02_script.lua b/projectiles/TIFMissileCruise02/TIFMissileCruise02_script.lua index 5a8f08cce5..081808bf59 100644 --- a/projectiles/TIFMissileCruise02/TIFMissileCruise02_script.lua +++ b/projectiles/TIFMissileCruise02/TIFMissileCruise02_script.lua @@ -21,9 +21,16 @@ --** SOFTWARE. --****************************************************************************************************** -local TMissileCruiseSubProjectile = import("/lua/terranprojectiles.lua").TMissileCruiseSubProjectile local EffectTemplate = import("/lua/effecttemplates.lua") +local TMissileCruiseSubProjectile = import("/lua/terranprojectiles.lua").TMissileCruiseSubProjectile +local TMissileCruiseSubProjectileOnCreate = TMissileCruiseSubProjectile.OnCreate +local TMissileCruiseSubProjectileOnExitWater = TMissileCruiseSubProjectile.OnExitWater +local TMissileCruiseProjectileOnImpact = TMissileCruiseSubProjectile.OnImpact + +-- upvalue scope for performance +local CreateLightParticleIntel = CreateLightParticleIntel + --- Used by ues0304 ---@class TIFMissileCruise02 : TMissileCruiseSubProjectile TIFMissileCruise02 = ClassProjectile(TMissileCruiseSubProjectile) { @@ -54,15 +61,26 @@ TIFMissileCruise02 = ClassProjectile(TMissileCruiseSubProjectile) { ---@param self TIFMissileCruise02 OnCreate = function(self) - TMissileCruiseSubProjectile.OnCreate(self) + TMissileCruiseSubProjectileOnCreate(self) self.MoveThread = self.Trash:Add(ForkThread(self.MovementThread, self)) end, ---@param self TIFMissileCruise02 OnExitWater = function(self) - TMissileCruiseSubProjectile.OnExitWater(self) + TMissileCruiseSubProjectileOnExitWater(self) self:SetDestroyOnWater(true) end, + + --- Called by the engine when the projectile impacts something + ---@param self TIFMissileCruise01 + ---@param targetType string + ---@param targetEntity Unit | Prop + OnImpact = function(self, targetType, targetEntity) + TMissileCruiseProjectileOnImpact(self, targetType, targetEntity) + + -- create light flashes + CreateLightParticleIntel(self, -1, self.Army, 7, 4, 'glow_02', 'ramp_antimatter_02') + end } TypeClass = TIFMissileCruise02 diff --git a/projectiles/TIFMissileCruiseCDR/TIFMissileCruiseCDR_proj.bp b/projectiles/TIFMissileCruiseCDR/TIFMissileCruiseCDR_proj.bp index 5ef022ccf7..dd9d2c64a2 100644 --- a/projectiles/TIFMissileCruiseCDR/TIFMissileCruiseCDR_proj.bp +++ b/projectiles/TIFMissileCruiseCDR/TIFMissileCruiseCDR_proj.bp @@ -73,5 +73,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', } diff --git a/projectiles/TIFMissileNukeCDR/TIFMissileNukeCDR_proj.bp b/projectiles/TIFMissileNukeCDR/TIFMissileNukeCDR_proj.bp index 82b3f093e7..6724e7257b 100644 --- a/projectiles/TIFMissileNukeCDR/TIFMissileNukeCDR_proj.bp +++ b/projectiles/TIFMissileNukeCDR/TIFMissileNukeCDR_proj.bp @@ -73,5 +73,5 @@ ProjectileBlueprint { ZigZagFrequency = 1, MaxZigZag = 1 }, - StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_nuke_missile.png', + StrategicIconName = '/textures/ui/common/game/strategicicons/icon_tactical_nuke_missile.dds', } diff --git a/textures/ui/common/game/strategicicons/icon_tactical_missile.dds b/textures/ui/common/game/strategicicons/icon_tactical_missile.dds new file mode 100644 index 0000000000..d19e6a6346 Binary files /dev/null and b/textures/ui/common/game/strategicicons/icon_tactical_missile.dds differ diff --git a/textures/ui/common/game/strategicicons/icon_tactical_nuke_missile.dds b/textures/ui/common/game/strategicicons/icon_tactical_nuke_missile.dds new file mode 100644 index 0000000000..31716ce47a Binary files /dev/null and b/textures/ui/common/game/strategicicons/icon_tactical_nuke_missile.dds differ