Esempio n. 1
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;
    }
    public void SetUnitData(ref PartyMemberUnitContext unit, PacketStructUnit unitData)
    {
        if (unit == null)
        {
            return;
        }
        if (unitData == null || unitData.id == 0)
        {
            return;
        }
        MasterDataParamChara charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id);

        if (charMaster == null)
        {
            return;
        }
        if (charMaster.skill_active0 > 0)
        {
            MasterDataSkillActive skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0);

            if (skill1 != null)
            {
                unit.IsActiveSkill1Empty = false;
                unit.Skill1Cost1         = MainMenuUtil.GetSkillElementIcon(skill1.cost1);
                unit.Skill1Cost2         = MainMenuUtil.GetSkillElementIcon(skill1.cost2);
                unit.Skill1Cost3         = MainMenuUtil.GetSkillElementIcon(skill1.cost3);
                unit.Skill1Cost4         = MainMenuUtil.GetSkillElementIcon(skill1.cost4);
                unit.Skill1Cost5         = MainMenuUtil.GetSkillElementIcon(skill1.cost5);
                unit.Skill1Color         = MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element);
            }
        }

        if (charMaster.skill_active1 > 0)
        {
            MasterDataSkillActive skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1);

            if (skill2 != null)
            {
                unit.IsActiveSkill2Empty = false;
                unit.Skill2Cost1         = MainMenuUtil.GetSkillElementIcon(skill2.cost1);
                unit.Skill2Cost2         = MainMenuUtil.GetSkillElementIcon(skill2.cost2);
                unit.Skill2Cost3         = MainMenuUtil.GetSkillElementIcon(skill2.cost3);
                unit.Skill2Cost4         = MainMenuUtil.GetSkillElementIcon(skill2.cost4);
                unit.Skill2Cost5         = MainMenuUtil.GetSkillElementIcon(skill2.cost5);
                unit.Skill2Color         = MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element);
            }
        }

        unit.ParamText = (unitData.level >= charMaster.level_max) ? GameTextUtil.GetText("uniticon_flag1")
                                    : string.Format(GameTextUtil.GetText("uniticon_flag2"), unitData.level); // レベル

        uint plusPoint = unitData.add_hp + unitData.add_pow;                                                 // プラス値の計算

        if (plusPoint != 0)
        {
            unit.ParamText += string.Format(GameTextUtil.GetText("uniticon_flag3"), plusPoint);
        }

        unit.LinkIcon           = MainMenuUtil.GetLinkMark(unitData, null); // リンクアイコン
        unit.OutSideCircleImage = MainMenuUtil.GetElementCircleSprite(charMaster.element);
        SetUpCharaData(ref unit, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false);
    }