public List <HunterIdea> GetHuntersByQuestKey(string Qkey)
    {
        List <HunterIdea> temp = new List <HunterIdea>();

        for (int i = 0; i < charaList.Count; i++)
        {
            if (charaList[i].associatedQuestKey == Qkey && charaList[i].CharaType == E_Charactor.HUNTER)
            {
                temp.Add(charaList[i] as HunterIdea);
            }
        }
        for (int i = 0; i < visitedToday.Count; i++)
        {
            if (visitedToday[i].associatedQuestKey == Qkey && visitedToday[i].CharaType == E_Charactor.HUNTER)
            {
                temp.Add(visitedToday[i] as HunterIdea);
            }
        }

        Queue <VisitChara> .Enumerator enu = expireCharaQue.GetEnumerator();

        while (enu.MoveNext())
        {
            CharactorIdea ci = enu.Current.one;
            if (ci.associatedQuestKey == Qkey && ci.CharaType == E_Charactor.HUNTER)
            {
                temp.Add(ci as HunterIdea);
            }
        }
        return(temp);
    }
    void SelectExpires() //만기일 온 애들 큐에 집어넣는 과정.
    {
        string visitMsg = UIGeneralTextsManager.GetUIGeneralText("quickMessage", "visited");
        int    idx      = 0;

        while (idx < charaList.Count)
        {
            if (charaList[idx].hasCommission && !charaList[idx].haveComeBeforeExpire)   //기본 조건.
            {
                if (!expired(charaList[idx]))
                {
                    idx++;
                    continue;
                }

                CharactorIdea expireOne = charaList[idx];
                charaList.RemoveAt(idx);
                expireCharaQue.Enqueue(new VisitChara(InGameTimeManager.GetInstance().GetNowInGameTimeStamp(), expireOne));
                QuickMessageUIManager.GetInstance().ShowQuickMessage(expireOne.CharaName + visitMsg);
                Debug.Log(expireOne.CharaName + "만기 큐에 들어옴. 현재시각 - " + InGameTimeManager.GetInstance().GetNowTime()
                          + "캐릭터의 만기는" + expireOne.GetExpire() + "였음"
                          );
            }
            else
            {
                idx++;
            }
        }
    }
    CharactorIdea GambleGetNewbie()
    {
        bool makeNewbie = (Random.Range(0, 2) == 1) ? makeNewbie = true : makeNewbie = false;

        E_Charactor charaType = (E_Charactor)(Random.Range(0, (int)E_Charactor.MAX));

        if (QuestManager.GetInstance().QuestDic.Count == 0) //현재 퀘스트가 한 개도 없으면 확정으로 클라이언트 생성.
        {
            charaType  = E_Charactor.CLIENT;
            makeNewbie = true;
        }

        if (!makeNewbie)
        {
            return(null);               //캐릭터를 새로 생성 안하는 경우도 있음.
        }
        string charaName = TextManager.GetInstance().GetNewbieName();

        CharactorIdea newbie    = null;
        int           spriteNum = Random.Range(0, SpriteManager.GetInstance().charactorSprites.Length); //캐릭터 스프라이트는... 그냥 랜덤으로...

        switch (charaType)
        {
        case E_Charactor.CLIENT:
            newbie = new ClientIdea(spriteNum, charaName);
            break;

        case E_Charactor.HUNTER:
            float nowQuestsAverageCap = Mathf.Floor(QuestManager.GetInstance().GetAverageQuestCap());
            //현재 퀘스트에 올라온 평균 능력치의 절반 부터 평균치의 1~2.5배 능력치 중에서 랜덤
            float hunterCap = Mathf.Floor(Random.Range(
                                              nowQuestsAverageCap / 2,
                                              checked (
                                                  nowQuestsAverageCap * Random.Range(1f, 2.5f)
                                                  )));

            newbie = new HunterIdea(spriteNum, charaName, hunterCap);
            break;
        }
        return(newbie);


        /*
         *
         * CharactorIdea tempforDebugNewbie;
         #if UNITY_EDITOR
         * //모킹
         * if(ds.GetInstance().clientBorn)
         * tempforDebugNewbie = new ClientIdea(0, tempName, E_Personality.CHEAP);
         * //새로운 캐릭터 생성.
         * else
         *  tempforDebugNewbie = new HunterIdea(1, tempName, E_Personality.CHEAP, hunterCap);
         #endif
         * return tempforDebugNewbie;
         */
    }
    bool expired(CharactorIdea idea)
    {
        uint nowTime    = InGameTimeManager.GetInstance().GetNowInGameTimeStamp();
        uint expireTime = idea.GetExpire().InGameTimeMinuteStamp;

        if (expireTime <= nowTime)
        {
            return(true);
        }
        //나중에 만기시각 몇 시간 정도 까지 랜덤? 하게 봐줄지 결정하기.
        return(false);
    }
예제 #5
0
    void ShowCharaIdea(CharactorIdea ci)
    {
        // Debug.Log(ci.CharaName);
        HunterIdea hunter = ci as HunterIdea;
        ClientIdea client = ci as ClientIdea;

        if (hunter != null)
        {
            EditorGUILayout.TextField("☆★헌터", ci.CharaName);
            EditorGUILayout.ObjectField(ci.CharaSprite, typeof(Sprite), true);
            EditorGUILayout.TextField("연관키", ci.associatedQuestKey);

            if (hunter.GetExpire() != null)
            {
                EditorGUILayout.TextField("헌터 겟 익스파이어.", hunter.GetExpire().ToString());
            }
            else
            {
                EditorGUILayout.TextField("헌터 겟 익스파이어.", "아직 존재 안함.");
            }



            EditorGUILayout.Toggle("커미션 가진 여부", ci.hasCommission);

            EditorGUILayout.TextField("밑은 헌팅 리스트 ,  만기여부=", hunter.haveComeBeforeExpire.ToString());
            int idx = 0;
            if (hunter.HuntedList != null)
            {
                foreach (QuestPerMob qpm in hunter.HuntedList)
                {
                    EditorGUILayout.TextField("QPM [" + idx + "]", qpm.ToString());
                    idx++;
                }
            }
            else
            {
                EditorGUILayout.TextField("헌팅 리스트 존재하지 않아.", "");
            }
        }
        else
        {
            EditorGUILayout.TextField("☆★클라이언트", ci.CharaName);
            EditorGUILayout.ObjectField(ci.CharaSprite, typeof(Sprite), true);
            EditorGUILayout.TextField("연관키", ci.associatedQuestKey);
            EditorGUILayout.Toggle("커미션 가진 여부", ci.hasCommission);
            EditorGUILayout.TextField("설정된 만기 기간은 = ", client.DaysExpire.ToString());

            EditorGUILayout.TextField("밑은 의뢰인 오리진 퀘스트, 만기 텀 여부는", client.haveComeBeforeExpire.ToString());
            ShowQuest(client.OriginOrderedQuest);
        }
    }
    public void RemoveCharactor(CharactorIdea nowChara) //리브 (딴 놈 콜 전에 호출됨.)
    //리브 애니메이션 전에 호출됨.
    {
        TextManager.GetInstance().HandInName(nowChara.CharaName);
        for (int i = 0; i < visitedToday.Count; i++)
        {
            if (visitedToday[i] == nowChara)
            {
                visitedToday.RemoveAt(i);   //얘는 뭐 하나니까.
                return;
            }
        }

        Debug.LogError("현재 나우 캐릭터 문제. 비지티드 파티에 없음." + nowChara.CharaName);
    }
예제 #7
0
    void VisitNextOne() //다음 놈 부르기.
    {
        if (RoomEventManager.GetInstance().IsNowWineAndDine)
        {
            return;                                                     //접대중이면 패쓰함.
        }
        EventParameterStorage.GetInstance().ParametersReset();

        CharactorIdea nextOne = CharactorManager.GetInstance().GetNextCharactor();

        if (nextOne == null)
        {
            return;
        }

        nextOne.AnamnesisToCharactorFrame();
        CharactorFrame.GetInstance().ComeAnim();
    }
    void GoBackExpires() //만기일 온 애들 기다리다가 그냥 가는 애들.
    {
        string leaveMsg = UIGeneralTextsManager.GetUIGeneralText("quickMessage", "leaved");

        if (expireCharaQue.Count <= 0)
        {
            return;
        }

        uint nowTime = InGameTimeManager.GetInstance().GetNowInGameTimeStamp();

        VisitChara visited;

        visited = expireCharaQue.Peek();

        while (visited != null)  //1시간 기다리다 감.
        {
            if (visited.comeTimeStamp + 60 >= nowTime)
            {
                CharactorIdea goback = expireCharaQue.Dequeue().one;
                goback.haveComeBeforeExpire = true;
                visitedToday.Add(goback);
                QuickMessageUIManager.GetInstance().ShowQuickMessage(goback.CharaName + leaveMsg);
                Debug.Log(goback.CharaName + "만기 기다리다 그냥 돌아감 현재 시각 " + InGameTimeManager.GetInstance().GetNowTime()
                          + "캐릭터의 만기는" + goback.GetExpire() + "였음  비지트 타음스탬프 =" + visited.comeTimeStamp + "현재시각 타임스탬프 ="
                          + nowTime
                          );
                if (expireCharaQue.Count <= 0)
                {
                    return;
                }
                visited = expireCharaQue.Peek();
            }
            else
            {
                return;
            }
        }
    }
 public VisitChara(uint st, CharactorIdea id)
 {
     comeTimeStamp = st; one = id;
 }