public void ClickOKHandler() { GameResData costGameResData = EquipmentUtil.CalculatePutOffCost(_equipmentInfo); if (GameProxy.instance.BaseResourceDictionary[costGameResData.type] >= costGameResData.count) { EquipmentController.instance.CLIENT2LOBBY_EQUIP_WEAR_OFF_REQ(_equipmentInfo.instanceID, EquipmentWearOffType.Off, false, _roleInstanceID); UIMgr.instance.Close(PREFAB_PATH); } else { CommonErrorTipsView.Open("Not enough diamond."); } }
public static float CalcRolePower(RoleInfo roleInfo) { PlayerInfo player = roleInfo as PlayerInfo; HeroInfo hero = roleInfo as HeroInfo; int correction = 0; if (player != null) { correction = player.heroData.correction; } else if (hero != null) { correction = hero.heroData.correction; } int powerBasic = GlobalData.GetGlobalData().powerBasic; int levelFactor = 0; if (roleInfo.level <= 50) { levelFactor = roleInfo.level - 1; } else { levelFactor = 2 * roleInfo.level - 51; } HeroStrengthenNeedData strengthenData = HeroStrengthenNeedData.GetHeroStrengthenNeedDataByLevel(roleInfo.strengthenLevel - 1); float aggFactor = 0; if (strengthenData != null) { aggFactor = strengthenData.aggr_value; } float rolePower = correction / 100.0f * 15 * ((powerBasic + levelFactor + aggFactor) * Mathf.Pow(1.28f, roleInfo.advanceLevel - 1)); rolePower += EquipmentUtil.CalcEquipPower(EquipmentProxy.instance.GetEquipmentInfoByInstanceID(roleInfo.armorID)); rolePower += EquipmentUtil.CalcEquipPower(EquipmentProxy.instance.GetEquipmentInfoByInstanceID(roleInfo.weaponID)); rolePower += EquipmentUtil.CalcEquipPower(EquipmentProxy.instance.GetEquipmentInfoByInstanceID(roleInfo.accessoryID)); return(rolePower); }
private int CompareEquipmentInfo(EquipmentInfo aEquipmentInfo, EquipmentInfo bEquipmentInfo) { return(EquipmentUtil.CompareEquipmentWeight(aEquipmentInfo, bEquipmentInfo, (EquipmentType)(_currentSelectEquipmentIndex + 1), _roleInfo.heroData.roleType, _sortFreeEquipmentItemsAsc)); }