/// <summary> /// リンクキャラの作成 /// </summary> /// <param name="unit"></param> void SetupLinkChara(PartyMemberUnitContext unit) { if (unit != null && unit.UnitData != null) { var linkData = CharaLinkUtil.GetLinkUnit(unit.UnitData.link_unique_id); List <MasterDataParamChara> charaMasterList = MasterFinder <MasterDataParamChara> .Instance.FindAll(); if (linkData != null && linkData.id > 0) { unit.LinkCharaMaster = charaMasterList.Find((v) => v.fix_id == linkData.id); UnitIconImageProvider.Instance.Get( linkData.id, sprite => { unit.LinkUnitImage = sprite; }); unit.IsEmptyLinkUnit = false; if (unit.LinkCharaMaster != null) { unit.LinkOutSideCircleImage = MainMenuUtil.GetElementCircleSprite(unit.LinkCharaMaster.element); } return; } } unit.LinkOutSideCircleImage = ResourceManager.Instance.Load("icon_circle_deco", ResourceType.Common); unit.LinkUnitImage = ResourceManager.Instance.Load("icon_empty2", ResourceType.Menu); unit.IsEmptyLinkUnit = true; }
static public void setupCharaParty(ref CharaParty _party, PacketStructUnit[] unitList, PacketStructUnit[] linkUnitList = null) { if (_party == null || unitList == null) { return; } CharaOnce[] acCharaList = new CharaOnce[(int)GlobalDefine.PartyCharaIndex.MAX]; for (int j = 0; j < unitList.Length; j++) { if (unitList[j] == null) { continue; } PacketStructUnit cBaseUnit = unitList[j]; // リンクの情報 int nLinkLimitOverLV = 0; uint nLinkId = 0; int nLinkLevel = 0; int nLinkPlusPow = 0; int nLinkPlusHp = 0; PacketStructUnit cLinkUnit; if (linkUnitList != null && linkUnitList.IsRange(j)) { cLinkUnit = linkUnitList[j]; } else { cLinkUnit = CharaLinkUtil.GetLinkUnit(cBaseUnit.link_unique_id); } if (cLinkUnit != null) { nLinkId = cLinkUnit.id; nLinkLevel = (int)cLinkUnit.level; nLinkPlusPow = (int)cLinkUnit.add_pow; nLinkPlusHp = (int)cLinkUnit.add_hp; nLinkLimitOverLV = (int)cLinkUnit.limitover_lv; } acCharaList[j] = new CharaOnce(); acCharaList[j].CharaSetupFromID(cBaseUnit.id, (int)cBaseUnit.level, (int)cBaseUnit.limitbreak_lv, (int)cBaseUnit.limitover_lv, (int)cBaseUnit.add_pow, (int)cBaseUnit.add_hp, nLinkId, nLinkLevel, nLinkPlusPow, nLinkPlusHp, (int)cBaseUnit.link_point, nLinkLimitOverLV); } _party.PartySetupMenu(acCharaList, false); }
public void SetUnitData(ref PartyMemberStatusListItemContext unitStatus, PacketStructUnit unitData, PacketStructUnit[] partyUnits) { if (unitStatus == null) { return; } MasterDataParamChara charMaster = null; if (unitData == null || unitData.id == 0) { unitStatus.HpText = ""; unitStatus.AtkText = ""; unitStatus.Cost = 0; unitStatus.Charm = 0; } else { charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id); SetUpCharaData(ref unitStatus, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false, partyUnits); } MasterDataSkillActive skill1 = null; if (charMaster != null && charMaster.skill_active0 > 0) { skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0); } unitStatus.IsActiveSkill1Empty = (skill1 == null); unitStatus.Skill1Cost1 = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost1) : null; unitStatus.Skill1Cost2 = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost2) : null; unitStatus.Skill1Cost3 = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost3) : null; unitStatus.Skill1Cost4 = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost4) : null; unitStatus.Skill1Cost5 = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost5) : null; unitStatus.Skill1Color = (skill1 != null) ? MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element) : null; MasterDataSkillActive skill2 = null; if (charMaster != null && charMaster.skill_active1 > 0) { skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1); } unitStatus.IsActiveSkill2Empty = (skill2 == null); unitStatus.Skill2Cost1 = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost1) : null; unitStatus.Skill2Cost2 = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost2) : null; unitStatus.Skill2Cost3 = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost3) : null; unitStatus.Skill2Cost4 = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost4) : null; unitStatus.Skill2Cost5 = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost5) : null; unitStatus.Skill2Color = (skill2 != null) ? MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element) : null; }
/// <summary> /// ソートパラメータ設定(ユニット) /// </summary> /// <param name="_main"></param> /// <param name="_mainMaster"></param> /// <param name="_sub"></param> public void setSortParamUnit(PacketStructUnit _main, MasterDataParamChara _mainMaster, bool bEvolCheck = true) { unit_id = _main.id; unique_id = _main.unique_id; unit = _main; master = _mainMaster; setSortParamUnit(_main, _mainMaster, CharaLinkUtil.GetLinkUnit(_main.link_unique_id)); party_assign = MainMenuUtil.ChkUnitPartyAssign(_main.unique_id); favorite = MainMenuUtil.ChkFavoritedUnit(_main.unique_id); get_time = (long)_main.get_time; if (bEvolCheck) { MasterDataParamCharaEvol evol = MasterFinder <MasterDataParamCharaEvol> .Instance.SelectFirstWhere(" where unit_id_pre = ? ", _mainMaster.fix_id); evolve = (evol != null) ? true : false; } }
public void SetUnitData(ref PartyMemberUnitContext unit, PacketStructUnit unitData) { if (unit == null) { return; } if (unitData == null || unitData.id == 0) { return; } MasterDataParamChara charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id); if (charMaster == null) { return; } if (charMaster.skill_active0 > 0) { MasterDataSkillActive skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0); if (skill1 != null) { unit.IsActiveSkill1Empty = false; unit.Skill1Cost1 = MainMenuUtil.GetSkillElementIcon(skill1.cost1); unit.Skill1Cost2 = MainMenuUtil.GetSkillElementIcon(skill1.cost2); unit.Skill1Cost3 = MainMenuUtil.GetSkillElementIcon(skill1.cost3); unit.Skill1Cost4 = MainMenuUtil.GetSkillElementIcon(skill1.cost4); unit.Skill1Cost5 = MainMenuUtil.GetSkillElementIcon(skill1.cost5); unit.Skill1Color = MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element); } } if (charMaster.skill_active1 > 0) { MasterDataSkillActive skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1); if (skill2 != null) { unit.IsActiveSkill2Empty = false; unit.Skill2Cost1 = MainMenuUtil.GetSkillElementIcon(skill2.cost1); unit.Skill2Cost2 = MainMenuUtil.GetSkillElementIcon(skill2.cost2); unit.Skill2Cost3 = MainMenuUtil.GetSkillElementIcon(skill2.cost3); unit.Skill2Cost4 = MainMenuUtil.GetSkillElementIcon(skill2.cost4); unit.Skill2Cost5 = MainMenuUtil.GetSkillElementIcon(skill2.cost5); unit.Skill2Color = MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element); } } unit.ParamText = (unitData.level >= charMaster.level_max) ? GameTextUtil.GetText("uniticon_flag1") : string.Format(GameTextUtil.GetText("uniticon_flag2"), unitData.level); // レベル uint plusPoint = unitData.add_hp + unitData.add_pow; // プラス値の計算 if (plusPoint != 0) { unit.ParamText += string.Format(GameTextUtil.GetText("uniticon_flag3"), plusPoint); } unit.LinkIcon = MainMenuUtil.GetLinkMark(unitData, null); // リンクアイコン unit.OutSideCircleImage = MainMenuUtil.GetElementCircleSprite(charMaster.element); SetUpCharaData(ref unit, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false); }
//---------------------------------------------------------------------------- /*! * @brief 基底継承:MainMenuSeq:ページ切り替えにより有効化された際に呼ばれる関数 * @note ページのレイアウト再構築を兼ねる */ //---------------------------------------------------------------------------- protected override void PageSwitchSetting(bool initalize) { base.PageSwitchSetting(initalize); //-------------------------------- // 情報破棄 // // リソースの参照が残ると破棄処理で抜けが生じるので // ページを無効にしたタイミングでも破棄するよう対応してる //-------------------------------- //-------------------------------- // オブジェクト破棄 //-------------------------------- if (m_AssetAutoSetBefore != null) { m_AssetAutoSetBefore.DestroyCharaMesh(); } if (m_AssetAutoSetAfter != null) { m_AssetAutoSetAfter.DestroyCharaMesh(); } //-------------------------------- // 進行情報クリア //-------------------------------- m_WorkStep = STEP_000_START; m_WorkStepDelta = 0; m_WorkStepTriger = true; m_CharaMeshAnim.ResetAnimation(); //---------------------------------------- // パッチ処理を行わないようにする. //---------------------------------------- MainMenuManager.Instance.m_ResumePatchUpdateRequest = false; //-------------------------------- // 進化前後のユニット情報を取得 //-------------------------------- PacketStructUnit cEvolUnit = MainMenuParam.m_EvolveBaseAfter; PacketStructUnit cEvolUnitPrev = MainMenuParam.m_EvolveBaseBefore; if (cEvolUnit == null || cEvolUnitPrev == null ) { Debug.LogError("Evol Unit Error!!"); //とりあえずホームへ MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_HOME_MENU, false, false); return; } //-------------------------------- // 選択されているユニット情報を選定 //-------------------------------- uint unCharaMasterDataID = cEvolUnit.id; // 進化後 uint unCharaMasterDataIDPrev = cEvolUnitPrev.id; // 新化前 MasterDataParamChara cCharaMasterData = MasterDataUtil.GetCharaParamFromID(unCharaMasterDataID); MasterDataParamChara cCharaMasterDataPrev = MasterDataUtil.GetCharaParamFromID(unCharaMasterDataIDPrev); if (cCharaMasterData == null || cCharaMasterDataPrev == null) { Debug.LogError("SelectUnit MasterData Is None! - " + unCharaMasterDataID); return; } // 表示ユニット情報を設定 //MainMenuParam.SetCharaDetailParam( cEvolUnit ); m_UnitNamePanel.setup(cCharaMasterDataPrev); // リンクユニット情報取得 PacketStructUnit cLinkUnit = CharaLinkUtil.GetLinkUnit(cEvolUnit); // 表示ユニット情報を設定 MainMenuParam.SetCharaDetailParam(cEvolUnit, cLinkUnit); //---------------------------------------- // キャラメッシュ生成 //---------------------------------------- { // 新化前ユニット if (m_AssetAutoSetBefore == null) { m_AssetAutoSetBefore = m_ReferObject[OBJECT_CHARA_MESH_BEFORE].AddComponent <AssetAutoSetCharaMesh>(); m_AssetAutoSetBefore.m_AssetBundleMeshScaleUp = true; m_AssetAutoSetBefore.m_AssetBundleMeshPosition = true; } m_AssetAutoSetBefore.SetCharaID(unCharaMasterDataIDPrev, true); // 進化後ユニット if (m_AssetAutoSetAfter == null) { m_AssetAutoSetAfter = m_ReferObject[OBJECT_CHARA_MESH_AFTER].AddComponent <AssetAutoSetCharaMesh>(); m_AssetAutoSetAfter.m_AssetBundleMeshScaleUp = true; m_AssetAutoSetAfter.m_AssetBundleMeshPosition = true; } m_AssetAutoSetAfter.SetCharaID(unCharaMasterDataID, true); } { TemplateList <uint> cPartsUnitIDList = new TemplateList <uint>(); for (int i = 0; i < MainMenuParam.m_EvolveParts.m_BufferSize; i++) { cPartsUnitIDList.Add(MainMenuParam.m_EvolveParts[i].id); } m_EvolCutinParts = new MainMenuCutin[cPartsUnitIDList.m_BufferSize]; for (int i = 0; i < cPartsUnitIDList.m_BufferSize; i++) { m_EvolCutinParts[i] = new MainMenuCutin(); m_EvolCutinParts[i].Setup(m_ReferObject[OBJECT_CUTIN_PARENT], cPartsUnitIDList[i], MainMenuDefine.CUTIN_OBJ_TYPE_COST); } } //---------------------------------------- // とりあえず非表示へ //---------------------------------------- m_LayoutWindow.SetLayoutAllDisable(); m_LayoutEvolve.SetLayoutAllDisable(); m_LayoutCategory.SetLayoutAllDisable(); //遷移ボタン非表示 m_UnitResultButton.IsActiveButton1 = false; m_UnitResultButton.IsActiveButton2 = false; }
/// <summary> /// パーティリストの作成 /// </summary> void CreatePartyList() { PacketStructUnit[][] partys = UserDataAdmin.Instance.m_StructPartyAssign; m_PartySelectGroup.ClearPartyGroups(); var partyModels = new List <PartySelectGroupUnitListItemModel>(); const int AnimationFirstIndex = 0; const int AnimationLastIndex = 4; for (int i = 0; i < partys.Length; ++i) { PacketStructUnit[] party = partys[i]; int index = i; var model = new PartySelectGroupUnitListItemModel((uint)index); PartySelectGroupUnitContext partyGroup = new PartySelectGroupUnitContext(model); partyGroup.Index = index; // 番号の設定 partyGroup.NameText = string.Format(GameTextUtil.GetText("questlast_tub"), index + 1); // パーティ名 Array.Copy(party, partyGroup.PartyData, partyGroup.PartyData.Length); // ユニット情報をコピー for (int pt_cout = 0; pt_cout < partyGroup.PartyData.Length; ++pt_cout) { // リンクユニット情報を設定 if (partyGroup.PartyData[pt_cout] == null) { continue; } partyGroup.PartyLinkData[pt_cout] = CharaLinkUtil.GetLinkUnit(partyGroup.PartyData[pt_cout].link_unique_id); } PacketStructUnit leaderUnit = partyGroup.PartyData[(int)GlobalDefine.PartyCharaIndex.LEADER]; if (leaderUnit != null) { // リーダーユニット画像 UnitIconImageProvider.Instance.Get( leaderUnit.id, sprite => { partyGroup.UnitImage = sprite; }); //partyGroup.IsActiveLinkIcon = (leaderUnit.link_info != (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_NONE); // リンクアイコン MasterDataParamChara _master = MasterFinder <MasterDataParamChara> .Instance.Find((int)leaderUnit.id); partyGroup.IconSelect = MainMenuUtil.GetElementCircleSprite(_master.element); } partyGroup.IsSelect = (index == m_UnitPartyCurrent); m_PartySelectGroup.AddData(partyGroup); model.OnClicked += () => { OnSelectPartyGroup(partyGroup); }; model.OnShowedNextIcon += () => { if (index <= AnimationFirstIndex || index > AnimationLastIndex) { return; } partyModels[index - 1].ShowIcon(); }; model.OnShowedNextName += () => { if (index >= AnimationLastIndex) { return; } partyModels[index + 1].ShowName(); }; model.OnViewStarted += () => { bool showName = index == AnimationFirstIndex || index > AnimationLastIndex; bool showIcon = index == AnimationLastIndex || index > AnimationLastIndex; if (showName) { model.ShowName(); } if (showIcon) { model.ShowIcon(); } }; partyModels.Add(model); } }
//---------------------------------------------------------------------------- /*! * @brief 基底継承:MainMenuSeq:ページ切り替えにより有効化された際に呼ばれる関数 * @note ページのレイアウト再構築を兼ねる */ //---------------------------------------------------------------------------- protected override void PageSwitchSetting(bool initalize) { base.PageSwitchSetting(initalize); //---------------------------------------- // ゲリラボス情報を取得 //---------------------------------------- m_GuerrillaBoss = MasterDataUtil.GetGuerrillaBossParamFromQuestID(MainMenuParam.m_QuestSelectMissionID); //---------------------------------------- // ゲーム本編に引き渡す情報を色々設定 //---------------------------------------- { //---------------------------------------- // 選択されている助っ人を取得 //---------------------------------------- PacketStructFriend cHelper = MainMenuParam.m_QuestHelper; if (cHelper == null) { Debug.LogError("SelectFriendNone"); } //---------------------------------------- // //---------------------------------------- int nPartyCurrent = UserDataAdmin.Instance.m_StructPlayer.unit_party_current; PacketStructUnit[] acUnitStruct = { UserDataAdmin.Instance.m_StructPartyAssign[nPartyCurrent][0] , UserDataAdmin.Instance.m_StructPartyAssign[nPartyCurrent][1] , UserDataAdmin.Instance.m_StructPartyAssign[nPartyCurrent][2] , UserDataAdmin.Instance.m_StructPartyAssign[nPartyCurrent][3] , cHelper.unit }; // @add Developer 2015/09/07 ver300 PacketStructUnit cLinkUnitStruct = null; UserDataUnitParam[] acUnitParam = new UserDataUnitParam[acUnitStruct.Length]; for (int i = 0; i < acUnitStruct.Length; i++) { if (acUnitStruct[i] == null) { continue; } acUnitParam[i] = new UserDataUnitParam(); acUnitParam[i].m_UnitDataID = acUnitStruct[i].id; acUnitParam[i].m_UnitParamLevel = (int)acUnitStruct[i].level; acUnitParam[i].m_UnitParamEXP = (int)acUnitStruct[i].exp; acUnitParam[i].m_UnitParamUniqueID = acUnitStruct[i].unique_id; acUnitParam[i].m_UnitParamLimitBreakLV = (int)acUnitStruct[i].limitbreak_lv; acUnitParam[i].m_UnitParamLimitOverLV = (int)acUnitStruct[i].limitover_lv; acUnitParam[i].m_UnitParamPlusPow = (int)acUnitStruct[i].add_pow; acUnitParam[i].m_UnitParamPlusHP = (int)acUnitStruct[i].add_hp; // @add Developer 2015/09/07 ver300 // リンクユニットを取得 if (i != acUnitStruct.Length - 1) { cLinkUnitStruct = CharaLinkUtil.GetLinkUnit(acUnitStruct[i].link_unique_id); } else { cLinkUnitStruct = cHelper.unit_link; } // リンクユニットのパラメータ設定 if (cLinkUnitStruct == null) { continue; } acUnitParam[i].m_UnitParamLinkID = cLinkUnitStruct.id; acUnitParam[i].m_UnitParamLinkLv = (int)cLinkUnitStruct.level; acUnitParam[i].m_UnitParamLinkPlusPow = (int)cLinkUnitStruct.add_pow; acUnitParam[i].m_UnitParamLinkPlusHP = (int)cLinkUnitStruct.add_hp; acUnitParam[i].m_UnitParamLinkPoint = (int)acUnitStruct[i].link_point; acUnitParam[i].m_UnitParamLinkLimitOverLV = (int)cLinkUnitStruct.limitover_lv; } //---------------------------------------- // 固定パーティ情報でパーティ情報を上書き //---------------------------------------- FixPartyAssign(ref acUnitParam, MainMenuParam.m_QuestSelectMissionID); { SceneGoesParamToQuest2 cSceneGoesParamToQuest2 = new SceneGoesParamToQuest2(); cSceneGoesParamToQuest2.m_QuestAreaID = MainMenuParam.m_QuestSelectAreaID; cSceneGoesParamToQuest2.m_QuestAreaAmendCoin = MainMenuParam.m_QuestSelectAreaAmendCoin; // ※パーセント表記 cSceneGoesParamToQuest2.m_QuestAreaAmendDrop = MainMenuParam.m_QuestSelectAreaAmendDrop; // ※パーセント表記 cSceneGoesParamToQuest2.m_QuestAreaAmendExp = MainMenuParam.m_QuestSelectAreaAmendEXP; // ※パーセント表記 cSceneGoesParamToQuest2.m_QuestMissionID = MainMenuParam.m_QuestSelectMissionID; cSceneGoesParamToQuest2.m_QuestRandSeed = RandManager.GetRand(); cSceneGoesParamToQuest2.m_IsUsedAutoPlay = false; cSceneGoesParamToQuest2.m_QuestGuerrillaBoss = m_GuerrillaBoss; cSceneGoesParamToQuest2.m_PartyFriend = cHelper; cSceneGoesParamToQuest2.m_PartyChara0Param = acUnitParam[0]; cSceneGoesParamToQuest2.m_PartyChara1Param = acUnitParam[1]; cSceneGoesParamToQuest2.m_PartyChara2Param = acUnitParam[2]; cSceneGoesParamToQuest2.m_PartyChara3Param = acUnitParam[3]; cSceneGoesParamToQuest2.m_PartyChara4Param = acUnitParam[4]; cSceneGoesParamToQuest2.m_NextAreaCleard = MainMenuUtil.ChkActiveNextArea(MainMenuParam.m_QuestSelectAreaID); SceneGoesParam.Instance.m_SceneGoesParamToQuest2 = cSceneGoesParamToQuest2; //---------------------------------------- // ゲーム開始情報をローカル保存。 // // 通信前に保存しているため、通信中にアプリを終了させるとサーバー側の諸々消費を飛ばして次回起動時に開始情報が残ってしまう。 // そのままクエストに入られるとサーバー上でコスト消費が行われずにクエストに移行する可能性があるがので、 // タイトル画面で「サーバーにクエスト開始が届いているか」をチェックするAPIを投げて届いている場合のみ適用することで対応する。 //---------------------------------------- if (LocalSaveManager.Instance != null) { LocalSaveManager.Instance.SaveFuncGoesToMenuResult(null); LocalSaveManager.Instance.SaveFuncGoesToMenuRetire(null); LocalSaveManager.Instance.SaveFuncGoesToQuest2Restore(null); LocalSaveManager.Instance.SaveFuncGoesToQuest2Start(cSceneGoesParamToQuest2); LocalSaveManager.Instance.SaveFuncInGameContinue(null); LocalSaveManager.Instance.SaveFuncInGameReset(null); } } } //---------------------------------------- // 通信発行 //---------------------------------------- ServerCommunicate(); }
//---------------------------------------------------------------------------- /*! * @brief 基底継承:MainMenuSeq:ページ切り替えにより有効化された際に呼ばれる関数 * @note ページのレイアウト再構築を兼ねる */ //---------------------------------------------------------------------------- protected override void PageSwitchSetting(bool initalize) { base.PageSwitchSetting(initalize); //-------------------------------- // 情報破棄 // // リソースの参照が残ると破棄処理で抜けが生じるので // ページを無効にしたタイミングでも破棄するよう対応してる //-------------------------------- //-------------------------------- // オブジェクト破棄 //-------------------------------- if (m_AssetAutoSet != null) { m_AssetAutoSet.DestroyCharaMesh(); } //-------------------------------- // リンク情報クリア //-------------------------------- m_WorkStep = STEP_000_START; m_WorkStepDelta = 0; m_WorkStepTriger = true; //-------------------------------- // Bugweb:5925 関連 // アチーブメント達成演出をスキップされる可能性を考慮しアチーブメント取得フラグONにしとく。 // フラグをONにすることで、次回、ミッション画面に遷移したとき、 // ローカルで保持してるアチーブメントマスタのリスト情報を破棄し、新しく一からマスタを取得し直すようになる。 //-------------------------------- if (MainMenuParam.m_AchievementListGet == false) { MainMenuParam.m_AchievementListGet = true; } //-------------------------------- // リンク前後の情報を保持しておく //-------------------------------- PacketStructUnit UnitBefore = new PacketStructUnit(); //!< ユニット情報:リンク前 PacketStructUnit UnitAfter = new PacketStructUnit(); //!< ユニット情報:リンク後 UnitBefore.Copy(MainMenuParam.m_LinkBaseBefore); UnitAfter.Copy(MainMenuParam.m_LinkBaseAfter); MasterDataParamChara m_UnitMasterData = MasterDataUtil.GetCharaParamFromID(UnitAfter.id); //!< ユニット情報:マスターデータ m_UnitNamePanel.setup(m_UnitMasterData); UnitBefore.add_hp = UnitAfter.add_hp; UnitBefore.add_pow = UnitAfter.add_pow; UnitBefore.link_unique_id = UnitAfter.link_unique_id; //-------------------------------- // リンク先のユニット情報を取得する //-------------------------------- PacketStructUnit cLinkUnit = CharaLinkUtil.GetLinkUnit(UnitBefore.link_unique_id); //---------------------------------------- // 初期情報としてリンク前のユニット情報を表示 //---------------------------------------- // 表示ユニット情報を設定 MainMenuParam.SetCharaDetailParam(UnitBefore, cLinkUnit); //---------------------------------------- // キャラメッシュ生成 //---------------------------------------- if (m_AssetAutoSet == null) { m_AssetAutoSet = m_ReferObject[OBJECT_CHARA_MESH].AddComponent <AssetAutoSetCharaMesh>(); m_AssetAutoSet.m_AssetBundleMeshScaleUp = true; m_AssetAutoSet.m_AssetBundleMeshPosition = true; } m_AssetAutoSet.SetCharaID(m_UnitMasterData.fix_id, true); //---------------------------------------- // カットインオブジェクト生成 //---------------------------------------- //-------------------------------- // リンクユニット //-------------------------------- m_CutinLink = new MainMenuCutin(); m_CutinLink.Setup(m_ReferObject[OBJECT_CUTIN_PARENT], MainMenuParam.m_LinkUnit.id, MainMenuDefine.CUTIN_OBJ_TYPE_FIX); //-------------------------------- // 素材ユニット //-------------------------------- if (MainMenuParam.m_LinkParts != null && MainMenuParam.m_LinkParts.m_BufferSize > 0) { m_CutinParts = new MainMenuCutin[MainMenuParam.m_LinkParts.m_BufferSize]; for (int i = 0; i < MainMenuParam.m_LinkParts.m_BufferSize; i++) { m_CutinParts[i] = new MainMenuCutin(); m_CutinParts[i].Setup(m_ReferObject[OBJECT_CUTIN_PARENT], MainMenuParam.m_LinkParts[i].id, MainMenuDefine.CUTIN_OBJ_TYPE_COST); } } //---------------------------------------- // とりあえず非表示へ //---------------------------------------- m_LayoutCategory.SetLayoutAllDisable(); m_LayoutWindow.SetLayoutAllDisable(); //遷移ボタンOFF m_UnitResultButton.IsActiveButton1 = false; m_UnitResultButton.IsActiveButton2 = false; // ロゴ情報 for (int i = 0; i < m_AnimationShotLogo.Length; i++) { if (m_AnimationShotLogo[i] == null) { continue; } UnityUtil.SetObjectEnabled(m_AnimationShotLogo[i].gameObject, false); } }
//---------------------------------------------------------------------------- /*! * @brief ステータス更新 * @note */ //---------------------------------------------------------------------------- void SetupBlendAfterStatus() { //----------------------- // 合成時のパラメータ数値表示部分を更新 //----------------------- if (m_BaseUnit != null) { MasterDataParamChara cBaseMasterData = m_BaseUnit.master; if (cBaseMasterData != null) { CharaOnce cCharaParam = new CharaOnce(); PacketStructUnit cBaseUnit = m_BaseUnit.unit; // リンクの限界突破 int nLinkLimitOverLV = 0; PacketStructUnit cLinkUnit = CharaLinkUtil.GetLinkUnit(cBaseUnit.link_unique_id); if (cLinkUnit != null) { nLinkLimitOverLV = (int)cLinkUnit.limitover_lv; } if (cBaseUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE) { cCharaParam.CharaSetupFromID(cBaseUnit.id , (int)cBaseUnit.level , (int)cBaseUnit.limitbreak_lv , 0 , (int)cBaseUnit.add_pow , (int)cBaseUnit.add_hp , cLinkUnit.id , (int)cLinkUnit.level , (int)cLinkUnit.add_pow , (int)cLinkUnit.add_hp , (int)cBaseUnit.link_point , nLinkLimitOverLV ); } else { cCharaParam.CharaSetupFromID(cBaseUnit.id , (int)cBaseUnit.level , (int)cBaseUnit.limitbreak_lv , 0 , (int)cBaseUnit.add_pow , (int)cBaseUnit.add_hp , 0 , 0 , 0 , 0 , 0 , nLinkLimitOverLV ); } m_BlendLevelMaxWarning = false; if (m_BaseUnit.level >= cBaseMasterData.level_max) { m_BlendLevelMaxWarning = true; } uint unBaseAtk = (uint)cCharaParam.m_CharaPow; uint unBaseHP = (uint)cCharaParam.m_CharaHP; //----------------------- // 合成費用を算出 // 合成費用 = ( ベースキャラレベル * 100 * 素材数 ) + ( 関連キャラのプラス値合計 * 1000 ) //----------------------- m_BlendPoint = 0; m_BlendPoint += (cBaseMasterData != null) ? (uint)cBaseMasterData.limit_over_unitpoint : 0; //----------------------- // プラス値を算出 //----------------------- uint unUnitPlusHP = (uint)cCharaParam.m_CharaPlusHP; uint unUnitPlusAtk = (uint)cCharaParam.m_CharaPlusPow; //----------------------- // ユニットが持ってる総合経験値を算出 // ※今回の合成で得られる経験値含む //----------------------- int nTotalEXP = 0;// GetTotalEXP(ref Parts, fBonusRateTotal, cBaseMasterData.element); int nTotalEXPAfter = nTotalEXP + (int)cBaseUnit.exp; //----------------------- // レベルを算出 //----------------------- uint unUnitLevelMax = (uint)cBaseMasterData.level_max; uint unUnitLevel = (uint)CharaUtil.GetLevelFromExp(cBaseMasterData, nTotalEXPAfter); //----------------------- // HPとATKを算出 //----------------------- uint unBuildUpHP = 0; uint unBuildUpAtk = 0; if (cBaseUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE) { //リンク親の場合はリンクキャラの値を反映しておく CharaOnce cCharaParamBuildUp = new CharaOnce(); cCharaParamBuildUp.CharaSetupFromID(cBaseUnit.id , (int)unUnitLevel , (int)cBaseUnit.limitbreak_lv , 0 , (int)unUnitPlusAtk , (int)unUnitPlusHP , cLinkUnit.id , (int)cLinkUnit.level , (int)cLinkUnit.add_pow , (int)cLinkUnit.add_hp , (int)cBaseUnit.link_point , nLinkLimitOverLV ); unBuildUpHP = (uint)cCharaParamBuildUp.m_CharaHP; unBuildUpAtk = (uint)cCharaParamBuildUp.m_CharaPow; } else { unBuildUpHP = (uint)CharaUtil.GetStatusValue(cBaseMasterData, (int)unUnitLevel, CharaUtil.VALUE.HP); unBuildUpAtk = (uint)CharaUtil.GetStatusValue(cBaseMasterData, (int)unUnitLevel, CharaUtil.VALUE.POW); //プラス値より合成後のHPとATK値を求める unBuildUpHP += unUnitPlusHP * GlobalDefine.PLUS_RATE_HP; unBuildUpAtk += unUnitPlusAtk * GlobalDefine.PLUS_RATE_POW; } //----------------------- // HPとATKの表示形式とカラーの設定 // 強化後のHP/ATK、プラス値更新があったら色つける //----------------------- //フォーマット string strFormatUp = GameTextUtil.GetText("kyouka_text1"); //値上昇時 string strFormatMax = "{0}"; //値MAX string strFormat = "{0}"; //値変更なし string strFormatPlus = "[{0}]"; string strFormatPlusNum = "+{0}"; string strUnitPlusHP = ""; string strUnitPlusHPNum = string.Format(strFormatPlusNum, unUnitPlusHP); if (unUnitPlusHP > (uint)cCharaParam.m_CharaPlusHP) { strUnitPlusHP = string.Format(strFormatUp, strUnitPlusHPNum); } else if (unUnitPlusHP == GlobalDefine.PLUS_MAX) { strUnitPlusHP = string.Format(strFormatMax, strUnitPlusHPNum); } else if (unUnitPlusHP == 0) { strUnitPlusHP = ""; } else { strUnitPlusHP = string.Format(strFormat, strUnitPlusHPNum); } if (strUnitPlusHP != string.Empty) { strUnitPlusHP = string.Format(strFormatPlus, strUnitPlusHP); } string strUnitPlusAtk = ""; string strUnitPlusAtkum = string.Format(strFormatPlusNum, unUnitPlusAtk); if (unUnitPlusAtk > (uint)cCharaParam.m_CharaPlusPow) { strUnitPlusAtk = string.Format(strFormatUp, strUnitPlusAtkum); } else if (unUnitPlusAtk == GlobalDefine.PLUS_MAX) { strUnitPlusAtk = string.Format(strFormatMax, strUnitPlusAtkum); } else if (unUnitPlusAtk == 0) { strUnitPlusAtk = ""; } else { strUnitPlusAtk = string.Format(strFormat, strUnitPlusAtkum); } if (strUnitPlusAtk != string.Empty) { strUnitPlusAtk = string.Format(strFormatPlus, strUnitPlusAtk); } m_BlendLimitOverResult = 0; m_BlendLimitOverWarning = false; m_BlendLinkPointUpFlag = false; m_BlendLinkPointMaxFlag = false; m_BlendRarityWarning = false; m_BlendPartsSameCharacter = false; m_BlendPartsSameSkill = false; // 限界突破レベル int nLimitOverCount = 1; // ベースユニットの限界突破MAXレベル int nLimitOverMaxLevel = (int)CharaLimitOver.GetParam(0, cBaseMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); // uint unBaseLinkPoint = 0; //リンクの子をベースにしている場合は親のリンクポイントを参照する if (m_BaseUnit.unit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_LINK) { PacketStructUnit cTmpLinkUnit = CharaLinkUtil.GetLinkUnit(m_BaseUnit.unit.link_unique_id); unBaseLinkPoint = cTmpLinkUnit.link_point; } else if (m_BaseUnit.unit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE) { unBaseLinkPoint = m_BaseUnit.unit.link_point; } //リンクポイントが最大かどうか if (unBaseLinkPoint >= CharaLinkUtil.LINK_POINT_MAX) { m_BlendLinkPointMaxFlag = true; } // ベースユニットの限界突破レベル uint nLimitOverLevel = m_BaseUnit.unit.limitover_lv + (uint)nLimitOverCount; string strBuilupLO = ""; string strBuilupCharm = ""; bool bChangeLO = false; if (nLimitOverCount > 0 && nLimitOverMaxLevel > 0) { bChangeLO = true; // 限界突破が元々MAXの場合 if (nLimitOverMaxLevel == m_BaseUnit.limitover_lv) { m_BlendLimitOverResult = (int)CharaLimitOver.RESULT_TYPE.eValueMax; } // 限界突破の上限値を超える場合 else if (nLimitOverMaxLevel < nLimitOverLevel) { m_BlendLimitOverResult = (int)CharaLimitOver.RESULT_TYPE.eValueOver; } else { m_BlendLimitOverResult = (int)CharaLimitOver.RESULT_TYPE.ePossible; } } //限界突破LV最大チェック if (nLimitOverMaxLevel < nLimitOverLevel) { nLimitOverLevel = (uint)nLimitOverMaxLevel; } // 限界突破の加算値 float fLoHp = ((float)CharaLimitOver.GetParam((uint)nLimitOverLevel, cBaseMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_HP) / 100); float fLoAtk = ((float)CharaLimitOver.GetParam((uint)nLimitOverLevel, cBaseMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_ATK) / 100); // ベースユニットの元々のHPと攻撃力を算出 int nCharaHP = CharaUtil.GetStatusValue(cBaseMasterData, (int)unUnitLevel, CharaUtil.VALUE.HP); int nCharaPow = CharaUtil.GetStatusValue(cBaseMasterData, (int)unUnitLevel, CharaUtil.VALUE.POW); // 限界突破のパラメーターを反映 uint unLO_HP = (uint)(nCharaHP * fLoHp); uint unLO_Atk = (uint)(nCharaPow * fLoAtk); double dLimitOverCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, cBaseMasterData.limit_over_type); //int nLimitOverCost = (int)CharaLimitOver.GetParam(nLimitOverLevel, cBaseMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_COST); string strBuildUpHP = (unBuildUpHP + unLO_HP).ToString(); string strBuildUpAtk = (unBuildUpAtk + unLO_Atk).ToString(); if (unBuildUpHP > unBaseHP || nLimitOverLevel != m_BaseUnit.limitover_lv) { strBuildUpHP = string.Format(strFormatUp, strBuildUpHP); } else if (unBuildUpHP == GlobalDefine.VALUE_MAX_HP) { strBuildUpHP = string.Format(strFormatMax, strBuildUpHP); } else { strBuildUpHP = string.Format(strFormat, strBuildUpHP); } if (unBuildUpAtk > unBaseAtk || nLimitOverLevel != m_BaseUnit.limitover_lv) { strBuildUpAtk = string.Format(strFormatUp, strBuildUpAtk); } else if (unBuildUpAtk == GlobalDefine.VALUE_MAX_POW) { strBuildUpAtk = string.Format(strFormatMax, strBuildUpAtk); } else { strBuildUpAtk = string.Format(strFormat, strBuildUpAtk); } if (bChangeLO && nLimitOverLevel != m_BaseUnit.limitover_lv) { strBuilupLO = string.Format(strFormatUp, nLimitOverLevel); strBuilupCharm = string.Format(strFormatUp, dLimitOverCharm.ToString("F1")); } else { strBuilupLO = nLimitOverLevel.ToString(); strBuilupCharm = dLimitOverCharm.ToString("F1"); } //---------------------------------------- // LVカラー //---------------------------------------- string strBuildUpLevel = ""; if (unUnitLevel == cCharaParam.m_CharaMasterDataParam.level_max) { strBuildUpLevel = string.Format(strFormatUp, GameTextUtil.GetText("unit_status18")); } else { if (unUnitLevel != (uint)cCharaParam.m_CharaLevel) { strBuildUpLevel = string.Format("{0}><color=#f90974>{1}</color>/{2}", cCharaParam.m_CharaLevel, unUnitLevel, cCharaParam.m_CharaMasterDataParam.level_max); } else { strBuildUpLevel = string.Format(GameTextUtil.GetText("unit_status17"), cCharaParam.m_CharaLevel, cCharaParam.m_CharaMasterDataParam.level_max); } } m_UnitStatusPanel.Level = strBuildUpLevel; m_UnitStatusPanel.Lo = strBuilupLO; m_UnitStatusPanel.Hp = strBuildUpHP + strUnitPlusHP; m_UnitStatusPanel.Atk = strBuildUpAtk + strUnitPlusAtk; m_UnitStatusPanel.Charm = strBuilupCharm; m_UnitBGPanel.Point = (int)m_BlendPoint; } else { #if BUILD_TYPE_DEBUG Debug.LogError("MasterData None!"); #endif } } m_UnitBGPanel.TotalPoint = (int)UserDataAdmin.Instance.m_StructPlayer.have_unit_point; }