(221f9f2a6) Merge branch 'dev' into capitalizationfixes
This commit is contained in:
@@ -234,6 +234,7 @@ namespace Barotrauma
|
||||
switch (order.AITag.ToLowerInvariant())
|
||||
{
|
||||
case "follow":
|
||||
if (orderGiver == null) { return null; }
|
||||
newObjective = new AIObjectiveGoTo(orderGiver, character, this, repeat: true, priorityModifier: priorityModifier)
|
||||
{
|
||||
CloseEnough = 150,
|
||||
|
||||
@@ -17,6 +17,12 @@ namespace Barotrauma
|
||||
{
|
||||
public abstract RagdollParams RagdollParams { get; protected set; }
|
||||
|
||||
const float ImpactDamageMultiplayer = 10.0f;
|
||||
/// <summary>
|
||||
/// Maximum damage per impact (0.1 = 10% of the character's maximum health)
|
||||
/// </summary>
|
||||
const float MaxImpactDamage = 0.1f;
|
||||
|
||||
private static List<Ragdoll> list = new List<Ragdoll>();
|
||||
|
||||
protected Hull currentHull;
|
||||
@@ -688,8 +694,10 @@ namespace Barotrauma
|
||||
Vector2 impactPos = ConvertUnits.ToDisplayUnits(points[0]);
|
||||
if (character.Submarine != null) impactPos += character.Submarine.Position;
|
||||
|
||||
float impactDamage = Math.Min((impact - ImpactTolerance) * ImpactDamageMultiplayer, character.MaxVitality * MaxImpactDamage);
|
||||
|
||||
character.LastDamageSource = null;
|
||||
character.AddDamage(impactPos, new List<Affliction>() { AfflictionPrefab.InternalDamage.Instantiate((impact - ImpactTolerance) * 10.0f) }, 0.0f, true);
|
||||
character.AddDamage(impactPos, new List<Affliction>() { AfflictionPrefab.InternalDamage.Instantiate(impactDamage) }, 0.0f, true);
|
||||
strongestImpact = Math.Max(strongestImpact, impact - ImpactTolerance);
|
||||
character.ApplyStatusEffects(ActionType.OnImpact, 1.0f);
|
||||
//briefly disable impact damage
|
||||
@@ -1303,13 +1311,6 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (Limb limb in Limbs)
|
||||
{
|
||||
limb.body.SetTransform(Collider.SimPosition, 0.0f);
|
||||
limb.body.ResetDynamics();
|
||||
}
|
||||
SetInitialLimbPositions();
|
||||
return false;
|
||||
}
|
||||
UpdateProjSpecific(deltaTime);
|
||||
}
|
||||
|
||||
@@ -217,7 +217,16 @@ namespace Barotrauma
|
||||
limb.body.AngularVelocity = matchingLimb.body.AngularVelocity;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < character.Inventory.Items.Length; i++)
|
||||
|
||||
if (character.Inventory.Items.Length != husk.Inventory.Items.Length)
|
||||
{
|
||||
string errorMsg = "Failed to move items from a human's inventory into a humanhusk's inventory (inventory sizes don't match)";
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("AfflictionHusk.CreateAIHusk:InventoryMismatch", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
for (int i = 0; i < character.Inventory.Items.Length && i < husk.Inventory.Items.Length; i++)
|
||||
{
|
||||
if (character.Inventory.Items[i] == null) continue;
|
||||
husk.Inventory.TryPutItem(character.Inventory.Items[i], i, true, false, null);
|
||||
|
||||
@@ -159,8 +159,14 @@ namespace Barotrauma
|
||||
public void StartRound(Level level, bool reloadSub = true, bool loadSecondSub = false, bool mirrorLevel = false)
|
||||
{
|
||||
#if CLIENT
|
||||
GameMain.LightManager.LosEnabled = GameMain.Client == null || GameMain.Client.CharacterInfo != null;
|
||||
if (GameMain.Client == null) GameMain.LightManager.LosMode = GameMain.Config.LosMode;
|
||||
if (GameMain.Client == null)
|
||||
{
|
||||
GameMain.LightManager.LosMode = GameMain.Config.LosMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.LightManager.LosEnabled = GameMain.Client.CharacterInfo != null;
|
||||
}
|
||||
#endif
|
||||
this.Level = level;
|
||||
|
||||
|
||||
@@ -656,7 +656,7 @@ namespace Barotrauma.Networking
|
||||
private set;
|
||||
} = new List<Pair<int, int>>();
|
||||
|
||||
public void ReadMonsterEnabled(NetBuffer inc)
|
||||
private void InitMonstersEnabled()
|
||||
{
|
||||
//monster spawn settings
|
||||
if (MonsterEnabled == null)
|
||||
@@ -673,7 +673,11 @@ namespace Barotrauma.Networking
|
||||
if (!MonsterEnabled.ContainsKey(s)) MonsterEnabled.Add(s, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ReadMonsterEnabled(NetBuffer inc)
|
||||
{
|
||||
InitMonstersEnabled();
|
||||
List<string> monsterNames = MonsterEnabled.Keys.ToList();
|
||||
foreach (string s in monsterNames)
|
||||
{
|
||||
@@ -681,7 +685,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
inc.ReadPadBits();
|
||||
}
|
||||
|
||||
|
||||
public void WriteMonsterEnabled(NetBuffer msg, Dictionary<string, bool> monsterEnabled = null)
|
||||
{
|
||||
//monster spawn settings
|
||||
@@ -703,13 +707,17 @@ namespace Barotrauma.Networking
|
||||
Dictionary<ItemPrefab, int> extraCargo = new Dictionary<ItemPrefab, int>();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string prefabIdentifier = msg.ReadString();
|
||||
string prefabName = msg.ReadString();
|
||||
byte amount = msg.ReadByte();
|
||||
ItemPrefab ip = MapEntityPrefab.List.Find(p => p is ItemPrefab && p.Name.Equals(prefabName, StringComparison.InvariantCulture)) as ItemPrefab;
|
||||
if (ip != null && amount > 0)
|
||||
|
||||
var itemPrefab = string.IsNullOrEmpty(prefabIdentifier) ?
|
||||
MapEntityPrefab.Find(prefabName, null, showErrorMessages: false) as ItemPrefab :
|
||||
MapEntityPrefab.Find(prefabName, prefabIdentifier, showErrorMessages: false) as ItemPrefab;
|
||||
if (itemPrefab != null && amount > 0)
|
||||
{
|
||||
if (changed || !ExtraCargo.ContainsKey(ip) || ExtraCargo[ip] != amount) changed = true;
|
||||
extraCargo.Add(ip, amount);
|
||||
if (changed || !ExtraCargo.ContainsKey(itemPrefab) || ExtraCargo[itemPrefab] != amount) changed = true;
|
||||
extraCargo.Add(itemPrefab, amount);
|
||||
}
|
||||
}
|
||||
if (changed) ExtraCargo = extraCargo;
|
||||
@@ -727,7 +735,9 @@ namespace Barotrauma.Networking
|
||||
msg.Write((UInt32)ExtraCargo.Count);
|
||||
foreach (KeyValuePair<ItemPrefab, int> kvp in ExtraCargo)
|
||||
{
|
||||
msg.Write(kvp.Key.Name); msg.Write((byte)kvp.Value);
|
||||
msg.Write(kvp.Key.Identifier ?? "");
|
||||
msg.Write(kvp.Key.OriginalName ?? "");
|
||||
msg.Write((byte)kvp.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user