diff --git a/Subsurface/Content/Particles/ParticlePrefabs.xml b/Subsurface/Content/Particles/ParticlePrefabs.xml
index ed5624623..4b744b1ea 100644
--- a/Subsurface/Content/Particles/ParticlePrefabs.xml
+++ b/Subsurface/Content/Particles/ParticlePrefabs.xml
@@ -7,8 +7,9 @@
startcolor="1.0, 1.0, 1.0" startalpha="0.8"
colorchange="0.0, 0.0, 0.0, -0.25"
lifetime="3"
- deleteonhit="true"
- velocitychange="0.0, -9.8">
+ growtime ="0.2"
+ deleteoncollision="true"
+ velocitychange="0.0, -9.8">
@@ -18,6 +19,7 @@
startrotationmin ="0.0" startrotationmax="6.28"
startcolor="1.0, 1.0, 1.0" startalpha="0.5"
colorchange="0.0, 0.0, 0.0, -0.25"
+ growtime ="0.2"
lifetime="3"
velocitychange="0.0, -0.05">
@@ -25,7 +27,7 @@
@@ -54,15 +56,16 @@
startcolor="0.5, 0.0, 0.0" startalpha="1.0"
colorchange="0.0, 0.0, 0.0, -1.0"
lifetime="2"
- deleteonhit="true"
+ growtime ="0.1"
+ deleteoncollision="true"
rotatetodirection="true"
velocitychange="0.0, -9.8">
@@ -124,10 +129,10 @@
diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs
index 5fa971966..719a3ee08 100644
--- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs
+++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpriteManager.cs
@@ -29,34 +29,53 @@ namespace Subsurface
}
}
- public void Update(float deltaTime)
+ public void SpawnSprites(int count)
{
- if (activeSprites.Count < MaxSprites)
- {
- WayPoint wp = WayPoint.WayPointList[Rand.Int(WayPoint.WayPointList.Count)];
+ count = Math.Min(count, MaxSprites);
- Vector2 pos = new Vector2(wp.Rect.X, wp.Rect.Y);
- pos += Rand.Vector(200.0f);
+ activeSprites.Clear();
+
+ for (int i = 0; i < count; i++ )
+ {
+ Vector2 pos = Vector2.Zero;
+
+ if (WayPoint.WayPointList.Count>0)
+ {
+ WayPoint wp = WayPoint.WayPointList[Rand.Int(WayPoint.WayPointList.Count)];
+
+ pos = new Vector2(wp.Rect.X, wp.Rect.Y);
+ pos += Rand.Vector(200.0f);
+ }
+ else
+ {
+ pos = Rand.Vector(2000.0f);
+ }
var prefab = prefabs[Rand.Int(prefabs.Count)];
- int amount = Rand.Range(prefab.SwarmMin,prefab.SwarmMax);
+ int amount = Rand.Range(prefab.SwarmMin, prefab.SwarmMax);
List swarmMembers = new List();
-
- for (int i = 0; i0)
+ if (amount > 0)
{
Swarm swarm = new Swarm(swarmMembers, prefab.SwarmRadius);
}
-
-
}
+ }
+ public void ClearSprites()
+ {
+ activeSprites.Clear();
+ }
+
+ public void Update(float deltaTime)
+ {
foreach (BackgroundSprite sprite in activeSprites)
{
sprite.Update(deltaTime);
diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs
index 0c56b3047..c8d049924 100644
--- a/Subsurface/Source/Characters/Character.cs
+++ b/Subsurface/Source/Characters/Character.cs
@@ -940,13 +940,13 @@ namespace Subsurface
for (int i = 0; i < 10; i++)
{
Particle p = Game1.ParticleManager.CreateParticle("waterblood",
- torso.SimPosition + new Vector2(Rand.Range(-0.5f, 0.5f), Rand.Range(-0.5f, 0.5f)),
+ torso.Position + new Vector2(Rand.Range(-50f, 50f), Rand.Range(-50f, 50f)),
Vector2.Zero);
if (p!=null) p.Size *= 2.0f;
Game1.ParticleManager.CreateParticle("bubbles",
torso.SimPosition,
- new Vector2(Rand.Range(-0.5f, 0.5f), Rand.Range(-1.0f,0.5f)));
+ new Vector2(Rand.Range(-50f, 50f), Rand.Range(-100f,50f)));
}
foreach (var joint in AnimController.limbJoints)
@@ -956,6 +956,21 @@ namespace Subsurface
Kill(true);
}
+ private IEnumerable