Example #1
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            MonoBehaviour monoBehaviour = Main.monoBehaviour;
            List <IEntityWithBoardPresence> removedEntities = m_removedEntities;
            int count = removedEntities.Count;

            for (int i = 0; i < count; i++)
            {
                IEntityWithBoardPresence entity = removedEntities[i];
                MonoBehaviourExtensions.StartCoroutineImmediateSafe(monoBehaviour, RemoveEntityFromBoard(entity), null);
            }
            if (GameStatus.fightType == FightType.BossFight && fightStatus.endReason == FightStatusEndReason.Lose)
            {
                FightMap current = FightMap.current;
                if (null != current)
                {
                    if (fightStatus.TryGetEntity((PlayerStatus p) => p.teamIndex == GameStatus.localPlayerTeamIndex, out PlayerStatus entityStatus))
                    {
                        HeroStatus heroStatus = entityStatus.heroStatus;
                        if (heroStatus != null)
                        {
                            Vector2Int refCoord = heroStatus.area.refCoord;
                            current.AddHeroLostFeedback(refCoord);
                        }
                    }
                    MonoBehaviourExtensions.StartCoroutineImmediateSafe(monoBehaviour, current.ClearMonsterSpawnCells(fightStatus.fightId), null);
                }
            }
            if (fightStatus == FightStatus.local && !GameStatus.hasEnded)
            {
                yield return(DisplayFightResultFeedback(fightStatus));
            }
        }