Skip to content

Commit aa05b10

Browse files
committed
Added device subgroup Tools - Breaching which will mark the device to be used against doors at a close range.
1 parent a816a0a commit aa05b10

File tree

8 files changed

+13
-16
lines changed

8 files changed

+13
-16
lines changed

Base.rte/AI/HumanBehaviors.lua

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,6 +2629,7 @@ function HumanBehaviors.ShootTarget(AI, Owner, Abort)
26292629
end
26302630

26312631
-- throw a grenade at the selected target
2632+
--TODO: This behavior should effectively have the actor close in on the target if out of range!
26322633
function HumanBehaviors.ThrowTarget(AI, Owner, Abort)
26332634
local ThrowTimer = Timer()
26342635
local aimTime = Owner.ThrowPrepTime
@@ -2839,25 +2840,18 @@ function HumanBehaviors.AttackTarget(AI, Owner, Abort)
28392840
end
28402841
-- use following sequence to attack either with a suited melee weapon or arms
28412842
local meleeDist = 0
2842-
local startPos = Vector(Owner.EyePos.X, Owner.EyePos.Y)
28432843

2844-
if Owner:EquipDeviceInGroup("Tools - Diggers", true) or Owner:EquipDeviceInGroup("Weapons - Melee", true) then
2845-
meleeDist = Owner.IndividualRadius + 25
2846-
startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y)
2847-
elseif Owner.armSway then
2848-
local arm = Owner.FGArm or Owner.BGArm
2849-
if arm then
2850-
meleeDist = arm.Radius + arm.Radius
2851-
startPos = arm.Pos
2852-
end
2844+
if Owner:EquipDeviceInGroup("Tools - Diggers", true) or Owner:EquipDeviceInGroup("Weapons - Melee", true) or Owner:EquipDeviceInGroup("Tools - Breaching", true) then
2845+
meleeDist = Owner.IndividualRadius + (IsThrownDevice(Owner.EquippedItem) and 50 or 25)
28532846
end
28542847
if meleeDist > 0 then
2848+
local startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y)
28552849
local attackPos = (AI.Target.ClassName == "ADoor" and ToADoor(AI.Target).Door and ToADoor(AI.Target).Door:IsAttached()) and ToADoor(AI.Target).Door.Pos or AI.Target.Pos
28562850
local dist = SceneMan:ShortestDistance(startPos, attackPos, false)
28572851
if dist.Magnitude < meleeDist then
28582852
AI.lateralMoveState = Actor.LAT_STILL
28592853
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.EyePos, attackPos, false).Normalized
2860-
AI.fire = true
2854+
AI.fire = not (AI.fire and IsThrownDevice(Owner.EquippedItem) and Owner.ThrowProgress == 1)
28612855
else
28622856
AI.fire = false
28632857
end

Base.rte/AI/NativeHumanAI.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,12 +727,10 @@ function NativeHumanAI:CreateAttackBehavior(Owner)
727727
local dist = SceneMan:ShortestDistance(Owner.Pos, self.Target.Pos, false).Magnitude
728728

729729
if IsADoor(self.Target) then
730-
if Owner:EquipNamedDevice("Heavy Digger", true) then
730+
--TODO: Include other explosive weapons with varying effective ranges!
731+
if Owner:EquipDeviceInGroup("Tools - Breaching", true) then
731732
self.NextBehavior = coroutine.create(HumanBehaviors.AttackTarget)
732733
self.NextBehaviorName = "AttackTarget"
733-
elseif dist < 50 and (Owner:EquipNamedDevice("Remote Explosive", true) or Owner:EquipNamedDevice("Timed Explosive", true)) then
734-
self.NextBehavior = coroutine.create(HumanBehaviors.ThrowTarget)
735-
self.NextBehaviorName = "ThrowTarget"
736734
elseif Owner.FirearmIsReady and HumanBehaviors.GetProjectileData(Owner).pen * 0.9 > (self.Target.Door or self.Target).Material.StructuralIntegrity then
737735
self.NextBehavior = coroutine.create(HumanBehaviors.ShootTarget)
738736
self.NextBehaviorName = "ShootTarget"

Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ AddMOSRotating = MOSRotating
229229
AddDevice = TDExplosive
230230
PresetName = Remote Explosive
231231
AddToGroup = Bombs
232+
AddToGroup = Tools - Breaching
232233
Description = Manually placed C4 explosives that are automatically set to operate on your team's frequency. Place the explosive against the target surface and detonate using the detonator tool. Excellent for destroying doors!
233234
Mass = 3
234235
HitsMOs = 1

Base.rte/Devices/Tools/Digger/Digger.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ AddDevice = HDFirearm
593593
PresetName = Heavy Digger
594594
AddToGroup = Tools
595595
AddToGroup = Tools - Diggers
596+
AddToGroup = Tools - Breaching
596597
Description = Heaviest and the most powerful of them all. Eats concrete with great hunger and allows you to penetrate bunker doors and walls.
597598
Mass = 10
598599
HitsMOs = 0

Browncoats.rte/Devices/Tools/Blowtorch/Blowtorch.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ AddDevice = HDFirearm
118118
PresetName = DG-1000 Blowtorch
119119
AddToGroup = Tools
120120
AddToGroup = Tools - Diggers
121+
AddToGroup = Tools - Breaching
121122
Description = Incredibly light but powerful digging device. Not the best at collecting gold, but excellent for breaching bunkers.
122123
Mass = 4.5
123124
HitsMOs = 0

Coalition.rte/Devices/Explosives/TimedExplosive/TimedExplosive.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ AddEffect = MOSRotating
124124
AddDevice = TDExplosive
125125
PresetName = Timed Explosive
126126
AddToGroup = Bombs
127+
AddToGroup = Tools - Breaching
127128
Description = Destructive plantable explosive charge. After planting, run for your life, as it explodes after 10 seconds. Excellent for destroying doors!
128129
Mass = 5
129130
RestThreshold = -1

Techion.rte/Devices/Tools/Nanolyzer/Nanolyzer.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ AddAmmo = Magazine
234234
AddDevice = HDFirearm
235235
PresetName = Nanolyzer
236236
AddToGroup = Tools
237+
AddToGroup = Tools - Breaching
237238
Description = This tool analyzes materials and destabilizes them into a gray goo, making it extremely easy to dig through. It performs at the same rate on any substance, but is slow and incapable of retrieving gold, making it ideal for breaking bunkers, but not for mining.
238239
Mass = 6
239240
HitsMOs = 0

Techion.rte/Devices/Tools/Nanolyzer/Nanolyzer.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function Update(self)
6969
local targetMO = MovableMan:GetMOFromID(ToMOSRotating(initMO).RootID);
7070
local dustTarget;
7171

72-
if targetMO and targetMO.ClassName ~= "ADoor" then
72+
if targetMO then
7373
local resistance = math.sqrt(targetMO.Radius + math.abs(targetMO.Mass) + targetMO.Material.StructuralIntegrity + 1);
7474
if IsActor(targetMO) then
7575
local actor = ToActor(targetMO);

0 commit comments

Comments
 (0)