Split Machines ItemComponents
There's still a lot of work to do before we can get the server to compile
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Barotrauma.Lights;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
@@ -8,7 +7,7 @@ using FarseerPhysics;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class Explosion
|
||||
partial class Explosion
|
||||
{
|
||||
private Attack attack;
|
||||
|
||||
@@ -36,41 +35,11 @@ namespace Barotrauma
|
||||
{
|
||||
Hull hull = Hull.FindHull(worldPosition);
|
||||
|
||||
if (shockwave)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("shockwave", worldPosition,
|
||||
Vector2.Zero, 0.0f, hull);
|
||||
}
|
||||
|
||||
for (int i = 0; i < attack.Range * 0.1f; i++)
|
||||
{
|
||||
Vector2 bubblePos = Rand.Vector(attack.Range * 0.5f);
|
||||
GameMain.ParticleManager.CreateParticle("bubbles", worldPosition+bubblePos,
|
||||
bubblePos, 0.0f, hull);
|
||||
|
||||
if (sparks)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("spark", worldPosition,
|
||||
Rand.Vector(Rand.Range(500.0f, 800.0f)), 0.0f, hull);
|
||||
}
|
||||
if (flames)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("explosionfire", ClampParticlePos(worldPosition + Rand.Vector(50f), hull),
|
||||
Rand.Vector(Rand.Range(50.0f, 100.0f)), 0.0f, hull);
|
||||
}
|
||||
if (smoke)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("smoke", ClampParticlePos(worldPosition + Rand.Vector(50f), hull),
|
||||
Rand.Vector(Rand.Range(1.0f, 10.0f)), 0.0f, hull);
|
||||
}
|
||||
}
|
||||
ExplodeProjSpecific(worldPosition, hull);
|
||||
|
||||
float displayRange = attack.Range;
|
||||
if (displayRange < 0.1f) return;
|
||||
|
||||
var light = new LightSource(worldPosition, displayRange, Color.LightYellow, null);
|
||||
CoroutineManager.StartCoroutine(DimLight(light));
|
||||
|
||||
float cameraDist = Vector2.Distance(GameMain.GameScreen.Cam.Position, worldPosition)/2.0f;
|
||||
GameMain.GameScreen.Cam.Shake = CameraShake * Math.Max((displayRange - cameraDist) / displayRange, 0.0f);
|
||||
|
||||
@@ -110,28 +79,7 @@ namespace Barotrauma
|
||||
MathHelper.Clamp(particlePos.X, hull.WorldRect.X, hull.WorldRect.Right),
|
||||
MathHelper.Clamp(particlePos.Y, hull.WorldRect.Y - hull.WorldRect.Height, hull.WorldRect.Y));
|
||||
}
|
||||
|
||||
|
||||
private IEnumerable<object> DimLight(LightSource light)
|
||||
{
|
||||
float currBrightness = 1.0f;
|
||||
float startRange = light.Range;
|
||||
|
||||
while (light.Color.A > 0.0f)
|
||||
{
|
||||
light.Color = new Color(light.Color.R, light.Color.G, light.Color.B, currBrightness);
|
||||
light.Range = startRange * currBrightness;
|
||||
|
||||
currBrightness -= CoroutineManager.DeltaTime * 20.0f;
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
light.Remove();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
|
||||
public static void ApplyExplosionForces(Vector2 worldPosition, float range, float force, float damage = 0.0f, float stun = 0.0f)
|
||||
{
|
||||
if (range <= 0.0f) return;
|
||||
|
||||
Reference in New Issue
Block a user