Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Items.Components;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -161,6 +162,24 @@ namespace Barotrauma
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
//if any of the target items is a reactor, prevent exploding it from damaging the player's sub
|
||||
foreach (Item item in items)
|
||||
{
|
||||
if (item.GetComponent<Reactor>() is Reactor reactor && (reactor.statusEffectLists?.ContainsKey(ActionType.OnBroken) ?? false))
|
||||
{
|
||||
foreach (var statusEffect in reactor.statusEffectLists[ActionType.OnBroken])
|
||||
{
|
||||
foreach (Explosion explosion in statusEffect.Explosions)
|
||||
{
|
||||
foreach (Submarine sub in Submarine.Loaded)
|
||||
{
|
||||
if (sub.TeamID == CharacterTeamType.Team1) { explosion.IgnoredSubmarines.Add(sub); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCharacters(Submarine submarine)
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Barotrauma
|
||||
|
||||
var item = new Item(itemPrefab, position.Value, cargoRoomSub)
|
||||
{
|
||||
SpawnedInOutpost = true,
|
||||
SpawnedInCurrentOutpost = true,
|
||||
AllowStealing = false
|
||||
};
|
||||
item.FindHull();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Barotrauma.Extensions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -6,8 +5,6 @@ namespace Barotrauma
|
||||
partial class CombatMission : Mission
|
||||
{
|
||||
private Submarine[] subs;
|
||||
// TODO: not used
|
||||
private List<Character>[] crews;
|
||||
|
||||
private readonly string[] descriptions;
|
||||
private static string[] teamNames = { "Team A", "Team B" };
|
||||
@@ -103,15 +100,16 @@ namespace Barotrauma
|
||||
|
||||
subs[0].NeutralizeBallast();
|
||||
subs[0].TeamID = CharacterTeamType.Team1;
|
||||
subs[0].DockedTo.ForEach(s => s.TeamID = CharacterTeamType.Team1);
|
||||
subs[0].GetConnectedSubs().ForEach(s => s.TeamID = CharacterTeamType.Team1);
|
||||
|
||||
subs[1].NeutralizeBallast();
|
||||
subs[1].TeamID = CharacterTeamType.Team2;
|
||||
subs[1].DockedTo.ForEach(s => s.TeamID = CharacterTeamType.Team2);
|
||||
subs[1].GetConnectedSubs().ForEach(s => s.TeamID = CharacterTeamType.Team2);
|
||||
subs[1].SetPosition(subs[1].FindSpawnPos(Level.Loaded.EndPosition));
|
||||
subs[1].FlipX();
|
||||
|
||||
#if SERVER
|
||||
crews = new List<Character>[] { new List<Character>(), new List<Character>() };
|
||||
#endif
|
||||
}
|
||||
|
||||
public override void End()
|
||||
|
||||
@@ -203,6 +203,14 @@ namespace Barotrauma
|
||||
enemySub.TeamID = CharacterTeamType.None;
|
||||
//make the enemy sub withstand atleast the same depth as the player sub
|
||||
enemySub.RealWorldCrushDepth = Math.Max(enemySub.RealWorldCrushDepth, Submarine.MainSub.RealWorldCrushDepth);
|
||||
if (Level.Loaded != null)
|
||||
{
|
||||
//...and the depth of the patrol positions + 1000 m
|
||||
foreach (var patrolPos in patrolPositions)
|
||||
{
|
||||
enemySub.RealWorldCrushDepth = Math.Max(enemySub.RealWorldCrushDepth, Level.Loaded.GetRealWorldDepth(patrolPos.Y) + 1000);
|
||||
}
|
||||
}
|
||||
enemySub.ImmuneToBallastFlora = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user