Esempio n. 1
0
 async Task TokenRemoved(ITokenRemovedArgs args)
 {
     if (args.Reason.IsDestroy())
     {
         await TokenDestroyed(args);
     }
 }
Esempio n. 2
0
    async Task DestroyNearbyPresence(ITokenRemovedArgs args)
    {
        if (args.Reason != RemoveReason.DestroyedInBattle)
        {
            return;
        }
        if (args.Token.Class != TokenType.Dahan)
        {
            return;
        }

        string prompt = $"{SwarnToVictory.Title}: {args.Count} dahan destroyed. Select presence to destroy.";

        int numToDestroy = args.Count;

        Space[] options;
        Space[] Calc() => args.Space.Range(1).Intersect(Presence.Spaces).ToArray();

        while (numToDestroy-- > 0 && (options = Calc()).Length > 0)
        {
            var space = await this.Action.Decision(Select.DeployedPresence.ToDestroy(prompt, options, Present.Always));

            await Presence.Destroy(space, args.GameState, DestoryPresenceCause.DahanDestroyed);
        }
    }
Esempio n. 3
0
    async Task TokenDestroyed(ITokenRemovedArgs args)
    {
        if (args.Token.Class != TokenType.Beast)
        {
            return;                                             // not a beast
        }
        if (this.CountOn(args.Space) < 2)
        {
            return;                                              // not our Sacred Site
        }
        if (args.GameState.Tokens[args.Space].Beasts.Count == 0) // no more beasts
        // Destroying the sacred-site beast, destroyes the sacred site

        // the only time we care about what destroyed the presence is for Vengencence as a burning plague.
        // since this is Many Minds, we don't care about that value.
        {
            var dontCareActionType = DestoryPresenceCause.None;

            // destroy saved site
            await base.Destroy(args.Space, args.GameState, dontCareActionType);

            await base.Destroy(args.Space, args.GameState, dontCareActionType);
        }
    }
Esempio n. 4
0
 Task Track(ITokenRemovedArgs x) => Check(x.Space);