public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.floatVars == null ||
                eventDefinition.variables.floatVars.Count != 3)
            {
                eventDefinition.variables.floatVars = new List <float>(3);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
            }

            xzForce = EditorGUILayout.Toggle("XZ Force", xzForce);
            yForce  = EditorGUILayout.Toggle("Y Force", yForce);

            if (xzForce)
            {
                eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("X Force",
                                                                                    eventDefinition.variables.floatVars[0]);
            }
            if (yForce)
            {
                eventDefinition.variables.floatVars[2] = EditorGUILayout.FloatField("Y Force",
                                                                                    eventDefinition.variables.floatVars[2]);
            }
            if (xzForce)
            {
                eventDefinition.variables.floatVars[1] = EditorGUILayout.FloatField("Z Force",
                                                                                    eventDefinition.variables.floatVars[1]);
            }
        }
        private bool CheckEventInputRequirement(CAF.Combat.AttackEventDefinition currentEvent)
        {
            if (StateManager.CurrentStateFrame != currentEvent.endFrame)
            {
                return(false);
            }

            switch (currentEvent.inputCheckTiming)
            {
            case AttackEventInputCheckTiming.ONCE:
                for (int i = (int)currentEvent.startFrame; i < currentEvent.endFrame; i++)
                {
                    if (CombatManager.CheckForInputSequence(currentEvent.input))
                    {
                        return(true);
                    }
                }
                break;

            case AttackEventInputCheckTiming.CONTINUOUS:
                for (int i = (int)currentEvent.startFrame; i < currentEvent.endFrame; i++)
                {
                    if (!CombatManager.CheckForInputSequence(currentEvent.input, i, true, true))
                    {
                        return(false);
                    }
                }
                return(true);

                break;
            }
            return(false);
        }
예제 #3
0
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.floatVars == null ||
                eventDefinition.variables.floatVars.Count != 3)
            {
                eventDefinition.variables.floatVars = new List <float>(3);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
            }
            if (eventDefinition.variables.curveVars == null ||
                eventDefinition.variables.curveVars.Count != 3)
            {
                eventDefinition.variables.curveVars = new List <AnimationCurve>(3);
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
            }
            if (eventDefinition.variables.intVars == null ||
                eventDefinition.variables.intVars.Count != 1)
            {
                eventDefinition.variables.intVars = new List <int>(1);
                eventDefinition.variables.intVars.Add(0);
            }

            ForceType ft = (ForceType)eventDefinition.variables.intVars[0];

            ft = (ForceType)EditorGUILayout.EnumPopup("Force Mode",
                                                      (ForceType)eventDefinition.variables.intVars[0]);
            eventDefinition.variables.intVars[0] = (int)ft;

            xForce = EditorGUILayout.Toggle("X Force", xForce);
            yForce = EditorGUILayout.Toggle("Y Force", yForce);
            zForce = EditorGUILayout.Toggle("Z Force", zForce);

            if (xForce)
            {
                eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("X Curve Multiplier",
                                                                                    eventDefinition.variables.floatVars[0]);
                eventDefinition.variables.curveVars[0] = EditorGUILayout.CurveField("X Curve",
                                                                                    eventDefinition.variables.curveVars[0]);
            }
            if (yForce)
            {
                eventDefinition.variables.floatVars[1] = EditorGUILayout.FloatField("Y Curve Multiplier",
                                                                                    eventDefinition.variables.floatVars[1]);
                eventDefinition.variables.curveVars[1] = EditorGUILayout.CurveField("Y Curve",
                                                                                    eventDefinition.variables.curveVars[1]);
            }
            if (zForce)
            {
                eventDefinition.variables.floatVars[2] = EditorGUILayout.FloatField("Z Curve Multiplier",
                                                                                    eventDefinition.variables.floatVars[2]);
                eventDefinition.variables.curveVars[2] = EditorGUILayout.CurveField("Z Curve",
                                                                                    eventDefinition.variables.curveVars[2]);
            }
        }
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.floatVars == null ||
                eventDefinition.variables.floatVars.Count != 1)
            {
                eventDefinition.variables.floatVars = new List <float>(1);
                eventDefinition.variables.floatVars.Add(0);
            }

            eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("Max Length", eventDefinition.variables.floatVars[0]);
        }
예제 #5
0
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.intVars == null ||
                eventDefinition.variables.intVars.Count != 1)
            {
                eventDefinition.variables.intVars = new List <int>();
                eventDefinition.variables.intVars.Add(0);
            }

            eventDefinition.variables.intVars[0] = EditorGUILayout.IntField("State",
                                                                            eventDefinition.variables.intVars[0]);
        }
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.objectVars == null ||
                eventDefinition.variables.objectVars.Count != 1)
            {
                eventDefinition.variables.objectVars = new List <Object>();
                eventDefinition.variables.objectVars.Add(null);
            }

            eventDefinition.variables.objectVars[0] = EditorGUILayout.ObjectField("Sound", eventDefinition.variables.objectVars[0],
                                                                                  typeof(ModObjectLink), false);
        }
예제 #7
0
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.objectVars == null ||
                eventDefinition.variables.objectVars.Count != 1)
            {
                eventDefinition.variables.objectVars = new List <Object>();
                eventDefinition.variables.objectVars.Add(null);
            }

            resetFrameCounter = EditorGUILayout.Toggle("Reset Frame Counter", resetFrameCounter);

            eventDefinition.variables.objectVars[0] = EditorGUILayout.ObjectField("Attack",
                                                                                  eventDefinition.variables.objectVars[0], typeof(MovesetAttackNode), false);
        }
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.floatVars == null ||
                eventDefinition.variables.floatVars.Count != 1)
            {
                eventDefinition.variables.floatVars = new List <float>(1);
                eventDefinition.variables.floatVars.Add(0);
            }

            xzFriction = EditorGUILayout.Toggle("XZ-Axis", xzFriction);
            yFriction  = EditorGUILayout.Toggle("Y-Axis", yFriction);

            eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("Friction",
                                                                                eventDefinition.variables.floatVars[0]);
        }
예제 #9
0
        public override void DrawEventVariables(CAF.Combat.AttackEventDefinition eventDefinition)
        {
            if (eventDefinition.variables.floatVars == null ||
                eventDefinition.variables.floatVars.Count != 3)
            {
                eventDefinition.variables.floatVars = new List <float>(3);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
                eventDefinition.variables.floatVars.Add(0);
            }
            if (eventDefinition.variables.curveVars == null ||
                eventDefinition.variables.curveVars.Count != 3)
            {
                eventDefinition.variables.curveVars = new List <AnimationCurve>(3);
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
                eventDefinition.variables.curveVars.Add(new AnimationCurve());
            }

            useEntityGravity      = EditorGUILayout.Toggle("Use Entity Gravity?", useEntityGravity);
            useEntityGravityScale = EditorGUILayout.Toggle("Use Entity Gravity Scale?", useEntityGravityScale);
            useEntityMaxFallSpeed = EditorGUILayout.Toggle("Use Entity Max Fall Speed?", useEntityMaxFallSpeed);

            EditorGUILayout.Space();

            if (!useEntityGravity)
            {
                eventDefinition.variables.floatVars[0] = EditorGUILayout.FloatField("Gravity Curve Multiplier",
                                                                                    eventDefinition.variables.floatVars[0]);
                eventDefinition.variables.curveVars[0] = EditorGUILayout.CurveField("Gravity Curve",
                                                                                    eventDefinition.variables.curveVars[0]);
            }
            if (!useEntityGravityScale)
            {
                eventDefinition.variables.floatVars[1] = EditorGUILayout.FloatField("Gravity Scale Curve Multiplier",
                                                                                    eventDefinition.variables.floatVars[1]);
                eventDefinition.variables.curveVars[1] = EditorGUILayout.CurveField("Gravity Scale Curve",
                                                                                    eventDefinition.variables.curveVars[1]);
            }
            if (!useEntityMaxFallSpeed)
            {
                eventDefinition.variables.floatVars[2] = EditorGUILayout.FloatField("Max Fall Speed Multiplier",
                                                                                    eventDefinition.variables.floatVars[2]);
                eventDefinition.variables.curveVars[2] = EditorGUILayout.CurveField("Max Fall Speed Curve",
                                                                                    eventDefinition.variables.curveVars[2]);
            }
        }
        /// <summary>
        /// Handles the lifetime of events.
        /// </summary>
        /// <param name="currentEvent">The event being processed.</param>
        /// <returns>True if the current attack state was canceled by the event.</returns>
        protected virtual bool HandleEvents(CAF.Combat.AttackEventDefinition currentEvent)
        {
            if (!currentEvent.active)
            {
                return(false);
            }
            if (StateManager.CurrentStateFrame >= currentEvent.startFrame &&
                StateManager.CurrentStateFrame <= currentEvent.endFrame)
            {
                // Check the on hit requirement.
                if (currentEvent.onHit)
                {
                    List <IHurtable> ihList = ((EntityHitboxManager)CombatManager.hitboxManager).GetHitList(currentEvent.onHitHitboxGroup);
                    if (ihList == null)
                    {
                        return(false);
                    }
                    if (ihList.Count <= 1)
                    {
                        return(false);
                    }
                }

                // Check the input requirement.
                if (currentEvent.inputCheckTiming != AttackEventInputCheckTiming.NONE &&
                    !CheckEventInputRequirement(currentEvent))
                {
                    return(false);
                }

                // Check the charge level requirement.
                if ((CombatManager.CurrentChargeLevel < currentEvent.chargeLevelMin ||
                     CombatManager.CurrentChargeLevel > currentEvent.chargeLevelMax) &&
                    (currentEvent.chargeLevelMin != -1))
                {
                    return(false);
                }

                return(currentEvent.attackEvent.Evaluate(StateManager.CurrentStateFrame - currentEvent.startFrame,
                                                         currentEvent.endFrame - currentEvent.startFrame,
                                                         controller,
                                                         currentEvent.variables));
            }
            return(false);
        }
예제 #11
0
        public virtual void DrawEventVariables(AttackEventDefinition eventDefinition)
        {
#if UNITY_EDITOR
#endif
        }