Beispiel #1
0
    /// <summary>
    /// ソートパラメータ設定(ユニット共通)
    /// </summary>
    /// <param name="_main"></param>
    /// <param name="_mainMaster"></param>
    /// <param name="_sub"></param>
    private void setSortParamUnit(PacketStructUnit _main, MasterDataParamChara _mainMaster, PacketStructUnit _sub)
    {
        CharaOnce baseChara = new CharaOnce();

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

        draw_id = (int)_mainMaster.draw_id;
        level   = (int)_main.level;
        hp      = baseChara.m_CharaHP;
        pow     = baseChara.m_CharaPow;
        plus    = baseChara.m_CharaPlusHP + baseChara.m_CharaPlusPow;
        cost    = _mainMaster.party_cost;
        if (_main.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE && _sub != null)
        {
            cost += CharaLinkUtil.GetLinkUnitCost(_sub.id);
        }
        rare         = (int)_mainMaster.rare;
        element      = _mainMaster.element;
        kind         = _mainMaster.kind;
        sub_kind     = _mainMaster.sub_kind;
        limitover_lv = (int)_main.limitover_lv;
        charm        = baseChara.m_CharaCharm;
    }
Beispiel #2
0
    private void setParam(CharaOnce baseChara, MasterDataParamChara _masterMain, MasterDataLimitOver _masterMainLO, PacketStructUnit _subUnit = null, int battleHP = 0, int battleHPMax = 0, int battleATK = -1)
    {
        /**
         * メインユニット情報
         */
        {
            string levelFormat = GameTextUtil.GetText("unit_status17");
            Level = string.Format(levelFormat, baseChara.m_CharaLevel, _masterMain.level_max);
        }
        if (battleHPMax != 0)
        {
            Hp = string.Format(GameTextUtil.GetText("unit_status_battle1"), battleHP, battleHPMax);
        }
        else
        {
            if (baseChara.m_CharaPlusHP != 0)
            {
                Hp = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaHP, baseChara.m_CharaPlusHP);
            }
            else
            {
                Hp = string.Format("{0}", baseChara.m_CharaHP);
            }
        }
        if (battleATK >= 0)
        {
            Atk = string.Format(GameTextUtil.GetText("unit_status_battle2"), battleATK);
        }
        else
        {
            if (baseChara.m_CharaPlusPow != 0)
            {
                Atk = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaPow, baseChara.m_CharaPlusPow);
            }
            else
            {
                Atk = string.Format("{0}", baseChara.m_CharaPow);
            }
        }
        int _cost = _masterMain.party_cost;

        if (_subUnit != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(_subUnit.id);
        }
        Cost  = _cost.ToString();
        Charm = string.Format(GameTextUtil.GetText("kyouka_text1"), baseChara.m_CharaCharm.ToString("F1"));
        Lo    = baseChara.m_CharaLimitOver.ToString();
        LoMax = _masterMainLO.limit_over_max.ToString();
    }
    /// <summary>
    /// アサインするとパーティコストを超えるかチェック
    /// </summary>
    /// <returns>true:コストオーバー false:コスト内</returns>
    bool CheckCostOver()
    {
        int nAssignedCost = 0;

        for (int i = 0; i < m_PartyMemberUnitGroup.Units.Count; ++i)
        {
            nAssignedCost += ServerDataUtil.GetPacketUnitCost(m_PartyMemberUnitGroup.Units[i].UnitData);
            // リンクユニット分のコストを加算
            nAssignedCost += CharaLinkUtil.GetLinkUnitCost(m_PartyMemberUnitGroup.Units[i].UnitData);
        }

        bool bAssignedCostOver = nAssignedCost > UserDataAdmin.Instance.m_StructPlayer.total_party;

        return(bAssignedCostOver);
    }
Beispiel #4
0
    /// <summary>
    /// ソートパラメータ設定(フレンド)
    /// </summary>
    /// <param name="_friend"></param>
    public void setSortParamFriend(
        PacketStructFriend _friend,
        CharaOnce _baseChara,
        MasterDataParamChara _master
        )
    {
        PacketStructUnit _sub = null;

        if (_friend.unit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE)
        {
            _sub = _friend.unit_link;
        }
        int _cost = _master.party_cost;

        if (_sub != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(_sub.id);
        }
        UnitParam              = new UnitGridParam();
        UnitParam.draw_id      = (int)_master.draw_id;
        UnitParam.level        = (int)_friend.unit.level;
        UnitParam.hp           = _baseChara.m_CharaHP;
        UnitParam.pow          = _baseChara.m_CharaPow;
        UnitParam.plus         = _baseChara.m_CharaPlusHP + _baseChara.m_CharaPlusPow;
        UnitParam.cost         = _cost;
        UnitParam.rare         = (int)_master.rare;
        UnitParam.element_int  = SortUtil.GetSortNumElement(_master.element);
        UnitParam.kind_int     = SortUtil.GetSortNumKind(_master.kind);
        UnitParam.sub_kind_int = SortUtil.GetSortNumKind(_master.sub_kind);
        UnitParam.limitover_lv = (int)_friend.unit.limitover_lv;
        UnitParam.charm        = _baseChara.m_CharaCharm;
        UnitParam.rank         = (int)_friend.user_rank;
        UnitParam.login_time   = SortUtil.GetSortNumLoginTime(_friend.last_play);
        UnitParam.favorite     = MainMenuUtil.ChkFavoridFriend(_friend.user_id);
        UnitParam.friend_state = (int)_friend.friend_state;
    }
Beispiel #5
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;
    }
Beispiel #6
0
    private void setParam(CharaOnce baseChara, MasterDataParamChara _masterMain, MasterDataLimitOver _masterMainLO, MasterDataSkillLimitBreak _masterMainLB, PacketStructUnit _subUnit = null, CharaOnce prevUnit = null)
    {
        /**
         * メインユニット情報
         */
        {
            string levelFormat = GameTextUtil.GetText("unit_status17");
            Level = string.Format(levelFormat, baseChara.m_CharaLevel, _masterMain.level_max);
        }
        {
            if (baseChara.m_CharaPlusHP != 0)
            {
                Hp = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaHP, baseChara.m_CharaPlusHP);
            }
            else
            {
                Hp = string.Format("{0}", baseChara.m_CharaHP);
            }
        }
        {
            if (baseChara.m_CharaPlusPow != 0)
            {
                Atk = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaPow, baseChara.m_CharaPlusPow);
            }
            else
            {
                Atk = string.Format("{0}", baseChara.m_CharaPow);
            }
        }
        int _cost = _masterMain.party_cost;

        if (_subUnit != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(_subUnit.id);
        }
        Cost  = _cost.ToString();
        Charm = baseChara.m_CharaCharm.ToString("F1");

        int limitBreakSkill    = 0;
        int limitBreakSkillMax = 0;

        if (_masterMainLB != null)
        {
            limitBreakSkill    = baseChara.m_CharaLBSLv + 1;
            limitBreakSkillMax = _masterMainLB.level_max + 1;
        }
        Aslv    = limitBreakSkill.ToString();
        AslvMax = limitBreakSkillMax.ToString();

        Lo    = baseChara.m_CharaLimitOver.ToString();
        LoMax = _masterMainLO.limit_over_max.ToString();
        if (prevUnit != null)
        {
            if (baseChara.m_CharaHP > prevUnit.m_CharaHP)
            {
                Hp = string.Format(GameTextUtil.GetText("kyouka_text1"), Hp);
            }
            if (baseChara.m_CharaPow > prevUnit.m_CharaPow)
            {
                Atk = string.Format(GameTextUtil.GetText("kyouka_text1"), Atk);
            }
            if (_cost > prevUnit.m_CharaMasterDataParam.party_cost)
            {
                Cost = string.Format(GameTextUtil.GetText("kyouka_text1"), Cost);
            }
            if (baseChara.m_CharaCharm > prevUnit.m_CharaCharm)
            {
                Charm = string.Format(GameTextUtil.GetText("kyouka_text1"), baseChara.m_CharaCharm.ToString("F1"));
            }
        }
    }
Beispiel #7
0
    private CharaOnce setParam()
    {
        int mainLv;
        int mainLOLv;

        limitOverMaster = MasterFinder <MasterDataLimitOver> .Instance.Find((int)charaMaster.limit_over_type);

        CharaOnce charaOnce = new CharaOnce();

        if (m_mainUnit == null)
        {
            mainLv   = 1;
            mainLOLv = 0;
            if (lvMax == true)
            {
                mainLv   = charaMaster.level_max;
                mainLOLv = limitOverMaster.limit_over_max;
            }
            charaOnce.CharaSetupFromID(
                m_UnitId,
                mainLv,
                0,
                mainLOLv,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }
        else
        {
            mainLv   = (int)m_mainUnit.level;
            mainLOLv = (int)m_mainUnit.limitover_lv;
            if (lvMax == true)
            {
                mainLv   = charaMaster.level_max;
                mainLOLv = limitOverMaster.limit_over_max;
            }
            if (m_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
                m_subUnit != null)
            {
                charaOnce.CharaSetupFromID(
                    m_UnitId,
                    mainLv,
                    (int)m_mainUnit.limitbreak_lv,
                    mainLOLv,
                    (int)m_mainUnit.add_pow,
                    (int)m_mainUnit.add_hp,
                    m_subUnit.id,
                    (int)m_subUnit.level,
                    (int)m_subUnit.add_pow,
                    (int)m_subUnit.add_hp,
                    (int)m_mainUnit.link_point,
                    (int)m_subUnit.limitover_lv
                    );
            }
            else
            {
                charaOnce.CharaSetupFromID(
                    charaMaster.fix_id,
                    mainLv,
                    (int)m_mainUnit.limitbreak_lv,
                    mainLOLv,
                    (int)m_mainUnit.add_pow,
                    (int)m_mainUnit.add_hp,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0
                    );
            }
        }

        Level = string.Format(GameTextUtil.GetText("unit_status16"), charaOnce.m_CharaLevel, charaMaster.level_max);
        Hp    = charaOnce.m_CharaHP.ToString();
        if (charaOnce.m_CharaPlusHP != 0)
        {
            Hp = string.Format(GameTextUtil.GetText("unit_status19"), charaOnce.m_CharaHP, charaOnce.m_CharaPlusHP);
        }

        Atk = charaOnce.m_CharaPow.ToString();
        if (charaOnce.m_CharaPlusPow != 0)
        {
            Atk = string.Format(GameTextUtil.GetText("unit_status19"), charaOnce.m_CharaPow, charaOnce.m_CharaPlusPow);
        }

        int _cost = charaMaster.party_cost;

        if (m_subUnit != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(m_subUnit.id);
        }
        Cost = _cost.ToString();

        LimitOver = string.Format(GameTextUtil.GetText("unit_status16"), charaOnce.m_CharaLimitOver, limitOverMaster.limit_over_max);

        Charm = charaOnce.m_CharaCharm.ToString("F1");

        if (lvMax == true)
        {
            Level     = string.Format(GameTextUtil.GetText("kyouka_text1"), Level);
            Hp        = string.Format(GameTextUtil.GetText("kyouka_text1"), Hp);
            Atk       = string.Format(GameTextUtil.GetText("kyouka_text1"), Atk);
            Cost      = string.Format(GameTextUtil.GetText("kyouka_text1"), Cost);
            LimitOver = string.Format(GameTextUtil.GetText("kyouka_text1"), LimitOver);
            Charm     = string.Format(GameTextUtil.GetText("kyouka_text1"), Charm);
        }

        return(charaOnce);
    }