Skip to content

Commit

Permalink
Makes strategic bombers immune to your own strats
Browse files Browse the repository at this point in the history
Friendly bombers still deal damage
  • Loading branch information
Strogoo authored and shalkya committed Oct 9, 2018
1 parent 267fe7b commit 5b49ee8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions units/UAA0304/UAA0304_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ UAA0304 = Class(AAirUnit) {
Weapons = {
Bomb = Class(AIFBombQuarkWeapon) {},
},

OnDamage = function(self, instigator, amount, vector, damageType)
if instigator:GetBlueprint().CategoriesHash.STRATEGICBOMBER and instigator:GetArmy() == self:GetArmy() then
return
end

AAirUnit.OnDamage(self, instigator, amount, vector, damageType)
end,
}

TypeClass = UAA0304
1 change: 1 addition & 0 deletions units/UAA0304/UAA0304_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ UnitBlueprint {
'RECLAIMABLE',
'SHOWATTACKRETICLE',
'OVERLAYRADAR',
'STRATEGICBOMBER',
},
CollisionOffsetZ = 0.2,
Defense = {
Expand Down
8 changes: 8 additions & 0 deletions units/UEA0304/UEA0304_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ UEA0304 = Class(TAirUnit) {
LinkedRailGun1 = Class(TAirToAirLinkedRailgun) {},
LinkedRailGun2 = Class(TAirToAirLinkedRailgun) {},
},

OnDamage = function(self, instigator, amount, vector, damageType)
if instigator:GetBlueprint().CategoriesHash.STRATEGICBOMBER and instigator:GetArmy() == self:GetArmy() then
return
end

TAirUnit.OnDamage(self, instigator, amount, vector, damageType)
end,
}

TypeClass = UEA0304
1 change: 1 addition & 0 deletions units/UEA0304/UEA0304_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ UnitBlueprint {
'SHOWATTACKRETICLE',
'OVERLAYANTIAIR',
'OVERLAYRADAR',
'STRATEGICBOMBER',
},
Defense = {
AirThreatLevel = 1.5,
Expand Down
8 changes: 8 additions & 0 deletions units/URA0304/URA0304_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@ URA0304 = Class(CAirUnit) {
CAirUnit.OnStopBeingBuilt(self,builder,layer)
self:SetScriptBit('RULEUTC_StealthToggle', true)
end,

OnDamage = function(self, instigator, amount, vector, damageType)
if instigator:GetBlueprint().CategoriesHash.STRATEGICBOMBER and instigator:GetArmy() == self:GetArmy() then
return
end

CAirUnit.OnDamage(self, instigator, amount, vector, damageType)
end,
}
TypeClass = URA0304
1 change: 1 addition & 0 deletions units/URA0304/URA0304_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ UnitBlueprint {
'SHOWATTACKRETICLE',
'OVERLAYANTIAIR',
'OVERLAYRADAR',
'STRATEGICBOMBER',
},
CollisionOffsetY = 0,
Defense = {
Expand Down
8 changes: 8 additions & 0 deletions units/XSA0304/XSA0304_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ XSA0304 = Class(SAirUnit) {
Weapons = {
Bomb = Class(SIFBombZhanaseeWeapon) {},
},

OnDamage = function(self, instigator, amount, vector, damageType)
if instigator:GetBlueprint().CategoriesHash.STRATEGICBOMBER and instigator:GetArmy() == self:GetArmy() then
return
end

SAirUnit.OnDamage(self, instigator, amount, vector, damageType)
end,
}
TypeClass = XSA0304
1 change: 1 addition & 0 deletions units/XSA0304/XSA0304_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ UnitBlueprint {
'RECLAIMABLE',
'SHOWATTACKRETICLE',
'OVERLAYRADAR',
'STRATEGICBOMBER',
},
Defense = {
AirThreatLevel = 1.5,
Expand Down

0 comments on commit 5b49ee8

Please sign in to comment.