void ShowNowCFrame() { HunterIdea ch = CharactorFrame.GetInstance().hunterIdea; ClientIdea cc = CharactorFrame.GetInstance().clientIdea; if (ch == null && cc == null) { EditorGUILayout.LabelField("현재 캐릭터 프레임 = 널"); return; } if (ch != null && cc != null) { Debug.LogError("캐릭터 프레임에 현재 헌터 클라이언트 모두 있음" + ch.CharaName + cc.CharaName); return; } if (ch != null) { EditorGUILayout.LabelField("현재 캐릭터 프레임 = 헌터" + ch.CharaName); ShowCharaIdea(ch); return; } if (cc != null) { EditorGUILayout.LabelField("현재 캐릭터 프레임 = 클라이언트" + cc.CharaName); ShowCharaIdea(cc); return; } }
/* * 렌탈할 수 있는 무기들을 보여줌. */ void InitRentalWeaponList() { for (int i = 0; i < rentalWeaponListViewContents.transform.childCount; i++) { Destroy(rentalWeaponListViewContents.transform.GetChild(i).gameObject); } HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; rCombo = new rentalWeaponCombo(hunter.EquipCap); EquipText.text = hunter.EquipCap.ToString(); List <Weapon> nowInven = Inventory.GetInstance().GetWeaponInvenTypes();//현재 갖고있는 무기 중 하나씩만 가져옴. for (int i = 0; i < nowInven.Count; i++) { int num = i; GameObject temp = Instantiate(weaponBtn, rentalWeaponListViewContents.transform); SetTxtsWeaponBtn(nowInven[i], temp); temp.GetComponent <Button>().onClick.AddListener( () => { AudioThing.GetInstance().PlaySFX(AudioThing.E_SFX.CLICK); rCombo.SelectRentalWeapon(num); } ); rCombo.SetWeaponCombo(num, temp, nowInven[i]); } }
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 HunterReturnRental() //온리 로직단이라고 보면됨. 렌탈했던 무기를 반납하는 거임. { //대여했던 무가 반납.(ui아니고 메소드로써 역할임.) HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; List <Weapon> nowBrokenRentaledWeapons = hunter.HandInRentaledWeaponsNotBroken(); //알아서 안 부서진 것만 줌. Inventory.GetInstance().AddWeaponsToInven(nowBrokenRentaledWeapons); }
public void CharactorLeave(E_Charactor charactor) { QuestRoomSceneUIManager.GetInstance().OnlyShowMainUIOrigin(); Stack <FSMState> stateStack = CharactorFrame.GetInstance().CharaController.GetStateStack(); CharactorIdea nowChara; //여기가 너무 안좋은데. switch (charactor) { case E_Charactor.CLIENT: nowChara = CharactorFrame.GetInstance().clientIdea; if (stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.COMMISSION_CANCEL))) { CharactorManager.GetInstance().RemoveCharactor(nowChara); break; } if (stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.CHECK_IMPERFACT_00)) || stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.CHECK_IMPERFACT_50)) || stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.CHECK_IMPERFACT_80)) || stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.CHECK_IMPERFACT_95)) || stateStack.Contains(ClientFSMFactory.GetInstance().GetState(E_ClientState.CHECK_PERFACT)) ) { ClientCommissionCheckCalculateLastincome(); CharactorManager.GetInstance().RemoveCharactor(nowChara); } break; case E_Charactor.HUNTER: nowChara = CharactorFrame.GetInstance().hunterIdea; if (stateStack.Contains(HunterFSMFactory.GetInstance().GetState(E_HunterState.INQUIRE_QUEST_CANCEL))) { CharactorManager.GetInstance().RemoveCharactor(nowChara); break; } if (stateStack.Contains(HunterFSMFactory.GetInstance().GetState(E_HunterState.HUNT_REWARD_ALL_PAYMENT)) || stateStack.Contains(HunterFSMFactory.GetInstance().GetState(E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT)) || stateStack.Contains(HunterFSMFactory.GetInstance().GetState(E_HunterState.HUNT_REWARD_DENIED)) ) { CharactorManager.GetInstance().RemoveCharactor(nowChara); break; } break; } CharactorFrame.GetInstance().LeaveAnim(); Debug.Log("캐릭터 리브"); }
public void HunterRewardSubmit(int payment) //그냥 eps 처리를 이 단에서 해주려고 한거. { //완전지불 버튼이면 0 , 부분지불 버튼이면 1 , 거부면 2 //버튼에서 인자 확실하게 넘겨줄것!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! EventParameterStorage.GetInstance().PlayerMultipleChoice = payment; QuestRoomSceneUIManager.GetInstance().OnlyShowMainUIOrigin(); CharactorFrame.GetInstance().UpdateFSM(); }
public void QuestCheckIsDone(List <QuestPerMob> checkedList) { ClientIdea client = CharactorFrame.GetInstance().clientIdea; float completeness = client.GetCompletenessClientOriginQuest(checkedList); EventParameterStorage.GetInstance().QuestCompareCompleteness = completeness; CharactorFrame.GetInstance().UpdateFSM(); }
public void CheckCommissionUIShow() //그 퀘스트 체크 유아이 띄우고 //완성도 반환 { Quest writtenQuest = QuestManager.GetInstance().GetQuest( CharactorFrame.GetInstance().clientIdea.associatedQuestKey ); QuestRoomSceneUIManager.GetInstance().OnlyShowQCUI(); QuestCheckManager.GetInstance().InitQCCanvas(writtenQuest); }
/* * 헌터의 스텟 세팅 */ void InitHunterStat() { HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; hunterImage.sprite = hunter.CharaSprite; hunterImage.preserveAspect = true; hunterNameText.text = hunter.CharaName; hunterCapText.text = hunter.HuntingCapabillity.ToString(); questCapText.text = ""; hunterCap = hunter.HuntingCapabillity; hunterCapPlusByWeaponRental = 0; }
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); }
void VisitNextOne() //다음 놈 부르기. { if (RoomEventManager.GetInstance().IsNowWineAndDine) { return; //접대중이면 패쓰함. } EventParameterStorage.GetInstance().ParametersReset(); CharactorIdea nextOne = CharactorManager.GetInstance().GetNextCharactor(); if (nextOne == null) { return; } nextOne.AnamnesisToCharactorFrame(); CharactorFrame.GetInstance().ComeAnim(); }
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(); }
public void PlayerChoice(bool playerChoice) //버튼 콜백 메서드 { EventParameterStorage.GetInstance().PlayerChoice = playerChoice; CharactorFrame.GetInstance().UpdateFSM(); }
protected override FSMState createState(E_HunterState e) { FSMState state = new MyState(() => { }); switch (e) { case E_HunterState.IDLE: break; case E_HunterState.INQUIRE_QUEST: state = new MyState( () => { string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.INQUIRE_QUEST, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.INQUIRE_QUEST, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("퀘스트수임 - 수임할 의뢰 있나요?", "네.", "아니요."); //나중에 엑셀이랑 연동해서 텍스트 받아오기. break; case E_HunterState.INQUIRE_QUEST_SELECT_START: state = new MyState(() => { InteractiveManager.GetInstance().HunterInquireQuest(); }); break; case E_HunterState.INQUIRE_QUEST_ACCEPT: state = new MyState( () => { string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.INQUIRE_QUEST_ACCEPT, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.INQUIRE_QUEST_ACCEPT, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("퀘스트 어셉트 - 후회 없을 거에요.?", "네. 수고요."); break; /* 무기 렌탈을 퀘스트 인콰이어때 같이 하는 걸로 뺌. * case E_HunterState.INQUIRE_QUEST_RENTAL_REQUIRE: * state = new TalkState("퀘스트 - 렌잘징징 - 너무 어려운데요.? 무기 빌려주세요.", "네." , "그냥 가세요."); * break; * * case E_HunterState.INQUIRE_QUEST_RENTAL_START: * state = new MyState(() => { #if DEBUG_TEST * fsmTestHunter.GetInstance().SetNowStateIndicator(e.ToString()); #endif * * InteractiveManager.GetInstance().HunterRentalShow(); }); * break; */ case E_HunterState.INQUIRE_QUEST_CANCEL: state = new MyState( () => { string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.INQUIRE_QUEST_CANCEL, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.INQUIRE_QUEST_CANCEL, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("퀘스트 캔슬, 나를 놓치다니.", "가세요."); break; case E_HunterState.HUNT_REWARD: state = new MyState( () => { string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState(" 헌팅 리워드 첫인사 - 안녕하세요. 의뢰 맡았던 사람이에요..", "어서오세요."); break; case E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN: state = new MyState(() => { InteractiveManager.GetInstance().HunterReturnRental(); string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); // InteractiveManager.GetInstance().ShowTalk("무기 잘썼어요.", "그래요."); } ); break; case E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_BROKEN: state = new MyState(() => { InteractiveManager.GetInstance().HunterReturnRental(); string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); // InteractiveManager.GetInstance().ShowTalk("무기 부서진 게 있네요.. 미안욧", "젠장!"); } ); break; case E_HunterState.HUNT_REWARD_EXPIRED: state = new MyState( () => { string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_EXPIRED, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_EXPIRED, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("HUNT_REWARD_EXPIRED 저번에 왔는데 없더라구요. 만기 지났지만 내 잘못 아닙니다..", "아,녜."); break; case E_HunterState.HUNT_REWARD_START: state = new MyState(() => { InteractiveManager.GetInstance().HunterRewardUIShow(); }); break; case E_HunterState.HUNT_REWARD_ALL_PAYMENT: state = new MyState(() => { InteractiveManager.GetInstance().HunterRewardCalculate(E_RewardType.ALL_PAYMENT); string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_ALL_PAYMENT, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_ALL_PAYMENT, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); // InteractiveManager.GetInstance().ShowTalk("완전지불. 감사합니다.", "잘가세요!"); }); break; case E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT: state = new MyState(() => { InteractiveManager.GetInstance().HunterRewardCalculate(E_RewardType.PARTIAL_PAYMENT); string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); //InteractiveManager.GetInstance().ShowTalk("부분지불. 그래도, 감사합니다.", "잘가세요!"); }); break; case E_HunterState.HUNT_REWARD_DENIED: state = new MyState(() => { InteractiveManager.GetInstance().HunterRewardCalculate(E_RewardType.PAYMENT_DENY); string charaText = TextManager.GetInstance().GetHunterText(E_HunterState.HUNT_REWARD_DENIED, CharactorFrame.GetInstance().hunterIdea); string[] playerTexts = TextManager.GetInstance().GetHunter_PlayerText(E_HunterState.HUNT_REWARD_DENIED, CharactorFrame.GetInstance().hunterIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); //InteractiveManager.GetInstance().ShowTalk("젠장! 다신 오나 봐라.", "뉘예뉘예"); }); break; case E_HunterState.LEAVE: state = new MyState(() => { InteractiveManager.GetInstance().CharactorLeave(E_Charactor.HUNTER); }); break; } return(state); }
protected override void MakeTransitions(FSMState state, E_HunterState e) { state.ClearTransitions(); switch (e) { case E_HunterState.IDLE: state.AddTransitions( new MyTransition( () => { bool hasCommision = true; //캐릭터 틀에서 수임 여부 hasCommision = CharactorFrame.GetInstance().hunterIdea.hasCommission; if (hasCommision) { return(true); } else { return(false); } }, GetState(E_HunterState.HUNT_REWARD), GetState(E_HunterState.INQUIRE_QUEST) ) ); break; case E_HunterState.INQUIRE_QUEST: state.AddTransitions(new PlayerChoiceTransition( GetState(E_HunterState.INQUIRE_QUEST_SELECT_START) , GetState(E_HunterState.INQUIRE_QUEST_CANCEL))); break; case E_HunterState.INQUIRE_QUEST_SELECT_START: //퀘스트 인콰이;어 ui에서 플레이어초이스에 퀘스트 선택 여부를 담음. state.AddTransitions( new PlayerChoiceTransition( GetState(E_HunterState.INQUIRE_QUEST_ACCEPT), GetState(E_HunterState.INQUIRE_QUEST_CANCEL))); /* 무기렌탈 로직을 퀘스트 인콰이어와 합쳤음. * , * new MyTransition( * ()=> * { * bool pc = EventParameterStorage.GetInstance().PlayerChoice; * * if (pc == true)//퀘스트 선택창의 제출 버튼을 누른것. * { * //요구능력 치에 따라서 징징과 어셉트를 구분해야함. #if DEBUG_TEST * if (fsmTestHunter.GetInstance().isHuntersPowerMoreThanQuest) * { * return true; * } #else * if ( * QuestManager.GetInstance().GetQuest( * EventParameterStorage.GetInstance().selectedQuestKey) * .GetWeight() * <= * CharactorFrame.GetInstance().hunterIdea.HuntingCapabillity * * ) //만약 헌터의 능력치가 퀘스트의 요구 능력치를 상회한다면. ) * { * return true; * } #endif * else return false;//헌터의 능력치가 퀘스트의 요구 능력치에 못미침. * } * return false; //의미 없음. * } * ,GetState(E_HunterState.INQUIRE_QUEST_ACCEPT), * GetState(E_HunterState.INQUIRE_QUEST_RENTAL_REQUIRE) * ) * */ break; case E_HunterState.INQUIRE_QUEST_ACCEPT: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); break; /*무기 렌탈 로직을 퀘스트 인콰이어와 합침. * case E_HunterState.INQUIRE_QUEST_RENTAL_REQUIRE: * state.AddTransitions(new PlayerChoiceTransition(GetState(E_HunterState.INQUIRE_QUEST_RENTAL_START), * GetState(E_HunterState.INQUIRE_QUEST_ACCEPT)//징징 했으나 무시해서 그냥 의뢰만 받아감. * )); * break; * * case E_HunterState.INQUIRE_QUEST_RENTAL_START: * state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); * //무기를 빌려주든 말든 그 로직처리는 ui 제출 버튼 쪽에서 할테니까. * //그냥 리브 해주면 됨. * break; */ case E_HunterState.INQUIRE_QUEST_CANCEL: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); break; case E_HunterState.HUNT_REWARD: state.AddTransitions( new MyTransition( () => { bool rentalSth = true; //캐릭터 틀이든 뭐든 대여한 무기가 있는지, 없는지 검사함. bool isRentalBroken = true; //무기의 내구도 도 조건이야... HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; rentalSth = hunter.DidRentalWeapon(); if (rentalSth) { isRentalBroken = hunter.IsBrokenRental(); } if (rentalSth && isRentalBroken) //빌린게 있음. 그리고 그것은 부서진 것이 존재한다. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_BROKEN), null ) , new MyTransition( () => { bool rentalSth = true; //캐릭터 틀이든 뭐든 대여한 무기가 있는지, 없는지 검사함. bool isRentalBroken = true; //무기의 내구도 도 조건이야... HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; rentalSth = hunter.DidRentalWeapon(); if (rentalSth) { isRentalBroken = hunter.IsBrokenRental(); } if (rentalSth && !isRentalBroken) //빌린게 있음. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN), null ) , new MyTransition( () => { bool rentalSth = true; //캐릭터 틀이든 뭐든 대여한 무기가 있는지, 없는지 검사함. bool expired = true; //만기에 늦었는지. HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; rentalSth = hunter.DidRentalWeapon(); expired = hunter.haveComeBeforeExpire; if (!rentalSth && expired) //빌린게 있음. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_EXPIRED), null ) , new MyTransition( () => { bool rentalSth = true; //캐릭터 틀이든 뭐든 대여한 무기가 있는지, 없는지 검사함. bool expired = true; //만기에 늦었는지. HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; rentalSth = hunter.DidRentalWeapon(); expired = hunter.haveComeBeforeExpire; if (!rentalSth && !expired) //빌리지 않았고, 만기에 늦지도 않았음. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_START), null ) ); break; case E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_NOT_BROKEN: state.AddTransitions( new MyTransition( () => { bool expired = true; //만기 전에 왔었는지 어쟀는지. HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; expired = hunter.haveComeBeforeExpire; if (expired) //만지 전에 왔었다가 그냥 갔음. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_EXPIRED), GetState(E_HunterState.HUNT_REWARD_START) )); break; case E_HunterState.HUNT_REWARD_RETURN_OF_RENTAL_BROKEN: state.AddTransitions( new MyTransition( () => { bool expired = true; //만기 전에 왔었는지 어쟀는지. HunterIdea hunter = CharactorFrame.GetInstance().hunterIdea; expired = hunter.haveComeBeforeExpire; if (expired) //만지 전에 왔었다가 그냥 갔음. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_EXPIRED), GetState(E_HunterState.HUNT_REWARD_START) )); break; case E_HunterState.HUNT_REWARD_EXPIRED: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.HUNT_REWARD_START))); break; case E_HunterState.HUNT_REWARD_START: state.AddTransitions( new MyTransition( () => { int pmc = EventParameterStorage.GetInstance().PlayerMultipleChoice; if (pmc == 0) //완전지불이면 { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_ALL_PAYMENT), null ), new MyTransition( () => { int pmc = EventParameterStorage.GetInstance().PlayerMultipleChoice; if (pmc == 2) //지불 거부, 거래쫑이면. { return(true); } else { return(false); } } , GetState(E_HunterState.HUNT_REWARD_DENIED), null ), new MyTransition( () => { int pmc = EventParameterStorage.GetInstance().PlayerMultipleChoice; bool beSulk = true; beSulk = CharactorFrame.GetInstance().hunterIdea.IsSulked(); if (pmc == 1) //부분지불이면 { if (false == beSulk) //성격 등등을 통해 갬블하고 //삐쳤으면 거래 거부 해버림. //안 삐쳤으면 부분 지불 받고 감. { return(true); } else { return(false); } } else { Debug.LogError("EPS에러." + pmc); return(false); } } , GetState(E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT), GetState(E_HunterState.HUNT_REWARD_DENIED) ) ); break; case E_HunterState.HUNT_REWARD_ALL_PAYMENT: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); break; case E_HunterState.HUNT_REWARD_PARTIAL_PAYMENT: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); break; case E_HunterState.HUNT_REWARD_DENIED: state.AddTransitions(new TriggerTransition(GetState(E_HunterState.LEAVE))); break; case E_HunterState.LEAVE: break; } }
protected override void MakeTransitions(FSMState state, E_ClientState e) { state.ClearTransitions(); switch (e) { case E_ClientState.IDLE: state.AddTransitions( new MyTransition( () => { bool hasCommision = true; //캐릭터 틀에서 수임 여부 #if DEBUG_TEST hasCommision = fsmTestHunter.GetInstance().hasCommision; #endif hasCommision = CharactorFrame.GetInstance().clientIdea.hasCommission; if (hasCommision == false) //캐릭터 틀에서 수임 했는지 여부를 받아오기. { return(true); } else { return(false); } }, GetState(E_ClientState.COMMISSION), null ) , new MyTransition( () => { bool hasCommision = true; //캐릭터 틀에서 수임 여부 #if DEBUG_TEST hasCommision = fsmTestHunter.GetInstance().hasCommision; #endif if (hasCommision) //캐릭터 틀에서 수임 했는지 여부를 받아오기. { bool expired; #if DEBUG_TEST expired = fsmTestHunter.GetInstance().expired; #endif expired = CharactorFrame.GetInstance().clientIdea.haveComeBeforeExpire; if (expired) { return(true); } else { return(false); } } else { return(false); //의미없음 } }, GetState(E_ClientState.CHECK_EXPIRED), GetState(E_ClientState.CHECK_NO_EXPIRE) ) ); break; case E_ClientState.COMMISSION: state.AddTransitions( new TriggerTransition(GetState(E_ClientState.COMMISSION_SAY_1)) ); break; case E_ClientState.COMMISSION_SAY_1: state.AddTransitions( new PlayerChoiceTransition(GetState(E_ClientState.COMMISSION_MAKE_START), GetState(E_ClientState.COMMISSION_SAY_2)) ); break; case E_ClientState.COMMISSION_SAY_2: state.AddTransitions( new PlayerChoiceTransition(GetState(E_ClientState.COMMISSION_MAKE_START), GetState(E_ClientState.COMMISSION_SAY_3)) ); break; case E_ClientState.COMMISSION_SAY_3: state.AddTransitions( new PlayerChoiceTransition(GetState(E_ClientState.COMMISSION_MAKE_START), GetState(E_ClientState.COMMISSION_CANCEL)) ); break; case E_ClientState.COMMISSION_MAKE_START: state.AddTransitions(new TriggerTransition(GetState(E_ClientState.COMMISION_MAKE_DONE))); break; case E_ClientState.COMMISION_MAKE_DONE: case E_ClientState.COMMISSION_CANCEL: state.AddTransitions(new TriggerTransition(GetState(E_ClientState.LEAVE))); break; case E_ClientState.CHECK_NO_EXPIRE: case E_ClientState.CHECK_EXPIRED: state.AddTransitions(new TriggerTransition(GetState(E_ClientState.CHECK_START))); break; case E_ClientState.CHECK_START: state.AddTransitions( new MyTransition( () => { float completeness; //qc 끝난 거랑 얘가 갖고 있는 원래 퀘스트랑 비겨ㅛ해서 나온 완성도 completeness = EventParameterStorage.GetInstance().QuestCompareCompleteness; if (completeness <= 0) { return(true); } else { return(false); } } , GetState(E_ClientState.CHECK_IMPERFACT_00), null ), new MyTransition( () => { float completeness; //qc 끝난 거랑 얘가 갖고 있는 원래 퀘스트랑 비겨ㅛ해서 나온 완성도 completeness = EventParameterStorage.GetInstance().QuestCompareCompleteness; if (completeness > 0 && completeness <= 50) { return(true); } else { return(false); } } , GetState(E_ClientState.CHECK_IMPERFACT_50), null ), new MyTransition( () => { float completeness; //qc 끝난 거랑 얘가 갖고 있는 원래 퀘스트랑 비겨ㅛ해서 나온 완성도 completeness = EventParameterStorage.GetInstance().QuestCompareCompleteness; if (completeness > 50 && completeness <= 80) { return(true); } else { return(false); } } , GetState(E_ClientState.CHECK_IMPERFACT_80), null ), new MyTransition( () => { float completeness; //qc 끝난 거랑 얘가 갖고 있는 원래 퀘스트랑 비겨ㅛ해서 나온 완성도 completeness = EventParameterStorage.GetInstance().QuestCompareCompleteness; if (completeness > 80 && completeness <= 95) { return(true); } else { return(false); } } , GetState(E_ClientState.CHECK_IMPERFACT_95), null ), new MyTransition( () => { float completeness; //qc 끝난 거랑 얘가 갖고 있는 원래 퀘스트랑 비겨ㅛ해서 나온 완성도 completeness = EventParameterStorage.GetInstance().QuestCompareCompleteness; if (completeness > 95) { return(true); } else { return(false); } } , GetState(E_ClientState.CHECK_PERFACT), null ) ); break; case E_ClientState.CHECK_IMPERFACT_00: case E_ClientState.CHECK_IMPERFACT_50: case E_ClientState.CHECK_IMPERFACT_80: case E_ClientState.CHECK_IMPERFACT_95: case E_ClientState.CHECK_PERFACT: state.AddTransitions(new TriggerTransition(GetState(E_ClientState.LEAVE))); break; case E_ClientState.LEAVE: break; } }
public override void AnamnesisToCharactorFrame() { base.AnamnesisToCharactorFrame(); CharactorFrame.GetInstance().SetClientIdea(this); }
protected override FSMState createState(E_ClientState e) { FSMState state = new MyState(() => { }); switch (e) { case E_ClientState.IDLE: break; case E_ClientState.COMMISSION: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.COMMISSION, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISSION, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); break; case E_ClientState.COMMISSION_SAY_1: state = new MyState( () => { string charaText = TextManager.GetInstance().GetNormalClientQuestSay( E_ClientState.COMMISSION_SAY_1, CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISSION_SAY_1, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); break; /* * * TalkState( * TextManager.GetInstance().GetNormalClientQuestSay( * 1, * CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList * ),"네,네.","뭐라구요?" * );*/ case E_ClientState.COMMISSION_SAY_2: state = new MyState( () => { string charaText = TextManager.GetInstance().GetNormalClientQuestSay( E_ClientState.COMMISSION_SAY_2, CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISSION_SAY_2, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); break; /* * state = new TalkState(TextManager.GetInstance().GetNormalClientQuestSay( * 2, * CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList * ),"네,네.", "뭐라구요?"); * break; */ case E_ClientState.COMMISSION_SAY_3: state = new MyState( () => { string charaText = TextManager.GetInstance().GetNormalClientQuestSay( E_ClientState.COMMISSION_SAY_3, CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISSION_SAY_3, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); //InteractiveManager.GetInstance().ShowTalk(charaText, "네,네.", "뭐라구요...?"); } ); break; /* * state = new TalkState(TextManager.GetInstance().GetNormalClientQuestSay( * 3, * CharactorFrame.GetInstance().clientIdea.OriginOrderedQuest.QuestList * ), "네,네.", "뭐라구요?"); * break; */ case E_ClientState.COMMISSION_MAKE_START: state = new MyState( () => { InteractiveManager.GetInstance().MakingQuest(); } ); break; case E_ClientState.COMMISION_MAKE_DONE: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.COMMISION_MAKE_DONE, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISION_MAKE_DONE, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("COMMISION_MAKE_DONE 만기 전에 끝내주십쇼.", "네 물론입죠."); break; case E_ClientState.COMMISSION_CANCEL: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.COMMISSION_CANCEL, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.COMMISSION_CANCEL, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("COMMISSION_CANCEL 젠장, 드럽게 못 알아먹네. 의뢰 안 하겠소.", "미안합니다."); break; case E_ClientState.CHECK_NO_EXPIRE: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_NO_EXPIRE, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_NO_EXPIRE, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); // state = new TalkState("CHECK_NO_EXPIRE 의뢰한 물건들 잘 모아왔습니까?", "잠시만요^^"); break; case E_ClientState.CHECK_EXPIRED: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_EXPIRED, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_EXPIRED, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); /* * state = new MyState( * () => * { * InteractiveManager.GetInstance().ShowTalk("CHECK_EXPIRED 저번에 왔는데 응대를 못 받았더군.\n내 잘못은 아니니" + * "부득불 가격을 좀 깎아야겠네.", "네..."); * } * );*/ break; case E_ClientState.CHECK_START: state = new MyState( () => { InteractiveManager.GetInstance().CheckCommissionUIShow(); } ); break; case E_ClientState.CHECK_IMPERFACT_00: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_IMPERFACT_00, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_IMPERFACT_00, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); /* * state = new MyState( * InteractiveManager.GetInstance().ShowTalk("CHECK_IMPERFACT_00 0퍼센트, 장난하나.", "죄송합니다."); * } * * );*/ break; case E_ClientState.CHECK_IMPERFACT_50: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_IMPERFACT_50, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_IMPERFACT_50, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } );/* * state = new MyState( * () => { #if DEBUG_TEST * fsmTestHunter.GetInstance().SetNowStateIndicator(e.ToString()); #endif * InteractiveManager.GetInstance().ShowTalk("CHECK_IMPERFACT_50 50퍼센트, 반절도 못채웠다....", "죄송합니다."); * } * * );*/ break; case E_ClientState.CHECK_IMPERFACT_80: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_IMPERFACT_80, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_IMPERFACT_80, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } );/* * state = new MyState( * () => { #if DEBUG_TEST * fsmTestHunter.GetInstance().SetNowStateIndicator(e.ToString()); #endif * InteractiveManager.GetInstance().ShowTalk("CHECK_IMPERFACT_80 80퍼센트, 아쉽군.", "네."); * } * * );*/ break; case E_ClientState.CHECK_IMPERFACT_95: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_IMPERFACT_95, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_IMPERFACT_95, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } );/* * state = new MyState( * () => { #if DEBUG_TEST * fsmTestHunter.GetInstance().SetNowStateIndicator(e.ToString()); #endif * InteractiveManager.GetInstance().ShowTalk("CHECK_IMPERFACT_95 95퍼센트, 간발의 차로군.", "아이고."); * } * * );*/ break; case E_ClientState.CHECK_PERFACT: state = new MyState( () => { string charaText = TextManager.GetInstance().GetClientText(E_ClientState.CHECK_PERFACT, CharactorFrame.GetInstance().clientIdea); string[] playerTexts = TextManager.GetInstance().GetClient_PlayerText(E_ClientState.CHECK_PERFACT, CharactorFrame.GetInstance().clientIdea); InteractiveManager.GetInstance().ShowTalk(charaText, playerTexts); } ); /* * state = new MyState( * () => { #if DEBUG_TEST * fsmTestHunter.GetInstance().SetNowStateIndicator(e.ToString()); #endif * InteractiveManager.GetInstance().ShowTalk("CHECK_PERFACT 100퍼센트, 완벽하군.", "감사합니다."); * } * * );*/ break; case E_ClientState.LEAVE: state = new MyState(() => { InteractiveManager.GetInstance().CharactorLeave(E_Charactor.CLIENT); }); break; } return(state); }
public virtual void AnamnesisToCharactorFrame() { CharactorFrame.GetInstance().ResetIdeas(); SetupAI(CharactorFrame.GetInstance().CharaController); CharactorFrame.GetInstance().ChangeLook(charaSprite, charaName); }
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; }
public void EndOfComeAnimation() { QuestRoomSceneUIManager.GetInstance().OnlyShowMainUIOrigin(); MainUIManager.GetInstance().SetCharaNameText(CharactorFrame.GetInstance().CharaName); CharactorFrame.GetInstance().UpdateFSM(); }