Example #1
0
        public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken)
        {
            await Activate(context, cancellationToken);
            await Dismiss(context, cancellationToken);

            return(true);
        }
Example #2
0
        public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken)
        {
            await Activate(context, cancellationToken);

            await context.ClickAt(DialogButton1, cancellationToken);

            var battle = new PrepareBattle(context);
            var ct     = new CancellationTokenSource(TimeSpan.FromSeconds(3));

            try {
                await battle.Activation(CancellationTokenSource.CreateLinkedTokenSource(ct.Token, cancellationToken).Token);
            } catch (TaskCanceledException) {
                //F**k, we've mistaken, it is a boss event!
                await context.ClickAt(600, 430, cancellationToken);

                var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3));
                try {
                    await battle.Activation(CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, cts.Token).Token);
                } catch (TaskCanceledException) {
                    await TryClose(context, cancellationToken);

                    return(false);
                }
            }

            await battle.Engage(cancellationToken);

            await WaitCombatEnd(context, cancellationToken);

            return(true);
        }
Example #3
0
        public override async Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken)
        {
            await Activate(context, cancellationToken);

            await context.ClickAt(DialogButton1, cancellationToken);

            return(true);
        }
Example #4
0
 public override Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken) => throw new NotImplementedException();
Example #5
0
 public abstract Task <bool> ResolveEvent(EventHall eventHall, GameContext context, CancellationToken cancellationToken);