Exemple #1
0
    private void RemoveDeadPlayerIfTurnChangedToPlayer(TurnState turn)
    {
        if (turn == TurnState.Player)
        {
            int totalSeverancePay = 0;
            var deadProgrammers   = Programmers.Where(programmer => programmer.IsAlive == false)
                                    .ToList();

            foreach (var programmer in deadProgrammers)
            {
                CommonLogger.LogFormat("UnitManager::RemoveDeadPlayerIfTurnChangedToPlayer => 프로그래머 {0}가 사망하여 스테이지 내에서 제외됨.", programmer.Status.Name);
                programmerActingDictionary.Remove(programmer);
                totalSeverancePay += programmer.Status.Cost.Fire;
            }

            if (totalSeverancePay > 0)
            {
                if (Turn != TurnState.GameEnd)
                {
                    StageManager.Instance.StageUi.RenderDeathText(deadProgrammers);
                }
                // TODO: Spend money!
            }
        }
    }
Exemple #2
0
 private void RemoveDeadPlayerIfTurnChangedToPlayer(TurnState turn)
 {
     if (turn == TurnState.Player)
     {
         foreach (var programmer in Programmers.Where(programmer => programmer.IsAlive == false)
                  .ToList())
         {
             CommonLogger.LogFormat("UnitManager::RemoveDeadPlayerIfTurnChangedToPlayer => 프로그래머 {0}가 사망하여 스테이지 내에서 제외됨.", programmer.Status.Name);
             programmerActingDictionary.Remove(programmer);
         }
     }
 }
Exemple #3
0
    private void RequestBossActionIfTurnChangedToBoss(TurnState turn)
    {
        if (Turn == TurnState.Boss)
        {
            if (Programmers.Where(programmer => programmer.Status.IsOnVacation).Count() ==
                Programmers.Count())
            {
                CommonLogger.Log("UnitManager::RequestBossActionIfTurnChangedToBoss => 보스에게 행동을 요청하려 했으나, 모든 프로그래머가 휴가 중이므로 취소됨.");

                StageManager.Instance.StageUi.RenderPlayerText("프로젝트가 아무런 행동도 수행하지 않았습니다.");
                boss.InvokeFinished();
                return;
            }

            CommonLogger.Log("UnitManager::RequestBossActionIfTurnChangedToBoss => 보스에게 행동을 요청함.");

            //Decrease Boss Skill Cool
            foreach (ProjectSkill iter in Boss.Ability.ProjectSkills)
            {
                iter.DecreaseCooldown();
            }
            //Decrease Boss Burf Cool and Remove if it's Cool down
            for (int i = 0, delete = 0; i < Boss.Status.Burf.Count; i++)
            {
                Boss.Status.Burf[i - delete].DecreaseTurn();
                if (Boss.Status.Burf[i - delete].Turn < 1)
                {
                    Boss.Status.Burf.RemoveAt(i - delete);
                    delete++;
                }
            }

            if (UnityEngine.Random.Range(0, 12) > 9)
            {
                //MOVE
                StageManager.Instance.MoveBoss();
                StageManager.Instance.StageUi.RenderPlayerText("프로젝트의 방향이 전환되었습니다!");
            }
            else
            {
                //DO Attack or Skill
                var usedSkill = boss.Invoke();
                if (usedSkill is ISoundProducible)
                {
                    var clip = (usedSkill as ISoundProducible).EffectSound;
                    SoundManager.Instance.FetchAvailableSource().PlayOneShot(clip);
                }

                StageManager.Instance.StageUi.RenderBossSkillNotice(usedSkill);

                CommonLogger.LogFormat("UnitManager::RequestBossActionIfTurnChangedToBoss => 보스가 {0} 스킬을 사용함.", usedSkill.Information.Name);

                switch (usedSkill.Information.Type)
                {
                case ProjectSkillType.SingleAttack:
                    InvokeSkill((ProjectSingleAttackSkill)usedSkill);
                    break;

                case ProjectSkillType.MultiAttack:
                    InvokeSkill((ProjectMultiAttackSkill)usedSkill);
                    break;

                case ProjectSkillType.SingleDeburf:
                    InvokeSkill((ProjectSingleDeburfSkill)usedSkill);
                    break;

                case ProjectSkillType.MultiDeburf:
                    InvokeSkill((ProjectMultiDeburfSkill)usedSkill);
                    break;

                case ProjectSkillType.Burf:
                    InvokeSkill((ProjectBurfSkill)usedSkill);
                    break;
                }
            }

            if (Turn != TurnState.GameEnd)
            {
                boss.InvokeFinished();
            }
        }
    }