protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            // Damage
            GetAssociatedCharacter().DebuffDamage(lastBuff);
            lastBuff = GetEffectMagnitude(0);
            GetAssociatedCharacter().BuffDamage(GetEffectMagnitude(0));

            // HP
            ProviderManager.TryGetProvider <RoomManager>(out RoomManager roomManager);
            int numUnits = roomManager.GetRoom(GetAssociatedCharacter().GetCurrentRoomIndex()).GetNumCharacters(Team.Type.Monsters, false) - 1;

            if (numUnits != lastCharNum)
            {
                if (numUnits > lastCharNum)
                {
                    if (GetAssociatedCharacter().GetMaxHP() > 10)
                    {
                        yield return(GetAssociatedCharacter().DebuffMaxHP((numUnits - lastCharNum) * 10));
                    }
                    else
                    {
                        GetAssociatedCharacter().Sacrifice(new CardState());
                    }
                }
            }
            else if (numUnits < lastCharNum)
            {
                yield return(GetAssociatedCharacter().BuffMaxHP((lastCharNum - numUnits) * 10));
            }

            lastCharNum = numUnits;
            yield break;
        }
Ejemplo n.º 2
0
        // This makes them unable to be targetted
        protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            yield return(inputTriggerParams.roomManager.GetRoomUI().SetSelectedRoom(inputTriggerParams.associatedCharacter.GetCurrentRoomIndex()));

            int statusEffectStacks = inputTriggerParams.associatedCharacter.GetStatusEffectStacks(GetStatusId());

            inputTriggerParams.playerManager.AddEnergy(statusEffectStacks);
            inputTriggerParams.associatedCharacter.ShowNotification(string.Format("StatusEffectEmberboostState_Activated".Localize(), statusEffectStacks), PopupNotificationUI.Source.General);

            GetAssociatedCharacter().RemoveStatusEffect(GetStatusId(), false, 1, true);
        }
Ejemplo n.º 3
0
        public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            List <CharacterState> towerchars = new List <CharacterState>();

            inputTriggerParams.combatManager.GetHeroManager().AddCharactersInTowerToList(towerchars);
            foreach (var hero in towerchars)
            {
                hero.AddDeathSignal(OnEnemyDeath, true);
            }

            return(true);
        }
 public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
 {
     if (inputTriggerParams.associatedCharacter == null)
     {
         return(true);
     }
     if (inputTriggerParams.associatedCharacter.HasStatusEffect("ambush"))
     {
         inputTriggerParams.associatedCharacter.RemoveStatusEffect("ambush", false, 1, false);
         inputTriggerParams.associatedCharacter.RemoveStatusEffect("slow", false, 1, true);
         inputTriggerParams.associatedCharacter.UpdateCharacterStateUI();
     }
     return(true);
 }
        public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            // This makes them unable to move
            outputTriggerParams.movementSpeed = 0;

            // This should make them unable to attack. Need to check about the TriggerStage to confirm it's firing at the right time.
            if (inputTriggerParams.canAttackOrHeal || inputTriggerParams.canFireTriggers)
            {
                outputTriggerParams.canAttackOrHeal = false;
                outputTriggerParams.canFireTriggers = false;
                return(true);
            }
            return(true);
        }
        public bool canMove(InputTriggerParams inputTriggerParams)
        {
            int currentRoom = inputTriggerParams.associatedCharacter.GetCurrentRoomIndex();

            if (currentRoom > 0)
            {
                if (inputTriggerParams.roomManager.GetRoom(currentRoom - 1).IsRoomEnabled())
                {
                    return(true);
                }
            }

            return(false);
        }
        public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            if (inputTriggerParams.associatedCharacter.GetCurrentRoomIndex() == 2 && inputTriggerParams.associatedCharacter.GetStatusEffectStacks("gravity") > 0)
            {
                return(false);
            }

            List <CharacterState> characters = new List <CharacterState>();

            inputTriggerParams.combatManager.GetHeroManager().AddCharactersInRoomToList(characters, inputTriggerParams.associatedCharacter.GetCurrentRoomIndex());
            foreach (var character in characters)
            {
                if (character.GetStatusEffect("relentless") != null)
                {
                    return(false);
                }
            }
            return(true);
        }
        protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            // Don't fly up during Relentless
            List <CharacterState> characters = new List <CharacterState>();

            inputTriggerParams.combatManager.GetHeroManager().AddCharactersInRoomToList(characters, inputTriggerParams.associatedCharacter.GetCurrentRoomIndex());
            foreach (var character in characters)
            {
                if (character.GetStatusEffect("relentless") != null)
                {
                    yield break;
                }
            }

            // Provider
            ProviderManager.TryGetProvider <RoomManager>(out inputTriggerParams.roomManager);

            // At end of turn, ascend and if we try to ascend into the Pyre then we kaboom and do something.
            if (inputTriggerParams.associatedCharacter.GetCurrentRoomIndex() == 2)
            {
                yield return(inputTriggerParams.associatedCharacter.Sacrifice(new CardState()));
            }
            else
            {
                var cardEffectParams = new CardEffectParams
                {
                    saveManager   = inputTriggerParams.combatManager.GetSaveManager(),
                    combatManager = inputTriggerParams.combatManager,
                    heroManager   = inputTriggerParams.combatManager.GetHeroManager(),
                    roomManager   = inputTriggerParams.roomManager,
                    targets       = new List <CharacterState> {
                        inputTriggerParams.associatedCharacter
                    },
                };
                var bumper = new CardEffectBump();
                yield return(bumper.Bump(cardEffectParams, 1));
            }

            yield break;
        }
        public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            if (inputTriggerParams.damage == 0)
            {
                return(false);
            }
            CharacterState attacked = inputTriggerParams.attacked;

            if (attacked == null)
            {
                return(false);
            }

            int attack = attacked.GetAttackDamage();
            int min    = Mathf.Min(attacked.GetAttackDamage(), inputTriggerParams.damage);

            attacked.DebuffDamage(min);

            outputTriggerParams.damage = inputTriggerParams.damage - min;
            //outputTriggerParams.visualDamage = inputTriggerParams.damage - min;
            //outputTriggerParams.damageBlocked = min;
            return(true);
        }
        protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            ProviderManager.TryGetProvider <RoomManager>(out inputTriggerParams.roomManager);

            // At end of turn, descend, and if we did Descend remove a stack of gravity.
            if (canMove(inputTriggerParams))
            {
                var cardEffectParams = new CardEffectParams
                {
                    saveManager   = inputTriggerParams.combatManager.GetSaveManager(),
                    combatManager = inputTriggerParams.combatManager,
                    heroManager   = inputTriggerParams.combatManager.GetHeroManager(),
                    roomManager   = inputTriggerParams.roomManager,
                    targets       = new List <CharacterState> {
                        inputTriggerParams.associatedCharacter
                    },
                };
                var bumper = new CardEffectBump();
                yield return(bumper.Bump(cardEffectParams, -1));

                yield return(Descend(inputTriggerParams.associatedCharacter));
            }
        }
 public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
 {
     OnPyreAttackChange(saveManager.GetDisplayedPyreAttack(), saveManager.GetDisplayedPyreNumAttacks());
     return(true);
 }
        // Ideally lose gold every time they attack, ascend, or get hit and don't die. We may only be able to implement two of those

        protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams)
        {
            GetAssociatedCharacter().RemoveStatusEffect(GetStatusId(), false, 1, true);
            yield break;
        }