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

        if (combatant != null)
        {
            combatant.Freeze();
        }
    }
示例#2
0
    public virtual bool DoAttack(ICombatant target, AttackType type = AttackType.Kill)
    {
        if (target.Defenseless || RollDice(this.KillChance))
        {
            if (target.TrySave(this))
            {
                target.DoOnBlock(this);
            }
            else
            {
                switch (type)
                {
                    case AttackType.Freeze:
                        target.Freeze(this);
                        if (target is Combatant)
                            (target as Combatant).AddEffect(this.FreezeEffect.Clone());
                        break;
                    case AttackType.Lag:
                        target.Lag(this);
                        if (target is Combatant)
                            (target as Combatant).AddEffect(this.LagEffect.Clone());
                        break;
                    default:
                        //this reads backwards
                        //it's actually "kill the target, this is who killed the target"
                        target.Kill(this);
                        break;
                }

            }

            return true;
        }
        return false;
    }