public void OnEventAboutToTrigger(RuleAttackRoll evt) { if (evt.Target.Descriptor.Resources.GetResourceAmount(resource) < cost) { return; } if ((base.Owner.Body.PrimaryHand.Weapon.Blueprint.Category == WeaponCategory.Dagger || base.Owner.Body.PrimaryHand.Weapon.Blueprint.Category == WeaponCategory.Starknife) && base.Owner.Body.PrimaryHand.Weapon.Blueprint.IsRanged) { ThrowAnything.toggleThrown(base.Owner.Body.PrimaryHand.Weapon, evt.Initiator); did_swap = true; } if (!evt.Weapon.Blueprint.IsMelee || evt.Parry != null || !base.Owner.Unit.IsEnemy(evt.Initiator)) { return; } if (evt.Target != base.Owner.Unit) { return; } if (!base.Owner.Unit.IsReach(evt.Target, base.Owner.Body.PrimaryHand)) { return; } //TODO - Conditions? /* * if (this.AttackerCondition.HasConditions) * { * MechanicsContext maybeContext = base.Fact.MaybeContext; * using ((maybeContext != null) ? maybeContext.GetDataScope(evt.Initiator) : null) * { * if (!this.AttackerCondition.Check(null)) * { * return; * } * } * } */ evt.TryParry(base.Owner.Unit, base.Owner.Body.PrimaryHand.Weapon, 0); if (evt.Parry == null) { return; } ModifiableValue additionalAttackBonus = base.Owner.Stats.AdditionalAttackBonus; int num = evt.Initiator.Descriptor.State.Size - base.Owner.State.Size; if (num > 0) { int value = -2 * num; evt.AddTemporaryModifier(additionalAttackBonus.AddModifier(value, this, ModifierDescriptor.Penalty)); } }
public override void OnTurnOn() { StatType statParam = Param.StatType.GetValueOrDefault(); if (statParam == StatType.Unknown) { return; } ModifiableValue stat = Owner.Stats.GetStat(statParam); int bonus = stat.BaseValue >= 10 ? 4 : 2; m_Modifier = stat.AddModifier(bonus, this, Descriptor); }
// Token: 0x060017AE RID: 6062 RVA: 0x0009E1E8 File Offset: 0x0009C3E8 public override void OnTurnOn() { base.OnTurnOn(); int classLevels = 0; foreach (var thisClass in this.classes) { classLevels += base.Owner.Progression.GetClassLevel(thisClass); } int value = 1 + classLevels / 5; ModifiableValue stat = base.Owner.Stats.GetStat(this.Stat); if (stat != null) { this.m_Modifier = stat.AddModifier(value, this, this.Descriptor); } }