예제 #1
0
        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());
            }
        }
예제 #2
0
        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());
                    }
                }
            }
        }
 public void ShowResult(SkillTest skillTest)
 {
     value.text            = skillTest.TotalInvestigatorValue.ToString();
     testValue.text        = SkillTest.TotalTestValue.ToString();
     imageSkillTest.sprite = skillTest.TokenThrow?.ImageToken ?? imageSkillTest.sprite;
     button.State          = skillTest.IsWin ? ButtonState.Ready : ButtonState.StandBy;
     button.ChangeButtonText(skillTest.IsWin ? "You WIN" : "You LOSE");
     button.AudioSource.PlayOneShot(skillTest.IsWin ? winClip : loseClip);
 }
예제 #4
0
        IEnumerator ChangingToken(RevealChaosTokenAction revealChaosToken)
        {
            effectUsed = true;
            yield return(new ReturnChaosTokenAction(revealChaosToken.Token).RunNow());

            SkillTest skillTest = revealChaosToken.SkillTest;

            yield return(new RevealChaosTokenAction(ref skillTest).RunNow());
        }
예제 #5
0
        IEnumerator ChangingTokenToFail(RevealChaosTokenAction revealChaosToken)
        {
            ChaosTokenComponent oldToken = revealChaosToken.Token;

            revealChaosToken.Token = AllComponents.ChaosBag.tokenList.Find(t => t.Type == ChaosTokenType.Fail);
            yield return(new ReturnChaosTokenAction(oldToken).RunNow());

            SkillTest skillTest = revealChaosToken.SkillTest;

            yield return(new RevealChaosTokenAction(ref skillTest, revealChaosToken.Token).RunNow());
        }
 /*****************************************************************************************/
 public void SetPanel(SkillTest skillTest)
 {
     investigatorTest.Active(GameControl.ActiveInvestigator.InvestigatorCardComponent);
     SkillTest = skillTest;
     extraCard.Active(SkillTest.ExtraCard);
     titlePanel.text       = GameControl.CurrentInteractableAction.ActiveInvestigator.InvestigatorCardComponent.Info.Name + " " + skillTest.Title;
     skill.sprite          = CheckSkillImage(skillTest.SkillType);
     imageSkillTest.sprite = AllComponents.CardBuilder.GetSprite(skillTest.CardToTest.IsBack ? skillTest.CardToTest.ID + "b" : skillTest.CardToTest.ID);
     imageSensor.Card      = skillTest.CardToTest;
     UpdatePanel();
     StartCoroutine(SelectThisPanel());
 }
 /*****************************************************************************************/
 public InvestigateLocation(CardComponent location, bool isCancelable)
 {
     Location  = location;
     WinEffect = () => new DiscoverCluesAction(GameControl.ActiveInvestigator, 1).RunNow();
     SkillTest = new SkillTest
     {
         Title         = "Investigando " + Location.Info.Name,
         SkillType     = Skill.Intellect,
         SkillTestType = SkillTestType.Investigate,
         CardToTest    = Location,
         TestValue     = ((CardLocation)Location.CardLogic).Shroud,
         IsOptional    = isCancelable,
     };
 }
        /*****************************************************************************************/
        public EvadeEnemySkillTest(CardComponent enemy, bool isCancelable)
        {
            this.enemy = enemy;

            SkillTest = new SkillTest
            {
                Title         = "Evadiendo " + enemy.Info.Name,
                SkillType     = Skill.Agility,
                SkillTestType = SkillTestType.Evade,
                CardToTest    = enemy,
                TestValue     = (int)enemy.Info.Enemy_evade,
                IsOptional    = isCancelable
            };
        }
예제 #9
0
 /*****************************************************************************************/
 public override IEnumerator Revelation()
 {
     skillTest = new SkillTest
     {
         Title      = "Evitando " + ThisCard.Info.Name,
         SkillType  = Skill.Agility,
         CardToTest = ThisCard,
         TestValue  = 3
     };
     skillTest.LoseEffect.Add(new CardEffect(
                                  card: ThisCard,
                                  effect: LoseEffect,
                                  type: EffectType.Choose,
                                  name: "Recibir daño"));
     yield return(new SkillTestAction(skillTest).RunNow());
 }
예제 #10
0
 /*****************************************************************************************/
 public override IEnumerator Revelation()
 {
     skillTest = new SkillTest
     {
         Title      = "Soportando " + ThisCard.Info.Name,
         SkillType  = Skill.Willpower,
         CardToTest = ThisCard,
         TestValue  = 4
     };
     skillTest.LoseEffect.Add(new CardEffect(
                                  card: ThisCard,
                                  effect: LoseEffect,
                                  type: EffectType.Choose,
                                  name: "Efecto de " + ThisCard.Info.Name));
     yield return(new SkillTestAction(skillTest).RunNow());
 }
        /*****************************************************************************************/
        public SettingInvestigatorAttack(CardComponent enemy, int damage, bool isCancelabe, int bonus = 0)
        {
            Enemy     = enemy;
            Damage    = damage;
            Bonus     = bonus;
            WinEffect = WinEffectDefault;

            SkillTest = new SkillTest
            {
                Title         = "Atacando a " + Enemy.Info.Name,
                SkillType     = Skill.Combat,
                SkillTestType = SkillTestType.Attack,
                CardToTest    = Enemy,
                TestValue     = (int)Enemy.Info.Enemy_fight,
                IsOptional    = isCancelabe
            };
        }
예제 #12
0
        public override IEnumerator CultistTokenEffect()
        {
            int horrorAmount = 1;

            if (IsHardDifficulty)
            {
                horrorAmount = 2;
                SkillTest skillTest = SkillTest;
                yield return(new RevealChaosTokenAction(ref skillTest).RunNow());

                yield return(new SkillTestChaosTokenEffect(skillTest.TokenThrow).RunNow());
            }

            SkillTest.LoseEffect.Add(new CardEffect(
                                         card: ThisCard,
                                         effect: () => new AssignDamageHorror(GameControl.ActiveInvestigator, horrorAmount: horrorAmount).RunNow(),
                                         type: EffectType.Choose,
                                         name: "Recibir horror"));
        }
예제 #13
0
        IEnumerator SkillTestToDiscard()
        {
            SkillTest skillTest = new SkillTest
            {
                Title      = "Intentando superar " + ThisCard.Info.Name,
                SkillType  = Skill.Willpower,
                CardToTest = ThisCard,
                TestValue  = 3
            };

            skillTest.WinEffect.Add(new CardEffect(
                                        card: ThisCard,
                                        effect: WinEffect,
                                        type: EffectType.Choose,
                                        name: "Descartar"));
            yield return(new SkillTestAction(skillTest).RunNow());

            IEnumerator WinEffect() => new DiscardAction(ThisCard).RunNow();
        }
예제 #14
0
        protected override IEnumerator LogicEffect()
        {
            List <CardEffect> listCardEffects = new List <CardEffect>();

            foreach (CardComponent enemy in ThisCard.VisualOwner.Threat.ListCards.FindAll(c => c.CardType == CardType.Enemy))
            {
                listCardEffects.Add(new CardEffect(
                                        card: enemy,
                                        effect: () => Evade(enemy),
                                        animationEffect: ((CardEnemy)enemy.CardLogic).BadEffectForEnemyAnimation,
                                        type: EffectType.Choose,
                                        name: ThisCard.Info.Name + " a " + enemy.Info.Name,
                                        investigatorImageCardInfoOwner: ThisCard.VisualOwner));
            }
            yield return(new ChooseCardAction(listCardEffects, cancelableCardEffect: ref playFromHand).RunNow());

            IEnumerator Evade(CardComponent enemy)
            {
                effectToExecuteIOnlyOne = true;
                EvadeEnemySkillTest evadeEnemy = new EvadeEnemySkillTest(enemy, playFromHand.IsCancelable);

                thisSkillTest = evadeEnemy.SkillTest;
                evadeEnemy.SkillTest.SkillType = Skill.Willpower;
                evadeEnemy.SkillTest.ExtraCard = ThisCard;
                evadeEnemy.SkillTest.WinEffect.Add(new CardEffect(
                                                       card: ThisCard,
                                                       effect: DoDamage,
                                                       animationEffect: DoDamageAnimation,
                                                       type: EffectType.Choose,
                                                       name: "Hacer daño",
                                                       investigatorImageCardInfoOwner: ThisCard.VisualOwner));
                yield return(evadeEnemy.RunNow());

                playFromHand.IsCancel = !evadeEnemy.SkillTest.IsComplete ?? false;

                IEnumerator DoDamageAnimation() => new AnimationCardAction(ThisCard, audioClip: ThisCard.Effect3).RunNow();

                IEnumerator DoDamage() => new DamageEnemyAction(enemy, DamageToEnemy).RunNow();
            }
        }
 /*****************************************************************************************/
 public SkillTestAction(SkillTest skillTest) => SkillTest = skillTest;
예제 #16
0
 /*****************************************************************************************/
 public SkillTestActionComplete(SkillTest skillTest) => SkillTest = skillTest;
예제 #17
0
 /*****************************************************************************************/
 public InvestigatorAttackAction(SkillTest combatTest) => this.combatTest = combatTest;
예제 #18
0
 /*****************************************************************************************/
 public RevealChaosTokenAction(ref SkillTest skillTest, ChaosTokenComponent token = null)
 {
     Token     = token ?? AllComponents.ChaosBag.RandomChaosToken();
     SkillTest = skillTest;
 }
예제 #19
0
 protected override void SettingFight(CardComponent enemy)
 {
     base.SettingFight(enemy);
     skillTestThisFight = attackToenemy.SkillTest;
 }
예제 #20
0
 public SkillTestResultAction(ref SkillTest skillTest) => SkillTest = skillTest;
 /*****************************************************************************************/
 public SkillTestActionResolution(SkillTest skillTest) => this.skillTest = skillTest;