// ReSharper disable once UnusedMember.Local
            private static void Postfix(UnitUseAbility __instance)
            {
                var caster          = __instance.Executor;
                var bondedComponent = Main.GetBondedItemComponentForCaster(caster.Descriptor);

                if (bondedComponent != null && bondedComponent.ownerItem != null && bondedComponent.ownerItem.Wielder != caster.Descriptor)
                {
                    using (GameLogContext.Setup()) {
                        Main.AddBattleLogMessage(
                            Main.L10NFormat(caster, "craftMagicItems-logMessage-not-wielding-bonded-item", bondedComponent.ownerItem.Name),
                            new L10NString("craftMagicItems-bonded-item-glossary"));
                    }
                    // Concentration checks have no way of overriding the DC, so contrive some fake damage to give a DC of 20 + spell level.
                    var ruleDamage = new RuleDealDamage(caster, caster, null);
                    Main.Accessors.SetRuleDealDamageDamage(ruleDamage, 20);
                    __instance.MakeConcentrationCheck(ruleDamage);
                }
            }
示例#2
0
 public GamesRepository(GameLogContext gameLogContext)
 {
     GameLogContext = gameLogContext;
 }