Example #1
0
        static void Prefix(CardManager __instance, CardState playCard, int selectedRoom, RoomState roomState, SpawnPoint dropLocation, CharacterState characterSummoned, List <CharacterState> targets, bool discardCard)
        {
            int roomindex = selectedRoom;

            if (roomindex == -1)
            {
                RoomManager roomManager;
                ProviderManager.TryGetProvider <RoomManager>(out roomManager);
                roomindex = roomManager.GetSelectedRoom();

                List <CharacterState> charList = new List <CharacterState>();
                ProviderManager.CombatManager.GetMonsterManager().AddCharactersInTowerToList(charList);
                foreach (var unit in charList)
                {
                    if (unit.IsChampion())
                    {
                        if (playCard.CharacterInRoomAtTimeOfCardPlay(unit))
                        {
                            roomindex = unit.GetCurrentRoomIndex();
                        }
                    }
                }
            }
            __instance.StartCoroutine(TriggerOnCardPlayed(playCard, roomindex, targets));
        }