Example #1
0
    public override async Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom _)
    {
        Spirit target = ctx.GameState.Spirits.Length == 1 ? ctx.Self
                        : await ctx.Decision(new Select.Spirit(powerName, ctx.GameState.Spirits));

        return(ctx.TargetSpirit(target));
    }
Example #2
0
    public override async Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom powerType)
    {
        var space = await ctx.Self.TargetsSpace(powerType, ctx.GameState, powerName + ": Target Space",
                                                sourceCriteria,
                                                new TargetCriteria( await CalcRange(ctx), TargetFilter )
                                                );

        return(space == null ? null : ctx.Target(space));
    }
Example #3
0
    public override async Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom powerType)
    {
        var space = await ctx.Self.TargetsSpace(powerType, ctx.GameState, powerName + ": Target Space"
                                                , sourceCriteria
                                                , new TargetCriteria( range, TargetFilter)
                                                , new TargetCriteria( range + 1, Target.Beast ) // extend 1 for beast
                                                );

        return(space == null ? null : ctx.Target(space));
    }
    public MistsShiftAndFlow(ShroudOfSilentMist spirit, GameState gameState, string prompt, TargetSourceCriteria sourceCriteria, TargetCriteria[] targetCriteria, TargettingFrom powerType)
    {
        this.spirit         = spirit;
        this.gameState      = gameState;
        this.prompt         = prompt ?? "Target Space.";
        this.sourceCriteria = sourceCriteria;
        this.targetCriteria = targetCriteria;
        this.powerType      = powerType;

        CalculateSpaceGroups();
    }
    public override async Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom powerType)
    {
        var target = (TargetSpaceCtx)await base.GetTargetCtx(powerName, ctx, powerType);

        int count = await target.Self.SelectNumber("# of presence to destroy?", target.Presence.Count, 0);

        // Destroy them now
        for (int i = 0; i < count; ++i)
        {
            await target.Presence.Destroy(target.Space, DestoryPresenceCause.SpiritPower);
        }

        return(new ErruptionCtx(target, count));
    }
    // Find Range
    // This is virtual so Volcano Targetting can call base()
    public virtual IEnumerable <Space> GetTargetOptionsFromKnownSource(
        Spirit self,
        GameState gameState,
        TargettingFrom powerType,
        IEnumerable <Space> source,
        TargetCriteria targetCriteria
        )
    {
        var ctx = self.BindMyPower(gameState); // !!! should this be Power???

        return(source                          // starting here
               .SelectMany(x => x.Range(targetCriteria.Range))
               .Distinct()
               .Where(s => ctx.Target(s).Matches(targetCriteria.Filter)));             // matching this destination
    }
 public abstract Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom powerType);
Example #8
0
 public override Task <object> GetTargetCtx(string powerName, SelfCtx ctx, TargettingFrom _)
 {
     return(Task.FromResult((object)ctx));
 }
 public IEnumerable <Space> GetTargetOptionsFromKnownSource(Spirit self, GameState gameState, TargettingFrom powerType, IEnumerable <Space> source, TargetCriteria tc)
 {
     return(originalApi.GetTargetOptionsFromKnownSource(self, gameState, powerType, source, new TargetCriteria(tc.Range + extension, tc.Filter)));
 }
        public override IEnumerable <Space> GetTargetOptionsFromKnownSource(Spirit self, GameState gameState, TargettingFrom powerType, IEnumerable <Space> source, TargetCriteria tc)
        {
            // original options
            List <Space> spaces = originalApi.GetTargetOptionsFromKnownSource(self, gameState, powerType, source, tc).ToList();

            // Target Spirit gains +1 range with their Powers that originate from a Mountain
            var mountainSource = source.Where(x => x.IsMountain).ToArray();

            return(mountainSource.Length == 0 ? spaces
                                : spaces
                   .Union(originalApi.GetTargetOptionsFromKnownSource(self, gameState, powerType, mountainSource, new TargetCriteria(tc.Range + 1, tc.Filter)))
                   .Distinct());
        }
Example #11
0
    public override IEnumerable <Space> GetTargetOptionsFromKnownSource(Spirit self, GameState gameState, TargettingFrom powerType, IEnumerable <Space> source, TargetCriteria tc)
    {
        List <Space> spaces = base.GetTargetOptionsFromKnownSource(self, gameState, powerType, source, tc)
                              .ToList();

        // Add towers
        if (powerType != TargettingFrom.Innate)
        {
            var towers = self.Presence.Placed.Where(s => 3 <= self.Presence.CountOn(s)).ToArray();
            if (towers.Length > 0)
            {
                spaces.AddRange(base.GetTargetOptionsFromKnownSource(self, gameState, powerType, towers, new TargetCriteria(tc.Range + 1, tc.Filter)));
            }
        }

        return(spaces.Distinct());
    }
 public override Task <Space> TargetsSpace(TargettingFrom powerType, GameState gameState, string prompt, TargetSourceCriteria sourceCriteria, params TargetCriteria[] targetCriteria)
 {
     return(new MistsShiftAndFlow(this, gameState, prompt, sourceCriteria, targetCriteria, powerType)
            .TargetAndFlow());
 }
Example #13
0
    public override IEnumerable <Space> GetTargetOptionsFromKnownSource(Spirit self, GameState gameState, TargettingFrom powerType, IEnumerable <Space> source, TargetCriteria tc)
    {
        var normal = orig.GetTargetOptionsFromKnownSource(self, gameState, powerType, source, tc);
        var shore  = orig.GetTargetOptionsFromKnownSource(self, gameState, powerType, source, new TargetCriteria(tc.Range + 3, tc.Filter)).Where(x => x.IsCoastal);

        return(normal.Union(shore));
    }