Faction Test 100.9.0.0
This commit is contained in:
+1
-5
@@ -30,8 +30,7 @@ namespace Barotrauma.Abilities
|
||||
NotSelf = 3,
|
||||
Alive = 4,
|
||||
Monster = 5,
|
||||
InFriendlySubmarine = 6,
|
||||
Large = 7,
|
||||
InFriendlySubmarine = 6
|
||||
};
|
||||
|
||||
protected List<TargetType> ParseTargetTypes(string[] targetTypeStrings)
|
||||
@@ -80,9 +79,6 @@ namespace Barotrauma.Abilities
|
||||
return !targetCharacter.IsHuman;
|
||||
case TargetType.InFriendlySubmarine:
|
||||
return targetCharacter.Submarine != null && targetCharacter.Submarine.TeamID == character.TeamID;
|
||||
case TargetType.Large:
|
||||
// mass of mudraptor is ~48
|
||||
return targetCharacter.AnimController is { Mass: > 50.0f };
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
+16
-8
@@ -1,21 +1,25 @@
|
||||
using System;
|
||||
using Barotrauma.Extensions;
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma.Abilities
|
||||
{
|
||||
class AbilityConditionItem : AbilityConditionData
|
||||
{
|
||||
private readonly string[] identifiers;
|
||||
private readonly string[] tags;
|
||||
private readonly ImmutableArray<Identifier> identifiers;
|
||||
private readonly ImmutableArray<Identifier> tags;
|
||||
private readonly MapEntityCategory category = MapEntityCategory.None;
|
||||
|
||||
public AbilityConditionItem(CharacterTalent characterTalent, ContentXElement conditionElement) : base(characterTalent, conditionElement)
|
||||
{
|
||||
identifiers = conditionElement.GetAttributeStringArray("identifiers", Array.Empty<string>(), convertToLowerInvariant: true);
|
||||
tags = conditionElement.GetAttributeStringArray("tags", Array.Empty<string>(), convertToLowerInvariant: true);
|
||||
identifiers = conditionElement.GetAttributeIdentifierArray("identifiers", Array.Empty<Identifier>()).ToImmutableArray();
|
||||
tags = conditionElement.GetAttributeIdentifierArray("tags", Array.Empty<Identifier>()).ToImmutableArray();
|
||||
category = conditionElement.GetAttributeEnum("category", MapEntityCategory.None);
|
||||
|
||||
if (!identifiers.Any() && !tags.Any())
|
||||
if (identifiers.None() && tags.None() && category == MapEntityCategory.None)
|
||||
{
|
||||
DebugConsole.ThrowError($"Error in talent \"{characterTalent}\". No identifiers or tags defined.");
|
||||
DebugConsole.ThrowError($"Error in talent \"{characterTalent}\". No identifiers, tags or category defined.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +37,11 @@ namespace Barotrauma.Abilities
|
||||
|
||||
if (itemPrefab != null)
|
||||
{
|
||||
if (category != MapEntityCategory.None)
|
||||
{
|
||||
if (!itemPrefab.Category.HasFlag(category)) { return false; }
|
||||
}
|
||||
|
||||
if (identifiers.Any())
|
||||
{
|
||||
if (!identifiers.Any(t => itemPrefab.Identifier == t))
|
||||
@@ -40,7 +49,6 @@ namespace Barotrauma.Abilities
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !tags.Any() || tags.Any(t => itemPrefab.Tags.Any(p => t == p));
|
||||
}
|
||||
else
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace Barotrauma.Abilities
|
||||
{
|
||||
foreach (Character c in GameSession.GetSessionCrewCharacters(CharacterType.Both))
|
||||
{
|
||||
if (c.IsUnconscious)
|
||||
if (!c.IsDead && c.IsUnconscious)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ namespace Barotrauma.Abilities
|
||||
|
||||
public bool IsViable()
|
||||
{
|
||||
if (!AllowClientSimulation && GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return false; }
|
||||
if (!AllowClientSimulation && GameMain.NetworkMember is { IsClient: true }) { return false; }
|
||||
if (RequiresAlive && Character.IsDead) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
@@ -9,6 +9,8 @@ namespace Barotrauma.Abilities
|
||||
{
|
||||
internal sealed class CharacterAbilityUnlockApprenticeshipTalentTree : CharacterAbility
|
||||
{
|
||||
public override bool AllowClientSimulation => false;
|
||||
|
||||
public CharacterAbilityUnlockApprenticeshipTalentTree(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement) { }
|
||||
|
||||
public override void InitializeAbility(bool addingFirstTime)
|
||||
|
||||
Reference in New Issue
Block a user