Example #1
0
        void SearchBasicWeakness()
        {
            if (basicWeaknessList == null)
            {
                basicWeaknessList = new List <string>();
                foreach (var card in Card.DataCard.Where(c => c.Subtype_code == "basicweakness" && c.Pack_code == "core" && c.Code != "01000").Select(c => new { Id = c.Code, c.Quantity }))
                {
                    for (int i = 0; i < card.Quantity; i++)
                    {
                        basicWeaknessList.Add(card.Id);
                    }
                }
            }

            int           rndCard           = Random.Range(0, basicWeaknessList.Count - 1);
            CardComponent basicWeaknessCard = AllComponents.CardBuilder.BuildCard(basicWeaknessList[rndCard], GameFiles.INVESTIGATOR_BACK_IMAGE);

            basicWeaknessCard.Owner = ThisCard.Owner;
            GameControl.CurrentInvestigator.RemoveCard(ThisCard);
            GameControl.CurrentInvestigator.AddCard(basicWeaknessCard);
            basicWeaknessList.RemoveAt(rndCard);
            new EffectAction(DrawRandomBasicWeakness).AddActionTo();

            IEnumerator DrawRandomBasicWeakness()
            {
                yield return(ThisCard.transform.DOLocalMoveX(-1, GameData.ANIMATION_TIME_DEFAULT).SetEase(Ease.OutCubic).WaitForCompletion());

                yield return(new MoveCardAction(ThisCard, AllComponents.CardBuilder.Zone, isBack: false).RunNow());

                yield return(new ShowCardAction(basicWeaknessCard).RunNow());

                yield return(new MoveCardAction(basicWeaknessCard, GameControl.CurrentInvestigator.InvestigatorDeck, withPreview: false, isBack: true).RunNow());
            }
        }
Example #2
0
 /*****************************************************************************************/
 public AnimationCardAction(CardComponent card, bool withReturn = true, bool?isBack = null, AudioClip audioClip = null)
 {
     thisCard        = card;
     this.withReturn = withReturn;
     this.isBack     = isBack;
     this.audioClip  = audioClip;
 }
Example #3
0
 public override void PointEnterCardAnimation(CardComponent card)
 {
     card.CardTools.PlaySoundEnterCard();
     DOTween.Kill(card.UniqueId + "ExitCard");
     this.StackOrder(card.transform);
     card.transform.DOScale(1.1f, GameData.INTERACTIVE_TIME_DEFAULT).SetId(card.UniqueId + "EnterCard").SetEase(enterCardEase);
 }
 public override void PointExitCardAnimation(CardComponent card)
 {
     card.CardTools.PlayOneShotSound(exitHover);
     DOTween.Sequence().Append(card.transform.DOMove(StayCard.transform.position, GameData.INTERACTIVE_TIME_DEFAULT))
     .Join(card.transform.DORotate(StayCard.transform.rotation.eulerAngles, GameData.INTERACTIVE_TIME_DEFAULT))
     .SetEase(easeDrop);
 }
 /*****************************************************************************************/
 public ShowCardAction(CardComponent card, bool isBack = false, bool withReturn = false, AudioClip audioClip = null)
 {
     ThisCard        = card;
     this.isBack     = isBack;
     this.withReturn = withReturn;
     this.audioClip  = audioClip ?? isBack ? ThisCard.ShowCardBack : ThisCard.ShowCardFront;
 }
 /*****************************************************************************************/
 public EnemyAttackAction(InvestigatorComponent investigator, CardComponent enemy)
 {
     Investigator = investigator;
     Enemy        = enemy;
     EnemyDamage  = (int)Enemy.Info.Enemy_damage;
     EnemyHorror  = (int)Enemy.Info.Enemy_horror;
 }
Example #7
0
 protected virtual void MoveToOriginalzone(CardComponent card)
 {
     card.CurrentZone.ZoneBehaviour = realZone[card.CurrentZone];
     card.MoveFast(card.CurrentZone, indexPosition: card.Position);
     card.Position = null;
     AllComponents.Table.CenterPreview.RemoveCard(card);
 }
Example #8
0
 /*****************************************************************************************/
 public DrawAction(InvestigatorComponent investigator, CardComponent cardToDraw, bool withShow = false)
 {
     this.investigator = investigator;
     CardToDraw        = cardToDraw;
     deckToDraw        = cardToDraw.CurrentZone;
     this.withShow     = withShow;
 }
Example #9
0
        public void Active(CardComponent card)
        {
            Desactive();
            cardMesh.mesh = card.CardTools.CardMesh.mesh;
            showPreviewRend.sharedMaterial = card.CardTools.PreviewMaterial;
            glowClone = Instantiate(card.CardTools.GlowImage.gameObject, transform);
            glowClone.GetComponent <Image>().material = inactiveGlow;
            buffBoxClone = Instantiate(card.CardTools.BuffBox, transform);
            buffBoxClone.GetComponentsInChildren <BoxCollider>().ToList().ForEach(b => b.enabled = false);
            tokensClone  = Instantiate(card.CardTools.TokensBox, transform);
            infoBoxClone = Instantiate(card.CardTools.InfoBox, transform);
            if (card.IsBack)
            {
                backInfoClone = Instantiate(card.CardTools.InfoBack, transform);
            }
            else
            {
                frontInfoClone = Instantiate(card.CardTools.InfoFront, transform);
            }
            //if (card.CardTools.LocationClues != null) locationCluesClone = Instantiate(card.CardTools.LocationClues.gameObject, transform);
            //if (card.CardTools.GiveClues != null) giveCluesClone = Instantiate(card.CardTools.GiveClues.gameObject, transform);
            //if (card.CardTools.EnemyLive != null) enemyLiveClone = Instantiate(card.CardTools.EnemyLive.gameObject, transform);


            gameObject.SetActive(true);
        }
 IEnumerator DrawCards(CardComponent investigator)
 {
     for (int i = 0; i < 3; i++)
     {
         yield return(new DrawAction(investigator.Owner, withShow: false).RunNow());
     }
 }
 void IBuffable.DeBuffEffect()
 {
     cardAffected.CardTools.HideBuff(ThisCard.UniqueId.ToString());
     ((CardEvent)cardAffected.CardLogic).OnBeginCanBePlayedFromHandEvent -= ChangeDiscardToHand;
     ((CardEvent)cardAffected.CardLogic).OnEndCanBePlayedFromHandEvent   -= ChangeHandToDiscard;
     cardAffected = null;
 }
 void IBuffable.BuffEffect()
 {
     cardAffected = playableCardEvent;
     playableCardEvent.CardTools.ShowBuff(ThisCard);
     ((CardEvent)playableCardEvent.CardLogic).OnBeginCanBePlayedFromHandEvent += ChangeDiscardToHand;
     ((CardEvent)playableCardEvent.CardLogic).OnEndCanBePlayedFromHandEvent   += ChangeHandToDiscard;
 }
Example #13
0
        IEnumerator ThrowFight(CardComponent enemy)
        {
            SettingInvestigatorAttack attackToenemy = new SettingInvestigatorAttack(enemy, GameControl.ActiveInvestigator.AttackDamage + 1, throwAttack.IsCancelable, bonus: 2);

            yield return(attackToenemy.RunNow());

            throwAttack.IsCancel = !attackToenemy.SkillTest.IsComplete ?? false;
        }
Example #14
0
 /*****************************************************************************************/
 public InvestigatorTraumaAction(InvestigatorComponent investigator, string textToCampaign, bool isPhysical, CardComponent cardToCampaign = null)
 {
     this.isPhysical     = isPhysical;
     this.investigator   = investigator;
     this.textToCampaign = textToCampaign;
     this.cardToCampaign = cardToCampaign;
     audioAnimation      = isPhysical ? investigator.InvestigatorCardComponent.Effect3 : investigator.InvestigatorCardComponent.Effect7;
 }
Example #15
0
 protected virtual void ActionLogicEnd()
 {
     ActivateCards(false);
     cardSelected = null;
     AnyIsClicked = false;
     AllComponents.ReadyButton.State = ButtonState.Off;
     AllComponents.PanelSkillTest.ReadyButton.State = ButtonState.Off;
 }
Example #16
0
        IEnumerator FightEffect(CardComponent enemy)
        {
            enemyToFight = enemy;
            SettingFight(enemy);
            yield return(attackToenemy.RunNow());

            weaponCardEffect.IsCancel = !attackToenemy.SkillTest.IsComplete ?? false;
        }
        public override void PointEnterPreview(CardComponent card)
        {
            float xOffSet   = card.transform.localPosition.x < 0 ? 0.6f : -0.6f;
            float xPosition = (card.transform.localPosition.x / 3f) + xOffSet;

            CardPreview.transform.localPosition = new Vector3(xPosition, CardPreview.transform.localPosition.y, CardPreview.transform.localPosition.z);
            base.PointEnterPreview(card);
        }
Example #18
0
 public override void CardPlay(CardComponent card)
 {
     CardPlayed = card;
     if ((ChosenCardEffects.Exists(c => c.Card == card) && !isLoop) || ChosenCardEffects.Count < 2)
     {
         ContinueNextAction = true;
     }
     base.CardPlay(card);
 }
Example #19
0
        protected override IEnumerator ThisCardEffect()
        {
            Zone       zoneToStayEnemies = GameControl.ActiveInvestigator.CurrentLocation.MyOwnZone;
            CardEffect thisCardEffect    = new CardEffect(
                card: ThisCard,
                effect: ConfirmDesenganged,
                type: EffectType.Choose,
                name: "Dejar de estar enfrentado a todos los enemigos");

            yield return(new ChooseCardAction(thisCardEffect, isOptionalChoice: true).RunNow());

            LocationSymbol    thisLocationSymbol = ((CardLocation)GameControl.ActiveInvestigator.CurrentLocation.CardLogic).MySymbol;
            List <CardEffect> chooseToMove       = new List <CardEffect>();

            foreach (CardComponent location in GameControl.AllCardComponents.FindAll(c => c.CardType == CardType.Location && c.IsInPlay && ((CardLocation)c.CardLogic).MovePosibilities.HasFlag(thisLocationSymbol)))
            {
                chooseToMove.Add(new CardEffect(
                                     card: location,
                                     effect: () => ConfirmMove(location),
                                     type: EffectType.Choose | EffectType.Move,
                                     name: "Moverse aquĆ­"));
            }
            yield return(new ChooseCardAction(chooseToMove, isOptionalChoice: true).RunNow());

            if (desenganged)
            {
                foreach (CardComponent enemy in ThisCard.VisualOwner.AllEnemiesEnganged)
                {
                    enemy.MoveTo(zoneToStayEnemies);
                }
            }
            if (locationToMove != null)
            {
                yield return(new MoveCardAction(GameControl.ActiveInvestigator.PlayCard, locationToMove.MyOwnZone).RunNow());
            }
            if (desenganged)
            {
                foreach (CardComponent enemy in ThisCard.VisualOwner.AllEnemiesEnganged)
                {
                    yield return(new MoveCardAction(enemy, enemy.CurrentZone, withPreview: false).RunNow());
                }
            }
            desenganged    = false;
            locationToMove = null;

            IEnumerator ConfirmDesenganged()
            {
                desenganged = true;
                yield return(null);
            }

            IEnumerator ConfirmMove(CardComponent location)
            {
                locationToMove = location;
                yield return(null);
            }
        }
        IEnumerator RevealOtherToken(RevealChaosTokenAction revealToken)
        {
            revealToken.IsActionCanceled = true;
            List <ChaosTokenComponent> tokens    = new List <ChaosTokenComponent>();
            List <CardEffect>          allTokens = new List <CardEffect>();

            for (int i = 0; i < 2; i++)
            {
                ChaosTokenComponent token = AllComponents.ChaosBag.RandomChaosToken();
                tokens.Add(token);
                allTokens.Add(new CardEffect(
                                  card: ThisCard,
                                  effect: () => ChoosingToken(token),
                                  type: EffectType.Choose,
                                  name: "Elegir este token",
                                  investigatorImageCardInfoOwner: ThisCard.VisualOwner));
                yield return(AllComponents.ChaosBag.DropToken(token));

                yield return(new WaitUntil(token.RigidBody.IsSleeping));
            }
            MultiCastAction multiCast = new MultiCastAction(allTokens, isOptionalChoice: false);

            for (int i = 0; i < 2; i++)
            {
                CardComponent card = multiCast.ListCardsEffect[i].Card;
                card.CardTools.TokensBox.SetActive(false);
                card.CardTools.HideFrontCard(true);
                card.CardTools.ChangeGlowImage(AllComponents.CardBuilder.TokenGlow, Vector3.one);
                originalTokenPosition[i] = tokens[i].transform.position;
                tokens[i].transform.SetParent(card.transform);
                tokens[i].RigidBody.isKinematic = true;
                tokens[i].GetComponent <MeshCollider>().enabled = false;
                DOTween.Sequence().Append(tokens[i].transform.DOLocalMove(Vector3.zero, timeAnimation))
                .Join(tokens[i].transform.DOScale(0.3f, timeAnimation))
                .Join(tokens[i].transform.DOLocalRotate(new Vector3(180, 0, 0), timeAnimation));
                tokens[i].gameObject.layer = 8;
            }
            yield return(multiCast.RunNow());

            IEnumerator ChoosingToken(ChaosTokenComponent tokenSelected)
            {
                for (int i = 0; i < 2; i++)
                {
                    tokens[i].AudioSource.enabled = true;
                    tokens[i].transform.SetParent(AllComponents.ChaosBag.transform);
                    DOTween.Sequence().Append(tokens[i].transform.DOMove(originalTokenPosition[i], timeAnimation))
                    .Join(tokens[i].transform.DOScale(1f, timeAnimation)).SetId("DualTokens");
                    tokens[i].RigidBody.isKinematic = false;
                    tokens[i].GetComponent <MeshCollider>().enabled = true;
                    tokens[i].gameObject.layer = 0;
                }
                yield return(new WaitWhile(() => DOTween.IsTweening("DualTokens")));

                revealToken.SkillTest.TokenThrow = tokenSelected;
                yield return(AllComponents.ChaosBag.ReturnToken(tokens.Find(t => t != tokenSelected)));
            }
        }
 public override void PointExitCardAnimation(CardComponent card)
 {
     card.CardTools.PlaySoundExitCard();;
     DOTween.Kill(card.UniqueId + "EnterCard");
     DOTween.Sequence().Append(card.transform.DOMoveY(transform.position.y + (card.transform.GetSiblingIndex() * yOffSet), GameData.INTERACTIVE_TIME_DEFAULT))
     .Join(card.transform.DOMoveZ(transform.position.z, GameData.INTERACTIVE_TIME_DEFAULT))
     .Join(card.transform.DOLocalRotate(StayCard.localRotation.eulerAngles, GameData.INTERACTIVE_TIME_DEFAULT))
     .SetId(card.UniqueId + "ExitCard").SetEase(enterCardEase);
 }
        IEnumerator Fight(CardComponent enemy)
        {
            SettingInvestigatorAttack attackToenemy = new SettingInvestigatorAttack(enemy, ThisCard.VisualOwner.AttackDamage + 2, playFromHand.IsCancelable);

            attackToenemy.SkillTest.SkillType = Skill.Agility;
            attackToenemy.SkillTest.ExtraCard = ThisCard;
            yield return(attackToenemy.RunNow());

            playFromHand.IsCancel = !attackToenemy.SkillTest.IsComplete ?? false;
        }
Example #23
0
 public override void PointExitCardAnimation(CardComponent card)
 {
     card.CardTools.PlaySoundExitCard();
     DOTween.Kill(card.UniqueId + "EnterCard");
     if (cardSelected != null && cardSelected.CardSensor.CurrentBehaviourZone == this)
     {
         this.StackOrder(cardSelected.transform);
     }
     card.transform.DOScale(1f, GameData.INTERACTIVE_TIME_DEFAULT).SetId(card.UniqueId + "ExitCard");
 }
 public override void CardPlay(CardComponent card)
 {
     PreparingCard(card, false);
     AllComponents.Table.CenterPreview.ListCards.Remove(card);
     if (ChosenCardEffects.Count < 2)
     {
         ContinueNextAction = true;
     }
     base.CardPlay(card);
     ChosenCardEffects.Remove(ChosenCardEffects.Find(c => c.Card == card));
 }
        public IEnumerator RemoveModifier(CardComponent card)
        {
            listModifiers.Find(m => m.Card == card).Active(null);
            SkillTest.UpdateModifier(-card.CardTools.GetModifierValue(SkillTest.SkillType));
            yield return(AllComponents.InvestigatorManagerComponent.SelectInvestigator(card.Owner));

            if (card.CurrentZone.ListCards.Last() != card)
            {
                yield return(card.transform.DOLocalMoveX(1, GameData.ANIMATION_TIME_DEFAULT).WaitForCompletion());
            }
            yield return(new MoveCardAction(card, card.Owner.Hand).RunNow());
        }
 protected override void EndGameAction(GameAction gameAction)
 {
     base.EndGameAction(gameAction);
     if (ThisCard.IsInPlay)
     {
         playableCardEvent = ThisCard.VisualOwner.InvestigatorDiscard.ListCards.FindAll(c => c.CardType == CardType.Event).LastOrDefault();
     }
     if (gameAction is ExecuteCardAction executeCard && executeCard.CardEffect == cardToCheck)
     {
         cardToCheck = null;
     }
 }
Example #27
0
 public override void PointEnterCardAnimation(CardComponent card)
 {
     if (card == topCard)
     {
         card.CardTools.PlaySoundEnterCard();
         DOTween.Kill(topCard.UniqueId + "ExitCard");
         DOTween.Sequence().Append(topCard.transform.DOMoveZ(ShowCard.position.z, GameData.INTERACTIVE_TIME_DEFAULT))
             .Join(topCard.transform.DOMoveY(ShowCard.position.y + GameData.CARD_THICK * transform.childCount, GameData.INTERACTIVE_TIME_DEFAULT))
             .Join(topCard.transform.DORotate(ShowCard.rotation.eulerAngles, GameData.INTERACTIVE_TIME_DEFAULT))
             .SetId(topCard.UniqueId + "EnterCard").SetEase(enterCardEase);
     }
 }
Example #28
0
        IEnumerator DeckVoid(Zone discardPile)
        {
            yield return(new MoveDeck(discardPile.ListCards, deckToDraw, isBack: true, withMoveUp: true).RunNow());

            yield return(new ShuffleAction(deckToDraw).RunNow());

            CardToDraw = deckToDraw.ListCards.LastOrDefault();
            if (discardPile.InvestigatorOwer != null)
            {
                yield return(new AssignDamageHorror(discardPile.InvestigatorOwer, horrorAmount: 1).RunNow());
            }
        }
Example #29
0
 protected void PreparingCard(CardComponent card, bool isPrepared)
 {
     card.CardTools.ShowCardsInMyOwnZone(!isPrepared);
     if (isPrepared && !AnyIsClicked)
     {
         card.CardTools.PrintCardActions(ChosenCardEffects);
     }
     else
     {
         card.CardTools.ShowInfoBox(string.Empty);
     }
     card.CardTools.CardCanvas.sortingLayerName = isPrepared ? "Super" : "Card";
 }
Example #30
0
        public override void PointExitCardAnimation(CardComponent card)
        {
            card.CardTools.PlaySoundExitCard();
            DOTween.Kill(card.UniqueId + "EnterCard");
            DOTween.Sequence().Append(card.transform.DOScale(1f, GameData.INTERACTIVE_TIME_DEFAULT))
            .Join(card.transform.DOLocalMoveZ(0f, GameData.INTERACTIVE_TIME_DEFAULT))
            .SetId(card.UniqueId + "ExitCard");
            int index = card.transform.GetSiblingIndex();

            invisibleCards[index].gameObject.SetActive(false);
            invisibleCards[index].GetComponent <LayoutElement>().preferredWidth = 300;
            StartCoroutine(this.HorizontalOrder(invisibleCards));
        }