public int GetWeaponType() { foreach (var equipment in avatarData.Equipments) { EquipmentConfig.Equipment equipmentCfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(equipment.Id); if (equipmentCfg != null && equipmentCfg.type == EquipmentConfig._Type.Weapon) { return(equipmentCfg.weaponType); } } return(IDSeg.InvalidId); }
public static int CompareEquipment(int e1, int e2) { EquipmentConfig.Equipment c1 = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e1); EquipmentConfig.Equipment c2 = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e2); return(CompareEquipment(c1, c2)); }
/// <summary> /// 1、 已被装备的装备靠上 /// 2、 品质越高越靠上 /// 3、 同品质时,使用装备优先级控制,优先级越高越靠上,依次是武器、衣服、鞋子、首饰、宝物(策划用) /// 4、 同品质、同部位时,根据装备表中装备的优先级显示,优先级越高越靠上 /// 5、 同装备有多个时,根据精炼等级排序,精炼等级越高越靠上 /// 6、 同装备同突破等级时,根据装备等级排序,等级越高越靠上 /// 7、 同装备同突破同强化等级时,随机排序。 /// </summary> //public static int CompareEquipment(WeihuaGames.ClientClass.Equipment e1, WeihuaGames.ClientClass.Equipment e2) //{ // int lineuped1 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e1) ? 1 : 0; // int lineuped2 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e2) ? 1 : 0; // if (lineuped1 != lineuped2) // return lineuped2 - lineuped1; // EquipmentConfig.Equipment e1Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e1.ResourceId); // EquipmentConfig.Equipment e2Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e2.ResourceId); // if (e1Cfg.qualityLevel != e2Cfg.qualityLevel) // return e2Cfg.qualityLevel - e1Cfg.qualityLevel; // else if (e1Cfg.sortIndex != e2Cfg.sortIndex) // return e2Cfg.sortIndex - e1Cfg.sortIndex; // else if (e1.BreakthoughtLevel != e2.BreakthoughtLevel) // return e2.BreakthoughtLevel - e1.BreakthoughtLevel; // else if (e1.LevelAttrib.Level != e2.LevelAttrib.Level) // return e2.LevelAttrib.Level - e1.LevelAttrib.Level; // return 0; //} /// <summary> /// 1、 品质越低越靠上 /// 2、 同品质时,优先级越低越靠上显示,从上向下依次是武器、衣服、鞋子、首饰、宝物(策划用) /// 3、 同品质、同部位时,根据装备表中装备的优先级显示,优先级越低越靠上 /// 4、 同装备有多个时,根据精炼等级排序,精炼等级越低越靠上 /// 5、 同装备同精炼等级时,根据装备等级排序,等级越低越靠上 /// 6、 同装备同突破同强化等级时,随机排序。 /// </summary> //public static int CompareEquipmentReverse(WeihuaGames.ClientClass.Equipment e1, WeihuaGames.ClientClass.Equipment e2) //{ // int lineuped1 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e1) ? 1 : 0; // int lineuped2 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e2) ? 1 : 0; // if (lineuped1 != lineuped2) // return lineuped1 - lineuped2; // EquipmentConfig.Equipment e1Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e1.ResourceId); // EquipmentConfig.Equipment e2Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e2.ResourceId); // if (e1Cfg.qualityLevel != e2Cfg.qualityLevel) // return e1Cfg.qualityLevel - e2Cfg.qualityLevel; // else if (e1Cfg.sortIndex != e2Cfg.sortIndex) // return e1Cfg.sortIndex - e2Cfg.sortIndex; // else if (e1.BreakthoughtLevel != e2.BreakthoughtLevel) // return e1.BreakthoughtLevel - e2.BreakthoughtLevel; // else if (e1.LevelAttrib.Level != e2.LevelAttrib.Level) // return e1.LevelAttrib.Level - e2.LevelAttrib.Level; // return 0; //} /// <summary> /// 1、 是否缘分(是,排在上面使用sortIndex排序) /// 2、 已被装备的装备靠上 /// 3、 品质越高越靠上 /// 4、 同品质时,使用装备优先级控制,优先级越高越靠上,依次是武器、衣服、鞋子、首饰、宝物(策划用) /// 5、 同品质、同部位时,根据装备表中装备的优先级显示,优先级越高越靠上 /// 6、 同装备有多个时,根据精炼等级排序,精炼等级越高越靠上 /// 7、 同装备同突破等级时,根据装备等级排序,等级越高越靠上 /// 8、 同装备同突破同强化等级时,随机排序。 /// </summary> //public static int CompareEquipmentForLineUp(WeihuaGames.ClientClass.Equipment e1, WeihuaGames.ClientClass.Equipment e2) //{ // int assemble1 = e1.IsAssembleActive ? 1 : 0; // int assemble2 = e2.IsAssembleActive ? 1 : 0; // if (assemble1 != assemble2) // return assemble2 - assemble1; // int lineuped1 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e1) ? 1 : 0; // int lineuped2 = PlayerDataUtility.IsLineUpInPosition(SysLocalDataBase.Inst.LocalPlayer, e2) ? 1 : 0; // if (lineuped1 != lineuped2) // return lineuped2 - lineuped1; // var e1Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e1.ResourceId); // var e2Cfg = ConfigDatabase.DefaultCfg.EquipmentConfig.GetEquipmentById(e2.ResourceId); // if (e1Cfg.qualityLevel != e2Cfg.qualityLevel) // return e2Cfg.qualityLevel - e1Cfg.qualityLevel; // else if (e1Cfg.sortIndex != e2Cfg.sortIndex) // return e2Cfg.sortIndex - e1Cfg.sortIndex; // else if (e1.BreakthoughtLevel != e2.BreakthoughtLevel) // return e2.BreakthoughtLevel - e1.BreakthoughtLevel; // else if (e1.LevelAttrib.Level != e2.LevelAttrib.Level) // return e2.LevelAttrib.Level - e1.LevelAttrib.Level; // return 0; //} public static int CompareEquipment(EquipmentConfig.Equipment e1, EquipmentConfig.Equipment e2) { return(e2.sortIndex - e1.sortIndex); }