示例#1
0
 public IonCannon(Actor firedBy, World world, CPos location)
 {
     this.firedBy = firedBy;
     target = Target.FromCell(location);
     anim = new Animation("ionsfx");
     anim.PlayThen("idle", () => Finish(world));
 }
示例#2
0
文件: Corpse.cs 项目: nevelis/OpenRA
 public Corpse(World world, float2 pos, string image, string sequence, string paletteName)
 {
     this.pos = pos;
     this.paletteName = paletteName;
     anim = new Animation(image);
     anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#3
0
 public Smoke(World world, PPos pos, string trail)
 {
     this.pos = pos;
     anim = new Animation(trail);
     anim.PlayThen("idle",
         () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#4
0
 public Explosion(World world, int2 pixelPos, string style, bool isWater)
 {
     this.pos = pixelPos;
     anim = new Animation("explosion");
     anim.PlayThen(style,
         () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#5
0
		public SpriteEffect(WPos pos, World world, string sprite, string palette)
		{
			this.pos = pos;
			this.palette = palette;
			anim = new Animation(world, sprite);
			anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this)));
		}
示例#6
0
 public WithFire(Actor self)
 {
     var rs = self.Trait<RenderSimple>();
     var roof = new Animation(rs.GetImage(self));
     roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
     rs.anims.Add( "fire", new RenderSimple.AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
 }
示例#7
0
        public Parachute(Actor cargo, WPos dropPosition)
        {
            this.cargo = cargo;

            parachutableInfo = cargo.Info.Traits.GetOrDefault<ParachutableInfo>();

            if (parachutableInfo != null)
                fallVector = new WVec(0, 0, parachutableInfo.FallRate);

            var parachuteSprite = parachutableInfo != null ? parachutableInfo.ParachuteSequence : null;
            if (parachuteSprite != null)
            {
                parachute = new Animation(cargo.World, parachuteSprite);
                parachute.PlayThen("open", () => parachute.PlayRepeating("idle"));
            }

            var shadowSprite = parachutableInfo != null ? parachutableInfo.ShadowSequence : null;
            if (shadowSprite != null)
            {
                shadow = new Animation(cargo.World, shadowSprite);
                shadow.PlayRepeating("idle");
            }

            if (parachutableInfo != null)
                parachuteOffset = parachutableInfo.ParachuteOffset;

            // Adjust x,y to match the target subcell
            cargo.Trait<IPositionable>().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition));
            var cp = cargo.CenterPosition;
            pos = new WPos(cp.X, cp.Y, dropPosition.Z);
        }
示例#8
0
 public IonCannon(Actor firedBy, World world, int2 location)
 {
     this.firedBy = firedBy;
     Target = location;
     anim = new Animation("ionsfx");
     anim.PlayThen("idle", () => Finish(world));
 }
示例#9
0
 public Explosion(World world, int2 pixelPos, int style, bool isWater)
 {
     this.pos = pixelPos;
     var variantSuffix = isWater ? "w" : "";
     anim = new Animation("explosion");
     anim.PlayThen(style.ToString() + variantSuffix,
         () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#10
0
 public Explosion(World world, WPos pos, string style)
 {
     this.world = world;
     this.pos = pos;
     this.cell = pos.ToCPos();
     anim = new Animation("explosion");
     anim.PlayThen(style, () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#11
0
        public CrateEffect(Actor a, string seq, string palette)
        {
            this.a = a;
            this.palette = palette;

            anim = new Animation(a.World, "crate-effects");
            anim.PlayThen(seq, () => a.World.AddFrameEndTask(w => w.Remove(this)));
        }
示例#12
0
 public Explosion(World world, WPos pos, string image, string sequence, string palette)
 {
     this.world = world;
     this.pos = pos;
     this.palette = palette;
     anim = new Animation(world, image);
     anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#13
0
 public IonCannon(Player firedBy, string weapon, World world, CPos location, string effect, string palette)
 {
     this.firedBy = firedBy;
     this.weapon = weapon;
     this.palette = palette;
     target = Target.FromCell(location);
     anim = new Animation(world, effect);
     anim.PlayThen("idle", () => Finish(world));
 }
示例#14
0
		public SatelliteLaunch(Actor a)
		{
			doors = new Animation(a.World, "atek");

			doors.PlayThen("active",
				() => a.World.AddFrameEndTask(w => w.Remove(this)));

			pos = a.CenterPosition;
		}
示例#15
0
 public Corpse(World world, WPos pos, string image, string sequence, string paletteName)
 {
     this.world = world;
     this.pos = pos;
     this.cell = world.Map.CellContaining(pos);
     this.paletteName = paletteName;
     anim = new Animation(world, image);
     anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#16
0
文件: Corpse.cs 项目: pdovy/OpenRA
        public Corpse(Actor fromActor, int death)
        {
            anim = new Animation(fromActor.TraitOrDefault<RenderSimple>().GetImage(fromActor));
            anim.PlayThen("die{0}".F(death + 1),
                () => fromActor.World.AddFrameEndTask(w => w.Remove(this)));

            pos = fromActor.CenterLocation;
            owner = fromActor.Owner;
        }
示例#17
0
 public IonCannon(Player firedBy, WeaponInfo weapon, World world, CPos location, string effect, string sequence, string palette, int delay)
 {
     this.firedBy = firedBy;
     this.weapon = weapon;
     this.palette = palette;
     weaponDelay = delay;
     target = Target.FromCell(world, location);
     anim = new Animation(world, effect);
     anim.PlayThen(sequence, () => Finish(world));
 }
示例#18
0
文件: Smoke.cs 项目: Roger-luo/OpenRA
		public Smoke(World world, WPos pos, string trail, string palette, string sequence)
		{
			this.world = world;
			this.pos = pos;
			this.palette = palette;

			anim = new Animation(world, trail);
			anim.PlayThen(sequence,
				() => world.AddFrameEndTask(w => w.Remove(this)));
		}
示例#19
0
 public SpriteEffect(WPos pos, World world, string image, string sequence, string palette, bool visibleThroughFog = false, bool scaleSizeWithZoom = false)
 {
     this.world = world;
     this.pos = pos;
     this.palette = palette;
     this.scaleSizeWithZoom = scaleSizeWithZoom;
     this.visibleThroughFog = visibleThroughFog;
     anim = new Animation(world, image);
     anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
 }
示例#20
0
        public Corpse(Actor fromActor, string sequence)
        {
            var rs = fromActor.Trait<RenderSimple>();
            palette = rs.Palette(fromActor.Owner);
            anim = new Animation(rs.GetImage(fromActor));
            anim.PlayThen(sequence,
                () => fromActor.World.AddFrameEndTask(w => w.Remove(this)));

            pos = fromActor.CenterLocation;
        }
示例#21
0
文件: Smoke.cs 项目: JackKucan/OpenRA
		public Smoke(World world, WPos pos, string trail)
		{
			this.world = world;
			this.pos = pos;
			this.cell = world.Map.CellContaining(pos);

			anim = new Animation(world, trail);
			anim.PlayThen("idle",
				() => world.AddFrameEndTask(w => w.Remove(this)));
		}
		public SmokeParticle(WPos pos, WVec[] gravity, World world, string image, string sequence, string palette, bool visibleThroughFog = false, bool scaleSizeWithZoom = false)
		{
			this.world = world;
			this.pos = pos;
			this.gravity = gravity;
			this.palette = palette;
			this.scaleSizeWithZoom = scaleSizeWithZoom;
			this.visibleThroughFog = visibleThroughFog;
			anim = new Animation(world, image, () => 0);
			anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this)));
		}
示例#23
0
        public SatelliteLaunch(Actor launcher, GpsPowerInfo info)
        {
            this.info = info;
            this.launcher = launcher;

            doors = new Animation(launcher.World, info.DoorImage);
            doors.PlayThen(info.DoorSequence,
                () => launcher.World.AddFrameEndTask(w => w.Remove(this)));

            pos = launcher.CenterPosition;
        }
示例#24
0
        public GravityBomb(GravityBombInfo info, ProjectileArgs args)
        {
            Args = args;
            altitude = args.srcAltitude;

            anim = new Animation(info.Image);
            if (anim.HasSequence("open"))
                anim.PlayThen("open", () => anim.PlayRepeating("idle"));
            else
                anim.PlayRepeating("idle");
        }
示例#25
0
        public IonCannon(Player firedBy, WeaponInfo weapon, World world, WPos launchPos, CPos location, string effect, string sequence, string palette, int delay)
        {
            this.firedBy = firedBy;
            this.weapon = weapon;
            this.palette = palette;
            weaponDelay = delay;
            target = Target.FromCell(world, location);
            anim = new Animation(world, effect);
            anim.PlayThen(sequence, () => Finish(world));

            if (weapon.Report != null && weapon.Report.Any())
                Game.Sound.Play(SoundType.World, weapon.Report.Random(firedBy.World.SharedRandom), launchPos);
        }
示例#26
0
        public GravityBomb(GravityBombInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;
            pos = args.Source;
            velocity = new WVec(WRange.Zero, WRange.Zero, -info.Velocity);

            anim = new Animation(info.Image);
            if (anim.HasSequence("open"))
                anim.PlayThen("open", () => anim.PlayRepeating("idle"));
            else
                anim.PlayRepeating("idle");
        }
示例#27
0
        public Parachute(Actor cargo, PPos location, int altitude)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;

            var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
            paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));

            if (pai != null) offset = pai.Offset;

            cargo.Trait<ITeleportable>().SetPxPosition(cargo, location);
        }
示例#28
0
        public Parachute(Actor cargo, WPos dropPosition)
        {
            this.cargo = cargo;

            var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
            paraAnim = new Animation(cargo.World, pai != null ? pai.ParachuteSprite : "parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));

            if (pai != null)
                parachuteOffset = pai.Offset;

            // Adjust x,y to match the target subcell
            cargo.Trait<IPositionable>().SetPosition(cargo, dropPosition.ToCPos());
            var cp = cargo.CenterPosition;
            pos = new WPos(cp.X, cp.Y, dropPosition.Z);
        }
示例#29
0
        public Parachute(Player owner, string image, float2 location, int altitude, Actor cargo)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;
            this.owner = owner;

            anim = new Animation(image);
            if (anim.HasSequence("idle"))
                anim.PlayFetchIndex("idle", () => 0);
            else
                anim.PlayFetchIndex("stand", () => 0);
            anim.Tick();

            paraAnim = new Animation("parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
        }
示例#30
0
        public GravityBomb(GravityBombInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;
            pos = args.Source;
            velocity = new WVec(WDist.Zero, WDist.Zero, -info.Velocity);
            acceleration = new WVec(WDist.Zero, WDist.Zero, info.Acceleration);

            if (!string.IsNullOrEmpty(info.Image))
            {
                anim = new Animation(args.SourceActor.World, info.Image);

                if (!string.IsNullOrEmpty(info.OpenSequence))
                    anim.PlayThen(info.OpenSequence, () => anim.PlayRepeating(info.Sequence));
                else
                    anim.PlayRepeating(info.Sequence);
            }
        }