Ejemplo n.º 1
0
    private static void _GatlingAndIndians()
    {
        if (_bot.RoleInfo.Role == ERole.Assistant)
        {
            return;
        }

        PackAsset gatling = _bot.Hand.Find(card => card.CardName == ECardName.Gatling);

        if (gatling == null)
        {
            return;
        }

        _bot.StartCoroutine(GatlingLogic.Gatling(_bot, (GatlingLogic)gatling));
        _bot.UsingCard(gatling);

        PackAsset indians = _bot.Hand.Find(card => card.CardName == ECardName.Indians);

        if (indians == null)
        {
            return;
        }

        _bot.StartCoroutine(IndiansLogic.Indians(_bot, (IndiansLogic)indians));
        _bot.UsingCard(indians);
    }
Ejemplo n.º 2
0
    private static void _Gatling(Player initPlayer, GatlingLogic currentCard)
    {
        initPlayer.Hand.Remove(currentCard);
        PackAndDiscard.Instance.Discard(currentCard);
        GlobalVeriables.Instance.audioSource.clip = currentCard.gatlingAudio;
        GlobalVeriables.Instance.audioSource.Play();

        foreach (Bot enemy in GlobalVeriables.Instance.Enemies)
        {
            if (!enemy.IsDead)
            {
                AIDefense.Defense(enemy, initPlayer);
            }
        }
    }
Ejemplo n.º 3
0
    public static IEnumerator Gatling(Bot init, GatlingLogic currentCard)
    {
        init.Hand.Remove(currentCard);
        PackAndDiscard.Instance.Discard(currentCard);
        GlobalVeriables.Instance.audioSource.clip = currentCard.gatlingAudio;
        GlobalVeriables.Instance.audioSource.Play();

        foreach (Bot enemy in GlobalVeriables.Instance.Enemies)
        {
            if (enemy != init && !enemy.IsDead)
            {
                AIDefense.Defense(enemy, init);
            }
        }

        List <PackAsset> defenseCard = new List <PackAsset>();

        defenseCard.AddRange(GlobalVeriables.Instance.Player.Hand.FindAll(card => card.CardName == ECardName.Missed));
        defenseCard.AddRange(GlobalVeriables.Instance.Player.Buffs.FindAll(card => card.CardName == ECardName.Barrel));

        if (GlobalVeriables.Instance.Player.CurrentHealth == 1)
        {
            defenseCard.AddRange(GlobalVeriables.Instance.Player.Hand.FindAll(card => card.CardName == ECardName.Beer));
        }

        if (defenseCard.Count == 0)
        {
            GlobalVeriables.Instance.Player.Hit();
            GlobalVeriables.Instance.Player.ShowBulletHole();
        }
        else
        {
            GlobalVeriables.GameState = EGameState.Defense;
            GlobalVeriables.Instance.CardZone.ShowCardSpawn(true, false);
            GlobalVeriables.Instance.CardZone.ShowPermanentMessage("Pick up card for defense");

            foreach (PackAsset card in defenseCard)
            {
                Actions.CreateCard(card);
            }
        }

        yield return(new WaitForSeconds(GlobalVeriables.Instance.audioSource.time));
    }