public static int equipSort(RuneBookData x, RuneBookData y) { int i = HeroPartsData.sortValueByPartsType(GameManager.info.heroBasePartsData[x.baseId].type).CompareTo(HeroPartsData.sortValueByPartsType(GameManager.info.heroBasePartsData[y.baseId].type)); if (i == 0) { GameManager.info.heroBasePartsData[x.baseId].id.CompareTo(GameManager.info.heroBasePartsData[y.baseId].id); } return(i); }
public HeroPartsItem(string character, string id) { if (string.IsNullOrEmpty(id)) { return; } characterId = character; partsId = id; itemInfo = new GameIDData(); itemInfo.parse(id, GameIDData.Type.Equip); parts = itemInfo.partsData; }
public static int sortEquipDataByTypeFromLow(GameIDData x, GameIDData y) { int i = HeroPartsData.sortValueByPartsType(x.partsData.type).CompareTo(HeroPartsData.sortValueByPartsType(y.partsData.type)); if (i == 0) { i = HeroPartsData.sortValueByPartsCharacter(x.partsData.character).CompareTo(HeroPartsData.sortValueByPartsCharacter(y.partsData.character)); } if (i == 0) { i = x.rare.CompareTo(y.rare); // 3> 레어도 (레전드>슈퍼레어>레어>노말)\ } return(i); }
public bool checkIsIsThisSelectedParts(HeroPartsData pd) { if (heroes.ContainsKey(pd.character)) { if (heroes[pd.character].partsHead.partsId == pd.id || heroes[pd.character].partsWeapon.partsId == pd.id || heroes[pd.character].partsBody.partsId == pd.id || heroes[pd.character].partsVehicle.partsId == pd.id) { return(true); } } return(false); }
//레벨 레어도 히어로 public static int sortEquipDataByLevelFromHigh(GameIDData x, GameIDData y) { int i = y.level.CompareTo(x.level); if (i == 0) { i = y.rare.CompareTo(x.rare); // 3> 레어도 (레전드>슈퍼레어>레어>노말) } if (i == 0) { i = HeroPartsData.sortValueByPartsCharacter(y.partsData.character).CompareTo(HeroPartsData.sortValueByPartsCharacter(x.partsData.character)); } return(i); }
public void setParts(HeroPartsData hpd, int rare) { string partsName = hpd.vehicleResource; foreach (SkinnedMeshRenderer smr in smrs) { if (smr.gameObject.name.Contains("parts")) { if (smr.name.Equals(partsName)) { smr.gameObject.SetActive(true); CharacterUtil.setPartsTexture(smr, hpd); } else { smr.gameObject.SetActive(false); } } } }
//=========================== 장비 정렬 ==========================// public static int sortForHeroPartsList(GameIDData x, GameIDData y) { // 1> 선택된 히어로의 아이템 (선택된히어로 > 레오 > 카일리 > 클로이 > 루크) // 2> 장착부위 (모자>의상>무기>타는펫) int i = HeroPartsData.sortValueByPartsCharacter(x.partsData.character).CompareTo(HeroPartsData.sortValueByPartsCharacter(y.partsData.character)); if (i == 0) { i = HeroPartsData.sortValueByPartsType(x.partsData.type).CompareTo(HeroPartsData.sortValueByPartsType(y.partsData.type)); } if (i == 0) { i = y.rare.CompareTo(x.rare); // 3> 레어도 (레전드>슈퍼레어>레어>노말) } if (i == 0) { i = y.reinforceLevel.CompareTo(x.reinforceLevel); // 4> 강화레벨 } return(i); }
public static void setPartsTexture(SkinnedMeshRenderer smr, HeroPartsData hpd) { string name; name = hpd.texture; // Debug.Log(name); if (smr.sharedMaterial != null) { if (smr.sharedMaterial.mainTexture != null) { if (smr.sharedMaterial.mainTexture.name != name) { smr.sharedMaterial.mainTexture = GameManager.resourceManager.getPartsTexture(name); } } else { smr.sharedMaterial.mainTexture = GameManager.resourceManager.getPartsTexture(name); } } }
// cInfo : 현재 주인공이 차고 있는 템. 인벤에 있는 템을 미리보기했을때 현재 착용하고 있는 템과의 비교를 해주기 위한 데이터다. void setStatLine(int transcendATTR, GameIDData descriptionData, int headerIndex, HeroPartsData hpd, GameIDData cInfo, int valueTypeIndex, string name, string format, bool useRound = true, string lastWord = "", int usePointNumLimit = -1) { GameValueType.Type valueType = hpd.valueTypeDic[valueTypeIndex]; Xfloat[] value = hpd.getArrayValueByIndex(valueTypeIndex); int len = value.Length; if (len > 0 && value[0] > 0) { if (_statHeader[headerIndex] == false) { _statHeader[headerIndex] = true; // setStatHeader(headerIndex); } // 스탯 이름. sb1.Append("[fcd4a3]"); sb1.Append(name); sb1.Append("[-]\n"); // 현재 장비 스탯 정보. float defaultValue = GameValueType.getPartsApplyValue(value, valueType, descriptionData.reinforceLevel); if (descriptionData.totalPLevel > 0) { defaultValue = descriptionData.getTranscendValueByATTR(defaultValue, transcendATTR); } if (useRound) { defaultValue = Mathf.CeilToInt(defaultValue - 0.4f); } if (usePointNumLimit > -1 && defaultValue >= usePointNumLimit) { format = "{0:0}"; } sb2.Append("[ffffff]"); sb2.Append(string.Format(format, defaultValue)); sb2.Append(lastWord + "[-]"); // 강화 했을때 수치 변화를 알려주기 위한 녀석이다. if (_compareData != null) { Xfloat[] rValue = _compareData.partsData.getArrayValueByIndex(valueTypeIndex); float rDefaultValue = GameValueType.getPartsApplyValue(rValue, valueType, _compareData.reinforceLevel); if (_compareData.totalPLevel > 0) { rDefaultValue = _compareData.getTranscendValueByATTR(rDefaultValue, transcendATTR); } if (useRound) { rDefaultValue = Mathf.CeilToInt(rDefaultValue - 0.4f); } rDefaultValue = defaultValue - rDefaultValue; if (rDefaultValue > 0) { sb2.Append("[ffe400] (↑"); sb2.Append(string.Format(format, rDefaultValue)); sb2.Append(lastWord + ")"); } else if (rDefaultValue < 0) { sb2.Append("[be1010] (↓"); sb2.Append(string.Format(format, rDefaultValue)); sb2.Append(lastWord + ")"); } } // 비교할 스탯 정보. if (cInfo != null) { Xfloat[] cValue = cInfo.partsData.getArrayValueByIndex(valueTypeIndex); float cDefaultValue = GameValueType.getPartsApplyValue(cValue, valueType, cInfo.reinforceLevel); if (cInfo.totalPLevel > 0) { cDefaultValue = cInfo.getTranscendValueByATTR(cDefaultValue, transcendATTR); } if (useRound) { cDefaultValue = Mathf.CeilToInt(cDefaultValue - 0.4f); } cDefaultValue = defaultValue - cDefaultValue; if (cDefaultValue > 0) { sb3.Append("[74f344]+"); sb3.Append(string.Format(format, cDefaultValue)); sb3.Append(lastWord); } else if (cDefaultValue < 0) { sb3.Append("[f1290f]"); sb3.Append(string.Format(format, cDefaultValue)); sb3.Append(lastWord); } } sb2.Append("\n"); sb3.Append("\n"); sb4.Append("\n"); if (name.Contains("\n")) { sb2.Append("\n"); sb3.Append("\n"); sb4.Append("\n"); } } }
void setStat(bool isFirstSequenceForReinforce, GameIDData descriptionData) { sb1.Length = 0; sb2.Length = 0; sb3.Length = 0; sb4.Length = 0; _statHeader[0] = false; _statHeader[1] = false; _statHeader[2] = false; HeroPartsData selectItem = descriptionData.partsData; GameIDData comparisonItem = null; if (isFromInventorySlot == true && popupType != RuneInfoPopup.Type.Book && popupType != RuneInfoPopup.Type.PreviewOnly && (popupType == RuneInfoPopup.Type.Normal || (isFirstSequenceForReinforce == false))) { if (GameDataManager.instance.selectHeroId == descriptionData.partsData.character) { switch (descriptionData.partsData.type) { case HeroParts.HEAD: comparisonItem = GameDataManager.selectedPlayerData.partsHead.itemInfo; break; case HeroParts.BODY: comparisonItem = GameDataManager.selectedPlayerData.partsBody.itemInfo; break; case HeroParts.WEAPON: comparisonItem = GameDataManager.selectedPlayerData.partsWeapon.itemInfo; break; case HeroParts.VEHICLE: comparisonItem = GameDataManager.selectedPlayerData.partsVehicle.itemInfo; break; } } else { if (descriptionData.partsData.character != null && GameDataManager.instance.heroes.ContainsKey(descriptionData.partsData.character)) { switch (descriptionData.partsData.type) { case HeroParts.HEAD: comparisonItem = GameDataManager.instance.heroes[descriptionData.partsData.character].partsHead.itemInfo; break; case HeroParts.BODY: comparisonItem = GameDataManager.instance.heroes[descriptionData.partsData.character].partsBody.itemInfo; break; case HeroParts.WEAPON: comparisonItem = GameDataManager.instance.heroes[descriptionData.partsData.character].partsWeapon.itemInfo; break; case HeroParts.VEHICLE: comparisonItem = GameDataManager.instance.heroes[descriptionData.partsData.character].partsVehicle.itemInfo; break; } } } } setStatLine(WSATTR.HPMAX_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_HP_MAX, Util.getUIText("MAXHP"), "{0:0}"); setStatLine(WSATTR.SPMAX_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_SP_MAX, Util.getUIText("MAXSP"), "{0:0}"); setStatLine(WSATTR.SP_RECOVERY_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_SP_RECOVERY, Util.getUIText("SPRECOVERY"), "{0:0}"); setStatLine(WSATTR.MPMAX_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_MP_MAX, Util.getUIText("MAXMP"), "{0:0}"); setStatLine(WSATTR.MP_RECOVERY_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_MP_RECOVERY, Util.getUIText("MPRECOVERY"), "{0:0.0}", false, "", 10); setStatLine(WSATTR.ATK_PHYSIC_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_ATK_PHYSIC, Util.getUIText("ATKPHYSIC"), "{0:0}"); setStatLine(WSATTR.ATK_MAGIC_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_ATK_MAGIC, Util.getUIText("ATKMAGIC"), "{0:0}"); setStatLine(WSATTR.DEF_PHYSIC_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_DEF_PHYSIC, Util.getUIText("DEFPHYSIC"), "{0:0}"); setStatLine(WSATTR.DEF_MAGIC_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_DEF_MAGIC, Util.getUIText("DEFMAGIC"), "{0:0}"); setStatLine(WSATTR.SPEED_I, descriptionData, 0, selectItem, comparisonItem, BaseHeroPartsDataInfo.INDEX_SPEED, Util.getUIText("MOVESPEED"), "{0:0}"); /* * if(_statHeader[0]) * { * sb1.Append("\n");sb2.Append("\n");sb3.Append("\n"); * } * * setStatLine(1,selectItem,null,BaseHeroPartsDataInfo.INDEX_SUMMON_SP_PERCENT, "소환SP 감소","{0:0}",false,"%"); * setStatLine(1,selectItem,null,BaseHeroPartsDataInfo.INDEX_UNIT_HP_UP, "생명력 증가","{0:0}",false,"%"); * setStatLine(1,selectItem,null,BaseHeroPartsDataInfo.INDEX_UNIT_DEF_UP, "방어력 증가","{0:0}",false,"%"); * * if(_statHeader[1]) * { * sb1.Append("\n");sb2.Append("\n");sb3.Append("\n"); * } * * setStatLine(2,selectItem,null,BaseHeroPartsDataInfo.INDEX_SKILL_SP_DISCOUNT, "소모MP 감소","{0:0}",false,"%"); * setStatLine(2,selectItem,null,BaseHeroPartsDataInfo.INDEX_SKILL_ATK_UP, "공격력 증가","{0:0}",false,"%"); * setStatLine(2,selectItem,null,BaseHeroPartsDataInfo.INDEX_SKILL_UP, "회복량 증가","{0:0}",false,"%"); * setStatLine(2,selectItem,null,BaseHeroPartsDataInfo.INDEX_SKILL_TIME_UP, "지속시간 증가","{0:0}",false,"%"); */ // if(_statHeader[2]) sb1.Append("\n"); string txt = sb1.ToString().Trim(); while (txt.Length > 2 && txt.EndsWith("\n")) { txt = txt.Substring(0, txt.Length - 2); } lbItemDescriptionName.text = txt; lbItemDescriptionStat.text = sb2.ToString(); if (_compareData != null) { lbItemDescriptionMaxStat.text = sb4.ToString(); lbItemDescriptionStat2.text = sb3.ToString(); } else { lbItemDescriptionMaxStat.text = sb3.ToString(); lbItemDescriptionStat2.text = ""; } _rareDescription = descriptionData.partsData.descriptionSuperRare; _legendDescription = descriptionData.partsData.descriptionLegend; sb1.Length = 0; sb2.Length = 0; sb3.Length = 0; sb4.Length = 0; if (string.IsNullOrEmpty(_rareDescription) == false) { sb1.Append(_rareDescription); } if (string.IsNullOrEmpty(_legendDescription) == false) { if (sb1.Length > 0) { sb1.Append("\n\n"); } sb1.Append(_legendDescription); } if (sb1.Length > 0) { goRareLegendPartsDescriptionContainer.SetActive(true); lbSuperRareLegendDescription.text = sb1.ToString(); sb1.Length = 0; } else { goRareLegendPartsDescriptionContainer.SetActive(false); } transcendInfo.setData(descriptionData); }