public static ContextActionDealDamage2 CreateNew(PhysicalDamageForm physical, ContextDiceValue damage, bool isAoE = false, bool halfIfSaved = false, bool IgnoreCritical = false) { // physical damage ContextActionDealDamage2 c = CreateInstance <ContextActionDealDamage2>(); c.DamageType = new DamageTypeDescription() { Type = Kingmaker.RuleSystem.Rules.Damage.DamageType.Physical, Common = new DamageTypeDescription.CommomData(), Physical = new DamageTypeDescription.PhysicalData() { Form = physical } }; c.Duration = new ContextDurationValue() { BonusValue = 0, Rate = DurationRate.Rounds, DiceCountValue = 0, DiceType = DiceType.Zero }; c.Value = damage; c.IsAoE = isAoE; c.HalfIfSaved = halfIfSaved; c.IgnoreCritical = IgnoreCritical; return(c); }
public static ContextActionDealDamage2 CreateNew(StatType abilityType, ContextDiceValue damage, bool drain = false, bool isAoE = false, bool halfIfSaved = false, bool IgnoreCritical = false) { // ability damage ContextActionDealDamage2 c = CreateInstance <ContextActionDealDamage2>(); c.M_Type = Type.AbilityDamage; Harmony12.AccessTools.Field(typeof(ContextActionDealDamage), "m_type").SetValue(c, 1); // ?? does this work? c.Duration = new ContextDurationValue() { BonusValue = 0, Rate = DurationRate.Rounds, DiceCountValue = 0, DiceType = DiceType.Zero }; c.AbilityType = abilityType; c.Value = damage; c.IsAoE = isAoE; c.HalfIfSaved = halfIfSaved; c.Drain = drain; c.IgnoreCritical = IgnoreCritical; return(c); }