/// <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 キャラ情報セットアップ:マスターデータ指定 @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; }
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); }
//---------------------------------------------------------------------------- /*! * @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; }