Esempio n. 1
0
    static async Task DamageInvaderHealthByItsOwnStrife(TokenCountDictionary tokens, HealthToken originalInvader)
    {
        var newInvader = originalInvader.AddDamage(originalInvader.StrifeCount);

        if (newInvader == originalInvader)
        {
            return;
        }

        if (newInvader.IsDestroyed)
        {
            await tokens.Destroy(originalInvader, tokens[originalInvader]);
        }
        else
        {
            tokens.Adjust(newInvader, tokens[originalInvader]);
            tokens.Init(originalInvader, 0);
        }
    }
Esempio n. 2
0
    static async Task ReduceInvaderHealthByItsOwnStrife(TokenCountDictionary tokens, HealthToken originalInvader, int minimum)
    {
        int newHealth  = Math.Min(minimum, originalInvader.FullHealth - originalInvader.StrifeCount);
        var newInvader = new HealthToken(originalInvader.Class, newHealth, originalInvader.Damage, originalInvader.StrifeCount);

        if (newInvader == originalInvader)
        {
            return;
        }

        if (newInvader.IsDestroyed)
        {
            await tokens.Destroy(originalInvader, tokens[originalInvader]);
        }
        else
        {
            tokens.Adjust(newInvader, tokens[originalInvader]);
            tokens.Init(originalInvader, 0);
            // !!! Need something at end of turn to restore health.
        }
    }
Esempio n. 3
0
 public void Init(Token token, int count) => _tokens.Init(token, count);
Esempio n. 4
0
 public void Init(int count) => tokens.Init(token, count);