Skip to content

Commit

Permalink
fix ACU damages
Browse files Browse the repository at this point in the history
  • Loading branch information
shalkya committed Jun 16, 2021
1 parent 3828e48 commit ac79880
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 60 deletions.
9 changes: 5 additions & 4 deletions lua/aeonprojectiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,15 @@ AQuantumDisruptorProjectile = Class(SinglePolyTrailProjectile) { -- ACU
FxImpactLand = EffectTemplate.AQuantumDisruptorHit01,

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()

DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' and targetType ~= 'Unit' then
local rotation = RandomFloat(0,2*math.pi)
local pos = self:GetPosition()
local army = self.Army

DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', 1, 1, 70, 20, army)
end

Expand Down
17 changes: 9 additions & 8 deletions lua/cybranprojectiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -687,17 +687,18 @@ CMolecularCannonProjectile = Class(SinglePolyTrailProjectile) { -- ACU
FxImpactLand = EffectTemplate.CMolecularRipperHit01,

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' and targetType ~= 'Unit' then
local rotation = RandomFloat(0,2*math.pi)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

if radius == 0 then -- to prevent OC from doing that decal
DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )
local rotation = RandomFloat(0,2*math.pi)
local army = self.Army

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', 1, 1, 100, 50, army)
CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', 1, 1, 70, 20, army)
end
end

Expand Down
50 changes: 24 additions & 26 deletions lua/seraphimprojectiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,35 +91,33 @@ SChronatronCannon = Class(MultiPolyTrailProjectile) { -- ACU
PolyTrailOffset = {0,0,0},

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

if radius == 0 then
DamageArea( self, pos, 0.5, 1, 'Force', false )
DamageArea( self, pos, 0.5, 1, 'Force', false )
else
DamageArea( self, pos, radius, 1, 'Force', false )
DamageArea( self, pos, radius, 1, 'Force', false )
end

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' and targetType ~= 'Unit' then
local rotation = RandomFloat(0,2*math.pi)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

if radius == 0 then
DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', 1, 1, 70, 20, army)
else
DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', radius+1, radius+1, 120, 70, army)
end

elseif targetType == 'Unit' then
elseif targetType == 'Unit' then --works well for small unit, but doesn't look good when shooting at exp
local radius = self.DamageData.DamageRadius

if radius ~= 0 then
local rotation = RandomFloat(0,2*math.pi)
local pos = self:GetPosition()
local army = self.Army

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', radius+1, radius+1, 120, 70, army)
end
end
Expand All @@ -139,14 +137,15 @@ SChronatronCannonOverCharge = Class(MultiPolyTrailProjectile) { -- ACU
PolyTrailOffset = {0,0,0},

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' then
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )


CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
end
Expand Down Expand Up @@ -407,17 +406,16 @@ SLaanseTacticalMissile = Class(SinglePolyTrailProjectile) { -- ACU / SACU / TML
end,

OnImpact = function(self, targetType, targetEntity)
local radius = self.DamageData.DamageRadius
local pos = self:GetPosition()
if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' then
local army = self.Army
local rotation = RandomFloat(0,2*math.pi)
local radius = self.DamageData.DamageRadius
local pos = self:GetPosition()

DamageArea(self, pos, radius, 1, 'Force', true)
DamageArea(self, pos, radius, 1, 'Force', true)


CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', radius * 2.5, radius * 2.5, 200, 90, army)
end
DamageArea(self, pos, radius, 1, 'Force', true)
DamageArea(self, pos, radius, 1, 'Force', true)

SinglePolyTrailProjectile.OnImpact(self, targetType, targetEntity)
end,
Expand Down
19 changes: 11 additions & 8 deletions lua/terranprojectiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -360,24 +360,27 @@ TLaserBotProjectile = Class(MultiPolyTrailProjectile) { -- ACU
FxImpactUnderWater = {},

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

if radius > 0 then -- OC
DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )
else
DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )
end

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' then
local rotation = RandomFloat(0,2*math.pi)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

if radius > 0 then -- OC
local rotation2 = RandomFloat(0,2*math.pi)

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

CreateDecal(pos, rotation, 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
CreateDecal(pos, rotation2, 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
else
DamageArea( self, pos, 0.5, 1, 'Force', true )
DamageArea( self, pos, 0.5, 1, 'Force', true )

CreateDecal(pos, rotation, 'scorch_001_albedo', '', 'Albedo', 1, 1, 70, 20, army)
end
end
Expand Down
11 changes: 6 additions & 5 deletions projectiles/ADFOverCharge01/ADFOverCharge01_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ TDFOverCharge01 = Class(ALaserBotProjectile, OverchargeProjectile) {
FxImpactLand = EffectTemplate.ACommanderOverchargeHit01,

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' then
local RandomFloat = import('/lua/utilities.lua').GetRandomFloat
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ CDFCannonMolecular01 = Class(CMolecularCannonProjectile, OverchargeProjectile) {
FxImpactLand = EffectTemplate.CCommanderOverchargeHit01,

OnImpact = function(self, targetType, targetEntity)
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

if targetType ~= 'Shield' and targetType ~= 'Water' and targetType ~= 'Air' and targetType ~= 'UnitAir' and targetType ~= 'Projectile' then
local RandomFloat = import('/lua/utilities.lua').GetRandomFloat
local pos = self:GetPosition()
local radius = self.DamageData.DamageRadius
local army = self.Army

DamageArea( self, pos, radius, 1, 'Force', true )
DamageArea( self, pos, radius, 1, 'Force', true )

CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
CreateDecal(pos, RandomFloat(0,2*math.pi), 'crater_radial01_albedo', '', 'Albedo', radius * 2, radius * 2, 150, 40, army)
end
Expand Down
2 changes: 1 addition & 1 deletion units/UAL0001/UAL0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ UnitBlueprint {
},
BallisticArc = 'RULEUBA_LowArc',
CollideFriendly = false,
Damage = 100,
Damage = 98, --add 2 more damage with DamageArea in projectile_script.lua
DamageType = 'Normal',
DisplayName = 'Quantum Disruptor',
FireTargetLayerCapsTable = {
Expand Down
2 changes: 1 addition & 1 deletion units/UEL0001/UEL0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ UnitBlueprint {
},
BallisticArc = 'RULEUBA_LowArc',
CollideFriendly = false,
Damage = 100,
Damage = 98, --add 2 more damage with DamageArea in projectile_script.lua
DamageType = 'Normal',
DisplayName = 'Zephyr Anti Matter Cannon',
FireTargetLayerCapsTable = {
Expand Down
2 changes: 1 addition & 1 deletion units/URL0001/URL0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ UnitBlueprint {
},
BallisticArc = 'RULEUBA_LowArc',
CollideFriendly = false,
Damage = 100,
Damage = 98, --add 2 more damage with DamageArea in projectile_script.lua
DamageType = 'Normal',
DisplayName = 'Molecular Ripper Cannon',
FireTargetLayerCapsTable = {
Expand Down
2 changes: 1 addition & 1 deletion units/XSL0001/XSL0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ UnitBlueprint {
},
BallisticArc = 'RULEUBA_LowArc',
CollideFriendly = false,
Damage = 100,
Damage = 98, --add 2 more damage with DamageArea in projectile_script.lua
DamageType = 'Normal',
DisplayName = 'Chronotron Cannon',
FireTargetLayerCapsTable = {
Expand Down

0 comments on commit ac79880

Please sign in to comment.