IEnumerator TakeControlLita(InvestigatorComponent investigator) { SkillTest skillTest = new SkillTest { Title = "Convenciendo a " + ThisCard.Info.Name, SkillType = Skill.Intellect, CardToTest = Lita, TestValue = 4, IsOptional = parlayCardEffect.IsCancelable }; skillTest.WinEffect.Add(new CardEffect( card: Lita, effect: WinEffect, animationEffect: WinEffectAnimation, type: EffectType.Choose, name: "Controlar a Lita")); SkillTestAction skillTestAction = new SkillTestAction(skillTest); yield return(skillTestAction.RunNow()); parlayCardEffect.IsCancel = !skillTestAction.SkillTest.IsComplete ?? false; IEnumerator WinEffectAnimation() => new AnimationCardAction(Lita, audioClip: Lita.Effect2).RunNow(); IEnumerator WinEffect() { Lita.Owner = investigator; yield return(new MoveCardAction(Lita, investigator.Assets, withPreview: false).RunNow()); } }
IEnumerator Heal() { List <CardEffect> cardEffects = new List <CardEffect>(); foreach (CardComponent investigator in GameControl.AllInvestigatorsInGame.FindAll(i => i.CurrentLocation == ThisCard.VisualOwner.CurrentLocation).Select(i => i.InvestigatorCardComponent)) { cardEffects.Add(new CardEffect( card: investigator, effect: () => SkillTestHeal(investigator), animationEffect: ((CardInvestigator)investigator.CardLogic).ThankYouAnimation, type: EffectType.Choose, name: "Intentar curar a " + investigator.Info.Name, investigatorImageCardInfoOwner: ThisCard.VisualOwner)); } yield return(new ChooseCardAction(cardEffects, cancelableCardEffect: ref mainCardEffect).RunNow()); IEnumerator SkillTestHeal(CardComponent investigator) { SkillTest skillTest = new SkillTest() { Title = "Curando a " + investigator.Info.Name, SkillType = Skill.Intellect, CardToTest = ThisCard, TestValue = 2, IsOptional = mainCardEffect.IsCancelable }; skillTest.WinEffect.Add(new CardEffect( card: ThisCard, effect: () => Healing(investigator), type: EffectType.Choose, name: "Curar a " + investigator.Info.Name + " con " + ThisCard.Info.Name, investigatorImageCardInfoOwner: ThisCard.VisualOwner, investigatorRealOwner: investigator.Owner)); skillTest.LoseEffect.Add(new CardEffect( card: ThisCard, effect: () => new AssignDamageHorror(investigator.Owner, damageAmount: 1).RunNow(), type: EffectType.Choose, name: "Dañar a " + investigator.Info.Name + " con " + ThisCard.Info.Name, investigatorImageCardInfoOwner: ThisCard.VisualOwner, investigatorRealOwner: investigator.Owner)); SkillTestAction skillTestAction = new SkillTestAction(skillTest); yield return(skillTestAction.RunNow()); mainCardEffect.IsCancel = !skillTestAction.SkillTest.IsComplete ?? false; IEnumerator Healing(CardComponent cardToHeal) { if (cardToHeal.HealthToken.Amount > 0) { yield return(new AddTokenAction(investigator.HealthToken, -1).RunNow()); } } } }