pulling IEffect out of Bullet in prep for Explosion
This commit is contained in:
@@ -4,13 +4,20 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Game.GameRules;
|
||||
using IjwFramework.Types;
|
||||
using OpenRa.Game.Graphics;
|
||||
using OpenRa.Game.Graphics;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
class Bullet
|
||||
{
|
||||
public readonly Player Owner;
|
||||
{
|
||||
interface IEffect
|
||||
{
|
||||
void Tick(Game g);
|
||||
IEnumerable<Pair<Sprite, float2>> Render();
|
||||
Player Owner { get; }
|
||||
}
|
||||
|
||||
class Bullet : IEffect
|
||||
{
|
||||
public Player Owner { get; private set; }
|
||||
readonly Actor FiredBy;
|
||||
readonly WeaponInfo Weapon;
|
||||
readonly ProjectileInfo Projectile;
|
||||
@@ -46,10 +53,13 @@ namespace OpenRa.Game
|
||||
if (t == 0)
|
||||
game.PlaySound(Weapon.Report + ".aud", false);
|
||||
|
||||
t += 40;
|
||||
|
||||
if (t > TotalTime()) /* remove finished bullets */
|
||||
game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
t += 40;
|
||||
|
||||
if (t > TotalTime()) /* remove finished bullets */
|
||||
{
|
||||
game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
game.PlaySound("kaboom25.aud", false);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Pair<Sprite, float2>> Render()
|
||||
|
||||
Reference in New Issue
Block a user