Skip to content

Commit

Permalink
Add a death weapon to make it visible in the UI (FAForever#6029)
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored May 1, 2024
1 parent a19f0b4 commit 63a80ff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/snippets/other.6029.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6029) Display the Loyalist's death EMP weapon in the additional unit details displayed when `Show Armament Detail in Build Menu` is enabled in the settings.
11 changes: 10 additions & 1 deletion units/URL0303/URL0303_Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ URL0303 = ClassUnit(CWalkingLandUnit) {
CreateLightParticle(self, -1, self.Army, 24, 62, 'flare_lens_add_02', 'ramp_red_10')

-- apply a stun manually
local targets = GetTrueEnemyUnitsInSphere(self, self:GetPosition(), 10, categories.MOBILE - (categories.EXPERIMENTAL + categories.COMMAND))
local radius = 10
local bpWeapon = self.Blueprint.Weapon
for _, v in bpWeapon do
if v.Label == 'DeathStun' then
radius = v.DamageRadius
break
end
end

local targets = GetTrueEnemyUnitsInSphere(self, self:GetPosition(), radius, categories.MOBILE - (categories.EXPERIMENTAL + categories.COMMAND))
if targets then
for k = 1, table.getn(targets) do
local target = targets[k]
Expand Down
10 changes: 10 additions & 0 deletions units/URL0303/URL0303_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,16 @@ UnitBlueprint {
WeaponUnpacks = false,
UseFiringSolutionInsteadOfAimBone = true,
},
{
Damage = 0,
DamageFriendly = false,
DamageRadius = 10,
DamageType = "EMP",
DisplayName = "Death EMP",
DummyWeapon = true,
Label = "DeathStun",
WeaponCategory = "Death",
},
},
Wreckage = {
Blueprint = "/props/DefaultWreckage/DefaultWreckage_prop.bp",
Expand Down

0 comments on commit 63a80ff

Please sign in to comment.