private bool CheckWeaponAgainstOtherProficienciesAsIfMartial(IWeaponAttackStatistics weapon) { var martialize = new ExoticToMartialWeaponDecorator(weapon); var proficiencies = components.GetAll <WeaponProficiency>().Exclude(this); return(proficiencies.IsProficient(martialize)); }
public WeaponAttack(OffenseStats offense, CharacterSize size, IWeaponAttackStatistics weapon) { this.offenseAbilities = offense; this.size = size; this.Weapon = weapon; this.Name = weapon.Name; this.Range = weapon.Range; this.DamageType = weapon.DamageType.ToString(); this.CriticalThreat = weapon.CriticalThreat; this.CriticalModifier = new BasicStat(string.Format("{0} Critical Modifier", weapon.Name), weapon.CriticalModifier); this.attackBonus = new BasicStat(string.Format("{0} Attack Bonus", weapon.Name), weapon.AttackModifier); this.attackBonus.AddModifier(new WeaponProficiencyAttackModifier(this.offenseAbilities, this.Weapon)); this.attackBonus.AddModifiers(MultipleAttackBonusModifier.GetConditionalMultipleAttackModifiers()); this.DamageModifier = new BasicStat(string.Format("{0} Damage Modifier", weapon.Name), 0); foreach (var weaponModifier in offense.WeaponModifiers) { if (weaponModifier.WeaponQualifies(weapon)) { weaponModifier.ApplyModifier(this); } } }
public virtual bool IsProficient(IWeaponAttackStatistics weapon) { bool passes = false; foreach (var prof in proficiencyList) { WeaponTrainingLevel trainingLevel; if (System.Enum.TryParse <WeaponTrainingLevel>(prof, true, out trainingLevel)) { passes = weapon.Level == trainingLevel; } else if (prof.Contains("\"")) { var result = Regex.Match(prof, "[\\w\\s]+"); passes = weapon.ProficiencyName.ContainsIgnoreCase(result.Value); } else { passes = weapon.ProficiencyName.EqualsIgnoreCase(prof); } if (passes) { return(true); } } return(false); }
public WeaponProficiencyAttackModifier(OffenseStats offenseAbilities, IWeaponAttackStatistics weapon) : base(weapon.Name + " Proficiency Modifier", "proficiency penalty") { this.offenseAbilities = offenseAbilities; this.weapon = weapon; this.Calculation = () => { return(this.offenseAbilities.IsProficient(weapon) ? 0 : -4); }; }
public MeleeAttack(OffenseStats offenseAbilities, AbilityScore strength, CharacterSize size, IWeaponAttackStatistics weapon) : base(offenseAbilities, size, weapon) { this.strength = strength; AttackBonus.AddModifier(new StatisticStatModifier("Melee Attack Bonus", offenseAbilities.MeleeAttackBonus)); DamageModifier.AddModifier(this.strength.UniversalStatModifier); this.AttackType = AttackTypes.Melee; }
public override bool IsProficient(IWeaponAttackStatistics weapon) { if (weapon.Level == WeaponTrainingLevel.Exotic) { foreach (var prof in proficiencyList) { if (weapon.Name.SearchFor(prof)) { return(CheckWeaponAgainstOtherProficienciesAsIfMartial(weapon)); } } } return(false); }
/// <summary> /// Determines whether this instance is proficient the specified weapon. /// </summary> /// <returns><c>true</c> if this instance is proficient in the specified weapon; otherwise, <c>false</c>.</returns> /// <param name="weapon">Weapon to check.</param> public bool IsProficient(IWeaponAttackStatistics weapon) { return(this.WeaponProficiencies.IsProficient(weapon)); }
private bool Qualifies(IWeaponAttackStatistics weapon) { return(weapon.ProficiencyName.EqualsIgnoreCase(this.Weapon.ProficiencyName)); }
private bool QualifyCheck(IWeaponAttackStatistics weapon) { return(weapon.Group == this.Group); }
/// <summary> /// Determines if is proficient the specified proficiencies wpn. /// </summary> /// <returns><c>true</c> if is proficient the specified proficiencies wpn; otherwise, <c>false</c>.</returns> /// <param name="proficiencies">Proficiencies to validate against.</param> /// <param name="weapon">Weapon to validate proficiency.</param> public static bool IsProficient(this IEnumerable <WeaponProficiency> proficiencies, IWeaponAttackStatistics weapon) { return(proficiencies.Any(x => x.IsProficient(weapon))); }
public ExoticToMartialWeaponDecorator(IWeaponAttackStatistics reference) : base(reference) { }
public WeaponAttackStatisticDecorator(IWeaponAttackStatistics reference) { this.reference = reference; }