예제 #1
0
        public override IEnumerable <Wait> RoutineUse(Creature user, object target)
        {
            Wallhach wallhach = user as Wallhach;

            if (target is Creature targetCreature)
            {
                Consume();
                ShowSkill(user);
                var chirality = user.GetStatusEffect <Chirality>();
                chirality?.AddBuildup(-8);
                if (wallhach != null)
                {
                    yield return(Scheduler.Instance.RunAndWait(wallhach.RoutineOpenWing(0.6f, 50, LerpHelper.Quadratic)));
                }
                user.VisualPose = user.FlickPose(CreaturePose.Cast, CreaturePose.Stand, 70);
                if (wallhach != null)
                {
                    Scheduler.Instance.Run(wallhach.RoutineFlashWing(15));
                }
                yield return(user.WaitSome(10));

                int         chiralStacks = user.GetStatusStacks <Chirality>();
                List <Wait> waits        = new List <Wait>();
                int         hands        = chiralStacks + 1;
                hands = 16;
                int timeLeft = hands + 90;
                for (int i = 0; i < hands; i++)
                {
                    List <Vector2> wingPositions = Wallhach.GetWingPositions(user.VisualTarget, 1.0f);
                    Vector2        velocity      = Util.AngleToVector(Random.NextFloat() * MathHelper.TwoPi) * 160;
                    Vector2        emitPos       = wingPositions.Pick(Random);
                    var            bullet        = new MissileHand(user.World, emitPos, targetCreature.VisualTarget, velocity, ColorMatrix.Tint(Color.Goldenrod), 60, timeLeft - i);
                    waits.Add(new WaitBullet(bullet));
                    yield return(user.WaitSome(1));
                }
                yield return(new WaitAll(waits));

                targetCreature.AddStatusEffect(new Wedlock(user)
                {
                    Duration = new Slider(float.PositiveInfinity),
                    Buildup  = 1.0,
                });
                if (wallhach != null)
                {
                    Scheduler.Instance.Run(wallhach.RoutineOpenWing(1f, 50, LerpHelper.Linear));
                }
                yield return(user.WaitSome(50));
            }
        }
예제 #2
0
        private IEnumerable <Wait> RoutineHand(Creature user, Creature target, int hits)
        {
            List <Vector2> wingPositions = Wallhach.GetWingPositions(user.VisualTarget, 1.0f);
            Vector2        velocity      = Util.AngleToVector(Random.NextFloat() * MathHelper.TwoPi) * 160;
            Vector2        emitPos       = wingPositions.Pick(Random);
            int            moveTime      = 30 + Random.Next(30);
            var            bullet        = new MissileHand(user.World, emitPos, target.VisualTarget, velocity, ColorMatrix.Tint(Color.Goldenrod), moveTime, moveTime);

            yield return(new WaitBullet(bullet));

            if (hits % 3 >= 2)
            {
                user.Attack(target, Vector2.Zero, AttackSlap);
            }
        }