Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit a25f88a

Browse files
committed
Set AI to ignore doors of NOTEAM (they now open for everybody) and allow AHuman AI to use melee weapons in hand-to-hand
1 parent a53064c commit a25f88a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Base.rte/AI/CrabBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function CrabBehaviors.LookForTargets(AI, Owner)
4444
FoundMO = ToACRocket(FoundMO)
4545
elseif FoundMO.ClassName == "ACDropShip" then
4646
FoundMO = ToACDropShip(FoundMO)
47-
elseif FoundMO.ClassName == "ADoor" and HumanBehaviors.GetProjectileData(Owner).pen * 0.9 > ToADoor(FoundMO).Door.Material.StructuralIntegrity then
47+
elseif FoundMO.ClassName == "ADoor" and FoundMO.Team ~= Activity.NOTEAM and Owner.AIMode ~= Actor.AIMODE_SENTRY and ToADoor(FoundMO).Door and ToADoor(FoundMO).Door:IsAttached() and HumanBehaviors.GetProjectileData(Owner).pen * 0.9 > ToADoor(FoundMO).Door.Material.StructuralIntegrity then
4848
FoundMO = ToADoor(FoundMO)
4949
elseif FoundMO.ClassName == "Actor" then
5050
FoundMO = ToActor(FoundMO)

Base.rte/AI/HumanBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ function HumanBehaviors.ShootTarget(AI, Owner, Abort)
23242324
aimTarget = Dist.AbsRadAngle
23252325
AI.canHitTarget = true
23262326
if Owner.InventorySize > 0 then -- we have more things in the inventory
2327-
if range < 60 and Owner:HasObjectInGroup("Tools - Diggers") then
2327+
if range < 60 and (Owner:HasObjectInGroup("Tools - Diggers") or Owner:HasObjectInGroup("Weapons - Melee")) then
23282328
AI:CreateHtHBehavior(Owner)
23292329
break
23302330
elseif Owner:EquipLoadedFirearmInGroup("Any", "Weapons - Explosive", true) then

Base.rte/AI/NativeHumanAI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function NativeHumanAI:Update(Owner)
278278
FoundMO = ToACRocket(FoundMO)
279279
elseif FoundMO.ClassName == "ACDropShip" then
280280
FoundMO = ToACDropShip(FoundMO)
281-
elseif FoundMO.ClassName == "ADoor" and Owner.AIMode ~= Actor.AIMODE_SENTRY and ToADoor(FoundMO).Door and ToADoor(FoundMO).Door:IsAttached() then
281+
elseif FoundMO.ClassName == "ADoor" and FoundMO.Team ~= Activity.NOTEAM and Owner.AIMode ~= Actor.AIMODE_SENTRY and ToADoor(FoundMO).Door and ToADoor(FoundMO).Door:IsAttached() then
282282
FoundMO = ToADoor(FoundMO)
283283
elseif FoundMO.ClassName == "Actor" then
284284
FoundMO = ToActor(FoundMO)
@@ -790,7 +790,7 @@ end
790790

791791
-- force the use of a digger when attacking
792792
function NativeHumanAI:CreateHtHBehavior(Owner) -- has to be digger, not just "tool"
793-
if Owner.AIMode ~= Actor.AIMODE_SQUAD and self.Target and Owner:HasObjectInGroup("Tools - Diggers") then --Owner:EquipDiggingTool(true) then
793+
if Owner.AIMode ~= Actor.AIMODE_SQUAD and self.Target and (Owner:HasObjectInGroup("Tools - Diggers") or Owner:HasObjectInGroup("Weapons - Melee")) then
794794
self.NextBehavior = coroutine.create(HumanBehaviors.AttackTarget)
795795
self.NextBehaviorName = "AttackTarget"
796796
self.NextCleanup = function(AI)

0 commit comments

Comments
 (0)