Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/ShieldAbsorptionValues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ shieldAbsorptionValues = {
["StaticShield"] = { -- For mod support, auto-assigned if the owner has STRUCTURE category.
["Deathnuke"] = 1.0,
["Overcharge"] = 1.0,
["NukeIgnoreShields"] = 0.0,
},
}
1 change: 1 addition & 0 deletions lua/armordefinition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
---| "FireBeetleExplosion"
---| "Normal"
---| "Nuke"
---| "NukeIgnoreShields"
---| "Overcharge"
---| "Reclaimed"
---| "Spell"
Expand Down
2 changes: 1 addition & 1 deletion lua/proptree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Tree = Class(Prop) {
EntitySetMesh(self, self.Blueprint.Display.MeshBlueprintWrecked)
end

elseif type == 'Nuke' and canBurn then
elseif (type == 'Nuke' or type == 'NukeIgnoreShields') and canBurn then
-- slight chance we catch fire
if Random(1, 250) < 5 then
self:Burn()
Expand Down
10 changes: 6 additions & 4 deletions lua/sim/NukeDamage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,25 @@ NukeAOE = ClassSimple {
if self.TotalTime == 0 then
import("/lua/sim/damagearea.lua").DamageArea(instigator, pos, self.Radius, self.Damage, (damageType or 'Nuke'), true, true, brain, army)
else
ForkThread(self.SlowNuke, self, instigator, pos)
ForkThread(self.SlowNuke, self, instigator, pos, damageType)
end
end,

---@param self NukeAOE
---@param instigator Unit
---@param pos Vector
SlowNuke = function(self, instigator, pos)
---@param damageType? DamageType
SlowNuke = function(self, instigator, pos, damageType)
damageType = damageType or 'Nuke'
local ringWidth = (self.Radius / self.Ticks)
local tickLength = (self.TotalTime / self.Ticks)

-- Since we're not allowed to have an inner radius of 0 in the DamageRing function,
-- I'm manually executing the first tick of damage with a DamageArea function.
DamageArea(instigator, pos, ringWidth, self.Damage, 'Nuke', true, true)
DamageArea(instigator, pos, ringWidth, self.Damage, damageType, true, true)
WaitSeconds(tickLength)
for i = 2, self.Ticks do
DamageRing(instigator, pos, ringWidth * (i - 1), ringWidth * i, self.Damage, 'Nuke', true, true)
DamageRing(instigator, pos, ringWidth * (i - 1), ringWidth * i, self.Damage, damageType, true, true)
WaitSeconds(tickLength)
end
end,
Expand Down
2 changes: 1 addition & 1 deletion lua/system/blueprints-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function SetThreatValuesOfUnit(bp, cache)
local surfaceMult = 0.1

-- determines if we apply dps to economic or anti surface threat
local weaponIsEconomicThreat = (weapon.DamageType == 'Nuke' or weapon.ArtilleryShieldBlocks) and (not mobileUnit and weapon.MaxRadius > 150 or weapon.MinRadius > 80)
local weaponIsEconomicThreat = (weapon.DamageType == 'Nuke' or weapon.DamageType == 'NukeIgnoreShields' or weapon.ArtilleryShieldBlocks) and (not mobileUnit and weapon.MaxRadius > 150 or weapon.MinRadius > 80)

-- Anti air
if weapon.RangeCategory == 'UWRC_AntiAir' or weapon.TargetRestrictOnlyAllow == 'AIR' or StringFind(weapon.WeaponCategory or 'nope', 'Anti Air') then
Expand Down
26 changes: 25 additions & 1 deletion units/XEA0306/XEA0306_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- Summary : UEF Heavy Air Transport Script
-- Copyright © 2007 Gas Powered Games, Inc. All rights reserved.
-----------------------------------------------------------------

local explosion = import("/lua/defaultexplosions.lua")
local util = import("/lua/utilities.lua")
local WeaponsFile = import("/lua/terranweapons.lua")
Expand All @@ -13,6 +14,9 @@ local TWeapons = import("/lua/terranweapons.lua")
local TDFHeavyPlasmaCannonWeapon = TWeapons.TDFHeavyPlasmaCannonWeapon

---@class XEA0306 : AirTransport
---@field MyShield TransportShield
---@field LandingAnimManip moho.AnimationManipulator
---@field UnfoldAnim moho.AnimationManipulator
XEA0306 = ClassUnit(AirTransport) {
AirDestructionEffectBones = { 'FrontRight_Engine_Exhaust', 'FrontLeft_Engine_Exhaust', 'BackRight_Engine_Exhaust',
'BackLeft_Engine_Exhaust' },
Expand All @@ -36,6 +40,7 @@ XEA0306 = ClassUnit(AirTransport) {

EngineRotateBones = { 'FrontRight_Engine', 'FrontLeft_Engine', 'BackRight_Engine', 'BackLeft_Engine', },

---@param self XEA0306
OnCreate = function(self)
AirTransport.OnCreate(self)

Expand All @@ -44,6 +49,9 @@ XEA0306 = ClassUnit(AirTransport) {
self.UnfoldAnim:SetRate(0)
end,

---@param self XEA0306
---@param builder Unit
---@param layer Layer
OnStopBeingBuilt = function(self, builder, layer)
AirTransport.OnStopBeingBuilt(self, builder, layer)
self.EngineManipulators = {}
Expand All @@ -68,18 +76,30 @@ XEA0306 = ClassUnit(AirTransport) {
end,

-- When a unit attaches or detaches, tell the shield about it.
---@param self XEA0306
---@param attachBone Bone
---@param unit Unit
OnTransportAttach = function(self, attachBone, unit)
AirTransport.OnTransportAttach(self, attachBone, unit)
self.MyShield:AddProtectedUnit(unit)
end,

---@param self XEA0306
---@param attachBone Bone
---@param unit Unit
OnTransportDetach = function(self, attachBone, unit)
AirTransport.OnTransportDetach(self, attachBone, unit)
self.MyShield:RemoveProtectedUnit(unit)
end,


---@param self XEA0306
---@param instigator Unit
---@param amount number
---@param vector Vector
---@param damageType DamageType
OnDamage = function(self, instigator, amount, vector, damageType)
if damageType == 'Nuke' or damageType == 'Deathnuke' then
if damageType == 'Nuke' or damageType == 'Deathnuke' or damageType == 'NukeIgnoreShields' then
self.MyShield:SetContentsVulnerable(true)
end

Expand All @@ -99,10 +119,13 @@ XEA0306 = ClassUnit(AirTransport) {
end,

-- Override air destruction effects so we can do something custom here
---@param self XEA0306
---@param scale number
CreateUnitAirDestructionEffects = function(self, scale)
self:ForkThread(self.AirDestructionEffectsThread, self)
end,

---@param self XEA0306
AirDestructionEffectsThread = function(self)
local numExplosions = math.floor(table.getn(self.AirDestructionEffectBones) * 0.5)
for i = 0, numExplosions do
Expand All @@ -112,6 +135,7 @@ XEA0306 = ClassUnit(AirTransport) {
end
end,

---@param self XEA0306
GetUnitSizes = function(self)
local bp = self.Blueprint
if self:GetFractionComplete() < 1.0 then
Expand Down
2 changes: 1 addition & 1 deletion units/XSB2401/XSB2401_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ UnitBlueprint{
CollideFriendly = false,
CountedProjectile = true,
Damage = 0,
DamageType = "Nuke",
DamageType = "NukeIgnoreShields",
DisplayName = "Experimental Strategic Missile Launcher",
EnergyDrainPerSecond = 0,
EnergyRequired = 0,
Expand Down