Unstable 0.1500.6.0 (1984 edition)

This commit is contained in:
Markus Isberg
2021-10-09 00:22:02 +09:00
parent 08bdfc6cea
commit c8943ef9c4
96 changed files with 1817 additions and 559 deletions
@@ -284,7 +284,7 @@ namespace Barotrauma
limb.LastImpactSoundTime = (float)Timing.TotalTime;
if (!string.IsNullOrWhiteSpace(limb.HitSoundTag))
{
bool inWater = limb.inWater;
bool inWater = limb.InWater;
if (character.CurrentHull != null &&
character.CurrentHull.Surface > character.CurrentHull.Rect.Y - character.CurrentHull.Rect.Height + 5.0f &&
limb.SimPosition.Y < ConvertUnits.ToSimUnits(character.CurrentHull.Rect.Y - character.CurrentHull.Rect.Height) + limb.body.GetMaxExtent())
@@ -348,16 +348,27 @@ namespace Barotrauma
float increment = 0.001f;
foreach (Character otherCharacter in Character.CharacterList)
{
if (otherCharacter == character) continue;
if (otherCharacter == character) { continue; }
startDepth += increment;
}
//make sure each limb has a distinct depth value
List<Limb> depthSortedLimbs = Limbs.OrderBy(l => l.ActiveSprite == null ? 0.0f : l.ActiveSprite.Depth).ToList();
//make sure each limb has a distinct depth value
List<Limb> depthSortedLimbs = Limbs.OrderBy(l => l.DefaultSpriteDepth).ToList();
foreach (Limb limb in Limbs)
{
if (limb.ActiveSprite != null)
limb.ActiveSprite.Depth = startDepth + depthSortedLimbs.IndexOf(limb) * 0.00001f;
if (limb.ActiveSprite == null) { continue; }
limb.ActiveSprite.Depth = startDepth + depthSortedLimbs.IndexOf(limb) * 0.00001f;
}
foreach (Limb limb in Limbs)
{
if (limb.ActiveSprite == null) { continue; }
if (limb.Params.InheritLimbDepth == LimbType.None) { continue; }
var matchingLimb = GetLimb(limb.Params.InheritLimbDepth);
if (matchingLimb != null)
{
limb.ActiveSprite.Depth = matchingLimb.ActiveSprite.Depth - 0.0000001f;
}
}
depthSortedLimbs.Reverse();
inversedLimbDrawOrder = depthSortedLimbs.ToArray();
}
@@ -567,6 +578,11 @@ namespace Barotrauma
pos = ConvertUnits.ToDisplayUnits(humanoid.LeftHandIKPos);
if (humanoid.character.Submarine != null) { pos += humanoid.character.Submarine.Position; }
GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X, (int)-pos.Y, 4, 4), GUI.Style.Green, true);
Vector2 aimPos = humanoid.AimSourceWorldPos;
aimPos.Y = -aimPos.Y;
GUI.DrawLine(spriteBatch, aimPos - Vector2.UnitY * 3, aimPos + Vector2.UnitY * 3, Color.Red);
GUI.DrawLine(spriteBatch, aimPos - Vector2.UnitX * 3, aimPos + Vector2.UnitX * 3, Color.Red);
}
if (character.MemState.Count > 1)
@@ -405,7 +405,7 @@ namespace Barotrauma
if (GameMain.NetworkMember.RespawnManager?.UseRespawnPrompt ?? false)
{
CoroutineManager.InvokeAfter(() =>
CoroutineManager.Invoke(() =>
{
if (controlled != null || (!(GameMain.GameSession?.IsRunning ?? false))) { return; }
var respawnPrompt = new GUIMessageBox(
@@ -1052,8 +1052,18 @@ namespace Barotrauma
Position + Vector2.UnitY * 150.0f,
Vector2.UnitY * 10.0f,
playSound: true,
subId: Submarine?.ID ?? -1);;
subId: Submarine?.ID ?? -1);
}
}
partial void OnTalentGiven(string talentIdentifier)
{
GUI.AddMessage(TextManager.Get("talentname." + talentIdentifier.ToString()),
GUI.Style.Yellow,
Position + Vector2.UnitY * 150.0f,
Vector2.UnitY * 10.0f,
playSound: true,
subId: Submarine?.ID ?? -1);
}
}
}
@@ -680,7 +680,7 @@ namespace Barotrauma
createAttachmentSlider(info.MoustacheIndex, WearableType.Moustache);
createAttachmentSlider(info.FaceAttachmentIndex, WearableType.FaceAttachment);
void createColorSelector(string labelTag, IEnumerable<Color> options, Func<Color> getter,
void createColorSelector(string labelTag, IEnumerable<(Color Color, float Commonness)> options, Func<Color> getter,
Action<Color> setter)
{
var selectorItemRT = createItemRectTransform(labelTag, 0.4f);
@@ -714,7 +714,7 @@ namespace Barotrauma
dropdown.ListBox.Content.RectTransform),
style: "ListBoxElement")
{
UserData = option,
UserData = option.Color,
CanBeFocused = true
};
var colorElement =
@@ -723,9 +723,9 @@ namespace Barotrauma
scaleBasis: ScaleBasis.Smallest),
style: null)
{
Color = option,
HoverColor = option,
OutlineColor = Color.Lerp(Color.Black, option, 0.5f),
Color = option.Color,
HoverColor = option.Color,
OutlineColor = Color.Lerp(Color.Black, option.Color, 0.5f),
CanBeFocused = false
};
}
@@ -784,19 +784,9 @@ namespace Barotrauma
{
OnClicked = (button, o) =>
{
var headPreset = info.Heads.Keys.GetRandom(Rand.RandSync.Unsynced);
info.Head.gender = headPreset.Gender;
info.Head.race = headPreset.Race;
info.Head.HeadSpriteId = headPreset.ID;
info.Head.HairIndex = Rand.Int(countAttachmentsOfType(WearableType.Hair), Rand.RandSync.Unsynced);
info.Head.BeardIndex = Rand.Int(countAttachmentsOfType(WearableType.Beard), Rand.RandSync.Unsynced);
info.Head.MoustacheIndex = Rand.Int(countAttachmentsOfType(WearableType.Moustache), Rand.RandSync.Unsynced);
info.Head.FaceAttachmentIndex = Rand.Int(countAttachmentsOfType(WearableType.FaceAttachment), Rand.RandSync.Unsynced);
info.Head.HairColor = info.HairColors.GetRandom(Rand.RandSync.Unsynced);
info.Head.FacialHairColor = info.FacialHairColors.GetRandom(Rand.RandSync.Unsynced);
info.Head.SkinColor = info.SkinColors.GetRandom(Rand.RandSync.Unsynced);
info.Head = new HeadInfo();
info.SetGenderAndRace(Rand.RandSync.Unsynced);
info.SetColors();
RecreateFrameContents();
info.RefreshHead();
@@ -998,10 +998,14 @@ namespace Barotrauma
if (Character.Controlled?.SelectedCharacter == null && openHealthWindow == null)
{
List<(Affliction affliction, string text)> statusIcons = new List<(Affliction affliction, string text)>();
if (Character.CurrentHull == null || Character.CurrentHull.LethalPressure > 5.0f)
if (Character.InPressure)
{
statusIcons.Add((pressureAffliction, TextManager.Get("PressureHUDWarning")));
}
if (Character.CurrentHull != null && Character.OxygenAvailable < LowOxygenThreshold && oxygenLowAffliction.Strength < oxygenLowAffliction.Prefab.ShowIconThreshold)
{
statusIcons.Add((oxygenLowAffliction, TextManager.Get("OxygenHUDWarning")));
}
foreach (Affliction affliction in currentDisplayedAfflictions)
{
@@ -109,6 +109,7 @@ namespace Barotrauma
private float wetTimer;
private float dripParticleTimer;
private float deadTimer;
private Color? randomColor;
/// <summary>
/// Note that different limbs can share the same deformations.
@@ -166,6 +167,8 @@ namespace Barotrauma
}
}
public float DefaultSpriteDepth { get; private set; }
public WearableSprite HuskSprite { get; private set; }
public WearableSprite HerpesSprite { get; private set; }
@@ -309,12 +312,23 @@ namespace Barotrauma
Deformations.AddRange(deformations);
NonConditionalDeformations.AddRange(deformations);
break;
case "randomcolor":
randomColor = subElement.GetAttributeColorArray("colors", null)?.GetRandom();
if (randomColor.HasValue)
{
Params.GetSprite().Color = randomColor.Value;
}
break;
case "lightsource":
LightSource = new LightSource(subElement, GetConditionalTarget())
{
ParentBody = body,
SpriteScale = Vector2.One * Scale * TextureScale
};
if (randomColor.HasValue)
{
LightSource.Color = new Color(randomColor.Value.R, randomColor.Value.G, randomColor.Value.B, LightSource.Color.A);
}
InitialLightSourceColor = LightSource.Color;
InitialLightSpriteAlpha = LightSource.OverrideLightSpriteAlpha;
break;
@@ -383,6 +397,7 @@ namespace Barotrauma
return deformations;
}
}
DefaultSpriteDepth = ActiveSprite.Depth;
LightSource?.CheckConditionals();
}
@@ -571,8 +586,8 @@ namespace Barotrauma
{
foreach (ParticleEmitter emitter in character.DamageEmitters)
{
if (inWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Air) { continue; }
if (!inWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Water) { continue; }
if (InWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Air) { continue; }
if (!InWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Water) { continue; }
ParticlePrefab overrideParticle = null;
foreach (DamageModifier damageModifier in result.AppliedDamageModifiers)
{
@@ -593,8 +608,8 @@ namespace Barotrauma
foreach (ParticleEmitter emitter in character.BloodEmitters)
{
if (inWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Air) { continue; }
if (!inWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Water) { continue; }
if (InWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Air) { continue; }
if (!InWater && emitter.Prefab.ParticlePrefab.DrawTarget == ParticlePrefab.DrawTargetType.Water) { continue; }
emitter.Emit(1.0f, WorldPosition, character.CurrentHull, sizeMultiplier: bloodParticleSize, amountMultiplier: bloodParticleAmount);
}
}
@@ -618,7 +633,7 @@ namespace Barotrauma
}
}
if (inWater)
if (InWater)
{
wetTimer = 1.0f;
}