v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -1,5 +1,6 @@
using Barotrauma.Items.Components;
using Barotrauma.Networking;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Immutable;
@@ -532,6 +533,47 @@ namespace Barotrauma
bool removeOnDeath = msg.ReadBoolean();
info?.ChangeSavedStatValue(statType, statValue, statIdentifier, removeOnDeath, setValue: true);
}
break;
case EventType.LatchOntoTarget:
bool attached = msg.ReadBoolean();
if (attached)
{
Vector2 characterSimPos = new Vector2(msg.ReadSingle(), msg.ReadSingle());
Vector2 attachSurfaceNormal = new Vector2(msg.ReadSingle(), msg.ReadSingle());
Vector2 attachPos = new Vector2(msg.ReadSingle(), msg.ReadSingle());
int attachWallIndex = msg.ReadInt32();
UInt16 attachTargetId = msg.ReadUInt16();
if (AIController is EnemyAIController { LatchOntoAI: { } latchOntoAi })
{
var attachTargetEntity = FindEntityByID(attachTargetId);
switch (attachTargetEntity)
{
case Character attachTargetCharacter:
latchOntoAi.SetAttachTarget(attachTargetCharacter);
break;
case Structure attachTargetStructure:
latchOntoAi.SetAttachTarget(attachTargetStructure, attachPos, attachSurfaceNormal);
break;
default:
var allLevelWalls = Level.Loaded.GetAllCells();
if (attachWallIndex >= 0 && attachWallIndex <= allLevelWalls.Count)
{
latchOntoAi.SetAttachTarget(allLevelWalls[attachWallIndex]);
}
break;
}
latchOntoAi.AttachToBody(attachPos, attachSurfaceNormal, characterSimPos);
}
}
else
{
if (AIController is EnemyAIController { LatchOntoAI: { } latchOntoAi })
{
latchOntoAi.DeattachFromBody(reset: false);
}
}
break;
}
msg.ReadPadBits();