Пример #1
0
    void CheckCombatEnded()
    {
        if (!bCombatEnded)
        {
            this.monsterGroupFighter.CheckFightersLife();
            this.humanGroupFighter.CheckFightersLife();

            if (this.monsterGroupFighter.allFightersDead)
            {
                bCombatEnded  = true;
                combatEndType = CombatEndType.MonstersDead;
                AkSoundEngine.PostEvent("CombatLose", gameObject);
            }
            else if (this.monsterGroupFighter.bEscaping)
            {
                bCombatEnded  = true;
                combatEndType = CombatEndType.MonsterEscape;
                fighterMouvementManager.bMonsterRun = true;
                AkSoundEngine.PostEvent("CombatLose", gameObject);
            }
            else if (this.humanGroupFighter.allFightersDead)
            {
                bCombatEnded  = true;
                combatEndType = CombatEndType.HumansDead;
                AkSoundEngine.PostEvent("CombatWin", gameObject);
            }

            if (((GroupHumanFighter)humanGroupFighter).bIsConviced)
            {
                bCombatEnded  = true;
                combatEndType = CombatEndType.HumansConvinced;
                AkSoundEngine.PostEvent("CombatWin", gameObject);
            }
            if (((GroupHumanFighter)humanGroupFighter).bIsFeared)
            {
                bCombatEnded  = true;
                combatEndType = CombatEndType.HumansFeared;
                fighterMouvementManager.bHumanRun = true;
                AkSoundEngine.PostEvent("CombatWin", gameObject);
                AkSoundEngine.PostEvent("Play_flee", gameObject);
            }

            if (bCombatEnded)
            {
                if (bSpecialFight && specialType == SpecialType.Bard)
                {
                    ((IABard)humanGroupFighter.groupLogic).EndCombat();
                }
                if (bSpecialFight && specialType == SpecialType.Ed)
                {
                    ((IAEd)humanGroupFighter.groupLogic).EndCombat();
                }
                if (combatEndType != CombatManager.CombatEndType.MonsterEscape && combatEndType != CombatManager.CombatEndType.MonstersDead)
                {
                    if (discoveredTip == null)
                    {
                        TipsManager tipManager = GameObject.FindGameObjectWithTag("TipManager").GetComponent <TipsManager>();
                        discoveredTip = tipManager.GetRandTipConcerningGroups((GroupMonsterFighter)monsterGroupFighter, (GroupHumanFighter)humanGroupFighter);
                    }
                }
            }
        }
    }