Ejemplo n.º 1
0
        public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams)
        {
            int       num             = 0;
            CardState parentCardState = cardEffectState.GetParentCardState();

            if (parentCardState != null)
            {
                CardTraitState.ApplyingHealParameters healParameters = default(CardTraitState.ApplyingHealParameters);
                healParameters.combatManager = cardEffectParams.combatManager;
                foreach (CardTraitState traitState in parentCardState.GetTraitStates())
                {
                    healParameters.healAmount = num;
                    num = traitState.OnApplyingTrainHeal(healParameters);
                }
            }
            num += cardEffectState.GetParamInt();
            PyreRoomState  pyreRoom       = cardEffectParams.roomManager.GetPyreRoom();
            CharacterState characterState = pyreRoom?.GetPyreHeart();

            if (characterState != null)
            {
                num = Mathf.Min(cardEffectParams.saveManager.GetMaxTowerHP() - cardEffectParams.playerManager.GetTowerHP(), num);
                characterState.GetCharacterUI().ApplyStateToUI(pyreRoom.GetPyreHeart(), cardEffectParams.popupNotificationManager, num, doingDamage: false);
            }
            cardEffectParams.playerManager.HealTowerHP(num);

            yield break;
        }
        private int GetDamageAmount()
        {
            if (pyreroom == null)
            {
                pyreroom = GameObject.FindObjectOfType <PyreRoomState>() as PyreRoomState;
            }
            int pyreAttack = 0;

            pyreroom.TryGetPyreAttack(out pyreAttack);


            return(pyreAttack);
        }