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()); } } } }
bool CheckPlayCardInGame(SkillTestAction skillTestAction) { if (!ThisCard.IsInPlay) { return(false); } if (GameControl.ActiveInvestigator != ThisCard.VisualOwner) { return(false); } if (!SkillToTest.HasFlag(skillTestAction.SkillTest.SkillType)) { return(false); } return(true); }
bool ChangeSkill(SkillTestAction skillTestAction) { if (!BuffActive) { return(false); } if (GameControl.CurrentSkillTestAction == skillTestAction) { return(false); } if (ThisCard.VisualOwner != skillTestAction.ActiveInvestigator) { return(false); } if (!((Skill.Agility | Skill.Combat).HasFlag(skillTestAction.SkillTest.SkillType))) { return(false); } return(true); }
IEnumerator ChangeSkillTest(SkillTestAction skillTestAction) { yield return(new AnimationCardAction(ThisCard, isBuffEvent: true, audioClip: ThisCard.Effect2).RunNow()); skillTestAction.SkillTest.SkillType = Skill.Intellect; }