예제 #1
0
        private double CalculateStat(string stat, GameData.DataBuddyInformation character, DataEquipmentInformation weapon, 
            DataEquipmentInformation armor, DataEquipmentInformation accessory, DataRecordMateriaInformation recordMateria,
            bool characterHasSynergy, bool weaponHasSynergy, bool armorHasSynergy, bool accessoryHasSynergy)
        {
            double baseValue = (character != null ? character.StatWithSynergy(stat, characterHasSynergy) : 0) +
                (weapon != null ? weapon.StatWithSynergy(stat, weaponHasSynergy) : 0) +
                (armor != null ? armor.StatWithSynergy(stat, armorHasSynergy) : 0) +
                (accessory != null ? accessory.StatWithSynergy(stat, accessoryHasSynergy) : 0);

            double multiplier;
            if (recordMateria != null && (stat == "Atk" || stat == "Mag" || stat == "Mnd" || stat == "Def" || stat == "Res"))
            {
                System.Reflection.MethodInfo method = recordMateria.GetType().GetMethod(stat + "Modifier");
                multiplier = (double)method.Invoke(recordMateria, new object[] { weapon, armor, accessory });
            }
            else
            {
                multiplier = 1;
            }

            switch (stat)
            {
                case "Atk":
                    if (recordMateria != null && (recordMateria.RecordMateriaId == 111070100 || recordMateria.RecordMateriaId == 111080060))
                    {
                        // Loner or Solitude
                        for (int i = 0; i < characterBoxes.Count(box => box.SelectedItem == null); i++)
                        {
                            multiplier *= 1.1;
                        }
                    }
                    if (checkBoxShout.Checked)
                    {
                        multiplier *= 1.5;
                    }

                    if (checkBoxHotE.Checked)
                    {
                        multiplier *= 1.3;
                    }
                    baseValue *= BuffedOffensiveMultiplier(multiplier);
                    break;

                case "Mag":
                    if (checkBoxFocus.Checked)
                    {
                        multiplier *= 1.2;
                    }

                    if (checkBoxFaith.Checked)
                    {
                        multiplier *= 1.2;
                    }
                    baseValue *= BuffedOffensiveMultiplier(multiplier);
                    break;

                case "Mnd":
                    baseValue *= BuffedOffensiveMultiplier(multiplier);
                    break;

                case "Def":
                    if (recordMateria != null && (recordMateria.RecordMateriaId == 111070100 || recordMateria.RecordMateriaId == 111080060))
                    {
                        // Loner or Solitude
                        for (int i = 0; i < characterBoxes.Count(box => box.SelectedItem == null); i++)
                        {
                            multiplier *= 1.1;
                        }
                    }
                    if (checkBoxHotE.Checked)
                    {
                        multiplier *= 1.3;
                    }
                    baseValue *= BuffedDefensiveMultiplier(multiplier);
                    break;

                case "Res":
                    if (checkBoxFaith.Checked)
                    {
                        multiplier *= 1.5;
                    }
                    baseValue *= BuffedDefensiveMultiplier(multiplier);
                    break;
                default:
                    break;
            }

            return baseValue;
        }
예제 #2
0
 public virtual double AbilityModifier(Party.DataEquipmentInformation weapon, Party.DataEquipmentInformation armor, Party.DataEquipmentInformation accessory, Ability ability)
 {
     return(1.0);
 }
예제 #3
0
        private double damagePerHit(GameData.DataBuddyInformation character, DataEquipmentInformation weapon, DataEquipmentInformation armor, 
            DataEquipmentInformation accessory, DataRecordMateriaInformation recordMateria,
            double atk, double mag, double mnd, GameData.Ability ability)
        {
            if (ability.Name == "Cactuar")
            {
                return 1000;
            }

            double damage = ((ability.Formula == GameData.SchemaConstants.Formulas.Healing ? 0 : 5) + ability.CalculateDamage(atk, Double.Parse(textBoxEnemyEffectiveDef.Text), mag, Double.Parse(textBoxEnemyEffectiveRes.Text), mnd)
                    * ability.Multiplier)
                    * (recordMateria != null ? recordMateria.AbilityModifier(weapon, armor, accessory, ability) : 1);

            if (ability.Formula != GameData.SchemaConstants.Formulas.Healing)
            {
                damage *= (weapon != null ? weapon.ElementalMultiplier(ability.Element) : 1)
                    * (armor != null ? armor.ElementalMultiplier(ability.Element) : 1)
                    * (accessory != null ? accessory.ElementalMultiplier(ability.Element) : 1)
                    * BossElementalMultiplier(ability.Element);
            }

            return damage;
        }