public void KillBox(Body component) { EaseMotion deathMotion = new EaseMotion(0.8f, component.LocalTransform, component.LocalTransform.Translation + new Vector3(0, -1, 0)); component.AnimationQueue.Add(deathMotion); deathMotion.OnComplete += component.Die; SoundManager.PlaySound(ContentPaths.Audio.whoosh, component.LocalTransform.Translation); Faction.World.ParticleManager.Trigger("puff", component.LocalTransform.Translation + new Vector3(0.5f, 0.5f, 0.5f), Color.White, 90); }
public void KillCoins(Body component) { ZoneBodies.Remove(component); EaseMotion deathMotion = new EaseMotion(0.8f, component.LocalTransform, component.LocalTransform.Translation + new Vector3(0, -1, 0)); component.AnimationQueue.Add(deathMotion); deathMotion.OnComplete += component.Die; SoundManager.PlaySound(ContentPaths.Audio.Oscar.sfx_ic_dwarf_stash_money, component.LocalTransform.Translation); Faction.World.ParticleManager.Trigger("puff", component.LocalTransform.Translation + new Vector3(0.5f, 0.5f, 0.5f), Color.White, 90); }
public override IEnumerable <Status> Run() { if ((Creature.Physics.GlobalTransform.Translation - Location).LengthSquared() < 0.5f) { yield return(Act.Status.Success); yield break; } switch (Type) { case TeleportType.Jump: { TossMotion motion = new TossMotion(0.6f, 0.9f, Creature.Physics.GlobalTransform, Location); Creature.Physics.AnimationQueue.Add(motion); SoundManager.PlaySound(ContentPaths.Audio.jump, Creature.Physics.GlobalTransform.Translation); while (!motion.IsDone()) { Creature.CurrentCharacterMode = CharacterMode.Falling; yield return(Status.Running); } break; } case TeleportType.Lerp: { EaseMotion motion = new EaseMotion(0.6f, Creature.Physics.GlobalTransform, Location); while (!motion.IsDone()) { Creature.Physics.PropogateTransforms(); motion.Update(DwarfTime.LastTime); Creature.AI.Position = motion.GetTransform().Translation; yield return(Status.Running); } Creature.Physics.IsSleeping = false; break; } case TeleportType.Snap: Creature.AI.Position = Location; break; } yield return(Status.Success); }
public override IEnumerable <Status> Run() { switch (Type) { case TeleportType.Jump: { TossMotion motion = new TossMotion(0.6f, 0.9f, Creature.Physics.GlobalTransform, Location); Creature.AI.Jump(DwarfTime.LastTime); while (!motion.IsDone()) { Creature.Physics.IsSleeping = true; motion.Update(DwarfTime.LastTime); Creature.AI.Position = motion.GetTransform().Translation; Creature.CurrentCharacterMode = Creature.CharacterMode.Falling; yield return(Status.Running); } break; } case TeleportType.Lerp: { EaseMotion motion = new EaseMotion(0.6f, Creature.Physics.GlobalTransform, Location); while (!motion.IsDone()) { motion.Update(DwarfTime.LastTime); Creature.AI.Position = motion.GetTransform().Translation; yield return(Status.Running); } break; } case TeleportType.Snap: Creature.AI.Position = Location; break; } yield return(Status.Success); }
public void KillBox(Body component) { EaseMotion deathMotion = new EaseMotion(0.8f, component.LocalTransform, component.LocalTransform.Translation + new Vector3(0, -1, 0)); component.AnimationQueue.Add(deathMotion); deathMotion.OnComplete += component.Die; SoundManager.PlaySound(ContentPaths.Audio.whoosh, component.LocalTransform.Translation); PlayState.ParticleManager.Trigger("puff", component.LocalTransform.Translation + new Vector3(0.5f, 0.5f, 0.5f), Color.White, 90); }
public override IEnumerable<Status> Run() { switch (Type) { case TeleportType.Jump: { TossMotion motion = new TossMotion(0.6f, 0.9f, Creature.Physics.GlobalTransform, Location); Creature.AI.Jump(DwarfTime.LastTime); while (!motion.IsDone()) { Creature.Physics.IsSleeping = true; motion.Update(DwarfTime.LastTime); Creature.AI.Position = motion.GetTransform().Translation; Creature.CurrentCharacterMode = Creature.CharacterMode.Falling; yield return Status.Running; } break; } case TeleportType.Lerp: { EaseMotion motion = new EaseMotion(0.6f, Creature.Physics.GlobalTransform, Location); while (!motion.IsDone()) { motion.Update(DwarfTime.LastTime); Creature.AI.Position = motion.GetTransform().Translation; yield return Status.Running; } break; } case TeleportType.Snap: Creature.AI.Position = Location; break; } yield return Status.Success; }