Example #1
0
    void CheckFear()
    {
        sDisplayed = "Feared : ";
        GroupHumanFighter group = (GroupHumanFighter)(combatManager.humanGroupFighter);

        sDisplayed += group.nCurrentFear + " / " + group.nFear;
    }
Example #2
0
    void CheckConvince()
    {
        sDisplayed = "Convinced : ";
        GroupHumanFighter group = (GroupHumanFighter)(combatManager.humanGroupFighter);

        sDisplayed += group.nCurrentConvice + " / " + group.nConvice;
    }
Example #3
0
    public Tip GetRandTipConcerningGroups(GroupMonsterFighter groupMonster, GroupHumanFighter groupHuman)
    {
        List <Tip> lFinalTips = GetAllTipConcerningGroups(groupMonster, groupHuman, true);

        if (lFinalTips.Count == 0)
        {
            return(null);
        }
        int randIndex = Random.Range(0, lFinalTips.Count);
        Tip tip       = lFinalTips[randIndex];

        LearnTip(tip);

        return(tip);
    }
Example #4
0
    public List <Tip> GetAllTipConcerningGroups(GroupMonsterFighter groupMonster, GroupHumanFighter groupHuman, bool inInitialGroup)
    {
        List <Tip> finalList = new List <Tip>();

        List <Fighter> allHuman   = groupHuman.lFighters;
        List <Fighter> allMonster = groupMonster.lFighters;

        if (inInitialGroup)
        {
            allHuman   = groupHuman.lInitialFighters;
            allMonster = groupMonster.lInitialFighters;
        }


        foreach (Tip tip in tipsNotKnownByPlayer)
        {
            bool bConcernM = false;
            bool bConcernH = false;

            foreach (Fighter fighter in allHuman)
            {
                ModelHumainUI       modelH  = ((Human)fighter).currentUI.gameObject.GetComponentInChildren <ModelHumainUI>();
                CaractHumainCheveux cheveux = modelH.caractCheveux;
                CaractHumainStuff   stuff   = modelH.caractStuff;
                if (tip.caracHumain == cheveux)
                {
                    bConcernH = true;
                }
                else if (tip.caracHumain == stuff)
                {
                    bConcernH = true;
                }
            }
            foreach (Fighter fighter in allMonster)
            {
                ModelMonsterUI modelM = ((Monster)fighter).currentUI.gameObject.GetComponentInChildren <ModelMonsterUI>();

                if (modelM != null)
                {
                    CaractMonster firstMutation = modelM.caractMonster;
                    CaractMonster permaMutation = modelM.permanentCarMutation;

                    if (tip.caracMonster == firstMutation)
                    {
                        bConcernM = true;
                    }
                    else if (tip.caracMonster == permaMutation)
                    {
                        bConcernM = true;
                    }
                }
            }

            if (bConcernH && bConcernM)
            {
                finalList.Add(tip);
            }
        }


        return(finalList);
    }
Example #5
0
    public float GetBonus(ActionType actionType, Monster monster, GroupHumanFighter groupHuman)
    {
        float bonus = 0;

        List <Tip> myTips = GetTipsOfAction(actionType, monster.eCreatureType);

        CaractMonster cm = monster.currentUI.gameObject.GetComponentInChildren <ModelMonsterUI>().caractMonster;

        myTips = GetTipsAboutMonsterCarac(cm, myTips);

        foreach (Fighter fighter in groupHuman.lFighters)
        {
            if (fighter.CanAttack())
            {
                ModelHumainUI modelH = ((Human)fighter).currentUI.gameObject.GetComponentInChildren <ModelHumainUI>();

                CaractHumainCheveux cheveux = modelH.caractCheveux;
                CaractHumainStuff   stuff   = modelH.caractStuff;

                foreach (Tip tip in myTips)
                {
                    if (tip.caracHumain == cheveux)
                    {
                        bonus += tip.modroll.GetValueOfAction(actionType, monster.eCreatureType);
                    }
                    else if (tip.caracHumain == stuff)
                    {
                        bonus += tip.modroll.GetValueOfAction(actionType, monster.eCreatureType);
                    }

                    if (bonus != 0)
                    {
                        break;
                    }
                }
            }

            if (bonus != 0)
            {
                break;
            }
        }


        myTips = GetTipsOfAction(actionType, monster.eCreatureType);
        cm     = monster.currentUI.gameObject.GetComponentInChildren <ModelMonsterUI>().permanentCarMutation;
        myTips = GetTipsAboutMonsterCarac(cm, myTips);

        foreach (Fighter fighter in groupHuman.lFighters)
        {
            if (fighter.CanAttack())
            {
                ModelHumainUI       modelH  = ((Human)fighter).currentUI.gameObject.GetComponentInChildren <ModelHumainUI>();
                CaractHumainCheveux cheveux = modelH.caractCheveux;
                CaractHumainStuff   stuff   = modelH.caractStuff;

                foreach (Tip tip in myTips)
                {
                    if (tip.caracHumain == cheveux)
                    {
                        bonus += tip.modroll.GetValueOfAction(actionType, monster.eCreatureType);
                    }
                    else if (tip.caracHumain == stuff)
                    {
                        bonus += tip.modroll.GetValueOfAction(actionType, monster.eCreatureType);
                    }

                    if (bonus != 0)
                    {
                        break;
                    }
                }
            }

            if (bonus != 0)
            {
                break;
            }
        }
        //   CaractMonster mutation;


        return(bonus);
    }