public IonCannon(Actor firedBy, World world, CPos location) { this.firedBy = firedBy; target = Target.FromCell(location); anim = new Animation("ionsfx"); anim.PlayThen("idle", () => Finish(world)); }
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))); }
public Smoke(World world, PPos pos, string trail) { this.pos = pos; anim = new Animation(trail); anim.PlayThen("idle", () => world.AddFrameEndTask(w => w.Remove(this))); }
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))); }
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))); }
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 } ); }
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); }
public IonCannon(Actor firedBy, World world, int2 location) { this.firedBy = firedBy; Target = location; anim = new Animation("ionsfx"); anim.PlayThen("idle", () => Finish(world)); }
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))); }
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))); }
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))); }
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))); }
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)); }
public SatelliteLaunch(Actor a) { doors = new Animation(a.World, "atek"); doors.PlayThen("active", () => a.World.AddFrameEndTask(w => w.Remove(this))); pos = a.CenterPosition; }
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))); }
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; }
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)); }
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))); }
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))); }
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; }
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))); }
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; }
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"); }
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); }
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"); }
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); }
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); }
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")); }
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); } }