Пример #1
0
    public void AddData(PacketStructUnit unitData, GlobalDefine.PartyCharaIndex partyCharaIndex, PacketStructUnit[] partyUnits)
    {
        PartyMemberStatusListItemContext unitStatus = new PartyMemberStatusListItemContext();

        unitStatus.PartyCharaIndex = partyCharaIndex;
        SetUnitData(ref unitStatus, unitData, partyUnits);
        UnitStatusParams.Add(unitStatus);
    }
Пример #2
0
    public void ChangeData(PacketStructUnit unitData, GlobalDefine.PartyCharaIndex partyCharaIndex, PacketStructUnit[] partyUnits)
    {
        PartyMemberStatusListItemContext selectUnitStatus = UnitStatusParams.Find(value => value.PartyCharaIndex == partyCharaIndex);

        SetUnitData(ref selectUnitStatus, unitData, partyUnits);
        UpdateOtherMemberStatus(partyCharaIndex, partyUnits);
        SetStatusParam();
    }
Пример #3
0
    public void SetUnitData(ref PartyMemberStatusListItemContext unitStatus, PacketStructUnit unitData, PacketStructUnit[] partyUnits)
    {
        if (unitStatus == null)
        {
            return;
        }

        MasterDataParamChara charMaster = null;

        if (unitData == null || unitData.id == 0)
        {
            unitStatus.HpText  = "";
            unitStatus.AtkText = "";
            unitStatus.Cost    = 0;
            unitStatus.Charm   = 0;
        }
        else
        {
            charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id);

            SetUpCharaData(ref unitStatus, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false, partyUnits);
        }

        MasterDataSkillActive skill1 = null;

        if (charMaster != null && charMaster.skill_active0 > 0)
        {
            skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0);
        }
        unitStatus.IsActiveSkill1Empty = (skill1 == null);
        unitStatus.Skill1Cost1         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost1) : null;
        unitStatus.Skill1Cost2         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost2) : null;
        unitStatus.Skill1Cost3         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost3) : null;
        unitStatus.Skill1Cost4         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost4) : null;
        unitStatus.Skill1Cost5         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost5) : null;
        unitStatus.Skill1Color         = (skill1 != null) ? MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element) : null;

        MasterDataSkillActive skill2 = null;

        if (charMaster != null && charMaster.skill_active1 > 0)
        {
            skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1);
        }
        unitStatus.IsActiveSkill2Empty = (skill2 == null);
        unitStatus.Skill2Cost1         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost1) : null;
        unitStatus.Skill2Cost2         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost2) : null;
        unitStatus.Skill2Cost3         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost3) : null;
        unitStatus.Skill2Cost4         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost4) : null;
        unitStatus.Skill2Cost5         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost5) : null;
        unitStatus.Skill2Color         = (skill2 != null) ? MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element) : null;
    }
Пример #4
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;
    }
Пример #5
0
    public override void OnInitialized()
    {
        base.OnInitialized();

        m_PartyMemberStatusPanel = GetComponentInChildren <PartyMemberStatusPanel>();

        // マスターデータ
        List <MasterDataParamChara> charaMasterDatas = MasterFinder <MasterDataParamChara> .Instance.FindAll();


        // パーティ
        for (int i = 0; i < m_PartyCount; ++i)
        {
            var model = new PartySelectGroupUnitListItemModel((uint)i);

            PartySelectGroupUnitContext party = new PartySelectGroupUnitContext(model);
            UnitIconImageProvider.Instance.Get(
                charaMasterDatas[Random.Range(0, 1800)].fix_id,
                sprite => { party.UnitImage = sprite; });
            party.NameText = string.Format(GameTextUtil.GetText("questlast_tub"), i + 1);
            m_PartySelectGroup.AddData(party);
            model.OnClicked += () => {
                m_PartySelectGroup.ChangePartyItemSelect(party.Index); // パーティ選択状態を変更
            };
        }

        // パーティメンバー
        for (int i = 0; i < 4; ++i)
        {
            var unitDataModel = new PartyMemberUnitListItemModel((uint)i);

            PartyMemberUnitContext unit = new PartyMemberUnitContext(unitDataModel);
            UnitIconImageProvider.Instance.Get(
                charaMasterDatas[Random.Range(0, 1800)].fix_id,
                sprite => { unit.UnitImage = sprite; });
            m_PartyMemberUnitGroup.Units.Add(unit);
            unitDataModel.OnClicked += () => {
                unit.DidSelectItem(unit); // TODO : DidSelectItem()の内容と差し替え
            };
            unitDataModel.OnLongPressed += () => {
                unit.DidLongPressItem(unit); // TODO : DidLongPressItem()の内容と差し替え
            };
        }

        // クエストパーティメンバー
        for (int i = 0; i < 5; ++i)
        {
            var unitDataModel = new PartyMemberUnitListItemModel((uint)i);

            PartyMemberUnitContext unit = new PartyMemberUnitContext(unitDataModel);
            UnitIconImageProvider.Instance.Get(
                charaMasterDatas[Random.Range(0, 1800)].fix_id,
                sprite => { unit.UnitImage = sprite; });
            //m_PartyParamQuestPartyPanel.Units.Add(unit);
            unitDataModel.OnClicked += () => {
                unit.DidSelectItem(unit); // TODO : DidSelectItem()の内容と差し替え
            };
            unitDataModel.OnLongPressed += () => {
                unit.DidLongPressItem(unit); // TODO : DidLongPressItem()の内容と差し替え
            };
        }

        for (int i = 0; i < 4; ++i)
        {
            PartyMemberStatusListItemContext status = new PartyMemberStatusListItemContext();
            m_PartyMemberStatusPanel.UnitStatusParams.Add(status);
        }
    }