コード例 #1
0
    protected override void Resolve(IEntity source, IEntity target)
    {
        ICombatant combatant = (target as ICombatant);

        if (combatant != null)
        {
            if (restriction_ids.ContainsKey(target))
            {
                combatant.RemoveAttackRestriction(restriction_ids[target]);
                restriction_ids.Remove(target);
            }

            int id = combatant.AddAttackRestriction(new AttackRestriction(CantAttackPlayers));
            restriction_ids.Add(target, id);

            GameStateManager.instance.TrackTimedEffect(this, source, target);
        }
    }