public void Run() { Random random = new Random(); var world = Origin.GetWorld(); var alive = Target.GetBehavior <BehaviorAlive>(); var sword = Origin.GetBehavior <BehaviorSword>(); var bloodfire = Origin.GetBehavior <BehaviorSkillBloodfireBlade>(); bloodfire.Extinguish(); new TimeFade(world, 0.05f, LerpHelper.ExponentialIn, 40); Target.GetFlashHelper()?.AddFlash(ColorMatrix.Flat(Color.White), 5); Target.GetShakeHelper()?.AddShakeRandom(3, LerpHelper.QuadraticOut, 5); new HitStop(world, 0, 5); alive.SetDamage(alive.HP); Target.GetFlashHelper()?.AddFlash(ColorMatrix.Translate(new Color(255, 64, 16)), LerpHelper.Invert(LerpHelper.QuadraticOut), (int)ExplosionTime.EndTime, false); Target.GetShakeHelper()?.AddShakeRandom(3, LerpHelper.Invert(LerpHelper.QuadraticOut), (int)ExplosionTime.EndTime, false); if (alive.CurrentDead) { if (Origin == world.PlayerCurio) { world.RunStats.Kills += 1; } } if (sword != null) { sword.HasBlood = false; } }
private IEnumerable <Wait> RoutineQuake(Creature user, Tile impactTile, int radius, ICollection <Tile> tiles) { var tileSet = impactTile.GetNearby(radius).Where(tile => tile.Opaque).Where(tile => GetSquareDistance(impactTile, tile) <= radius * radius).Shuffle(Random); int chargeTime = 60; List <Tile> damageTiles = new List <Tile>(); foreach (Tile tile in tileSet) { tile.VisualUnderColor = ChargeColor(user, chargeTime); if (!tiles.Contains(tile)) { damageTiles.Add(tile); } tiles.Add(tile); } new ScreenShakeRandom(user.World, 4, chargeTime + 60, LerpHelper.Invert(LerpHelper.Linear)); yield return(user.WaitSome(chargeTime)); new LightningField(user.World, SpriteLoader.Instance.AddSprite("content/lightning_ender"), tileSet, 60); yield return(user.WaitSome(60)); new ScreenShakeRandom(user.World, 8, 60, LerpHelper.Linear); foreach (Tile tile in tileSet) { Vector2 offset = new Vector2(-0.5f + Random.NextFloat(), -0.5f + Random.NextFloat()) * 16; if (Random.NextDouble() < 0.7) { new EnderExplosion(user.World, tile.VisualTarget + offset, Vector2.Zero, 0, Random.Next(14) + 6); } tile.VisualUnderColor = () => Color.TransparentBlack; tile.MakeFloor(); } }
public override IEnumerable <Wait> RoutineUse(Creature user, object target) { if (target is Creature targetCreature) { Consume(); ShowSkill(user); user.VisualPose = user.FlickPose(CreaturePose.Cast, CreaturePose.Stand, 70); yield return(user.WaitSome(50)); var effect = new FlareCharge(user.World, SpriteLoader.Instance.AddSprite("content/cinder_ender"), user, () => targetCreature.VisualTarget, 200); yield return(user.WaitSome(50)); new ScreenShakeRandom(user.World, 2, 150, LerpHelper.Invert(LerpHelper.Linear)); yield return(new WaitEffect(effect)); new ScreenFlashLocal(user.World, () => ColorMatrix.Ender(), targetCreature.VisualTarget, 60, 150, 80, 50); new EnderNuke(user.World, SpriteLoader.Instance.AddSprite("content/nuke_ender"), targetCreature.VisualTarget, 0.6f, 80); new ScreenShakeRandom(user.World, 8, 80, LerpHelper.QuarticIn); //new BigExplosion(user.World, () => target.VisualTarget, (pos, time) => new EnderExplosion(user.World, pos, Vector2.Zero, time)); yield return(user.WaitSome(10)); var wait = user.Attack(targetCreature, SkillUtil.SafeNormalize(targetCreature.VisualTarget - user.VisualTarget), FlareAttack); yield return(wait); yield return(user.WaitSome(20)); } }
private IEnumerable <Wait> RoutineQuake(Creature user, Tile impactTile, int radius, ICollection <Tile> tiles, PopupHelper popupHelper) { var tileSet = impactTile.GetNearby(radius).Where(tile => GetSquareDistance(impactTile, tile) <= radius * radius).Shuffle(Random); int chargeTime = Random.Next(10) + 1; List <Tile> damageTiles = new List <Tile>(); foreach (Tile tile in tileSet) { if (!tiles.Contains(tile)) { damageTiles.Add(tile); } tiles.Add(tile); } //new FireField(user.World, tileSet, chargeTime); new ScreenShakeRandom(user.World, 2, chargeTime + 30, LerpHelper.Invert(LerpHelper.Linear)); yield return(user.WaitSome(chargeTime)); new ScreenShakeRandom(user.World, 4, 60, LerpHelper.Linear); foreach (Tile tile in tileSet) { Vector2 offset = new Vector2(-0.5f + Random.NextFloat(), -0.5f + Random.NextFloat()) * 16; if (Random.NextDouble() < 0.7) { new SteamExplosion(user.World, tile.VisualTarget + offset, Vector2.Zero, 0, Random.Next(14) + 6); } //else if (Random.NextDouble() < 0.7) // new FlameBig(user.World, tile.VisualTarget + offset, Vector2.Zero, 0, Random.Next(14) + 6); tile.VisualUnderColor = () => Color.TransparentBlack; } CloudIce cloud = user.Map.AddCloud(map => new CloudIce(map)); foreach (Tile tile in damageTiles) { cloud.Add(tile, 20); foreach (Creature target in tile.Creatures) { user.Attack(target, Vector2.Zero, (a, b) => ExplosionAttack(a, b, popupHelper)); } } }