예제 #1
0
        public void Tick(SceneGame scene)
        {
            var sword    = Curio.GetBehavior <BehaviorSword>();
            var enflamed = Enflamed;

            if (sword != null /*&& sword.HasBlood*/)
            {
                FrameCharge += scene.TimeModCurrent;
            }
            else
            {
                Extinguish();
            }

            if (Enflamed)
            {
                if (FrameVisual.Done)
                {
                    if (sword != null)
                    {
                        var particle = new ExplosionParticle(scene, SpriteLoader.Instance.AddSprite("content/effect_explosion"), sword.GetBlade(8), Random.Next(10, 20))
                        {
                            Angle    = Curio.GetVisualAngle() + sword.VisualAngle() + Random.NextFloat(-0.3f, +0.3f),
                            Color    = Color.White,
                            DrawPass = DrawPass.EffectAdditive,
                        };
                        particle.Size.Set(Random.NextFloat(0.5f, 1.0f));
                    }
                    FrameVisual.Reset();
                }
                FrameVisual += scene.TimeModCurrent;
            }
        }
        public override bool CanUse()
        {
            var world = Curio.GetWorld();
            var tile  = Curio.GetMainTile();
            var map   = tile.Map;
            var mace  = Curio.GetBehavior <BehaviorMace>();

            return(mace != null && mace.IsInArea(world.PlayerCurio) && map.CanSee(Curio.GetVisualTarget(), world.PlayerCurio.GetVisualTarget()));
        }
예제 #3
0
        public override void Apply()
        {
            Curio.AddBehavior(this);
            var pos = Curio.GetBehavior <BehaviorOnTile>();

            if (pos != null)
            {
                TeleportVisual(pos.MapTile);
            }
        }
예제 #4
0
        public void OnAction(EventAction e)
        {
            var sword = Curio.GetBehavior <BehaviorSword>();

            if (sword == null || !sword.HasBlood)
            {
                return;
            }
            var slashes = e.Actions.GetEffectsBy <ActionSwordSlash>(Curio);

            foreach (var slash in slashes.ToList())
            {
                e.Actions.Insert(0, new ActionBloodThorn(slash.Origin, slash.SlashStart, slash.SlashEnd).InSlot(ActionSlot.Active));
            }
        }
예제 #5
0
        public void OnAction(EventAction e)
        {
            var sword = Curio.GetBehavior <BehaviorSword>();

            if (sword == null || !sword.HasBlood)
            {
                return;
            }
            var slashes = e.Actions.GetEffectsBy <ActionConsumeHeartSword>(Curio);

            if (slashes.Any())
            {
                e.Actions.Insert(0, new ActionConsumeBlood(Curio, 1).InSlot(ActionSlot.Active));
                e.Actions.RemoveAll(x => x.Action is ActionConsumeHeartSword);
            }
        }
        public override void Perform()
        {
            var world        = Curio.GetWorld();
            var delta        = world.PlayerCurio.GetVisualTarget() - Curio.GetVisualTarget();
            var orientable   = Curio.GetBehavior <BehaviorOrientable>();
            var angleCurrent = orientable.Angle;
            var angleTarget  = Enumerable.Range(0, 8).Select(x => MathHelper.PiOver4 * x).GetClosestAngle(Util.VectorToAngle(delta));
            var angleDelta   = MathHelper.WrapAngle(angleTarget - angleCurrent);
            var attack       = new List <ActionWrapper>()
            {
                new ActionMaceGoreAttack(Curio, world.PlayerCurio, UpSwingTime, UpSwingSlashTime, DownSwingTime).InSlot(ActionSlot.Active),
                new ActionTurn(Curio, angleDelta, TurnTime).InSlot(ActionSlot.Active),
            };

            attack.Apply(Curio);
        }
예제 #7
0
        public void OnAction(EventAction e)
        {
            var sword = Curio.GetBehavior <BehaviorSword>();

            if (sword == null || !sword.HasHeart)
            {
                return;
            }
            var slashes = e.Actions.GetEffectsBy <ActionSwordSlash>(Curio);

            foreach (var slash in slashes.ToList())
            {
                if (Math.Abs(slash.SlashStart - slash.SlashEnd) == 6)
                {
                    e.Actions.Add(new ActionDestructionWave(slash.Origin, 4, 500).InSlot(ActionSlot.Active));
                }
            }
        }
        public void OnMove(EventMove.Finish e)
        {
            if (e.Curio != Curio)
            {
                return;
            }

            var orientable = Curio.GetBehavior <BehaviorOrientable>();

            var trail = new Curio(Template.BloodThornTrail);

            trail.MoveTo(e.Source);
            trail.GetBehavior <BehaviorTrailBloodThorn>().Shooter = Projectile.Shooter;
            new TrailParticle(Curio.GetWorld(), SpriteLoader.Instance.AddSprite("content/bloodthorn"), Curio.GetVisualTarget(), 30)
            {
                Angle    = orientable.Angle,
                FadeLerp = LerpHelper.QuadraticIn,
            };
        }
예제 #9
0
        public void OnAction(EventAction e)
        {
            var sword = Curio.GetBehavior <BehaviorSword>();

            if (sword == null || !Enflamed)
            {
                return;
            }
            var slashes = e.Actions.GetEffectsBy <ActionSwordSlash>(Curio);
            var stabs   = e.Actions.GetEffectsBy <ActionSwordStab>(Curio);

            foreach (var slash in slashes.ToList())
            {
                e.Actions.Insert(0, new ActionFireSlash(Curio, slash).InSlot(ActionSlot.Active));
            }

            foreach (var stab in stabs.ToList())
            {
                e.Actions.Insert(0, new ActionFireStab(Curio, stab).InSlot(ActionSlot.Active));
            }
        }
예제 #10
0
        private void FireDaggers()
        {
            var world = Origin.GetWorld();
            var tile  = Origin.GetMainTile();

            //new TimeFade(world, 0.05f, LerpHelper.ExponentialIn, 20);

            int index    = 0;
            var position = SlashEnd;
            var angle    = Origin.GetAngle() + position * MathHelper.PiOver4;
            var offset   = Util.AngleToVector(angle).ToTileOffset();
            var neighbor = tile.GetNeighborOrNull(offset.X, offset.Y);

            if (neighbor != null)
            {
                var dagger = new Curio(Template.BloodThorn);
                dagger.MoveTo(tile);
                dagger.GetBehavior <BehaviorProjectile>().Fire(Origin, Util.AngleToVector(angle), 3, 20);
            }
            index++;
        }
예제 #11
0
        public void OnAction(EventAction e)
        {
            var sword = Curio.GetBehavior <BehaviorSword>();

            if (sword == null)
            {
                return;
            }
            var slashes = e.Actions.GetEffectsBy <ActionSwordSlash>(Curio);

            foreach (var slash in slashes.ToList())
            {
                if (slash.SlashStart == 0 && slash.SlashEnd == -3)
                {
                    e.Actions.Add(new ActionButterflyKnives(slash.Origin, -1, -3).InSlot(ActionSlot.Active));
                }
                if (slash.SlashStart == 0 && slash.SlashEnd == 3)
                {
                    e.Actions.Add(new ActionButterflyKnives(slash.Origin, 1, 3).InSlot(ActionSlot.Active));
                }
            }
        }
예제 #12
0
        private void FireDaggers()
        {
            var world         = Origin.GetWorld();
            var tile          = Origin.GetMainTile();
            var areaPositions = Enumerable.Range(Math.Min(SlashStart, SlashEnd), Math.Abs(SlashEnd - SlashStart) + 1);

            new TimeFade(world, 0.05f, LerpHelper.ExponentialIn, 20);

            int index = 0;

            foreach (var position in areaPositions)
            {
                var angle    = Origin.GetAngle() + position * MathHelper.PiOver4;
                var offset   = Util.AngleToVector(angle).ToTileOffset();
                var neighbor = tile.GetNeighborOrNull(offset.X, offset.Y);
                if (neighbor != null)
                {
                    var dagger = new Curio(Template.EnergyKnife);
                    dagger.MoveTo(tile);
                    dagger.GetBehavior <BehaviorProjectile>().Fire(Origin, Util.AngleToVector(angle), 3, 20);
                }
                index++;
            }
        }