Esempio n. 1
0
 /*****************************************************************************************/
 public DrawAction(InvestigatorComponent investigator, CardComponent cardToDraw, bool withShow = false)
 {
     this.investigator = investigator;
     CardToDraw        = cardToDraw;
     deckToDraw        = cardToDraw.CurrentZone;
     this.withShow     = withShow;
 }
 /*****************************************************************************************/
 public EnemyAttackAction(InvestigatorComponent investigator, CardComponent enemy)
 {
     Investigator = investigator;
     Enemy        = enemy;
     EnemyDamage  = (int)Enemy.Info.Enemy_damage;
     EnemyHorror  = (int)Enemy.Info.Enemy_horror;
 }
        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());
            }
        }
Esempio n. 4
0
        IEnumerator BasicAttack(InvestigatorComponent investigator)
        {
            SettingInvestigatorAttack attackToEnemy = new SettingInvestigatorAttack(ThisCard, investigator.AttackDamage, attack.IsCancelable);

            yield return(attackToEnemy.RunNow());

            attack.IsCancel = !attackToEnemy.SkillTest.IsComplete ?? false;
        }
        void BuildOneInvestigator(string investigatorId)
        {
            InvestigatorComponent investigatorComponent = Instantiate(investigatorPrefab, transform);

            investigatorComponent.IdInvestigator = investigatorComponent.gameObject.name = investigatorId;
            investigatorComponent.BuildingCardsInvestigator();
            GameControl.AllInvestigatorsInGame.Add(investigatorComponent);
        }
Esempio n. 6
0
 /*****************************************************************************************/
 void ICleanCard.CleanCard()
 {
     foreach (InvestigatorComponent investigator in investigatorsAfected.Keys.ToArray())
     {
         investigatorSelected = investigator;
         ((IBuffable)this).DeBuffEffect();
     }
 }
Esempio n. 7
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;
 }
 public override bool CanMoveToThis(InvestigatorComponent investigator)
 {
     if (!IsRevealed)
     {
         return(false);
     }
     return(base.CanMoveToThis(investigator));
 }
Esempio n. 9
0
 public virtual bool CanMoveToThis(InvestigatorComponent investigator)
 {
     if (!((CardLocation)investigator.CurrentLocation.CardLogic)
         .MovePosibilities.HasFlag(MySymbol))
     {
         return(false);
     }
     return(true);
 }
Esempio n. 10
0
 /*****************************************************************************************/
 public void SetInvestigatorTraumas(InvestigatorComponent investigator)
 {
     isKilledText.gameObject.SetActive(investigator.IsKilled);
     isInsaneText.gameObject.SetActive(investigator.IsInsane);
     this.investigator        = investigator;
     investigatorImage.sprite = AllComponents.CardBuilder.GetSprite(investigator.IdInvestigator);
     ShowPhysicalTrauma();
     ShowMentalTrauma();
     ShowExperience();
 }
 public IEnumerator SelectInvestigator(InvestigatorComponent investigator)
 {
     if (investigator != GameControl.CurrentInvestigator)
     {
         DOTween.Kill("SelectInvestigator");
         DOTween.Complete("StackOrder");
         if (GameControl.CurrentInvestigator != null)
         {
             yield return(RemoveCardsInTable());
         }
         GameControl.CurrentInvestigator = investigator;
         yield return(MoveCardsToTable(investigator));
     }
 }
 /*****************************************************************************************/
 public MoveCardAction(CardComponent card, Zone zone, bool withPreview = true, bool?isBack = null, bool?returnIsBack = null, bool isFast = false, float previewPause = 0, float timeMove = GameData.ANIMATION_TIME_DEFAULT)
 {
     ThisCard             = card;
     Zone                 = zone;
     WithPreview          = withPreview;
     PreviewPause         = previewPause;
     IsBack               = isBack ?? card.IsBack;
     ReturnIsBack         = returnIsBack ?? IsBack;
     IsFast               = isFast;
     OldZone              = card.CurrentZone;
     this.timeMove        = timeMove;
     investigatorToSelect = GameControl.AllInvestigatorsInGame.Find(i => i.InvestigatorZones.Contains(Zone));
     needCoroutine        = investigatorToSelect != null &&
                            investigatorToSelect != ThisCard.VisualOwner &&
                            ThisCard.CurrentZone.ZoneType != Zones.CardBuilder;
 }
Esempio n. 13
0
 bool IBuffable.ActiveBuffCondition(GameAction gameAction)
 {
     foreach (InvestigatorComponent investigator in GameControl.AllInvestigatorsInGame)
     {
         investigatorSelected = investigator;
         if (CurrentLocation != null && investigator.CurrentLocation == CurrentLocation && !investigatorsAfected.ContainsKey(investigator))
         {
             ((IBuffable)this).BuffEffect();
         }
         else if (investigatorsAfected.ContainsKey(investigator) && investigator.CurrentLocation != CurrentLocation)
         {
             ((IBuffable)this).DeBuffEffect();
         }
     }
     return(false);
 }
Esempio n. 14
0
 public CardEffect(CardComponent card, Effect effect, EffectType type, string name = null, int actionCost = 0, int resourceCost = 0, bool needExhaust = false, InvestigatorComponent investigatorImageCardInfoOwner = null, InvestigatorComponent investigatorRealOwner = null, Effect payEffect = null, Effect cancelEffect = null, Effect animationEffect = null, Func <bool> checkFilterToCancel = null)
 {
     Card                = card;
     Effect              = effect;
     PayCostEffect       = payEffect;
     CancelEffect        = cancelEffect;
     Type                = type;
     Name                = name;
     ActionCost          = actionCost;
     ResourceCost        = resourceCost;
     NeedExhaust         = needExhaust;
     AnimationEffect     = animationEffect;
     PlayOwner           = investigatorImageCardInfoOwner ?? GameControl.ActiveInvestigator ?? GameControl.LeadInvestigator;
     RealVisualOwner     = investigatorRealOwner ?? (PlayOwner != card.VisualOwner ? card.VisualOwner : null);
     CheckFilterToCancel = checkFilterToCancel;
 }
Esempio n. 15
0
 public DrawAction(InvestigatorComponent investigator, bool isEncounter = false, bool withShow = true)
 {
     this.investigator = investigator;
     this.withShow     = withShow;
     if (isEncounter)
     {
         deckToDraw      = AllComponents.Table.EncounterDeck;
         deckDiscardPile = AllComponents.Table.EncounterDiscard;
     }
     else
     {
         deckToDraw      = investigator.InvestigatorDeck;
         deckDiscardPile = investigator.InvestigatorDiscard;
     }
     CardToDraw = deckToDraw.ListCards.LastOrDefault();
 }
        IEnumerator Bonus()
        {
            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: () => ChooseSkill(investigator),
                                    animationEffect: ((CardInvestigator)investigator.CardLogic).ThankYouAnimation,
                                    type: EffectType.Choose,
                                    name: "Obtener bonificación para " + investigator.Info.Name,
                                    investigatorImageCardInfoOwner: investigator.Owner));
            }
            yield return(new ChooseCardAction(cardEffects, cancelableCardEffect: ref mainCardEffect).RunNow());

            IEnumerator ChooseSkill(CardComponent investigator)
            {
                investigatorAfected = investigator.Owner;
                List <CardEffect> cardEffects2 = new List <CardEffect>();

                foreach (Skill skill in ((Skill[])Enum.GetValues(typeof(Skill))).Where(v => v != Skill.None))
                {
                    cardEffects2.Add(new CardEffect(
                                         card: investigator,
                                         effect: () => AddSkill(skill),
                                         type: EffectType.Choose,
                                         name: "+2 <sprite name=" + skill.ToString() + ">",
                                         investigatorImageCardInfoOwner: investigator.Owner)
                                     );
                }
                MultiCastAction multiCast = new MultiCastAction(cardEffects2, isOptionalChoice: mainCardEffect.IsCancelable);

                yield return(multiCast.RunNow());

                mainCardEffect.IsCancel = multiCast.IsCancel;


                IEnumerator AddSkill(Skill skill)
                {
                    skillBonuses = skill;
                    BuffActive   = true;
                    yield return(null);
                }
            }
        }
 /*****************************************************************************************/
 public CheckDiscardAssetsAction(InvestigatorComponent investigator, CardComponent cardToPlay, bool isConsult = false)
 {
     this.isConsult = isConsult;
     CardToPlay     = cardToPlay;
     Investigator   = investigator;
     SlotType       = cardToPlay.Info.Slot ?? string.Empty;
     if (SlotType == "Hand x2")
     {
         NeedThisAmountSlots = 2;
         SlotType            = "Hand";
     }
     if (SlotType == "Arcane x2")
     {
         NeedThisAmountSlots = 2;
         SlotType            = "Arcane";
     }
     AllAssetsForThisSlot = investigator.Assets.ListCards.FindAll(c => c.Info.Slot != null && c.Info.Slot.Contains(SlotType));
     AllAssetsForThisSlot.AddRange(investigator.Threat.ListCards.FindAll(c => c.Info.Slot != null && c.Info.Slot.Contains(SlotType)));
 }
 bool IBuffable.ActiveBuffCondition(GameAction gameAction)
 {
     if (!ThisCard.Owner)
     {
         return(false);
     }
     foreach (InvestigatorComponent investigator in GameControl.AllInvestigatorsInGame)
     {
         investigatorSelected = investigator;
         if (ThisCard.IsInPlay && investigator.CurrentLocation == ThisCard.Owner.CurrentLocation && !investigatorAfected.Contains(investigator))
         {
             ((IBuffable)this).BuffEffect();
         }
         else if ((!ThisCard.IsInPlay || investigator.CurrentLocation != ThisCard.Owner?.CurrentLocation) && investigatorAfected.Contains(investigator))
         {
             ((IBuffable)this).DeBuffEffect();
         }
     }
     return(false);
 }
        IEnumerator MoveCardsToTable(InvestigatorComponent investigator)
        {
            audioSource.PlayOneShot(changingInvestigator);
            for (int i = 0; i < investigator.InvestigatorZones.Length; i++)
            {
                investigator.InvestigatorZones[i].ZoneBehaviour = AllComponents.Table.InvestigatorZonesBehaviour[i];
                foreach (CardComponent card in investigator.InvestigatorZones[i].ListCards.ToArray())
                {
                    if (!card.IsInCenterPreview)
                    {
                        card.MoveFast(investigator.InvestigatorZones[i], withAudio: null).SetId("SelectInvestigator");
                    }
                }
            }
            yield return(new WaitWhile(() => DOTween.IsTweening("SelectInvestigator")));

            foreach (Zone zone in investigator.InvestigatorZones)
            {
                zone.ZoneBehaviour.PostCardMove();
            }
            yield return(new WaitWhile(() => DOTween.IsTweening("HorizontalOrder")));
        }
Esempio n. 20
0
        IEnumerator TakeLitaCard(InvestigatorComponent investigator)
        {
            yield return(new ChooseCardAction(new CardEffect(
                                                  card: lita,
                                                  effect: TakeLita,
                                                  animationEffect: TakeLitaAnimation,
                                                  type: EffectType.Choose,
                                                  name: "Agregar " + lita.Info.Name + " al mazo de " + investigator.Name,
                                                  investigatorImageCardInfoOwner: investigator), isOptionalChoice: true).RunNow());

            IEnumerator TakeLitaAnimation() => new AnimationCardAction(lita, withReturn: false, audioClip: lita.Effect2).RunNow();

            IEnumerator TakeLita()
            {
                yield return(new MoveCardAction(lita, investigator.InvestigatorDeck, withPreview: false, returnIsBack: false).RunNow());

                AllComponents.PanelCampaign.RegisterText(investigator.Name + " obtiene la carta " + lita.Info.Name);
                AllComponents.PanelCampaign.AddVictoryCard(lita.ID);
                investigator.AddCard(lita);
                yield return(null);
            }
        }
 IEnumerator DrawCardAnimation(InvestigatorComponent investigator) => new AnimationCardAction(investigator.PlayCard, audioClip: investigator.InvestigatorCardComponent.Effect8).RunNow();
Esempio n. 22
0
 /*****************************************************************************************/
 public EngangeAction(CardComponent enemy, InvestigatorComponent investigator)
 {
     this.enemy        = enemy;
     this.investigator = investigator;
 }
Esempio n. 23
0
 /*****************************************************************************************/
 public AssignDamageHorror(InvestigatorComponent investigator, int damageAmount = 0, int horrorAmount = 0)
 {
     Investigator = investigator;
     DamageAmount = damageAmount;
     HorrorAmount = horrorAmount;
 }
 /*****************************************************************************************/
 public SelectInvestigatorAction(InvestigatorComponent investigator) => this.investigator = investigator;
Esempio n. 25
0
 /*****************************************************************************************/
 public CheckInitialBasicWeakness(InvestigatorComponent investigator) => this.investigator = investigator;
 public void DeBuffEffect()
 {
     InvestigatorAffected.InvestigatorCardComponent.CardTools.HideBuff(ThisCard.UniqueId.ToString());
     InvestigatorAffected = null;
 }
 public void BuffEffect()
 {
     InvestigatorAffected = GameControl.ActiveInvestigator;
     InvestigatorAffected.InvestigatorCardComponent.CardTools.ShowBuff(ThisCard);
 }
 /*****************************************************************************************/
 public UpdateActionsLeft(InvestigatorComponent investigator, int amount)
 {
     Amount       = amount;
     Investigator = investigator;
 }
 IEnumerator TakeDamage(InvestigatorComponent investigator) => new AssignDamageHorror(investigator, damageAmount: 1).RunNow();
Esempio n. 30
0
 /*****************************************************************************************/
 public ExecuteCardAction(CardEffect cardEffect)
 {
     CardEffect   = cardEffect;
     Investigator = cardEffect.PlayOwner;
 }