(3dc4135ce) v0.9.5.1
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Barotrauma
|
||||
{
|
||||
private static bool toggledThisFrame;
|
||||
|
||||
private static Sprite damageOverlay;
|
||||
public static Sprite DamageOverlay;
|
||||
|
||||
private static string[] strengthTexts;
|
||||
|
||||
@@ -153,12 +153,7 @@ namespace Barotrauma
|
||||
get { return healthBarPulsateTimer; }
|
||||
set { healthBarPulsateTimer = MathHelper.Clamp(value, 0.0f, 10.0f); }
|
||||
}
|
||||
|
||||
static CharacterHealth()
|
||||
{
|
||||
damageOverlay = new Sprite("Content/UI/damageOverlay.png", Vector2.Zero);
|
||||
}
|
||||
|
||||
|
||||
partial void InitProjSpecific(XElement element, Character character)
|
||||
{
|
||||
DisplayedVitality = MaxVitality;
|
||||
@@ -837,8 +832,8 @@ namespace Barotrauma
|
||||
|
||||
if (damageOverlayAlpha > 0.0f)
|
||||
{
|
||||
damageOverlay.Draw(spriteBatch, Vector2.Zero, Color.White * damageOverlayAlpha, Vector2.Zero, 0.0f,
|
||||
new Vector2(GameMain.GraphicsWidth / damageOverlay.size.X, GameMain.GraphicsHeight / damageOverlay.size.Y));
|
||||
DamageOverlay?.Draw(spriteBatch, Vector2.Zero, Color.White * damageOverlayAlpha, Vector2.Zero, 0.0f,
|
||||
new Vector2(GameMain.GraphicsWidth / DamageOverlay.size.X, GameMain.GraphicsHeight / DamageOverlay.size.Y));
|
||||
}
|
||||
|
||||
if (Character.Inventory != null)
|
||||
@@ -997,30 +992,7 @@ namespace Barotrauma
|
||||
//key = item identifier
|
||||
//float = suitability
|
||||
Dictionary<string, float> treatmentSuitability = new Dictionary<string, float>();
|
||||
float minSuitability = -10, maxSuitability = 10;
|
||||
foreach (Affliction affliction in afflictions)
|
||||
{
|
||||
foreach (KeyValuePair<string, float> treatment in affliction.Prefab.TreatmentSuitability)
|
||||
{
|
||||
if (!treatmentSuitability.ContainsKey(treatment.Key))
|
||||
{
|
||||
treatmentSuitability[treatment.Key] = treatment.Value * affliction.Strength;
|
||||
}
|
||||
else
|
||||
{
|
||||
treatmentSuitability[treatment.Key] += treatment.Value * affliction.Strength;
|
||||
}
|
||||
minSuitability = Math.Min(treatmentSuitability[treatment.Key], minSuitability);
|
||||
maxSuitability = Math.Max(treatmentSuitability[treatment.Key], maxSuitability);
|
||||
}
|
||||
}
|
||||
//normalize the suitabilities to a range of 0 to 1
|
||||
foreach (string treatment in treatmentSuitability.Keys.ToList())
|
||||
{
|
||||
treatmentSuitability[treatment] = (treatmentSuitability[treatment] - minSuitability) / (maxSuitability - minSuitability);
|
||||
//lerp towards a random value if the medical skill is low
|
||||
treatmentSuitability[treatment] = MathHelper.Lerp(treatmentSuitability[treatment], Rand.Range(0.0f, 1.0f), randomVariance);
|
||||
}
|
||||
GetSuitableTreatments(treatmentSuitability, normalize: true, randomization: randomVariance);
|
||||
|
||||
foreach (Affliction affliction in afflictions)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user