private static IEnumerator _Indians(Player init, IndiansLogic currentCard) { init.Hand.Remove(currentCard); PackAndDiscard.Instance.Discard(currentCard); init.UsedCard.Add(currentCard); GlobalVeriables.Instance.audioSource.clip = currentCard.audioSource; GlobalVeriables.Instance.audioSource.Play(); foreach (Bot enemy in GlobalVeriables.Instance.Enemies) { PackAsset bangCard = enemy.Hand.Find(asset => asset.CardName == ECardName.Bang); if (bangCard != null) { enemy.Hand.Remove(bangCard); PackAndDiscard.Instance.Discard(bangCard); } else { enemy.Hit(); } } yield return(new WaitForSeconds(GlobalVeriables.Instance.audioSource.time)); }
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); }
public static IEnumerator Indians(Bot init, IndiansLogic currentCard) { init.Hand.Remove(currentCard); PackAndDiscard.Instance.Discard(currentCard); GlobalVeriables.Instance.audioSource.clip = currentCard.audioSource; GlobalVeriables.Instance.audioSource.Play(); foreach (Bot enemy in GlobalVeriables.Instance.Enemies) { if (enemy != init) { PackAsset bangCard = enemy.Hand.Find(asset => asset.CardName == ECardName.Bang); if (bangCard != null) { enemy.Hand.Remove(bangCard); PackAndDiscard.Instance.Discard(bangCard); } else { enemy.Hit(); } } } if (!GlobalVeriables.Instance.Player.IsDead) { List <PackAsset> bangs = new List <PackAsset>(GlobalVeriables.Instance.Player.Hand.FindAll(card => card.CardName == ECardName.Bang)); if (bangs.Count == 0) { GlobalVeriables.Instance.Player.Hit(); } else { GlobalVeriables.GameState = EGameState.Defense; GlobalVeriables.Instance.CardZone.ShowCardSpawn(true, false); GlobalVeriables.Instance.CardZone.ShowPermanentMessage("Drop bang or take hit"); foreach (PackAsset bang in bangs) { _CreateCard(bang); } } } else { yield return(new WaitForSeconds(GlobalVeriables.Instance.audioSource.time)); } }