private void RipHeart(SceneGame world, BehaviorSword sword) { foreach (var stabTarget in sword.StabTargets.Where(x => !x.Removed)) { var actions = new List <ActionWrapper>(); actions.Add(new ActionRipHeartSword(Origin, stabTarget).InSlot(ActionSlot.Active)); actions.Apply(stabTarget); } sword.StabTargets.Clear(); }
public void Run() { var world = Origin.GetWorld(); var sword = Origin.GetBehavior <BehaviorSword>(); sword.SetPositionVisual(SlashStart); sword.OrientTo(SlashEnd, LerpHelper.QuarticOut, this); var slash = new Slash(world, Origin.GetVisualTarget, Origin.GetVisualAngle, 16); slash.Perform(BehaviorSword.GetAngle(SlashStart), BehaviorSword.GetAngle(SlashEnd), 16, LerpHelper.QuadraticOut, this); new ScreenShakeJerk(world, Util.AngleToVector(Origin.GetVisualAngle() + BehaviorSword.GetAngle(SlashEnd)) * 3, 10); Sound.Play(1.0f, Random.NextFloat(-0.5f, +0.5f), 0); RipHeart(world, sword); DamageArea(); }
public void Run() { var world = Origin.GetWorld(); var sword = new BehaviorSword(Origin, 3); Behavior.Apply(sword); sword.SetScale(1, LerpHelper.QuadraticOut, this); var star = new BigStar(world, SpriteLoader.Instance.AddSprite("content/effect_star_big")); star.Angle.Set(0, MathHelper.TwoPi, LerpHelper.QuadraticOut, 30); star.Scale.Set(0, 0.1f, LerpHelper.QuadraticOut, 30); star.ShouldDestroy.Set(true, LerpHelper.Linear, 30); var swordEffect = new SwordEffect(world, star, sword, 16) { DrawPass = DrawPass.EffectAdditive, }; }
public SwordEffect(SceneGame world, ProtoEffectDrawable protoEffect, BehaviorSword sword, float bladeLength) : base(world) { ProtoEffect = protoEffect; Sword = sword; BladeLength = bladeLength; }