/// <summary> /// 強化画面更新 /// </summary> /// <param name="bRenew"></param> public void updateBuildupStatus(bool bRenew = false) { if (bRenew) { makeUnitList(); m_ExpandWindow.Close(true); m_Validate = false; m_UnitBGPanel.IsViewPanel = false; m_UnitGrid.IsActiveSortButton = true; m_UnitGrid.changeGridWindowSize(false, (m_ExpandWindow != null) ? m_ExpandWindow.ViewHeightSize : 0); } if (m_UnitListCount <= 0) { if (m_MaxDialog == null) { m_MaxDialog = Dialog.Create(DialogType.DialogOK); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.Title, "error_reject_common_title"); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "unit_list_Unowned"); m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1"); m_MaxDialog.SetDialogEvent(DialogButtonEventType.OK, () => { MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_HOME_MENU, false, false); }); m_MaxDialog.DisableCancelButton(); m_MaxDialog.Show(); } } m_BaseUnit = UserDataAdmin.Instance.SearchUnitGridParam(MainMenuParam.m_BuildupBaseUnitUniqueId); if (m_BaseUnit != null) { MasterDataParamChara _master = m_BaseUnit.master; m_UnitStatusPanel.setupUnit(m_BaseUnit.unit); m_UnitBGPanel.setupBaseUnit(_master, m_BaseUnit.unit); m_UnitBGPanel.IsViewExecButton = true; m_UnitBGPanel.IsViewReturnButton = true; m_UnitBGPanel.ExecButtonImage = m_ConfirmSprite; m_UnitBGPanel.IsActiveExecButton = IsBuildupStart(); // 限界突破対応リストを作成 CharaLimitOver.SetEvolBaseUnitIdList(_master.fix_id); updateUnitBaseAfterList(); SetupBlendAfterStatus(); } else { m_UnitBGPanel.resetBaseUnit(); m_UnitBGPanel.IsViewExecButton = false; m_UnitBGPanel.IsViewReturnButton = false; m_UnitBGPanel.Point = 0; m_UnitStatusPanel.reset(); updateUnitBaseList(); } }
private string setUnitLimitOver(ref PacketStructUnit _unit, string _limitOver) { if (_unit == null) { return(""); } MasterDataParamChara master = MasterFinder <MasterDataParamChara> .Instance.Find((int)_unit.id); if (master == null) { return(""); } int nLimitOverMaxLevel = (int)CharaLimitOver.GetParam(0, master.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); int limitOver = _limitOver.ToInt(0); if (limitOver > nLimitOverMaxLevel) { limitOver = nLimitOverMaxLevel; } _unit.limitover_lv = (uint)limitOver; return(limitOver.ToString()); }
/// <summary> /// リンクボーナス設定 /// </summary> /// <param name="skill_id"></param> public uint setupLinkEffectInfo(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData, bool bLink) { BaseHeight = BASE_LINK_BONUS_HEIGHT; TitleHeight = TITLE_DEFAULT_HEIGHT; TitleWidth = LINK_BONUS_TITLE_WIDTH; MessageBgH = LINK_MESSAGE_BG_HEIGHT; setLinkTitleImage("skill_name_bg1", "linkubo-nasu"); LvLabel = GameTextUtil.GetText("unit_status4"); HpLabel = GameTextUtil.GetText("unit_status5"); AtkLabel = GameTextUtil.GetText("unit_status6"); CostLabel = GameTextUtil.GetText("unit_status8"); LinkLabel = GameTextUtil.GetText("unit_linkstatus3"); CharmLabel = GameTextUtil.GetText("unit_status9"); IsSkillItem = false; IsViewStatus = true; IsViewIcon = true; // LinkTitleText = ""; //---------------------------------------- // リンク効果設定 //---------------------------------------- //int nUnitId = (int)cCharaMasterData.fix_id; int nLv = cCharaOnce.m_CharaLevel; int nPlusHp = cCharaOnce.m_CharaPlusHP; int nPlusPow = cCharaOnce.m_CharaPlusPow; int nCost = cCharaMasterData.party_cost; uint unID = cCharaMasterData.fix_id; double nCharm = 0; //------------------------------------------------------------ // LINK BONUS //------------------------------------------------------------ //レベル Lv = nLv; //HP int nHp = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP)); // ATK int nPow = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW)); //COST Cost = nCost; //アイコン IsViewIcon = false; uint nLinkPoint = 0; //リンクポイント if (bLink) { //リンク子の場合はリンクポイントを反映 nLinkPoint = (uint)cCharaOnce.m_LinkParam.m_CharaLinkPoint; float fLinkPoint = nLinkPoint * 0.01f; Link = string.Format(GameTextUtil.GetText("unit_linkstatus4"), fLinkPoint); } else { //ハイフン表示 Link = EmptyStr; } uint nLimitOverLevel = (uint)cCharaOnce.m_CharaLimitOver; if (nLimitOverLevel > 0) { // 限界突破タイプ int nLimitOverType = cCharaMasterData.limit_over_type; // 限界突破後のコスト //Cost = (int)CharaLimitOver.GetParam(nLimitOverLevel, nLimitOverType, (int)CharaLimitOver.EGET.ePARAM_COST); // 限界突破後のHp nHp = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP); // 限界突破後のPow nPow = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW); // CHARM nCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, nLimitOverType); } if (nPlusHp > 0) { Hp = string.Format(GameTextUtil.GetText("unit_status19"), nHp, nPlusHp); } else { Hp = nHp.ToString(); } if (nPlusPow > 0) { Atk = string.Format(GameTextUtil.GetText("unit_status19"), nPow, nPlusPow); } else { Atk = nPow.ToString(); } Charm = nCharm.ToString("F1"); return(nLinkPoint); }
/// <summary> /// リンクボーナス設定 /// </summary> /// <param name="skill_id"></param> public void setupUnitData(CharaOnce cCharaParam, MasterDataParamChara cCharaMasterData) { BaseHeight = BASE_LINK_BONUS_HEIGHT; TitleHeight = TITLE_DEFAULT_HEIGHT; TitleWidth = LINK_BONUS_TITLE_WIDTH; MessageBgH = LINK_MESSAGE_BG_HEIGHT; setLinkTitleImage("skill_name_bg1", "linkubo-nasu"); LvLabel = GameTextUtil.GetText("unit_status4"); HpLabel = GameTextUtil.GetText("unit_status5"); AtkLabel = GameTextUtil.GetText("unit_status6"); CostLabel = GameTextUtil.GetText("unit_status8"); LinkLabel = GameTextUtil.GetText("unit_linkstatus3"); CharmLabel = GameTextUtil.GetText("unit_status9"); IsSkillItem = false; IsViewStatus = true; IsViewIcon = true; //-------------------------------- // 選択されているユニット情報を選定 //-------------------------------- uint unCharaLevel = (uint)cCharaParam.m_CharaLevel; // キャラレベル // +情報 //---------------------------------------- // リンク情報の設定 v300対応 //---------------------------------------- //リンクキャラの定義取得 uint unCharaId = cCharaParam.m_LinkParam.m_CharaID; // リンク対象ユニット MasterDataParamChara cCharaParamLink = MasterDataUtil.GetCharaParamFromID(unCharaId); // コスト int nCharaCost = cCharaMasterData.party_cost; if (unCharaId > 0 && cCharaParamLink != null) { //------------------------------------------------------------ // LINK BONUS //------------------------------------------------------------ //ユニット名 LinkTitleText = cCharaParamLink.name; //レベル Lv = cCharaParam.m_LinkParam.m_CharaLv; //HP int nHp = (CharaLinkUtil.GetLinkUnitBonusElement(cCharaParamLink, cCharaParam.m_LinkParam.m_CharaLv, 0, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(cCharaParam.m_LinkParam.m_CharaPlusHP, CharaUtil.VALUE.HP)); int nPlusHp = cCharaParam.m_LinkParam.m_CharaPlusHP; // ATK int nPow = (CharaLinkUtil.GetLinkUnitBonusElement(cCharaParamLink, cCharaParam.m_LinkParam.m_CharaLv, 0, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(cCharaParam.m_LinkParam.m_CharaPlusPow, CharaUtil.VALUE.POW)); int nPlusPow = cCharaParam.m_LinkParam.m_CharaPlusPow; double nCharm = 0; //COST Cost = cCharaParamLink.party_cost; // リンクポイント float fLinkPoint = (cCharaParam.m_LinkParam.m_CharaLinkPoint) * 0.01f; Link = string.Format(GameTextUtil.GetText("unit_linkstatus4"), fLinkPoint); uint nLimitOverLevel = (uint)cCharaParam.m_LinkParam.m_CharaLOLevel; if (nLimitOverLevel > 0) { // 限界突破タイプ int nLimitOverType = cCharaParamLink.limit_over_type; // 限界突破後のコスト //Cost = (int)CharaLimitOver.GetParam(nLimitOverLevel, nLimitOverType, (int)CharaLimitOver.EGET.ePARAM_COST); // 限界突破後のHp nHp = CharaLinkUtil.GetLinkUnitBonusElement(unCharaId, Lv, nLimitOverLevel, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP); // 限界突破後のPow nPow = CharaLinkUtil.GetLinkUnitBonusElement(unCharaId, Lv, nLimitOverLevel, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW); // CHARM nCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, nLimitOverType); } //キャラアイコン IsViewIcon = true; IconSelect = MainMenuUtil.GetElementCircleSprite(cCharaParamLink.element); UnitIconImageProvider.Instance.Get( cCharaParamLink.fix_id, sprite => { IconImage = sprite; }); if (nPlusHp > 0) { Hp = string.Format(GameTextUtil.GetText("unit_status19"), nHp, nPlusHp); } else { Hp = nHp.ToString(); } if (nPlusPow > 0) { Atk = string.Format(GameTextUtil.GetText("unit_status19"), nPow, nPlusPow); } else { Atk = nPow.ToString(); } Charm = nCharm.ToString("F1"); } }
//---------------------------------------------------------------------------- /*! * @brief ステータス更新 * @note 売却のパラメータ表示部分のテキスト表記を更新 */ //---------------------------------------------------------------------------- void SetupSaleStatusValue() { //----------------------- // 選択してるユニットから合計金額と合計ユニットポイントを求める //----------------------- uint unTotalMoney = 0; uint unTotalUnitPoint = 0; uint unSelectCount = 0; m_WarningRarity = false; m_WarningBuildup = false; for (int i = 0; i < MAX_SALE_UNIT_COUNT; i++) { if (m_UnitSale.UnitList[i].m_UniqueId == 0) { continue; } PacketStructUnit _saleUnit = UserDataAdmin.Instance.SearchChara(m_UnitSale.UnitList[i].m_UniqueId); MasterDataParamChara _saleMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)_saleUnit.id); if (_saleUnit == null || _saleMaster == null) { continue; } unSelectCount++; //レアリティ★4以上のユニットが選択されていたら警告する。 if ((int)_saleMaster.rare >= (int)MasterDataDefineLabel.RarityType.STAR_4) { m_WarningRarity = true; } //ユニットが強化されていたら警告する。 if (_saleUnit.level > 1 || (_saleMaster.skill_limitbreak != 0 && _saleUnit.limitbreak_lv > 0) || _saleUnit.limitover_lv > 0 || _saleUnit.add_hp > 0 || _saleUnit.add_pow > 0) { m_WarningBuildup = true; } // コイン uint unUnitMoney = (uint)CharaUtil.GetStatusValue(_saleMaster, (int)_saleUnit.level, CharaUtil.VALUE.SALE); unTotalMoney += unUnitMoney; unTotalMoney += _saleUnit.add_pow * GlobalDefine.PLUS_SALE_COIN; unTotalMoney += _saleUnit.add_hp * GlobalDefine.PLUS_SALE_COIN; // ユニットポイント unTotalUnitPoint += (uint)_saleMaster.sales_unitpoint; // 限界突破によるコインとユニットポイントの計算 if (_saleUnit.limitover_lv > 0) { // 限界突破によるボーナスコイン double dLimitOverMaxLevel = CharaLimitOver.GetParam(0, _saleMaster.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); double dLimitOverLevel = (double)_saleUnit.limitover_lv; //unTotalMoney += (uint)( unUnitMoney * nLimitOverLevel + unUnitMoney * ( nLimitOverLevel + 1 ) * ( GlobalDefine.LIMITOVER_BONUS * nLimitOverLevel / nLimitOverMaxLevel ) ); double dLoBounsMoney = CharaLimitOver.GetParamSaleLimitOverBouns(dLimitOverLevel, dLimitOverMaxLevel, unUnitMoney); unTotalMoney += (uint)dLoBounsMoney; // 限界突破によるボーナスユニットポイント unTotalUnitPoint += (uint)(_saleMaster.sales_unitpoint * dLimitOverLevel); } } m_UnitBGPanel.Money = (int)unTotalMoney; m_UnitBGPanel.Point = (int)unTotalUnitPoint; m_UnitBGPanel.SaleCount = (int)unSelectCount; m_UnitBGPanel.IsEnableResetButton = m_UnitBGPanel.IsActiveExecButton = IsSaleUnit(); }
private void SetLinkEffectInfo(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData, bool bLink) { //---------------------------------------- // リンク効果設定 //---------------------------------------- //int nUnitId = (int)cCharaMasterData.fix_id; int nLv = cCharaOnce.m_CharaLevel; int nPlusHp = cCharaOnce.m_CharaPlusHP; int nPlusPow = cCharaOnce.m_CharaPlusPow; int nCost = cCharaMasterData.party_cost; uint unID = cCharaMasterData.fix_id; double nCharm = 0; //------------------------------------------------------------ // LINK BONUS //------------------------------------------------------------ //レベル Lv = nLv; //HP int nHp = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP)); // ATK int nPow = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW)); //COST Cost = nCost; uint nLinkPoint = 0; //リンクポイント if (bLink) { //リンク子の場合はリンクポイントを反映 nLinkPoint = (uint)cCharaOnce.m_LinkParam.m_CharaLinkPoint; float fLinkPoint = nLinkPoint * 0.01f; Link = string.Format(GameTextUtil.GetText("unit_linkstatus4"), fLinkPoint); } else { //ハイフン表示 Link = EmptyStr; } uint nLimitOverLevel = (uint)cCharaOnce.m_CharaLimitOver; if (nLimitOverLevel > 0) { // 限界突破タイプ int nLimitOverType = cCharaMasterData.limit_over_type; // 限界突破後のコスト //Cost = (int)CharaLimitOver.GetParam(nLimitOverLevel, nLimitOverType, (int)CharaLimitOver.EGET.ePARAM_COST); // 限界突破後のHp nHp = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP); // 限界突破後のPow nPow = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW); // CHARM nCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, nLimitOverType); } if (nPlusHp > 0) { Hp = string.Format(GameTextUtil.GetText("unit_linkstatus1"), nHp, nPlusHp); } else { Hp = nHp.ToString(); } if (nPlusPow > 0) { Atk = string.Format(GameTextUtil.GetText("unit_linkstatus1"), nPow, nPlusPow); } else { Atk = nPow.ToString(); } Charm = nCharm.ToString("F1"); //------------------------------------------------------------ // RACE BONUS //------------------------------------------------------------ // 種族 //RaceName = GameTextUtil.GetKindToText(cCharaOnce.kind, cCharaOnce.kind_sub); RaceName = GameTextUtil.GetKindToText(cCharaMasterData.kind, cCharaMasterData.sub_kind); // 説明文 RaceBonusMessage = CharaLinkUtil.GetLinkBonusRaceText(cCharaMasterData); SetLinkEffectSkill(cCharaMasterData, nLinkPoint); }
void CreateSendUnitGetDatas(bool isLink, bool isEvol) { List <PacketStructUnitGetDebug> cUnitGetList = new List <PacketStructUnitGetDebug>(); MasterDataParamChara cCharaMasterData; // ユニットのマスターデータ PacketStructUnitGetDebug cUnitGet; // ユニットデータ MasterDataParamCharaEvol cEvolMasterData; // 進化素材のマスターデータ MasterDataParamChara cCLinkharaMasterData; // リンク素材のマスターデータ int nLimitOverMax; // 限界突破レベルの最大値 for (int i = 0; i < m_DebugGetUnitSelectPanel.Units.Count; i++) { // 選択ユニット追加 if (m_DebugGetUnitSelectPanel.Units[i].unitID == 0) { continue; } cUnitGet = new PacketStructUnitGetDebug(); cUnitGet.id = m_DebugGetUnitSelectPanel.Units[i].unitID; cUnitGet.limitbreak_lv = m_DebugGetUnitSelectPanel.m_UnitGetData.limitbreak_lv; cUnitGet.limitover_lv = m_DebugGetUnitSelectPanel.m_UnitGetData.limitover_lv; cUnitGet.level = m_DebugGetUnitSelectPanel.m_UnitGetData.level; cUnitGet.add_pow = m_DebugGetUnitSelectPanel.m_UnitGetData.add_pow; cUnitGet.add_hp = m_DebugGetUnitSelectPanel.m_UnitGetData.add_hp; cCharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); nLimitOverMax = (int)CharaLimitOver.GetParam(0, cCharaMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); cUnitGet.limitover_lv = (nLimitOverMax < (int)cUnitGet.limitover_lv) ? (uint)nLimitOverMax : cUnitGet.limitover_lv; cUnitGetList.Add(cUnitGet); // 進化ユニット追加 if (isEvol) { cEvolMasterData = MasterDataUtil.GetCharaEvolParamFromCharaID(cUnitGet.id); if (cEvolMasterData != null) { if (cEvolMasterData.unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetEvol1 = new PacketStructUnitGetDebug(); cUnitGetEvol1.id = cEvolMasterData.unit_id_parts1; cUnitGetEvol1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol1.level = cUnitGet.level; cUnitGetEvol1.add_hp = cUnitGet.add_hp; cUnitGetEvol1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol1); } if (cEvolMasterData.unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetEvol2 = new PacketStructUnitGetDebug(); cUnitGetEvol2.id = cEvolMasterData.unit_id_parts2; cUnitGetEvol2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol2.level = cUnitGet.level; cUnitGetEvol2.add_hp = cUnitGet.add_hp; cUnitGetEvol2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol2); } if (cEvolMasterData.unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetEvol3 = new PacketStructUnitGetDebug(); cUnitGetEvol3.id = cEvolMasterData.unit_id_parts3; cUnitGetEvol3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol3.level = cUnitGet.level; cUnitGetEvol3.add_hp = cUnitGet.add_hp; cUnitGetEvol3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol3); } } } // リンクユニット追加 if (isLink) { cCLinkharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); if (cCLinkharaMasterData != null) { if (cCLinkharaMasterData.link_unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetLink1 = new PacketStructUnitGetDebug(); cUnitGetLink1.id = cCLinkharaMasterData.link_unit_id_parts1; cUnitGetLink1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink1.level = cUnitGet.level; cUnitGetLink1.add_hp = cUnitGet.add_hp; cUnitGetLink1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink1); } if (cCLinkharaMasterData.link_unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetLink2 = new PacketStructUnitGetDebug(); cUnitGetLink2.id = cCLinkharaMasterData.link_unit_id_parts2; cUnitGetLink2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink2.level = cUnitGet.level; cUnitGetLink2.add_hp = cUnitGet.add_hp; cUnitGetLink2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink2); } if (cCLinkharaMasterData.link_unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetLink3 = new PacketStructUnitGetDebug(); cUnitGetLink3.id = cCLinkharaMasterData.link_unit_id_parts3; cUnitGetLink3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink3.level = cUnitGet.level; cUnitGetLink3.add_hp = cUnitGet.add_hp; cUnitGetLink3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink3); } } } } if (cUnitGetList.Count > 0) { //---------------------------------------- // 追加ユニット数を10倍にする //---------------------------------------- if (m_DebugGetUnitSelectPanel.IsMultiplyUnit) { List <PacketStructUnitGetDebug> unitGetMultiplyList = new List <PacketStructUnitGetDebug>(); foreach (PacketStructUnitGetDebug unit in cUnitGetList) { for (int i = 0; i < 10; i++) { PacketStructUnitGetDebug copyUnit = new PacketStructUnitGetDebug(); copyUnit.Copy(unit); unitGetMultiplyList.Add(copyUnit); } } cUnitGetList = unitGetMultiplyList; } //---------------------------------------- // リクエスト開始 //---------------------------------------- if (cUnitGetList.Count > 100 || m_DebugGetUnitSelectPanel.IsMultiplyUnit) { // 10倍すると、かなり数が多くなるので警告を出しておく Dialog newDialog = Dialog.Create(DialogType.DialogYesNo); newDialog.SetDialogText(DialogTextType.Title, "ユニット取得"); newDialog.SetDialogText(DialogTextType.MainText, string.Format("{0}体のユニットを取得しようとしています。\nよろしいですか。", cUnitGetList.Count)); newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4"); newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5"); newDialog.SetDialogEvent(DialogButtonEventType.YES, () => { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト }); newDialog.SetDialogEvent(DialogButtonEventType.NO, () => { }); newDialog.Show(); } else { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト } } }
void CreateSendUnitGetDatas(bool isLink, bool isEvol) { List <PacketStructUnitGetDebug> cUnitGetList = new List <PacketStructUnitGetDebug>(); MasterDataParamChara cCharaMasterData; // ユニットのマスターデータ PacketStructUnitGetDebug cUnitGet; // ユニットデータ MasterDataParamCharaEvol cEvolMasterData; // 進化素材のマスターデータ MasterDataParamChara cCLinkharaMasterData; // リンク素材のマスターデータ int nLimitOverMax; // 限界突破レベルの最大値 for (int i = 0; i < Units.Count; i++) { // 選択ユニット追加 if (Units[i].UnitGetData.id == 0) { continue; } cUnitGet = Units[i].UnitGetData; cCharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); nLimitOverMax = (int)CharaLimitOver.GetParam(0, cCharaMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_LIMITOVER_MAX); cUnitGet.limitover_lv = (nLimitOverMax < (int)cUnitGet.limitover_lv) ? (uint)nLimitOverMax : cUnitGet.limitover_lv; cUnitGetList.Add(cUnitGet); // 進化ユニット追加 if (isEvol) { cEvolMasterData = MasterDataUtil.GetCharaEvolParamFromCharaID(cUnitGet.id); if (cEvolMasterData != null) { if (cEvolMasterData.unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetEvol1 = new PacketStructUnitGetDebug(); cUnitGetEvol1.id = cEvolMasterData.unit_id_parts1; cUnitGetEvol1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol1.level = cUnitGet.level; cUnitGetEvol1.add_hp = cUnitGet.add_hp; cUnitGetEvol1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol1); } if (cEvolMasterData.unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetEvol2 = new PacketStructUnitGetDebug(); cUnitGetEvol2.id = cEvolMasterData.unit_id_parts2; cUnitGetEvol2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol2.level = cUnitGet.level; cUnitGetEvol2.add_hp = cUnitGet.add_hp; cUnitGetEvol2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol2); } if (cEvolMasterData.unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetEvol3 = new PacketStructUnitGetDebug(); cUnitGetEvol3.id = cEvolMasterData.unit_id_parts3; cUnitGetEvol3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetEvol3.level = cUnitGet.level; cUnitGetEvol3.add_hp = cUnitGet.add_hp; cUnitGetEvol3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetEvol3); } } } // リンクユニット追加 if (isLink) { cCLinkharaMasterData = MasterDataUtil.GetCharaParamFromID(cUnitGet.id); if (cCLinkharaMasterData != null) { if (cCLinkharaMasterData.link_unit_id_parts1 != 0) { PacketStructUnitGetDebug cUnitGetLink1 = new PacketStructUnitGetDebug(); cUnitGetLink1.id = cCLinkharaMasterData.link_unit_id_parts1; cUnitGetLink1.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink1.level = cUnitGet.level; cUnitGetLink1.add_hp = cUnitGet.add_hp; cUnitGetLink1.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink1); } if (cCLinkharaMasterData.link_unit_id_parts2 != 0) { PacketStructUnitGetDebug cUnitGetLink2 = new PacketStructUnitGetDebug(); cUnitGetLink2.id = cCLinkharaMasterData.link_unit_id_parts2; cUnitGetLink2.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink2.level = cUnitGet.level; cUnitGetLink2.add_hp = cUnitGet.add_hp; cUnitGetLink2.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink2); } if (cCLinkharaMasterData.link_unit_id_parts3 != 0) { PacketStructUnitGetDebug cUnitGetLink3 = new PacketStructUnitGetDebug(); cUnitGetLink3.id = cCLinkharaMasterData.link_unit_id_parts3; cUnitGetLink3.limitbreak_lv = cUnitGet.limitbreak_lv; cUnitGetLink3.level = cUnitGet.level; cUnitGetLink3.add_hp = cUnitGet.add_hp; cUnitGetLink3.add_pow = cUnitGet.add_pow; cUnitGetList.Add(cUnitGetLink3); } } } } if (cUnitGetList.Count > 0) { SendGetDebugUnit(cUnitGetList.ToArray()); // リクエスト } }
//---------------------------------------------------------------------------- /*! * @brief リンクシステム:属性ボーナス:キャラマスター指定 * @param[in] MasterDataParamChara (cCharaMaster) キャラマスター * @param[in] int (nLevel) ユニットレベル * @param[in] int (nLoLevel) 限界突破レベル * @param[in] int (nBonusType) ボーナスタイプ * @return int (nResult) [+加算値] * @note HPとATKのボーナス値 ※引数でまとめて受け取った方がいいかも */ //---------------------------------------------------------------------------- static public int GetLinkUnitBonusElement(MasterDataParamChara cCharaMaster, int nLevel, uint nLoLevel, CharaUtil.VALUE nBonusType) { MasterDataLinkSystem[] acLinkMaster = MasterFinder <MasterDataLinkSystem> .Instance.GetAll(); int nResult = 0; //-------------------------------- // エラーチェック //-------------------------------- if (acLinkMaster == null || cCharaMaster == null) { Debug.LogError("MasterDataLinkSystem or MasterDataParamChara Is None!"); return(nResult); } int nLimitOverCost = (int)CharaLimitOver.GetParam(nLoLevel, cCharaMaster.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_COST); //-------------------------------- // 基礎値 //-------------------------------- float fBaseValue = 1.0f; float fCostValue = InGameUtilBattle.AvoidErrorMultiple((float)cCharaMaster.party_cost + nLimitOverCost, RATE_COST); float fRareValue = ((int)cCharaMaster.rare + 1) * ((int)cCharaMaster.rare + 1); fBaseValue += fCostValue + fRareValue; //-------------------------------- // 属性値 //-------------------------------- int nLinkNum = 0; float fElemValue = 0.0f; // ボーナス定義の確定 for (int num = 0; num < LINK_BONUS_KIND; ++num) { // ボーナス定義の属性と、リンクユニットの属性が等しい場合 if (acLinkMaster[num].elem == cCharaMaster.element) { nLinkNum = num; break; } } // ボーナス値の種類による分岐 switch (nBonusType) { case CharaUtil.VALUE.POW: fElemValue = InGameUtilBattle.GetDBRevisionValue((float)acLinkMaster[nLinkNum].atk); break; case CharaUtil.VALUE.HP: fElemValue = InGameUtilBattle.GetDBRevisionValue((float)acLinkMaster[nLinkNum].hp); break; } //-------------------------------- // レベル補正 //-------------------------------- float fLevelCorrection = 1.0f; float fLevelValue = InGameUtilBattle.AvoidErrorMultiple((float)nLevel, RATE_LEVEL); fLevelCorrection += fLevelValue; //-------------------------------- // 最終結果:属性ボーナス値(基礎値 × 属性値 × Lv補正)※端数切捨て //-------------------------------- float fWork = 0.0f; fWork = InGameUtilBattle.AvoidErrorMultiple(fBaseValue, fElemValue); fWork = InGameUtilBattle.AvoidErrorMultiple(fWork, fLevelCorrection); nResult = (int)fWork; return(nResult); }
//---------------------------------------------------------------------------- /*! @brief キャラ情報セットアップ:マスターデータ指定 @param MasterDataParamChara cMasterData キャラマスター @param int nLevel キャラレベル @param int lbsLv リミットブレイクスキルレベル @param int nPlusPow プラス値:攻撃 @param int nPlusHP プラス値:体力 @param int nLOLevel プラス値:限界突破値 @note */ //---------------------------------------------------------------------------- public bool CharaSetupFromParam(MasterDataParamChara cMasterData, int nLevel, int lbsLv, int nPlusPow, int nPlusHP, int nLOLevel) { m_CharaMasterDataParam = cMasterData; m_bHasCharaMasterDataParam = (null != m_CharaMasterDataParam); if (m_CharaMasterDataParam == null) { Debug.LogError("CharaSetup Error! - InstanceNone!! "); return false; } // @change Developer 2015/09/03 ver300 #region ==== 通常処理 ==== int nPlusValuePow = 0; int nPlusValueHP = 0; m_CharaLevel = nLevel; m_CharaLBSLv = lbsLv; float fLimitOverHP = 0; float fLimitOverATK = 0; #region ==== スキルレベルまるめ処理 ==== MasterDataSkillLimitBreak cSkillLimitBreak = BattleParam.m_MasterDataCache.useSkillLimitBreak(cMasterData.skill_limitbreak); if (cSkillLimitBreak != null) { if (lbsLv > cSkillLimitBreak.level_max) { m_CharaLBSLv = cSkillLimitBreak.level_max; } } #endregion #region ==== リミットオーバーまるめ処理 ==== MasterDataLimitOver _masterMainLO = MasterFinder<MasterDataLimitOver>.Instance.Find((int)cMasterData.limit_over_type); if (_masterMainLO != null) { if (nLOLevel > _masterMainLO.limit_over_max) { nLOLevel = _masterMainLO.limit_over_max; } } #endregion m_CharaPow = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.POW); m_CharaDef = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.DEF); m_CharaHP = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.HP); m_CharaLimitBreak = 0; m_CharaPlusPow = nPlusPow; m_CharaPlusDef = 0; m_CharaPlusHP = nPlusHP; m_CharaLimitOver = nLOLevel; m_CharaCharm = CharaLimitOver.GetParamCharm((uint)nLOLevel, cMasterData.limit_over_type); // レベルMAXなら限界突破の値を追加 float fLimitOverAddHp = CharaLimitOver.GetParam((uint)nLOLevel, cMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_HP); float fLimitOverAddAtk = CharaLimitOver.GetParam((uint)nLOLevel, cMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_ATK); fLimitOverHP = m_CharaHP * (fLimitOverAddHp / 100); fLimitOverATK = m_CharaPow * (fLimitOverAddAtk / 100); // プラス値を算出 nPlusValuePow = m_CharaPlusPow * GlobalDefine.PLUS_RATE_POW; nPlusValueHP = m_CharaPlusHP * GlobalDefine.PLUS_RATE_HP; #endregion // @add Developer 2015/09/03 ver300 #region ==== リンクシステム処理 ==== int nElemValuePow = 0; int nElemValueHP = 0; int nRaceValuePow = 0; int nRaceValueHP = 0; int nLinkPlusValuePow = 0; int nLinkPlusValueHP = 0; double nLinkCharm = 0; // リンク中の場合 //MasterDataParamChara cLinkCharaMaster = BattleParam.m_MasterDataCache.useCharaParam(m_LinkParam.m_CharaID); MasterDataParamChara cLinkCharaMaster = m_LinkParam.m_cCharaMasterDataParam; if (cLinkCharaMaster != null) { float fWork = 0.0f; // 属性ボーナスを加算 nElemValuePow = CharaLinkUtil.GetLinkUnitBonusElement(cLinkCharaMaster, m_LinkParam.m_CharaLv, (uint)m_LinkParam.m_CharaLOLevel, CharaUtil.VALUE.POW); nElemValueHP = CharaLinkUtil.GetLinkUnitBonusElement(cLinkCharaMaster, m_LinkParam.m_CharaLv, (uint)m_LinkParam.m_CharaLOLevel, CharaUtil.VALUE.HP); // 種族ボーナス:攻撃力の+%値を算出 fWork = CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.kind, CharaUtil.VALUE.POW); // %値取得(メイン) fWork += CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.sub_kind, CharaUtil.VALUE.POW); // %値取得(サブ) fWork = InGameUtilBattle.GetDBRevisionValue(fWork); // 数値変換 nRaceValuePow = (int)InGameUtilBattle.AvoidErrorMultiple((float)m_CharaPow, fWork); // 増加量 // 種族ボーナス:体力の実値を取得 nRaceValueHP = (int)CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.kind, CharaUtil.VALUE.HP); // 実値取得(メイン) nRaceValueHP += (int)CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.sub_kind, CharaUtil.VALUE.HP); // 実値取得(サブ) // +値の算出 nLinkPlusValuePow = CharaLinkUtil.GetLinkUnitBonusPlus(m_LinkParam.m_CharaPlusPow, CharaUtil.VALUE.POW); nLinkPlusValueHP = CharaLinkUtil.GetLinkUnitBonusPlus(m_LinkParam.m_CharaPlusHP, CharaUtil.VALUE.HP); nLinkCharm = CharaLimitOver.GetParamCharm((uint)m_LinkParam.m_CharaLOLevel, cLinkCharaMaster.limit_over_type); } else { // リンク用変数の初期化 m_LinkParam.Setup(); } #endregion #if BUILD_TYPE_DEBUG DebugBattleLog.writeText(DebugBattleLog.StrOpe + "キャラ基本情報" + "[" + cMasterData.name + "]" + " FixID:" + cMasterData.fix_id + " DrawID:" + cMasterData.draw_id + " LV:" + m_CharaLevel.ToString() + " SkillLV:" + m_CharaLBSLv.ToString() + " LimOverLv:" + m_CharaLimitOver.ToString() + " PlusPow:" + m_CharaPlusPow.ToString() + " PlusHp:" + m_CharaPlusHP.ToString() + " 属性:" + cMasterData.element.ToString() + " 種族1:" + cMasterData.kind.ToString() + " 種族2:" + cMasterData.sub_kind.ToString() ); DebugBattleLog.writeText(DebugBattleLog.StrOpe + " HP(" + (m_CharaHP + nPlusValueHP + nElemValueHP + nRaceValueHP + nLinkPlusValueHP + (int)fLimitOverHP).ToString() + ")" + " = LV(" + m_CharaHP.ToString() + ")" + " + PlusHP(" + nPlusValueHP.ToString() + ")" + " + LinkElem(" + nElemValueHP.ToString() + ")" + " + LinkRace(" + nRaceValueHP.ToString() + ")" + " + LinkPlus(" + nLinkPlusValueHP.ToString() + ")" + " + LimitOver(" + ((int)fLimitOverHP).ToString() + ")" ); DebugBattleLog.writeText(DebugBattleLog.StrOpe + " POW(" + (m_CharaPow + nPlusValuePow + nElemValuePow + nRaceValuePow + nLinkPlusValuePow + (int)fLimitOverATK).ToString() + ")" + " = LV(" + m_CharaPow.ToString() + ")" + " + PlusPow(" + nPlusValuePow.ToString() + ")" + " + LinkElem(" + nElemValuePow.ToString() + ")" + " + LinkRace(" + nRaceValuePow.ToString() + ")" + " + LinkPlus(" + nLinkPlusValuePow.ToString() + ")" + " + LimitOver(" + ((int)fLimitOverATK).ToString() + ")" ); const int ADD_SKILL_COUNT_LIMIT = 50; // スキル連結数の上限 if (cMasterData.skill_leader != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リーダースキル(fixid:" + cMasterData.skill_leader.ToString(), false); MasterDataSkillLeader master_data = BattleParam.m_MasterDataCache.useSkillLeader(cMasterData.skill_leader); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cMasterData.skill_limitbreak != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リミブレスキル(fixid:" + cMasterData.skill_limitbreak.ToString(), false); MasterDataSkillLimitBreak master_data = BattleParam.m_MasterDataCache.useSkillLimitBreak(cMasterData.skill_limitbreak); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { int loop_limit = ADD_SKILL_COUNT_LIMIT; int add_fix_id = master_data.add_fix_id; while (add_fix_id != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false); MasterDataSkillLimitBreak add_master_data = BattleParam.m_MasterDataCache.useSkillLimitBreak((uint)add_fix_id); if (add_master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); break; } add_fix_id = add_master_data.add_fix_id; loop_limit--; if (loop_limit <= 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))"); } } DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cMasterData.skill_active0 != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " ノーマルスキル1(fixid:" + cMasterData.skill_active0.ToString(), false); MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cMasterData.skill_active0); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cMasterData.skill_active1 != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " ノーマルスキル2(fixid:" + cMasterData.skill_active1.ToString(), false); MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cMasterData.skill_active1); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cMasterData.skill_passive != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " パッシブスキル(fixid:" + cMasterData.skill_passive.ToString(), false); MasterDataSkillPassive master_data = BattleParam.m_MasterDataCache.useSkillPassive(cMasterData.skill_passive); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { int loop_limit = ADD_SKILL_COUNT_LIMIT; int add_fix_id = master_data.add_fix_id; while (add_fix_id != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false); MasterDataSkillPassive add_master_data = BattleParam.m_MasterDataCache.useSkillPassive((uint)add_fix_id); if (add_master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); break; } add_fix_id = add_master_data.add_fix_id; loop_limit--; if (loop_limit <= 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))"); } } DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cLinkCharaMaster != null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リンクキャラ" + "[" + cLinkCharaMaster.name + "]" + " FixID:" + cLinkCharaMaster.fix_id + " DrawID:" + cLinkCharaMaster.draw_id + " LV:" + m_LinkParam.m_CharaLv.ToString() + " LimOverLv:" + m_LinkParam.m_CharaLOLevel.ToString() + " PlusPow:" + m_LinkParam.m_CharaPlusPow.ToString() + " PlusHp:" + m_LinkParam.m_CharaPlusHP.ToString() + " LinkPoint:" + m_LinkParam.m_CharaLinkPoint.ToString() ); if (cLinkCharaMaster.link_skill_active != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リンクスキル(fixid:" + cLinkCharaMaster.link_skill_active.ToString(), false); MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cLinkCharaMaster.link_skill_active); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } if (cLinkCharaMaster.link_skill_passive != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リンクパッシブスキル(fixid:" + cLinkCharaMaster.link_skill_passive.ToString(), false); MasterDataSkillPassive master_data = BattleParam.m_MasterDataCache.useSkillPassive(cLinkCharaMaster.link_skill_passive); if (master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); } else { int loop_limit = ADD_SKILL_COUNT_LIMIT; int add_fix_id = master_data.add_fix_id; while (add_fix_id != 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false); MasterDataSkillPassive add_master_data = BattleParam.m_MasterDataCache.useSkillPassive((uint)add_fix_id); if (add_master_data == null) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))"); break; } add_fix_id = add_master_data.add_fix_id; loop_limit--; if (loop_limit <= 0) { DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))"); } } DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail); } } } #endif //BUILD_TYPE_DEBUG // 攻撃力、体力の増加値を加算 m_CharaPow += nPlusValuePow + nElemValuePow + nRaceValuePow + nLinkPlusValuePow + (int)fLimitOverATK; m_CharaHP += nPlusValueHP + nElemValueHP + nRaceValueHP + nLinkPlusValueHP + (int)fLimitOverHP; m_CharaCharm += nLinkCharm; if (m_CharaPow > GlobalDefine.VALUE_MAX_POW) { m_CharaPow = GlobalDefine.VALUE_MAX_POW; } if (m_CharaHP > GlobalDefine.VALUE_MAX_HP) { m_CharaHP = GlobalDefine.VALUE_MAX_HP; } return true; }
//---------------------------------------------------------------------------- /*! * @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; }