Ejemplo n.º 1
0
    public override string GetConditionText(long i64ParamVal)
    {
        string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        int              num            = 0;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return("No User");
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 1)
            {
                bool flag = false;
                for (int j = 0; j < 6; j++)
                {
                    if (soldierInfo.GetEquipItemInfo() != null && (long)soldierInfo.GetEquipItem(j).m_nItemUnique == base.GetParam())
                    {
                        num  = soldierInfo.GetEquipItem(j).m_nRank;
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    break;
                }
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "targetname",
            itemNameByItemUnique,
            "count1",
            base.GetParamVal(),
            "count2",
            num
        });

        return(empty);
    }
Ejemplo n.º 2
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 1)
            {
                for (int j = 0; j < 6; j++)
                {
                    if (soldierInfo.GetEquipItemInfo() != null && (long)soldierInfo.GetEquipItem(j).m_nItemUnique == base.GetParam())
                    {
                        int num2 = Protocol_Item.Get_Defense(soldierInfo.GetEquipItem(j));
                        if (num > num2)
                        {
                            num = num2;
                        }
                    }
                }
            }
        }
        NkUserInventory instance = NkUserInventory.GetInstance();

        if (instance == null)
        {
            return(false);
        }
        for (short num3 = 0; num3 < 30; num3 += 1)
        {
            ITEM item = instance.GetItem(1, (int)num3);
            if (item != null)
            {
                int num4 = Protocol_Item.Get_Defense(item);
                if (num > num4)
                {
                    num = num4;
                }
            }
        }
        return((long)num >= base.GetParamVal());
    }
Ejemplo n.º 3
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        int num = 0;

        if (charPersonInfo == null)
        {
            return(false);
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            for (int j = 0; j < 6; j++)
            {
                ITEM equipItem = soldierInfo.GetEquipItem(j);
                if (equipItem != null)
                {
                    if ((long)equipItem.m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                }
            }
        }
        return((long)num >= base.GetParamVal());
    }
Ejemplo n.º 4
0
    public void OnItemChange(NkSoldierInfo kSoldier, int itemindex, GameObject kGameObj)
    {
        if (kSoldier == null || null == kGameObj)
        {
            return;
        }
        eEQUIP_ITEM itempos = eEQUIP_ITEM.EQUIP_ITEM_MAX;

        if (itemindex == 3)
        {
            itempos = eEQUIP_ITEM.EQUIP_WEAPON1;
        }
        ITEM equipItem = kSoldier.GetEquipItem((int)itempos);

        if (equipItem != null)
        {
            int       rank          = equipItem.m_nOption[2];
            string    strName       = ItemManager.RankStateString(rank);
            Transform childContains = NkUtil.GetChildContains(kGameObj.transform, strName);
            if (null != childContains)
            {
                Transform transform = kGameObj.transform;
                childContains.parent = null;
                int childCount = transform.childCount;
                for (int i = 0; i < childCount; i++)
                {
                    Transform child = transform.GetChild(0);
                    UnityEngine.Object.DestroyImmediate(child.gameObject);
                }
                childContains.parent = transform;
            }
        }
    }
Ejemplo n.º 5
0
    public override bool CheckCondition(long i64Param, ref long i64ParamVal)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        int num = 0;

        if (base.GetParam() == 0L)
        {
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null && soldierInfo.GetSolID() != 0L)
                    {
                        int nItemUnique = soldierInfo.GetEquipItem(j).m_nItemUnique;
                        if (nItemUnique > 0)
                        {
                            if (NrTSingleton <ItemManager> .Instance.GetItemPartByItemUnique(nItemUnique) == eITEM_PART.ITEMPART_WEAPON)
                            {
                                num++;
                            }
                            if (base.GetParamVal() <= (long)num)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            for (int k = 0; k < 6; k++)
            {
                for (int l = 0; l < 6; l++)
                {
                    if ((long)charPersonInfo.GetSoldierInfo(k).GetEquipItem(l).m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                    if (base.GetParamVal() <= (long)num)
                    {
                        return(true);
                    }
                }
            }
        }
        return(false);
    }
Ejemplo n.º 6
0
    public override string GetConditionText(long i64ParamVal)
    {
        string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        int num = 0;

        if (charPersonInfo == null)
        {
            return("No User");
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            for (int j = 0; j < 6; j++)
            {
                ITEM equipItem = soldierInfo.GetEquipItem(j);
                if (equipItem != null)
                {
                    if ((long)equipItem.m_nItemUnique == base.GetParam())
                    {
                        num++;
                    }
                }
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "targetname",
            itemNameByItemUnique,
            "count1",
            num,
            "count2",
            base.GetParamVal()
        });

        return(empty);
    }
Ejemplo n.º 7
0
    public void SetData(ITEM pkItem, NkSoldierInfo pSolInfo, int WinID)
    {
        this.m_ParentWinID = WinID;
        Debug.Log("ParentWinID :" + this.m_ParentWinID);
        Dictionary <int, ITEM_SET> dictionary = null;
        int      num      = 0;
        ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(pkItem.m_nItemUnique);

        if (itemInfo == null)
        {
            return;
        }
        if (itemInfo.m_nSetUnique == 0)
        {
            return;
        }
        if (pSolInfo != null)
        {
            for (int i = 0; i < 6; i++)
            {
                ITEM equipItem = pSolInfo.GetEquipItem(i);
                if (equipItem != null && equipItem.m_nItemID > 0L)
                {
                    if (equipItem.m_nDurability > 0)
                    {
                        ITEMINFO itemInfo2 = NrTSingleton <ItemManager> .Instance.GetItemInfo(equipItem.m_nItemUnique);

                        if (itemInfo2 != null)
                        {
                            if (itemInfo2.m_nSetUnique != 0)
                            {
                                if (dictionary == null)
                                {
                                    dictionary = new Dictionary <int, ITEM_SET>();
                                }
                                if (dictionary.ContainsKey(itemInfo2.m_nSetUnique))
                                {
                                    ITEM_SET value = dictionary[itemInfo2.m_nSetUnique];
                                    value.m_nSetCount++;
                                    dictionary.Remove(itemInfo2.m_nSetUnique);
                                    dictionary.Add(value.m_SetUnique, value);
                                }
                                else
                                {
                                    ITEM_SET value2 = default(ITEM_SET);
                                    value2.m_SetUnique = itemInfo2.m_nSetUnique;
                                    value2.m_nSetCount = 0;
                                    dictionary.Add(value2.m_SetUnique, value2);
                                }
                            }
                        }
                    }
                }
            }
            if (dictionary != null && dictionary.ContainsKey(itemInfo.m_nSetUnique))
            {
                num = dictionary[itemInfo.m_nSetUnique].m_nSetCount;
            }
        }
        StringBuilder stringBuilder = new StringBuilder();
        string        text          = string.Empty;

        for (int j = 0; j < 6; j++)
        {
            text = NrTSingleton <NrSetItemDataManager> .Instance.GetString(itemInfo.m_nSetUnique, j);

            int value3 = NrTSingleton <NrSetItemDataManager> .Instance.GetValue(itemInfo.m_nSetUnique, j);

            if (!string.IsNullOrEmpty(text))
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    text,
                    "SETNUM",
                    j + 1,
                    "VALUE",
                    value3
                });

                if (j <= num)
                {
                    stringBuilder.Append(NrTSingleton <CTextParser> .Instance.GetTextColor("2002"));
                }
                stringBuilder.Append(text);
                stringBuilder.Append(NrTSingleton <CTextParser> .Instance.GetTextColor("1002"));
                stringBuilder.Append("\n");
            }
        }
        this.m_lbSetItemInfo.SetFlashLabel(stringBuilder.ToString());
        this.m_lbSetItemName.SetText(NrTSingleton <NrSetItemDataManager> .Instance.GetSetItemName(itemInfo.m_nSetUnique));
        base.SetSize(base.GetSizeX(), this.m_lbSetItemInfo.GetLocationY() + this.m_lbSetItemInfo.Height);
    }
Ejemplo n.º 8
0
    public override string GetConditionText(long i64ParamVal)
    {
        string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

        string textFromQuest_Code = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

        string           empty          = string.Empty;
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return("No User");
        }
        int num = 0;

        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (soldierInfo.GetSolPosType() == 1)
            {
                for (int j = 0; j < 6; j++)
                {
                    if (soldierInfo.GetEquipItemInfo() != null && (long)soldierInfo.GetEquipItem(j).m_nItemUnique == base.GetParam())
                    {
                        int num2 = Protocol_Item.Get_Defense(soldierInfo.GetEquipItem(j));
                        if (num > num2)
                        {
                            num = num2;
                        }
                    }
                }
            }
        }
        NkUserInventory instance = NkUserInventory.GetInstance();

        if (instance == null)
        {
            return(string.Empty);
        }
        for (short num3 = 0; num3 < 30; num3 += 1)
        {
            ITEM item = instance.GetItem(1, (int)num3);
            if (item != null)
            {
                int num4 = Protocol_Item.Get_Defense(item);
                if (num > num4)
                {
                    num = num4;
                }
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            textFromQuest_Code,
            "targetname",
            itemNameByItemUnique,
            "count1",
            num,
            "count2",
            base.GetParamVal()
        });

        return(empty);
    }
Ejemplo n.º 9
0
    public override string GetConditionText(long i64ParamVal)
    {
        string text  = string.Empty;
        string empty = string.Empty;

        if (0L < base.GetParam())
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

            string itemNameByItemUnique = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique((int)base.GetParam());

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                text,
                "targetname",
                itemNameByItemUnique
            });
        }
        else if (base.GetParam() == 0L)
        {
            NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

            if (charPersonInfo == null)
            {
                return(" ");
            }
            int num = 0;
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
                    if (soldierInfo != null && soldierInfo.GetSolID() != 0L)
                    {
                        int nItemUnique = soldierInfo.GetEquipItem(j).m_nItemUnique;
                        if (nItemUnique > 0)
                        {
                            if (NrTSingleton <ItemManager> .Instance.GetItemPartByItemUnique(nItemUnique) == eITEM_PART.ITEMPART_WEAPON)
                            {
                                num++;
                            }
                            if (base.GetParamVal() <= (long)num)
                            {
                                num = (int)base.GetParamVal();
                                break;
                            }
                        }
                    }
                }
            }
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromQuest_Code(this.m_szTextKey);

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                text,
                "count1",
                num,
                "count2",
                base.GetParamVal()
            });
        }
        return(empty);
    }
	public void SetSolStatInfo(NkSoldierInfo solInfo)
	{
		if (solInfo != null)
		{
			string charNameBySoldierInfo = this.GetCharNameBySoldierInfo(solInfo);
			this.m_lbCharName.Text = string.Format("Lv.{0} {1}", solInfo.GetLevel(), charNameBySoldierInfo);
			string text = string.Empty;
			string empty = string.Empty;
			EVENT_HERODATA eventHeroCharCode = NrTSingleton<NrTableEvnetHeroManager>.Instance.GetEventHeroCharCode(solInfo.GetCharKind(), solInfo.GetGrade());
			int num = solInfo.GetMaxHP();
			int num2 = solInfo.GetMinDamage();
			int num3 = solInfo.GetMaxDamage();
			string text2 = solInfo.GetMaxHP().ToString();
			string text3 = solInfo.GetMinDamage().ToString();
			string text4 = solInfo.GetMaxDamage().ToString();
			string textColor = NrTSingleton<CTextParser>.Instance.GetTextColor("1107");
			string textColor2 = NrTSingleton<CTextParser>.Instance.GetTextColor("1002");
			string second = string.Empty;
			string empty2 = string.Empty;
			if (eventHeroCharCode != null)
			{
				int num4 = 0;
				if (eventHeroCharCode.i32Hp != 100)
				{
					num = (int)((float)solInfo.GetMaxHP() * ((float)eventHeroCharCode.i32Hp * 0.01f));
					second = NrTSingleton<UIDataManager>.Instance.GetString(textColor, "(+", (num - solInfo.GetMaxHP()).ToString(), ")", textColor2);
					text2 = NrTSingleton<UIDataManager>.Instance.GetString(solInfo.GetMaxHP().ToString(), second);
					NrTSingleton<CTextParser>.Instance.ReplaceParam(ref empty2, new object[]
					{
						NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("2192"),
						"count",
						eventHeroCharCode.i32Hp.ToString()
					});
					this.m_lbEventHeroStat[num4].SetText(empty2);
					this.m_lbEventHeroStat[num4].SetAnchorText(SpriteText.Anchor_Pos.Middle_Right);
					this.m_lbEventHeroStat[num4].SetEnabled(true);
					this.m_lbEventHeroStat[num4].Hide(false);
					num4++;
				}
				if (eventHeroCharCode.i32Attack != 100)
				{
					num2 = (int)((float)solInfo.GetMinDamage() * ((float)eventHeroCharCode.i32Attack * 0.01f));
					num3 = (int)((float)solInfo.GetMaxDamage() * ((float)eventHeroCharCode.i32Attack * 0.01f));
					second = NrTSingleton<UIDataManager>.Instance.GetString(textColor, "(+", (num2 - solInfo.GetMinDamage()).ToString(), ")", textColor2);
					text3 = NrTSingleton<UIDataManager>.Instance.GetString(solInfo.GetMinDamage().ToString(), second);
					second = NrTSingleton<UIDataManager>.Instance.GetString(textColor, "(+", (num3 - solInfo.GetMaxDamage()).ToString(), ")", textColor2);
					text4 = NrTSingleton<UIDataManager>.Instance.GetString(solInfo.GetMaxDamage().ToString(), second);
					NrTSingleton<CTextParser>.Instance.ReplaceParam(ref empty2, new object[]
					{
						NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("2191"),
						"count",
						eventHeroCharCode.i32Attack.ToString()
					});
					this.m_lbEventHeroStat[num4].SetText(empty2);
					this.m_lbEventHeroStat[num4].SetAnchorText(SpriteText.Anchor_Pos.Middle_Right);
					this.m_lbEventHeroStat[num4].SetEnabled(true);
					this.m_lbEventHeroStat[num4].Hide(false);
				}
				this.m_dtEventTexture.Visible = true;
				Transform child = NkUtil.GetChild(this.m_dtEventTexture.gameObject.transform, "child_effect");
				if (child == null)
				{
					NrTSingleton<FormsManager>.Instance.AttachEffectKey("FX_UI_EVENTFONT", this.m_dtEventTexture, this.m_dtEventTexture.GetSize());
				}
			}
			else
			{
				this.m_dtEventTexture.Visible = false;
			}
			text = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1879");
			NrTSingleton<CTextParser>.Instance.ReplaceParam(ref empty, new object[]
			{
				text,
				"maxhp",
				text2
			});
			this.m_lbHP.Text = empty;
			text = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1880");
			NrTSingleton<CTextParser>.Instance.ReplaceParam(ref empty, new object[]
			{
				text,
				"mindmg",
				text3,
				"maxdmg",
				text4
			});
			this.m_lbAtack.Text = empty;
			text = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1881");
			NrTSingleton<CTextParser>.Instance.ReplaceParam(ref empty, new object[]
			{
				text,
				"defance",
				solInfo.GetPhysicalDefense().ToString()
			});
			this.m_lbDefence.Text = empty;
			long solSubData = solInfo.GetSolSubData(eSOL_SUBDATA.SOL_SUBDATA_FIGHTINGPOWER);
			this.m_lbFightPower.Text = ANNUALIZED.Convert(solSubData);
			float num5 = 512f;
			this.m_dtCharImg.SetUVMask(new Rect(4f / num5, 0f, 504f / num5, 448f / num5));
			this.m_dtCharImg.SetTextureEffect(eCharImageType.LARGE, solInfo.GetCharKind(), (int)solInfo.GetGrade(), NrTSingleton<NrCharCostumeTableManager>.Instance.GetCostumePortraitPath(solInfo));
			short legendType = NrTSingleton<NrCharKindInfoManager>.Instance.GetLegendType(solInfo.GetCharKind(), (int)solInfo.GetGrade());
			UIBaseInfoLoader solLargeGradeImg = NrTSingleton<NrCharKindInfoManager>.Instance.GetSolLargeGradeImg(solInfo.GetCharKind(), (int)solInfo.GetGrade());
			this.m_dtRank.Visible = (null != solLargeGradeImg);
			if (0 < legendType)
			{
				this.m_dtRank.SetSize(solLargeGradeImg.UVs.width, solLargeGradeImg.UVs.height);
			}
			this.m_dtRank.SetTexture(solLargeGradeImg);
			this.SetItem(this.m_ivHelmet, solInfo.GetEquipItem(1));
			this.SetItem(this.m_ivArmor, solInfo.GetEquipItem(2));
			this.SetItem(this.m_ivGlove, solInfo.GetEquipItem(3));
			this.SetItem(this.m_ivBoots, solInfo.GetEquipItem(4));
			this.SetItem(this.m_ivWeapon, solInfo.GetEquipItem(0));
			this.SetItem(this.m_ivRing, solInfo.GetEquipItem(5));
		}
		else
		{
			this.m_lbCharName.Text = string.Empty;
			this.m_lbHP.Text = string.Empty;
			this.m_lbAtack.Text = string.Empty;
			this.m_lbDefence.Text = string.Empty;
			this.m_lbFightPower.Text = string.Empty;
		}
	}