コード例 #1
0
    void SetUpCharaData(ref PartyMemberStatusListItemContext item, PacketStructUnit _mainUnit, PacketStructUnit _subUnit, bool dispCharm, PacketStructUnit[] partyUnits)
    {
        CharaOnce baseChara = new CharaOnce();

        if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
            _subUnit != null)
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                _subUnit.id,
                (int)_subUnit.level,
                (int)_subUnit.add_pow,
                (int)_subUnit.add_hp,
                (int)_mainUnit.link_point,
                (int)_subUnit.limitover_lv
                );
        }
        else
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }

        var changeHp   = (int)(baseChara.m_CharaHP * MainMenuUtil.GetLeaderSkillHpRate(baseChara, partyUnits));
        var statusText = string.Format(GameTextUtil.GetText("questlast_text4"), changeHp);

        if (changeHp > baseChara.m_CharaHP)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text8"), changeHp);
        }
        else if (changeHp < baseChara.m_CharaHP)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text9"), changeHp);
        }
        item.HpText = statusText;

        var changePow = (int)(baseChara.m_CharaPow * MainMenuUtil.GetLeaderSkillDamageRate(baseChara, MainMenuUtil.GetPartyCharaOnceArray(partyUnits)));

        statusText = string.Format(GameTextUtil.GetText("questlast_text4"), changePow);
        if (changePow > baseChara.m_CharaPow)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text8"), changePow);
        }
        else if (changePow < baseChara.m_CharaPow)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text9"), changePow);
        }
        item.AtkText = statusText;

        item.Cost  = ServerDataUtil.GetPacketUnitCost(_mainUnit) + CharaLinkUtil.GetLinkUnitCost(_mainUnit);
        item.Charm = baseChara.m_CharaCharm;
    }