public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { if (evt.Weapon.Blueprint.Category == Category) { evt.AddBonus(1, Fact); } }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { if (evt.Weapon != Owner) { return; } evt.AddBonus(EnhancementBonus, Fact); }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { if (evt.Weapon != this.Owner) { return; } evt.AddBonus(added_bonus, this.Fact); }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { if (evt.Weapon == null || !this.CheckWeapon(evt.Weapon)) { return; } evt.AddBonus(Enhancement, this.Fact); }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { int bonus = getBonus(evt.Weapon); if (bonus > 0) { evt.AddBonus(bonus, this.Fact); } }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { int luck = GetLuckBonus(evt, StatType.AdditionalAttackBonus); if (luck > 0) { evt.AddBonus(1, Fact); } }
internal static bool Prefix(RuleCalculateAttackBonusWithoutTarget __instance, RulebookEventContext context) { if (__instance.Weapon == null || !__instance.Weapon.Blueprint.IsMelee) { return(true); } var blade_tutor_part = __instance?.Initiator?.Get <BladeTutorUnitPart>(); if (blade_tutor_part == null) { return(true); } var res = blade_tutor_part.getValue(); if (res.Item2 == null || res.Item1 == 0) { return(true); } int total_penalty = 0; var attack_bonus = __instance.Initiator.Stats.GetStat(StatType.AdditionalAttackBonus); foreach (var m in attack_bonus.Modifiers) { if (m.Source?.Blueprint != null && facts.Contains(m.Source.Blueprint)) { total_penalty -= m.ModValue; } } foreach (var m in __instance.BonusSources) { if (m.Source?.Blueprint != null && facts.Contains(m.Source.Blueprint)) { total_penalty -= m.Bonus; } } int bonus = Math.Min(total_penalty, res.Item1); __instance.AddBonus(bonus, res.Item2); return(true); }
public void OnEventAboutToTrigger(RuleCalculateAttackBonusWithoutTarget evt) { if (evt.Initiator.Descriptor.HasFact(Wildshape.no_multi_attack)) { return; } if ((bool)evt.Initiator.Descriptor.State.Features.IterativeNaturalAttacks) { return; } if (countNumberOfAttacks(evt.Initiator) < 3) { return; } if (evt.Weapon.IsSecondary) { evt.AddBonus(3, this.Fact); } }