コード例 #1
0
        private void CycleGeneratorComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string armor = "Molten Armor";
            CalculationOptionsMage calculationOptions = character.CalculationOptions as CalculationOptionsMage;
            CalculationsMage       calculations       = (CalculationsMage)Calculations.Instance;
            Solver solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false);

            solver.Initialize(null);

            switch ((string)((ComboBoxItem)CycleGeneratorComboBox.SelectedItem).Content)
            {
            case "Arcane (MB/2T10 duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGenerator(castingState, true, false, true, false, true, true);
                break;

            case "Arcane (Arcane Power, MB/2T10 duration collapsed)":
                castingState = new CastingState(solver, (int)StandardEffect.ArcanePower, false, 0);
                generator    = new ArcaneCycleGenerator(castingState, true, false, true, false, true, true);
                break;

            case "Arcane (ABar on cooldown only, MB/2T10 duration/ABar cooldown collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGenerator(castingState, true, true, true, true, true, true);
                break;

            case "Arcane (no ABar, MB duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGenerator(castingState, false, true, true, true, false, true);
                break;

            case "Arcane Movement (average 1 per 10 sec for 1 sec)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneMovementCycleGenerator(castingState, 0.1f, 1.0f, true, false, true, true, true, true);
                break;

            case "Frost":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator(castingState, true, false);
                break;

            case "Frost (no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator(castingState, false, false);
                break;

            case "Frost+Deep Freeze":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, false, false, false);
                break;

            case "Frost+Deep Freeze (no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, false, false, false);
                break;

            case "Frost+Deep Freeze (2T10 duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, true, false, false);
                break;

            case "Frost+Deep Freeze (2T10 duration collapsed, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, true, false, false);
                break;

            case "Frost+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, true, true, false);
                break;

            case "Frost+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, true, true, false);
                break;

            case "Frost+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, 10 sec Deep Freeze cooldown)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 10.0f, true, true, false);
                break;

            case "Frost+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, 10 sec Deep Freeze cooldown, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 10.0f, true, true, false);
                break;

            case "FrostFFB+Deep Freeze":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, false, false, true);
                break;

            case "FrostFFB+Deep Freeze (no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, false, false, true);
                break;

            case "FrostFFB+Deep Freeze (2T10 duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, true, false, true);
                break;

            case "FrostFFB+Deep Freeze (2T10 duration collapsed, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, true, false, true);
                break;

            case "FrostFFB+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 30.0f, true, true, true);
                break;

            case "FrostFFB+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 30.0f, true, true, true);
                break;

            case "FrostFFB+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, 10 sec Deep Freeze cooldown)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, true, true, 10.0f, true, true, true);
                break;

            case "FrostFFB+Deep Freeze (FOF instants on last charge only, 2T10 duration collapsed, 10 sec Deep Freeze cooldown, no latency combos)":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGenerator2(castingState, false, true, 10.0f, true, true, true);
                break;

            case "Fire":
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FireCycleGenerator(castingState);
                break;
            }

            if (castingState == null || generator == null)
            {
                return;
            }

            if (character.Ranged != null)
            {
                wand = new WandTemplate(solver, (MagicSchool)character.Ranged.Item.DamageType, character.Ranged.Item.MinDamage, character.Ranged.Item.MaxDamage, character.Ranged.Item.Speed).GetSpell(castingState);
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(generator.StateDescription);

            sb.AppendLine("");
            for (int i = 0; i < generator.ControlOptions.Length; i++)
            {
                sb.Append(i);
                sb.Append(": ");
                sb.Append(generator.StateList[Array.IndexOf(generator.ControlIndex, i)]);
                sb.Append(": ");
                foreach (var kvp in generator.SpellMap[i])
                {
                    sb.Append(kvp.Value);
                    sb.Append("=");
                    sb.Append(kvp.Key);
                    sb.Append("  ");
                }
                sb.AppendLine();
            }

            Description.Text   = sb.ToString();
            ControlString.Text = new string('0', generator.ControlOptions.Length);

            //ControlString.SelectAll();
            ControlString.Focus();

            Calculate_Click(null, null);
        }
コード例 #2
0
        private void CycleGeneratorComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string armor;
            Solver solver;
            CalculationOptionsMage calculationOptions = character.CalculationOptions as CalculationOptionsMage;
            CalculationsMage       calculations       = (CalculationsMage)Calculations.Instance;

            switch ((string)((ComboBoxItem)CycleGeneratorComboBox.SelectedItem).Content)
            {
            case "Arcane":
            default:
                armor  = "Mage Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGeneratorBeta(castingState, true, false, false, false);
                break;

            case "Arcane Dragonwrath":
                armor  = "Mage Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGeneratorLegendary(castingState, true, false, false, false);
                break;

            case "Arcane Hyper Regen":
                armor  = "Mage Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneCycleGeneratorBeta(castingState, true, false, false, true);
                break;

            case "Arcane AOE":
                armor  = "Mage Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new ArcaneAOECycleGenerator(castingState, true, false, false);
                break;

            case "Frost":
                armor  = "Molten Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGeneratorBeta(castingState, false, 0.0f, false, 0.0f);
                break;

            case "Frost+Deep Freeze":
                armor  = "Molten Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGeneratorBeta(castingState, true, 30.0f, false, 0.0f);
                break;

            case "Frost+Freeze":
                armor  = "Molten Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGeneratorBeta(castingState, false, 0.0f, true, 25.0f);
                break;

            case "Frost+Freeze+Deep Freeze":
                armor  = "Molten Armor";
                solver = new Solver(character, calculationOptions, false, false, false, 0, armor, false, false, false, false, true, false, false);
                solver.Initialize(null);
                castingState = new CastingState(solver, 0, false, 0);
                generator    = new FrostCycleGeneratorBeta(castingState, true, 30.0f, true, 25.0f);
                break;
            }

            if (castingState == null || generator == null)
            {
                return;
            }

            if (character.Ranged != null)
            {
                wand = new WandTemplate(solver, (MagicSchool)character.Ranged.Item.DamageType, character.Ranged.Item.MinDamage, character.Ranged.Item.MaxDamage, character.Ranged.Item.Speed).GetSpell(castingState);
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(generator.StateDescription);

            sb.AppendLine();
            for (int i = 0; i < generator.ControlOptions.Length; i++)
            {
                sb.Append(i);
                sb.Append(": ");
                sb.Append(generator.StateList[Array.IndexOf(generator.ControlIndex, i)]);
                sb.Append(": ");
                List <int> keys = new List <int>();
                foreach (var kvp in generator.SpellMap[i])
                {
                    keys.Add(generator.SpellList.IndexOf(kvp.Key));
                }
                keys.Sort();
                foreach (var key in keys)
                {
                    sb.Append(key);
                    sb.Append("=");
                    sb.Append(generator.SpellList[key]);
                    sb.Append("  ");
                }
                sb.AppendLine();
            }

            sb.AppendLine();
            sb.AppendLine("Transitions:");
            sb.AppendLine();

            for (int i = 0; i < generator.ControlOptions.Length; i++)
            {
                foreach (var kvp in generator.SpellMap[i])
                {
                    sb.Append(i);
                    sb.Append(": ");
                    sb.Append(kvp.Key);
                    sb.Append(" => ");

                    List <int> list = new List <int>();
                    for (int s = 0; s < generator.ControlIndex.Length; s++)
                    {
                        if (generator.ControlIndex[s] == i)
                        {
                            foreach (CycleControlledStateTransition transition in generator.StateList[s].Transitions)
                            {
                                string n;
                                if (transition.Spell != null)
                                {
                                    n = transition.Spell.Name;
                                }
                                else
                                {
                                    n = "Pause";
                                }
                                if (n == kvp.Key)
                                {
                                    int target = generator.ControlIndex[transition.TargetState.Index];
                                    if (!list.Contains(target))
                                    {
                                        list.Add(target);
                                    }
                                }
                            }
                        }
                    }

                    list.Sort();
                    sb.Append(string.Join(",", list));

                    sb.AppendLine();
                }
            }


            Description.Text   = sb.ToString();
            ControlString.Text = generator.ConvertCycleNameInternalToEasy(new string('0', generator.ControlOptions.Length));

            //ControlString.SelectAll();
            ControlString.Focus();

            Calculate_Click(null, null);
        }