Skip to content

Commit 8f9e72d

Browse files
committed
Merge branch 'development' into ronin-sounds
2 parents 3303019 + f9483a2 commit 8f9e72d

File tree

1,414 files changed

+473515
-94214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,414 files changed

+473515
-94214
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ concurrency:
1919
jobs:
2020
meson:
2121
uses: ./.github/workflows/meson.yml
22-
23-
msbuild:
24-
uses: ./.github/workflows/msbuild.yml
2522

26-
format:
27-
uses: ./.github/workflows/clang-format.yml
23+
msbuild:
24+
uses: ./.github/workflows/msbuild.yml

.github/workflows/meson.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
sudo pip install meson
8585
8686
- name: ccache
87-
uses: hendrikmuhs/ccache-action@v1.2.11 # Keep this at 1.2.11 until #181 or #182 is closed
87+
uses: hendrikmuhs/ccache-action@v1
8888
with:
8989
key: ${{ github.job }}-${{ matrix.os }}
9090

@@ -175,8 +175,10 @@ jobs:
175175
env:
176176
OSXCROSS_MACPORTS_MIRROR: "https://packages.macports.org"
177177
run: |
178+
echo "::group::Installing pkg-config"
179+
sudo apt install pkg-config
178180
echo "::group::Installing mac deps"
179-
omp install libsdl2 onetbb lz4 libpng minizip luajit flac
181+
omp install libsdl2 libsdl2_image onetbb lz4 libpng minizip luajit flac
180182
echo "OSXCROSS_PKG_CONFIG_PATH=${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/pkgconfig" >> $GITHUB_ENV
181183
echo "::endgroup::"
182184
echo "::group::Installing meson"
@@ -191,7 +193,7 @@ jobs:
191193
github_token: ${{ secrets.GITHUB_TOKEN }}
192194

193195
- name: ccache
194-
uses: hendrikmuhs/ccache-action@v1.2.11 # Keep this at 1.2.11 until #181 or #182 is closed
196+
uses: hendrikmuhs/ccache-action@v1
195197
with:
196198
key: ${{ github.job }}-${{ matrix.os }}
197199

.github/workflows/nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
- name: Update tag pointing to the previous nightly release
128128
if: steps.check_nightly.outputs.release_exists
129129
run: |
130-
curl -X PATCH \
130+
curl --fail-with-body -X PATCH \
131131
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
132132
-H "Accept: application/vnd.github.v3+json" \
133133
https://api.github.com/repos/${{ github.repository }}/git/refs/tags/${{ env.PREV_TAG }} \

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"request": "launch",
1414
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand",
1515
"cwd": "${workspaceFolder}",
16-
"preLaunchTask": "meson Build Release",
16+
"preLaunchTask": "Meson: Build all targets",
1717
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
1818
"presentation": {
1919
"group": "unix"

CHANGELOG.md

Lines changed: 175 additions & 14 deletions
Large diffs are not rendered by default.

Data/Base.rte/AI/CrabBehaviors.lua

Lines changed: 2 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function CrabBehaviors.LookForTargets(AI, Owner)
3131
FoundMO = ToACRocket(FoundMO);
3232
elseif FoundMO.ClassName == "ACDropShip" then
3333
FoundMO = ToACDropShip(FoundMO);
34-
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
34+
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 SharedBehaviors.GetProjectileData(Owner).pen * 0.9 > ToADoor(FoundMO).Door.Material.StructuralIntegrity then
3535
FoundMO = ToADoor(FoundMO);
3636
elseif FoundMO.ClassName == "Actor" then
3737
FoundMO = ToActor(FoundMO);
@@ -42,7 +42,7 @@ function CrabBehaviors.LookForTargets(AI, Owner)
4242
if FoundMO then
4343
if AI.Target then
4444
-- check if this MO should be targeted instead
45-
if HumanBehaviors.CalculateThreatLevel(FoundMO, Owner) > HumanBehaviors.CalculateThreatLevel(AI.Target, Owner) + 0.2 then
45+
if SharedBehaviors.CalculateThreatLevel(FoundMO, Owner) > SharedBehaviors.CalculateThreatLevel(AI.Target, Owner) + 0.2 then
4646
AI.OldTargetPos = Vector(AI.Target.Pos.X, AI.Target.Pos.Y);
4747
AI.Target = FoundMO;
4848
AI.TargetOffset = SceneMan:ShortestDistance(AI.Target.Pos, HitPoint, false); -- this is the distance vector from the target center to the point we hit with our ray
@@ -257,182 +257,6 @@ function CrabBehaviors.Sentry(AI, Owner, Abort)
257257
return true;
258258
end
259259

260-
-- move to the next waypoint
261-
function CrabBehaviors.GoToWpt(AI, Owner, Abort)
262-
if not Owner.MOMoveTarget then
263-
if SceneMan:ShortestDistance(Owner:GetLastAIWaypoint(), Owner.Pos, false).Largest < Owner.Height * 0.15 then
264-
Owner:ClearAIWaypoints();
265-
Owner:ClearMovePath();
266-
267-
if Owner.AIMode == Actor.AIMODE_GOTO then
268-
AI.SentryFacing = Owner.HFlipped; -- guard this direction
269-
AI.SentryPos = Vector(Owner.Pos.X, Owner.Pos.Y); -- guard this point
270-
Owner.AIMode = Actor.AIMODE_SENTRY;
271-
end
272-
273-
AI:CreateSentryBehavior(Owner);
274-
275-
return true;
276-
end
277-
end
278-
279-
local UpdatePathTimer = Timer();
280-
UpdatePathTimer:SetSimTimeLimitMS(5000);
281-
282-
local StuckTimer = Timer();
283-
StuckTimer:SetSimTimeLimitMS(2000);
284-
285-
local WptList, Waypoint, Dist, CurrDist;
286-
287-
while true do
288-
while AI.Target and Owner.FirearmIsReady do -- don't move around if we have something to shoot at
289-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
290-
if _abrt then return true end
291-
end
292-
293-
if Owner.Vel:MagnitudeIsGreaterThan(2) then
294-
StuckTimer:Reset();
295-
end
296-
297-
if Owner.MOMoveTarget then -- make the last waypoint marker stick to the MO we are following
298-
if MovableMan:ValidMO(Owner.MOMoveTarget) then
299-
Owner:RemoveMovePathEnd();
300-
Owner:AddToMovePathEnd(Owner.MOMoveTarget.Pos);
301-
else
302-
Owner.MOMoveTarget = nil;
303-
end
304-
end
305-
306-
if UpdatePathTimer:IsPastSimTimeLimit() then
307-
UpdatePathTimer:Reset();
308-
AI.deviceState = AHuman.STILL;
309-
AI.lateralMoveState = Actor.LAT_STILL;
310-
Waypoint = nil;
311-
WptList = nil;
312-
elseif StuckTimer:IsPastSimTimeLimit() then -- dislodge
313-
StuckTimer:Reset();
314-
if AI.lateralMoveState == Actor.LAT_LEFT then
315-
AI.lateralMoveState = Actor.LAT_RIGHT;
316-
elseif AI.lateralMoveState == Actor.LAT_LEFT then
317-
AI.lateralMoveState = Actor.LAT_LEFT;
318-
else
319-
AI.lateralMoveState = math.random(Actor.LAT_LEFT, Actor.LAT_RIGHT);
320-
end
321-
elseif WptList then -- we have a list of waypoints, folow it
322-
if not WptList[1] and not Waypoint then -- arrived
323-
if Owner.MOMoveTarget then -- following actor
324-
if MovableMan:ValidMO(Owner.MOMoveTarget) then
325-
local Trace = SceneMan:ShortestDistance(Owner.Pos, Owner.MOMoveTarget.Pos, false);
326-
-- stop here if the MOMoveTarget is close and in LOS
327-
if Trace.Largest < Owner.Height * 0.5 + Owner.MOMoveTarget.Radius and SceneMan:CastStrengthRay(Owner.Pos, Trace, 5, Vector(), 4, rte.grassID, true) then
328-
while true do
329-
AI.lateralMoveState = Actor.LAT_STILL;
330-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
331-
if _abrt then return true end
332-
333-
if Owner.MOMoveTarget and MovableMan:ValidMO(Owner.MOMoveTarget) then
334-
Trace = SceneMan:ShortestDistance(Owner.Pos, Owner.MOMoveTarget.Pos, false);
335-
if Trace.Largest > Owner.Height * 0.7 + Owner.MOMoveTarget.Radius then
336-
Waypoint = {Pos = Owner.MOMoveTarget.Pos};
337-
break;
338-
end
339-
end
340-
end
341-
else
342-
WptList = nil; -- update the path
343-
break;
344-
end
345-
end
346-
else -- moving towards a scene point
347-
if SceneMan:ShortestDistance(Owner:GetLastAIWaypoint(), Owner.Pos, false).Largest < Owner.Height * 0.4 then
348-
if Owner.AIMode == Actor.AIMODE_GOTO then
349-
AI.SentryFacing = Owner.HFlipped; -- guard this direction
350-
AI.SentryPos = Vector(Owner.Pos.X, Owner.Pos.Y); -- guard this point
351-
AI:CreateSentryBehavior(Owner);
352-
end
353-
354-
Owner:ClearAIWaypoints();
355-
Owner:ClearMovePath();
356-
357-
break;
358-
end
359-
end
360-
else
361-
if not Waypoint then -- get the next waypoint in the list
362-
UpdatePathTimer:Reset();
363-
Waypoint = table.remove(WptList, 1);
364-
if WptList[1] then
365-
Owner:RemoveMovePathBeginning();
366-
elseif not Owner.MOMoveTarget and SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false):MagnitudeIsLessThan(Owner.MoveProximityLimit) then -- the last waypoint
367-
Owner:ClearMovePath();
368-
WptList = nil;
369-
Waypoint = nil;
370-
end
371-
end
372-
373-
if Waypoint then
374-
CurrDist = SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false);
375-
if CurrDist.X < -3 then
376-
AI.lateralMoveState = Actor.LAT_LEFT;
377-
elseif CurrDist.X > 3 then
378-
AI.lateralMoveState = Actor.LAT_RIGHT;
379-
end
380-
381-
if CurrDist:MagnitudeIsLessThan(Owner.MoveProximityLimit) then
382-
Waypoint = nil;
383-
end
384-
end
385-
end
386-
else -- no waypoint list, create one
387-
local TmpList = {};
388-
table.insert(TmpList, {Pos=Owner.Pos});
389-
390-
Owner:UpdateMovePath();
391-
392-
-- wait until movepath is updated
393-
while Owner.IsWaitingOnNewMovePath do
394-
local _ai, _ownr, _abrt = coroutine.yield();
395-
if _abrt then return true end
396-
end
397-
398-
Owner:DrawWaypoints(true);
399-
400-
for WptPos in Owner.MovePath do -- skip any waypoint too close to the previous one
401-
if SceneMan:ShortestDistance(TmpList[#TmpList].Pos, WptPos, false):MagnitudeIsGreaterThan(10) then
402-
table.insert(TmpList, {Pos=WptPos});
403-
end
404-
end
405-
406-
if #TmpList < 3 then
407-
Dist = nil;
408-
if TmpList[2] then
409-
Dist = SceneMan:ShortestDistance(TmpList[2].Pos, Owner.Pos, false);
410-
end
411-
412-
-- already at the target
413-
if not Dist or Dist:MagnitudeIsLessThan(25) then
414-
Owner:ClearMovePath();
415-
break;
416-
end
417-
end
418-
419-
WptList = TmpList;
420-
421-
-- create the move path seen on the screen
422-
Owner:ClearMovePath();
423-
for _, Wpt in pairs(TmpList) do
424-
Owner:AddToMovePathEnd(Wpt.Pos);
425-
end
426-
end
427-
428-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
429-
if _abrt then return true end
430-
end
431-
432-
return true;
433-
end
434-
435-
436260
-- open fire on the selected target
437261
function CrabBehaviors.ShootTarget(AI, Owner, Abort)
438262
if not MovableMan:ValidMO(AI.Target) then

0 commit comments

Comments
 (0)