Unstable v0.1300.0.2
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
||||
using System.Threading;
|
||||
using FarseerPhysics.Dynamics;
|
||||
#if DEBUG && CLIENT
|
||||
using System;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
#endif
|
||||
|
||||
@@ -115,6 +116,37 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if LINUX
|
||||
// disgusting
|
||||
if (PlayerInput.KeyDown(Keys.RightShift) && Character.Controlled is { CharacterHealth: { } health } && PlayerInput.MouseSpeed != Vector2.Zero)
|
||||
{
|
||||
AfflictionPrefab radiationPrefab = AfflictionPrefab.RadiationSickness;
|
||||
float afflictionAmount = (PlayerInput.MousePosition.X / GameMain.GraphicsWidth) * radiationPrefab.MaxStrength;
|
||||
Affliction affliction = health.GetAffliction(radiationPrefab.Identifier, true);
|
||||
|
||||
if (affliction == null)
|
||||
{
|
||||
health.ApplyAffliction(null, new Affliction(radiationPrefab, Math.Abs(afflictionAmount)));
|
||||
}
|
||||
else
|
||||
{
|
||||
float diff = affliction.Strength - afflictionAmount;
|
||||
|
||||
if (!MathUtils.NearlyEqual(diff, 0))
|
||||
{
|
||||
if (diff > 0)
|
||||
{
|
||||
health.ReduceAffliction(null, radiationPrefab.Identifier, Math.Abs(diff));
|
||||
}
|
||||
else if (diff < 0)
|
||||
{
|
||||
health.ApplyAffliction(null, new Affliction(radiationPrefab, Math.Abs(diff)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CLIENT
|
||||
|
||||
Reference in New Issue
Block a user