public void QuestMakingDone(List <QuestPerMob> madeQPMList)//작성한 퀘스트.
    {
        if (madeQPMList == null || madeQPMList.Count == 0)
        {
            Debug.LogError("퀘스트 메이킹 작업물이 존재하지 않음.");
        }


        ClientIdea client = CharactorFrame.GetInstance().clientIdea;
        string     newKey = Quest.MakeQuestKey(client.CharaName);

        Quest writtenQuest = new Quest();   //작성한 퀘스트 생성.

        writtenQuest.SettingQuestMetaDataByToday(newKey, client.CharaName, client.DaysExpire, madeQPMList);
        QuestManager.GetInstance().AddQuest(newKey, writtenQuest); //퀘스트매니져에 작성한 퀘스트를 넣어둬
        client.SetHasCommission(newKey);                           //여기서 의뢰인의 오리진 퀘스트 의뢰일과 만기가 설정됨.

        MainCamAnim.GetInstance().CamToPosNormal(
            () => {
            CharactorFrame.GetInstance().UpdateFSM();                                                             //메인 카메라가 원상태로 복귀한 후에 fsm 업뎃해주기 위해.

            int deposit = PayFormula.CalculateClientRequestDeposit(client.OriginOrderedQuest, client.DaysExpire); //디포짓 얻는 것.
            GoldManager.GetInstance().AdjustGold(deposit, GoldManager.E_PayType.FROM_CLIENT);
        });                                                                                                       //메인카메라 원상태로.
        // CharactorFrame.GetInstance().UpdateFSM(); 메인 카메라가 원상태로 복귀한 후에 fsm 업뎃해주기 위해. 여기서 업뎃하면 안댐
    }
    public void HunterRewardCalculate(E_RewardType type) //헌터 보상 정산만.
    {
        HunterIdea         hunter       = CharactorFrame.GetInstance().hunterIdea;
        Quest              writtenQuest = QuestManager.GetInstance().GetQuest(hunter.associatedQuestKey);
        List <QuestPerMob> huntedList   = hunter.HuntedList;
        int hunterExpireTerm            = hunter.GetHunterExpireGap();
        int hunterPayment = PayFormula.CalculateHuntLastPayment(writtenQuest, hunterExpireTerm, huntedList, type);

        GoldManager.GetInstance().AdjustGold(-1 * hunterPayment, GoldManager.E_PayType.TO_HUNTER);

        if (type != E_RewardType.PAYMENT_DENY)
        {
            Inventory.GetInstance().AddMobEviByList(CharactorFrame.GetInstance().hunterIdea.HuntedList);
        }
    }
    void ClientCommissionCheckCalculateLastincome()   //만기여부와 등등을 고려하여 정산할것!! 클라이언트가 qc 정산 하는 단계!
    {
        ClientIdea client = CharactorFrame.GetInstance().clientIdea;
        int        outDue = 0;

        if (client.haveComeBeforeExpire)
        {
            InGameTime clientExpire = client.GetExpire();
            InGameTime nowTime      = InGameTimeManager.GetInstance().GetNowTime();
            outDue = nowTime.GetDaysGap(clientExpire);
        }
        int lastClientPayment = PayFormula.CalculateClientRequestLastPayment(client.OriginOrderedQuest,
                                                                             client.DaysExpire,
                                                                             EventParameterStorage.GetInstance().QuestCompareCompleteness, outDue);

        GoldManager.GetInstance().AdjustGold(lastClientPayment, GoldManager.E_PayType.FROM_CLIENT);
    }
    public void HunterInquireQuestSubmit(string Qkey, bool didDetermined, List <Weapon> rentalSelected) //헌터에게 퀘스트를 맡기고 렌탈등과 퀘스트 등과 선택 했을 때.
    {
        if (!didDetermined)                                                                             //ui에서 제출이면 true 인자로 넣어서 보내주기!
        {
            EventParameterStorage.GetInstance().PlayerChoice = false;
            CharactorFrame.GetInstance().UpdateFSM();
            return;
        }

        EventParameterStorage.GetInstance().PlayerChoice = true;
        HunterIdea hunter        = CharactorFrame.GetInstance().hunterIdea;
        Quest      selectedQuest = QuestManager.GetInstance().GetQuest(Qkey);

        //본래 퀘스트의 만기보다 하루 빨리. 그리고 10시~ 17시 사이를 랜덤으로 지정.
        InGameTime dayOneMinus  = InGameTime.GetOnlyOneDayMinus(selectedQuest.ExpireDate);
        uint       hour         = (uint)Random.Range(Constant.dayStartHour, Constant.dayEndHour - 1);
        InGameTime hunterExpire = new InGameTime(dayOneMinus.Year, dayOneMinus.Month, dayOneMinus.Day, hour, 0);

        hunter.SetHasCommission(Qkey);
        hunter.SetHuntExpireDay(hunterExpire);

        if (rentalSelected != null)
        {
            //렌탈 처리 해주기.
            hunter.SetRentalTheseWeapon(rentalSelected);
            Inventory.GetInstance().RemoveWeaponsFromInven(rentalSelected);//렌탈해간 물건들 인벤에서 뺴주는 처리.
        }

        WholeMonsterRiskManager.GetInstance().AddHunter(hunter);    //수임을 받은날 위협도 매니져에서 일함.(그 날의 데이오프 부터)

        QuestRoomSceneUIManager.GetInstance().OnlyShowMainUIOrigin();

        int deposit = PayFormula.CalculateHuntDeposit(selectedQuest, hunter.GetHunterExpireGap());   //헌터 착수금 지불.

        GoldManager.GetInstance().AdjustGold(-1 * deposit, GoldManager.E_PayType.TO_HUNTER);

        CharactorFrame.GetInstance().UpdateFSM();
    }
Пример #5
0
    void Init()
    {
        HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea;

        Debug.Log("헌터 리워드, 원래 헌터." + hunter.HuntedList.DebugString());

        List <QuestPerMob> huntingOutcome;
        var hol = from ho in hunter.HuntedList
                  orderby(int) ho.mob
                  select ho;

        huntingOutcome = hol.ToList <QuestPerMob>();

        for (int i = 0; i < huntingOutcome.Count; i++)
        {
            QuestPerMob qpm  = huntingOutcome[i];
            GameObject  temp = Instantiate(itemBtn, hunterBringContent.transform);
            SetTxtsItem(qpm, temp);
        }
        List <QuestPerMob> writtenQuestList = QuestManager.GetInstance().GetQuest(
            hunter.associatedQuestKey
            ).QuestList;

        var wql = from wq in writtenQuestList
                  orderby(int) wq.mob
                  select wq;

        writtenQuestList = wql.ToList <QuestPerMob>();

        for (int i = 0; i < writtenQuestList.Count; i++)
        {
            QuestPerMob qpm  = writtenQuestList[i];
            GameObject  temp = Instantiate(itemBtn, writtenQuestContent.transform);
            SetTxtsItem(qpm, temp);
        }
        completeness = QuestManager.GetInstance().GetQuest(hunter.associatedQuestKey).GetCompleteness
                           (hunter.HuntedList);

        hunterName.text       = hunter.CharaName;
        completenessText.text = completeness.ToString();

        if (completeness <= 50)
        {
            completenessText.color = Color.red;
        }
        else if (completeness < 80)
        {
            completenessText.color = Color.yellow;
        }
        else
        {
            completenessText.color = Color.green;
        }


        allPayGolds = PayFormula.CalculateHuntLastPayment(QuestManager.GetInstance().GetQuest(
                                                              hunter.associatedQuestKey
                                                              ),
                                                          hunter.GetHunterExpireGap(),
                                                          hunter.HuntedList, E_RewardType.ALL_PAYMENT);

        partialPayGolds = PayFormula.CalculateHuntLastPayment(QuestManager.GetInstance().GetQuest(
                                                                  hunter.associatedQuestKey),
                                                              hunter.GetHunterExpireGap()
                                                              , hunter.HuntedList, E_RewardType.PARTIAL_PAYMENT);

        //지불 금액 텍스트 표시.
        allPaymentText.text = allPayGolds.ToString() + " " + paymentTxt;

        if (completeness < 100 && completeness > 0)
        {
            partialPaymentText.text = partialPayGolds.ToString() + " " + paymentTxt;
        }
        else
        {
            partialBtn.interactable = false;
            partialPaymentText.text = "";
        }

        denyPaymentText.text = "0 " + paymentTxt;
    }
Пример #6
0
    public string GetClientText(E_ClientState state, ClientIdea client)
    {
        string          result   = "";
        Client_TextData textData = clientText.dataArray[(int)state];

        switch (LanguageManager.GetInstance().Language)
        {
        case E_Language.KOREAN:
            result = textData.Charatextkor;
            break;

        case E_Language.ENGLISH:
            result = textData.Charatexteng;
            break;
        }
        int deposit = PayFormula.CalculateClientRequestDeposit(client.OriginOrderedQuest, client.DaysExpire);


        switch (state)  //치환해야하는 문자열의 경우.
        {
        case E_ClientState.COMMISSION:
            int clientLastPayin100per = PayFormula.CalculateClientRequestLastPayment(
                client.OriginOrderedQuest, client.DaysExpire, 100f, 0
                );
            result = result.Replace("[0]", deposit.ToString());
            result = result.Replace("[1]", clientLastPayin100per.ToString());
            break;

        case E_ClientState.COMMISION_MAKE_DONE:

            result = result.Replace("[0]", client.DaysExpire.ToString());
            result = result.Replace("[1]", deposit.ToString());
            break;

        case E_ClientState.CHECK_NO_EXPIRE:
            result = result.Replace("[0]", client.DaysExpire.ToString());
            break;

        case E_ClientState.CHECK_IMPERFACT_00:      //뺐을 착수금으로 치환
            result = result.Replace("[0]", deposit.ToString());
            break;

        case E_ClientState.CHECK_IMPERFACT_50:      //성공보수금으로 치환
        case E_ClientState.CHECK_IMPERFACT_80:
        case E_ClientState.CHECK_IMPERFACT_95:
        case E_ClientState.CHECK_PERFACT:
            int outDue = 0;
            if (client.haveComeBeforeExpire)
            {
                InGameTime clientExpire = client.GetExpire();
                InGameTime nowTime      = InGameTimeManager.GetInstance().GetNowTime();
                outDue = nowTime.GetDaysGap(clientExpire);
            }
            int lastClientPayment = PayFormula.CalculateClientRequestLastPayment(client.OriginOrderedQuest,
                                                                                 client.DaysExpire,
                                                                                 EventParameterStorage.GetInstance().QuestCompareCompleteness, outDue);

            result = result.Replace("[0]", lastClientPayment.ToString());
            break;
        }

        return(result);
    }