Ejemplo n.º 1
0
    public void setupUnit(uint unit_id, PacketStructUnit _mainUnit, PacketStructUnit _subUnit)
    {
        MasterDataParamChara _masterMain = MasterFinder <MasterDataParamChara> .Instance.Find((int)unit_id);

        if (_masterMain == null)
        {
            return;
        }

        MasterDataLimitOver _masterMainLO = MasterFinder <MasterDataLimitOver> .Instance.Find((int)_masterMain.limit_over_type);

        if (_masterMainLO == null)
        {
            return;
        }

        CHARALINK_TYPE linkType = CHARALINK_TYPE.CHARALINK_TYPE_NONE;

        CharaOnce m_CharaParam = new CharaOnce();

        if (_mainUnit == null)
        {
            m_CharaParam.CharaSetupFromID(
                unit_id,
                _masterMain.level_max,
                0,
                _masterMainLO.limit_over_max,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }
        else
        {
            PacketStructUnit _parentUnit = null;
            if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_LINK)
            {
                _parentUnit = UserDataAdmin.Instance.SearchChara(_mainUnit.link_unique_id);
            }
            if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
                _subUnit != null)
            {
                m_CharaParam.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 if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_LINK &&
                     _parentUnit != null)
            {
                m_CharaParam.CharaSetupFromID(
                    _mainUnit.id,
                    (int)_mainUnit.level,
                    (int)_mainUnit.limitbreak_lv,
                    (int)_mainUnit.limitover_lv,
                    (int)_mainUnit.add_pow,
                    (int)_mainUnit.add_hp,
                    _parentUnit.id,
                    (int)_parentUnit.level,
                    (int)_parentUnit.add_pow,
                    (int)_parentUnit.add_hp,
                    (int)_parentUnit.link_point,
                    (int)_parentUnit.limitover_lv
                    );
            }
            else
            {
                m_CharaParam.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
                    );
            }

            linkType = (CHARALINK_TYPE)_mainUnit.link_info;
        }
        switch (linkType)
        {
        case CHARALINK_TYPE.CHARALINK_TYPE_BASE:
        case CHARALINK_TYPE.CHARALINK_TYPE_NONE:
            SetLinkEffectInfo(m_CharaParam, _masterMain, false);
            setActiveGray(true);
            break;

        case CHARALINK_TYPE.CHARALINK_TYPE_LINK:
            SetLinkEffectInfo(m_CharaParam, _masterMain, true);
            setActiveGray(false);
            break;
        }
    }
Ejemplo n.º 2
0
    public void setupUnit(PacketStructUnit _mainUnit, PacketStructUnit _subUnit, LinkParamType _type)
    {
        MasterDataParamChara _masterMain = MasterFinder <MasterDataParamChara> .Instance.Find((int)_mainUnit.id);

        if (_masterMain == null)
        {
            return;
        }

        MasterDataLimitOver _masterMainLO = MasterFinder <MasterDataLimitOver> .Instance.Find((int)_masterMain.limit_over_type);

        if (_masterMainLO == null)
        {
            return;
        }

        CHARALINK_TYPE   linkType    = CHARALINK_TYPE.CHARALINK_TYPE_NONE;
        PacketStructUnit _parentUnit = null;

        if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_LINK)
        {
            _parentUnit = UserDataAdmin.Instance.SearchChara(_mainUnit.link_unique_id);
        }

        m_CharaParam   = new CharaOnce();
        m_CharaLOParam = null;
        MasterDataParamChara _masterSub = null;

        if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
            _subUnit != null)
        {
            m_CharaParam.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
                );
            _masterSub = MasterFinder <MasterDataParamChara> .Instance.Find((int)_subUnit.id);

            if (_masterSub != null)
            {
                IconSelect = MainMenuUtil.GetElementCircleSprite(_masterSub.element);
            }
        }
        else if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_LINK &&
                 _parentUnit != null)
        {
            m_CharaParam.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                _parentUnit.id,
                (int)_parentUnit.level,
                (int)_parentUnit.add_pow,
                (int)_parentUnit.add_hp,
                (int)_parentUnit.link_point,
                (int)_parentUnit.limitover_lv
                );
        }
        else
        {
            m_CharaParam.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
                );
        }

        linkType     = (CHARALINK_TYPE)_mainUnit.link_info;
        IsViewParent = false;

        AllClear();
        switch (_type)
        {
        case LinkParamType.Link:
            switch (linkType)
            {
            case CHARALINK_TYPE.CHARALINK_TYPE_BASE:
                AddUnitDataLink(m_CharaParam, _masterMain);
                AddRaceBonus(_masterSub);
                AddLinkSkill(_masterSub, (uint)m_CharaParam.m_LinkParam.m_CharaLinkPoint);
                AddLinkPassive(_masterSub);
                setActiveGray(false);
                break;

            case CHARALINK_TYPE.CHARALINK_TYPE_LINK:
                SetLinkParent(m_CharaParam);
                setActiveGray(false);
                break;

            case CHARALINK_TYPE.CHARALINK_TYPE_NONE:
                SetLinkNone();
                break;
            }
            break;

        case LinkParamType.LinkEffect:
            if (_masterMain.link_enable == MasterDataDefineLabel.BoolType.ENABLE)
            {
                switch (linkType)
                {
                case CHARALINK_TYPE.CHARALINK_TYPE_BASE:
                case CHARALINK_TYPE.CHARALINK_TYPE_NONE:
                    AddLinkEffectInfo(m_CharaParam, _masterMain, false);
                    AddRaceBonus(_masterMain);
                    AddLinkSkill(_masterMain, 0);
                    AddLinkPassive(_masterMain);
                    setActiveGray(true);
                    break;

                case CHARALINK_TYPE.CHARALINK_TYPE_LINK:
                    AddLinkEffectInfo(m_CharaParam, _masterMain, true);
                    AddRaceBonus(_masterMain);
                    AddLinkSkill(_masterMain, (uint)m_CharaParam.m_LinkParam.m_CharaLinkPoint);
                    AddLinkPassive(_masterMain);
                    setActiveGray(false);
                    break;
                }
            }
            else
            {
                SetLinkDisable();
            }
            break;
        }
    }