private void SetDiceThrowLabel(ICaste caste, IRace race, string propertyName, Label label)
        {
            var casteAttributes          = caste.GetCustomAttributes(propertyName);
            var diceThrow                = AttributeUtils.GetAttribute <DiceThrowAttribute>(casteAttributes);
            var diceThrowModifier        = AttributeUtils.GetAttribute <DiceThrowModifierAttribute>(casteAttributes);
            var specialTrainingAttribute = AttributeUtils.GetAttribute <SpecialTrainingAttribute>(casteAttributes);

            label.Text = Lng.Elem(EnumUtils.GetDescription(diceThrow.DiceThrowType));
            if (diceThrowModifier != null)
            {
                label.Text += $" + {diceThrowModifier.Modifier}";
            }
            if (specialTrainingAttribute != null)
            {
                label.Text += $" + {Lng.Elem("St")}";
            }
            if (diceThrow.DiceThrowType.ToString().EndsWith("2_Times"))
            {
                label.Text += " (2x)";
            }
            var raceModifier = race.GetPropertyShortValue(propertyName);

            if (raceModifier != 0)
            {
                label.Text += raceModifier < 0 ? $" - {Math.Abs(raceModifier)}" : $" + {raceModifier}";
            }
        }
示例#2
0
 public static (byte AttackPercentage, byte DefensePercentage, byte AimingPercentage) Get(ICaste caste, IRace race)
 {
     if ((caste is IUseRangedWeapons) || (race is IUseRangedWeapons))
     {
         return(25, 25, 50);
     }
     else if ((caste is IHateRangedWeapons) || (race is IHateRangedWeapons))
     {
         return(50, 50, 0);
     }
     return(35, 35, 30);
 }