v1.6.17.0 (Unto the Breach update)

This commit is contained in:
Regalis11
2024-10-22 17:29:04 +03:00
parent e74b3cdb17
commit 6e6c17e100
417 changed files with 17166 additions and 5870 deletions
@@ -1,4 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using System.Linq;
@@ -56,7 +56,16 @@ namespace Barotrauma
private float distance;
public TriggerAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
public TriggerAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element)
{
if (element.GetAttribute(nameof(TagAction.IgnoreIncapacitatedCharacters)) != null)
{
DebugConsole.AddWarning(
$"Potential error in {nameof(TriggerAction)}, event \"{parentEvent.Prefab.Identifier}\": "+
$"{nameof(TagAction.IgnoreIncapacitatedCharacters)} is a property of {nameof(TagAction)}, did you mean {nameof(DisableIfTargetIncapacitated)}?",
contentPackage: element.ContentPackage);
}
}
private bool isFinished = false;
public override bool IsFinished(ref string goTo)
@@ -157,13 +166,13 @@ namespace Barotrauma
Item item = null;
if (e1 is Character char1)
{
if (char1.IsBot)
{
npc ??= char1;
if (char1.IsPlayer)
{
player = char1;
}
else
{
player = char1;
else
{
npc ??= char1;
}
}
else
@@ -172,13 +181,13 @@ namespace Barotrauma
}
if (e2 is Character char2)
{
if (char2.IsBot)
{
npc ??= char2;
}
else
if (char2.IsPlayer)
{
player = char2;
player = char2;
}
else
{
npc ??= char2;
}
}
else
@@ -190,6 +199,10 @@ namespace Barotrauma
{
if (npc != null)
{
if (!npcsOrItems.Any(n => n.TryGet(out Character npc2) && npc2 == npc))
{
npcsOrItems.Add(npc);
}
if (npc.CampaignInteractionType == CampaignMode.InteractionType.Talk)
{
//if the NPC has a conversation available, don't assign the trigger until the conversation is done
@@ -197,10 +210,6 @@ namespace Barotrauma
}
else if (npc.CampaignInteractionType != CampaignMode.InteractionType.Examine)
{
if (!npcsOrItems.Any(n => n.TryGet(out Character npc2) && npc2 == npc))
{
npcsOrItems.Add(npc);
}
npc.CampaignInteractionType = CampaignMode.InteractionType.Examine;
npc.RequireConsciousnessForCustomInteract = DisableIfTargetIncapacitated;
#if CLIENT
@@ -339,7 +348,7 @@ namespace Barotrauma
return true;
}
}
else if (c.AIController is EnemyAIController enemyAI && (enemyAI.State == AIState.Aggressive || enemyAI.State == AIState.Attack))
else if (c.AIController is EnemyAIController { State: AIState.Aggressive or AIState.Attack } enemyAI)
{
if (enemyAI.SelectedAiTarget?.Entity == character || c.CurrentHull == character.CurrentHull)
{
@@ -401,10 +410,18 @@ namespace Barotrauma
{
if (TargetModuleType.IsEmpty)
{
string targetStr = "none";
if (npcsOrItems.Any())
{
targetStr = string.Join(", ",
npcsOrItems.Select(npcOrItem =>
npcOrItem.TryGet(out Character character) ? character.Name : (npcOrItem.TryGet(out Item item) ? item.Name : "none")));
}
return
$"{ToolBox.GetDebugSymbol(isFinished, isRunning)} {nameof(TriggerAction)} -> (" +
(WaitForInteraction ?
$"Selected non-player target: {(npcsOrItems?.ToString() ?? "<null>").ColorizeObject()}, " :
$"Selected non-player target: {targetStr.ColorizeObject()}, " :
$"Distance: {((int)distance).ColorizeObject()}, ") +
$"Radius: {Radius.ColorizeObject()}, " +
$"TargetTags: {Target1Tag.ColorizeObject()}, " +