コード例 #1
0
        public void Grapple(int targetPos)
        {
            var angle  = Curio.GetAngle() + targetPos * MathHelper.PiOver4;
            var offset = Util.AngleToVector(angle);

            var grappleTarget = Curio.GetGrappleTarget(offset);

            var actions = new List <ActionWrapper>();

            if (grappleTarget != null)
            {
                foreach (var grapple in grappleTarget.GetBehaviors <IGrappleTarget>())
                {
                    grapple.AddGrappleAction(actions, Curio, offset);
                }
            }
            else
            {
                actions.Add(new ActionGrappleNothing(Curio, GetFurthestGrapple(offset), offset, 10, 5).InSlot(ActionSlot.Active));
                actions.Add(new ActionKeepMoving(Curio).InSlot(ActionSlot.Active));
            }
            actions.Apply(Curio);
        }