static async Task RemoveTownOr2Explorers(InvaderBinding grp)         // !! maybe we should let the player choose in case town was strifed
 {
     if (grp.Tokens.Has(Invader.Town))
     {
         await grp.Remove(Invader.Town);
     }
     else
     {
         await grp.Remove(Invader.Explorer);
     }
     await grp.Remove(Invader.Explorer);
 }
Beispiel #2
0
    public RavageAction(GameState gs, InvaderBinding grp)
    {
        var cfg = gs.GetRavageConfiguration(grp.Space);

        this.gameState     = gs;
        this.grp           = grp;
        this.cfg           = cfg;
        damageLandCallback = gs.DamageLandFromRavage;

        @event = new InvadersRavaged {
            Space = grp.Space
        };
    }
    public static async Task SingleInvaderWithExplorers(Spirit spirit, InvaderBinding grp, TokenClass oldInvader, int replaceCount)
    {
        var tokens   = grp.Tokens;
        var specific = (HealthToken)await spirit.Action.Decision(Select.Invader.ToReplace("disolve", grp.Space, tokens.OfType(oldInvader)));

        if (specific == null)
        {
            return;
        }

        tokens.Adjust(specific, -1);
        tokens.AdjustDefault(Invader.Explorer, replaceCount);

        // apply pre-existing damage
        int damage = System.Math.Min(replaceCount, specific.FullHealth - specific.RemainingHealth);      // !!! cleanup damage calculations
        await grp.Destroy(damage, Invader.Explorer);

        // !!! ??? pre-existing strife?
    }
Beispiel #4
0
    static Task Destroy_1ExplorerPerTownAnd2ExplorersPerCity(InvaderBinding grp)
    {
        int numToDestroy = grp.Tokens.Sum(Invader.Town) + grp.Tokens.Sum(Invader.City) * 2;

        return(grp.Destroy(numToDestroy, Invader.Explorer));
    }
Beispiel #5
0
 static Task EachCityDestroys1Town(InvaderBinding grp)
 {
     return(grp.Destroy(grp.Tokens.Sum(Invader.City), Invader.Town));
 }
Beispiel #6
0
 static Task Destroy_1ExplorerPerTown(InvaderBinding grp)
 {
     return(grp.Destroy(grp.Tokens.Sum(Invader.Town), Invader.Explorer));
 }