Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            PowerCombo combo = (PowerCombo)target;

            serializedObject.Update();

            // Show default inspector property editor
            //DrawDefaultInspector();

            EditorGUILayout.PropertyField(serializedObject.FindProperty("duration"), new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("window"), new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("powers"), true, new GUILayoutOption[0]);

            serializedObject.ApplyModifiedProperties();

            string msg = "";

            for (int i = 0; i < combo.powers.Length; i++)
            {
                if (combo.powers[i] && combo.powers[i].mode != Power.Mode.Instant)
                {
                    msg += "WARNING!: Power " + combo.powers[i].name + " is not an Instant Power!\n";
                }
            }

            if (msg.Length > 0)
            {
                EditorGUILayout.TextArea(msg, new GUILayoutOption[0]);
            }
        }
Ejemplo n.º 2
0
        IEnumerator AdvanceCombo(PowerCombo combo)
        {
            yield return(new WaitForSeconds(0.5f));

            int index = currentComboStage;

            if (currentCombo != combo)
            {
                index = 0;
            }

            currentCombo      = combo;
            currentComboStage = (index + 1) % combo.powers.Length;
            currentComboTimer = combo.window;
        }
Ejemplo n.º 3
0
        public void OnEnd(Character caster, bool interrupted = false)
        {
            if (IsInstant())
            {
                //Debug.Log("OnEnd: index = " + caster.currentComboStage);
                GetPower(caster).StartPower(caster);

                // set off a coroutine to advance combos
                PowerCombo combo = this as PowerCombo;
                if (combo)
                {
                    caster.QueueAdvanceCombo(combo);
                }

                if (mode == Mode.MoveTo)
                {
                    float dist = caster.target == null ? 0 : Vector3.Distance(caster.transform.position, caster.target.transform.position);
                    if (dist > 1)
                    {
                        lunge = true;
                        return;
                    }
                    else
                    {
                        lunge = false;
                        caster.Hit();
                    }
                }
            }
            else
            {
                caster.activePower = null;
            }

            caster.EnableAnimator(2);

            if (mode != Mode.MoveTo || lunge == false)
            {
                EndPower(caster);
            }

            switch (mode)
            {
            case Mode.Instant:
            case Mode.MoveTo:
                break;

            case Mode.Charge:
                if (!interrupted)
                {
                    OnActivate(caster);
                }
                caster.activePower = null;
                caster.stats[RPGSettings.StatName.Charge.ToString()].currentValue = 0;
                break;

            case Mode.Maintain:
                caster.stats[RPGSettings.StatName.Charge.ToString()].currentValue = 0;
                break;

            case Mode.Block:
                caster.statusDirty = true;
                break;
            }
        }
Ejemplo n.º 4
0
 public void QueueAdvanceCombo(PowerCombo combo)
 {
     StartCoroutine(AdvanceCombo(combo));
 }
Ejemplo n.º 5
0
 public void ResetCombos()
 {
     currentCombo      = null;
     currentComboStage = 0;
     currentComboTimer = 0;
 }