Faction Test 100.10.0.0
This commit is contained in:
@@ -692,7 +692,7 @@ namespace Barotrauma
|
||||
//if the attacker has the same targeting tag as the character we're protecting, we can't change the TargetState
|
||||
//otherwise e.g. a pet that's set to follow humans would start attacking all humans (and other pets, since they're considered part of the same group) when a hostile human attacks it
|
||||
//TODO: a way for pets to differentiate hostile and friendly humans?
|
||||
if (attacker?.AiTarget != null && targetCharacter.SpeciesName != GetTargetingTag(attacker.AiTarget))
|
||||
if (attacker?.AiTarget != null && targetCharacter.SpeciesName != GetTargetingTag(attacker.AiTarget) && !attacker.IsFriendly(targetCharacter))
|
||||
{
|
||||
// Attack the character that attacked the target we are protecting
|
||||
ChangeTargetState(attacker, AIState.Attack, selectedTargetingParams.Priority * 2);
|
||||
@@ -3729,7 +3729,7 @@ namespace Barotrauma
|
||||
// When the monsters attack the player sub, they wall hack so that they can be more aggressive.
|
||||
// Pets should always check the visibility, unless the pet and the target are both outside the submarine -> shouldn't target when they can't perceive (= no wall hack)
|
||||
checkVisibility =
|
||||
Character.IsPet && (Character.Submarine == null) != (target.Entity.Submarine == null) ||
|
||||
Character.IsPet && (Character.Submarine != null || target.Entity.Submarine != null) ||
|
||||
target.Entity.Submarine != null && target.Entity.Submarine == Character.Submarine && target.Entity.Submarine.TeamID == CharacterTeamType.None;
|
||||
}
|
||||
if (dist > 0)
|
||||
|
||||
+9
@@ -238,6 +238,15 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInTargetSlot(Item item)
|
||||
{
|
||||
if (container?.Inventory is ItemInventory inventory && TargetSlot is not null)
|
||||
{
|
||||
return inventory.IsInSlot(item, (int)TargetSlot);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
|
||||
+2
@@ -115,6 +115,8 @@ namespace Barotrauma
|
||||
{
|
||||
objective.TargetSlot = container.FindSuitableSubContainerIndex(OXYGEN_SOURCE);
|
||||
}
|
||||
// Only remove the oxygen source being replaced
|
||||
objective.RemoveExistingPredicate = i => objective.IsInTargetSlot(i);
|
||||
return objective;
|
||||
},
|
||||
onAbandon: () =>
|
||||
|
||||
@@ -324,9 +324,18 @@ namespace Barotrauma
|
||||
|
||||
public override void AddExtraMissions(LevelData levelData)
|
||||
{
|
||||
if (levelData == null)
|
||||
{
|
||||
throw new ArgumentException("Current location was null.");
|
||||
}
|
||||
|
||||
extraMissions.Clear();
|
||||
|
||||
var currentLocation = Map.CurrentLocation;
|
||||
if (currentLocation == null)
|
||||
{
|
||||
throw new InvalidOperationException("Current location was null.");
|
||||
}
|
||||
if (levelData.Type == LevelData.LevelType.Outpost)
|
||||
{
|
||||
//if there's an available mission that takes place in the outpost, select it
|
||||
@@ -765,9 +774,10 @@ namespace Barotrauma
|
||||
if (map != null && CargoManager != null)
|
||||
{
|
||||
map.CurrentLocation.RegisterTakenItems(takenItems);
|
||||
map.CurrentLocation.AddStock(CargoManager.SoldItems);
|
||||
CargoManager.ClearSoldItemsProjSpecific();
|
||||
map.CurrentLocation.RemoveStock(CargoManager.PurchasedItems);
|
||||
if (transitionType != TransitionType.None)
|
||||
{
|
||||
UpdateStoreStock();
|
||||
}
|
||||
}
|
||||
if (GameMain.NetworkMember == null)
|
||||
{
|
||||
@@ -830,6 +840,16 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates store stock before saving the game
|
||||
/// </summary>
|
||||
public void UpdateStoreStock()
|
||||
{
|
||||
Map?.CurrentLocation?.AddStock(CargoManager.SoldItems);
|
||||
CargoManager?.ClearSoldItemsProjSpecific();
|
||||
Map?.CurrentLocation?.RemoveStock(CargoManager.PurchasedItems);
|
||||
}
|
||||
|
||||
public void EndCampaign()
|
||||
{
|
||||
foreach (Character c in Character.CharacterList)
|
||||
|
||||
@@ -574,6 +574,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
private readonly static HashSet<Submarine> upgradedSubs = new HashSet<Submarine>();
|
||||
/// <summary>
|
||||
/// Applies an upgrade on the submarine, should be called by <see cref="ApplyUpgrades"/> when the round starts.
|
||||
/// </summary>
|
||||
@@ -584,6 +585,12 @@ namespace Barotrauma
|
||||
/// <returns>New level that was applied, -1 if no upgrades were applied.</returns>
|
||||
private static int BuyUpgrade(UpgradePrefab prefab, UpgradeCategory category, Submarine submarine, int level = 1, Submarine? parentSub = null)
|
||||
{
|
||||
if (parentSub == null)
|
||||
{
|
||||
upgradedSubs.Clear();
|
||||
}
|
||||
upgradedSubs.Add(submarine);
|
||||
|
||||
int? newLevel = null;
|
||||
if (category.IsWallUpgrade)
|
||||
{
|
||||
@@ -619,9 +626,12 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Submarine loadedSub in Submarine.Loaded.Where(sub => sub != submarine))
|
||||
foreach (Submarine loadedSub in Submarine.Loaded)
|
||||
{
|
||||
if (loadedSub == parentSub) { continue; }
|
||||
if (loadedSub == parentSub || loadedSub == submarine) { continue; }
|
||||
if (loadedSub.Info?.Type != SubmarineType.Player) { continue; }
|
||||
if (upgradedSubs.Contains(loadedSub)) { continue; }
|
||||
|
||||
XElement? root = loadedSub.Info?.SubmarineElement;
|
||||
if (root == null) { continue; }
|
||||
|
||||
@@ -630,8 +640,8 @@ namespace Barotrauma
|
||||
if (root.Attribute("location") == null) { continue; }
|
||||
|
||||
// Check if this is our linked submarine
|
||||
ushort dockingPortID = (ushort) root.GetAttributeInt("originallinkedto", 0);
|
||||
if (dockingPortID > 0 && submarine.GetItems(true).Any(item => item.ID == dockingPortID))
|
||||
ushort dockingPortID = (ushort)root.GetAttributeInt("originallinkedto", 0);
|
||||
if (dockingPortID > 0 && submarine.GetItems(alsoFromConnectedSubs: true).Any(item => item.ID == dockingPortID))
|
||||
{
|
||||
BuyUpgrade(prefab, category, loadedSub, level, submarine);
|
||||
}
|
||||
|
||||
@@ -953,6 +953,12 @@ namespace Barotrauma
|
||||
slots[index].RemoveItem(item);
|
||||
}
|
||||
|
||||
public bool IsInSlot(Item item, int index)
|
||||
{
|
||||
if (index < 0 || index >= slots.Length) { return false; }
|
||||
return slots[index].Contains(item);
|
||||
}
|
||||
|
||||
public void SharedRead(IReadMessage msg, out List<ushort>[] newItemIds)
|
||||
{
|
||||
byte slotCount = msg.ReadByte();
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v100.10.0.0
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixes included in v0.20.11.0.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v100.9.0.1
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
@@ -108,6 +114,25 @@ Test version of the faction overhaul:
|
||||
- There's now always two paths from biome to another, one controlled by the Coalition and one by Separatists.
|
||||
- Improvements to the campaign map.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.20.11.0
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Unstable only:
|
||||
- Yet another passive sonar fix: fixed blips "flickering" when there's multiple sound sources, some of which directional, visible on the sonar.
|
||||
- Fixed bots walking against the admin module's door in the campaign tutorial outpost.
|
||||
- Fixed Sulphuric Acid and Europabrew not being categorized as "Medical" in the sub editor.
|
||||
- Fixed arc emitter being in the "Machine" category.
|
||||
- Fixed water-reactant items flashing on and off constantly.
|
||||
- Fixed Defensebot attacking players.
|
||||
- Fixed Defensebot still wall hacking.
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bots being unable to fix Typhon 2's top docking hatch or the wall right next to it.
|
||||
- Fixed crashing when applying upgrades to linked subs, and there's more than one linked sub.
|
||||
- Fixed Research Station being in the "Outpost" subcategory in the sub editor.
|
||||
- Fixed bots dropping medicine from PUCS when changing its oxygen tank.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.20.10.1
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user