Spatially partition NukeLaunch effect
This commit is contained in:
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class NukeLaunch : IProjectile
|
||||
public class NukeLaunch : IProjectile, ISpatiallyPartitionable
|
||||
{
|
||||
readonly Player firedBy;
|
||||
readonly Animation anim;
|
||||
@@ -64,6 +64,8 @@ namespace OpenRA.Mods.Common.Effects
|
||||
|
||||
if (skipAscent)
|
||||
ticks = turn;
|
||||
|
||||
firedBy.World.ScreenMap.Add(this, pos, anim.Image);
|
||||
}
|
||||
|
||||
public void Tick(World world)
|
||||
@@ -81,12 +83,14 @@ namespace OpenRA.Mods.Common.Effects
|
||||
if (ticks == delay)
|
||||
Explode(world);
|
||||
|
||||
world.ScreenMap.Update(this, pos, anim.Image);
|
||||
|
||||
ticks++;
|
||||
}
|
||||
|
||||
void Explode(World world)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
world.AddFrameEndTask(w => { w.Remove(this); w.ScreenMap.Remove(this); });
|
||||
weapon.Impact(Target.FromPos(pos), firedBy.PlayerActor, Enumerable.Empty<int>());
|
||||
world.WorldActor.Trait<ScreenShaker>().AddEffect(20, pos, 5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user