Beispiel #1
0
        public async Task VortexAttackAsync()
        {
            if (CurrentAction == ActionType.Died)
            {
                return;
            }

            if (CurrentAction != ActionType.Handle &&
                CurrentAction != ActionType.BlockAttack)
            {
                return;
            }

            CurrentAction = ActionType.VortexAttack;
            IsInBlock     = false;
            var random = new Random();

            if (!Rival.IsInBlock)
            {
                if (Rival.CurrentAction != ActionType.Died)
                {
                    Rival.Health -= random.Next(3, 4);
                    Adrenaline   += GetRandomNumber(0.2, 0.3);
                }
            }
            else
            {
                _ = Rival.PlayAnimAsync("block_attack");
            }

            var color = Rival.IsInBlock ? ConsoleColor.Blue : ConsoleColor.Red;
            var task1 = Rival.FlashingAsync(color, ConsoleColor.Gray, 3, 100);
            var task2 = PlayAnimAsync("vortex_attack");

            await Task.WhenAll(new[] { task1, task2 });

            CurrentAction = ActionType.Handle;
            _             = PlayAnimAsync(IsInBlock ? "block_attack" : "armed_handle");

            if (Rival.Health <= 0 && Rival.CurrentAction != ActionType.Died)
            {
                _ = Rival.PlayAnimAsync("poof_die");
                Rival.CurrentAction = ActionType.Died;
            }

            _ = GameObject.InterfaceUpdateAsync();
        }
Beispiel #2
0
        public async Task UseSkill()
        {
            if (CurrentAction == ActionType.Died)
            {
                return;
            }

            if (CurrentAction != ActionType.Handle &&
                CurrentAction != ActionType.BlockAttack)
            {
                return;
            }

            CurrentAction = ActionType.UseSkill;

            if (Adrenaline >= 3 && !IsInBlock && Rival.CurrentAction != ActionType.Died)
            {
                IsInBlock = false;
                var random = new Random();

                Rival.Health -= random.Next(13, 17);
                Adrenaline    = 0;

                _ = PlayAnimAsync("armed_handle");

                CurrentAction = ActionType.Handle;

                if (Rival.Health <= 0)
                {
                    _ = Rival.PlayAnimAsync("poof_die");
                    Rival.CurrentAction = ActionType.Died;
                }

                _ = GameObject.InterfaceUpdateAsync();
            }

            CurrentAction = ActionType.Handle;
        }