示例#1
0
 static public SelfAction DestroyPresence(int count, DestoryPresenceCause actionType) => new SelfAction($"Destroy {count} presence", async ctx => {
     for (int i = 0; i < count; ++i)
     {
         await ctx.Presence.DestroyOne(actionType);
     }
 }
                                                                                                        );
示例#2
0
    public async Task DestroyOne(DestoryPresenceCause actionType, Func <SpiritIsland.Space, bool> filter = null)
    {
        var space = filter == null
                        ? await ctx.Decision(Select.DeployedPresence.ToDestroy("Select presence to destroy", ctx.Self))
                        : await ctx.Decision(Select.DeployedPresence.ToDestroy("Select presence to destroy", ctx.Self, filter));

        await Destroy(space, actionType);
    }
示例#3
0
        public override async Task Destroy(Space space, GameState gs, DestoryPresenceCause actionType, AddReason blightAddedReason = AddReason.None)
        {
            // Blight added
            if (actionType == DestoryPresenceCause.Blight
                // due to Spirit Effects (Powers, Special Rules, Scenario-based Rituals, etc)
                && blightAddedReason != AddReason.BlightedIsland && blightAddedReason != AddReason.Ravage
                )
            {
                // does not destroy your presence. (including cascades)"
                return;
            }

            await base.Destroy(space, gs, actionType, blightAddedReason);
        }
 public override async Task DestroyPresenceApi(SpiritPresence presence, Space space, GameState gs, DestoryPresenceCause actionType)
 {
     if (actionType != DestoryPresenceCause.SpiritPower)
     {
         await gs.Tokens[space].Disease.Add(1);
     }
     await base.DestroyPresenceApi(presence, space, gs, actionType);
 }
示例#5
0
        public override async Task DestroyPresenceApi(SpiritPresence presence, Space space, GameState gs, DestoryPresenceCause actionType)
        {
            await base.DestroyPresenceApi(presence, space, gs, actionType);

            // Destroying Volcano presence, causes damage to Dahan and invaders
            await gs.DahanOn(space).ApplyDamage(1);

            await gs.Invaders.On(space).UserSelectedDamage(1, spirit);
        }
示例#6
0
 public virtual Task DestroyPresenceApi(SpiritPresence presence, Space space, GameState gs, DestoryPresenceCause actionType)
 {
     presence.RemoveFrom_NoCheck(space, gs);
     ++presence.Destroyed;
     return(Task.CompletedTask);
 }
示例#7
0
    public virtual async Task Destroy(Space space, GameState gs, DestoryPresenceCause actionType, AddReason blightAddedReason = AddReason.None)
    {
        await DestroyBehavior.DestroyPresenceApi(this, space, gs, actionType);

        CheckIfSpiritIsDestroyed();
    }
示例#8
0
 public Task Destroy(Space space, DestoryPresenceCause actionType) => ctx.Self.Presence.Destroy(space, ctx.GameState, actionType);
        public async Task DestroyPresenceApi(SpiritPresence presence, Space space, GameState gs, DestoryPresenceCause actionType)
        {
            if (space == this.protectedSpace)
            {
                var dst = await spirit.Action.Decision(new Select.Space("Instead of destroying, push presence to:", space.Adjacent, Present.Done));

                if (dst != null)
                {
                    presence.Move(space, dst, gs);
                    return;
                }
            }
            await originalBehavior.DestroyPresenceApi(presence, space, gs, actionType);
        }
示例#10
0
 static public SelfAction DestroyPresence(DestoryPresenceCause actionType) => new SelfAction("Destroy 1 presence.", ctx => ctx.Presence.DestroyOne(actionType));