|
@@ -11,19 +11,37 @@ namespace GFGGame
|
|
|
public Texture2D RoleTextuex { get; set; }
|
|
|
|
|
|
//角色基础分+部件基础分
|
|
|
- private int _score;
|
|
|
- public int score
|
|
|
+ // private int _score;
|
|
|
+ // public int score
|
|
|
+ // {
|
|
|
+ // get
|
|
|
+ // {
|
|
|
+ // return _score;
|
|
|
+ // }
|
|
|
+ // set
|
|
|
+ // {
|
|
|
+ // _score = value;
|
|
|
+ // EventAgent.DispatchEvent(ConstMessage.DRESS_UP_SCORE_CHANGED, _score);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ public FightRoleData roleData
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- return _score;
|
|
|
+ return GetMyFightRoleData();
|
|
|
}
|
|
|
- set
|
|
|
+ }
|
|
|
+ public int GetScore(List<int> itemScoreList)
|
|
|
+ {
|
|
|
+ int score = 0;
|
|
|
+
|
|
|
+ for (int i = 0; i < itemScoreList.Count; i++)
|
|
|
{
|
|
|
- _score = value;
|
|
|
- EventAgent.DispatchEvent(ConstMessage.DRESS_UP_SCORE_CHANGED, _score);
|
|
|
+ score += itemScoreList[i];
|
|
|
}
|
|
|
+ return score;
|
|
|
}
|
|
|
+
|
|
|
//最终得分
|
|
|
private int _totalScore;
|
|
|
public int totalScore
|
|
@@ -163,20 +181,23 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
//获取玩家战斗数据
|
|
|
- public FightRoleData GetMyFightRoleData()
|
|
|
+ private FightRoleData GetMyFightRoleData()
|
|
|
{
|
|
|
FightRoleData roleData = new FightRoleData();
|
|
|
roleData.name = RoleDataManager.roleName;
|
|
|
roleData.headId = RoleDataManager.headId;
|
|
|
roleData.headBorderId = RoleDataManager.headBorderId;
|
|
|
- roleData.scoreType = InstanceZonesDataManager.currentScoreType; //本次战斗的主题
|
|
|
roleData.baseScore = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).baseScore;//角色等级分数
|
|
|
- roleData.cardId = InstanceZonesDataManager.currentCardId; ;//卡牌id
|
|
|
- roleData.cardScore = CardDataManager.GetCardDataById(roleData.cardId).scores[roleData.scoreType];//卡牌对应主题的属性分数
|
|
|
if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
|
|
|
{
|
|
|
- // roleData.fightScene = ConstInstanceZonesType.Arena;
|
|
|
- roleData.tags = new string[1] { ArenaDataManager.Instance.Tag };
|
|
|
+ if (ArenaDataManager.Instance.CurFightIndex == 0)
|
|
|
+ {
|
|
|
+ roleData.tags = new string[1] { ArenaDataManager.Instance.Tag };
|
|
|
+ }
|
|
|
+ roleData.scoreType = ArenaDataManager.Instance.DressupList[ArenaDataManager.Instance.CurFightIndex].scoreType;
|
|
|
+ roleData.cardId = ArenaDataManager.Instance.DressupList[ArenaDataManager.Instance.CurFightIndex].cardId;
|
|
|
+ roleData.cardScore = ItemDataManager.GetItemAdditionScore(roleData.cardId, roleData.scoreType, roleData.tags);
|
|
|
+ roleData.itemList = ArenaDataManager.Instance.DressupList[ArenaDataManager.Instance.CurFightIndex].itemList;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -187,12 +208,16 @@ namespace GFGGame
|
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
roleData.tags = fightCfg.needTagsArr;////本次战斗要求的标签
|
|
|
}
|
|
|
+ roleData.scoreType = InstanceZonesDataManager.currentScoreType; //本次战斗的主题
|
|
|
+ roleData.cardId = InstanceZonesDataManager.currentCardId; ;//卡牌id
|
|
|
+ roleData.cardScore = CardDataManager.GetCardDataById(roleData.cardId).scores[roleData.scoreType];//卡牌对应主题的属性分数
|
|
|
+ roleData.itemList = MyDressUpHelper.dressUpObj.itemList;
|
|
|
+
|
|
|
}
|
|
|
if (roleData.cardId > 0)
|
|
|
{
|
|
|
roleData.skillLvs = SkillDataManager.Instance.GetSkillLvs(roleData.cardId);
|
|
|
}
|
|
|
- roleData.itemList = MyDressUpHelper.dressUpObj.itemList;
|
|
|
|
|
|
for (int i = 0; i < roleData.itemList.Count; i++)
|
|
|
{
|
|
@@ -260,6 +285,37 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 卡牌列表按竞技战力排序
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="arrayList"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public List<CardData> SortCardList(List<CardData> arrayList, List<int> itemList, int scoreType)
|
|
|
+ {
|
|
|
+ double itemSum = 0;
|
|
|
+ for (int i = 0; i < itemList.Count; i++)
|
|
|
+ {
|
|
|
+ itemSum += ItemDataManager.GetItemAdditionScore(itemList[i], scoreType);
|
|
|
+ }
|
|
|
+ int baseScore = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).baseScore;
|
|
|
+ arrayList.Sort((CardData a, CardData b) =>
|
|
|
+ {
|
|
|
+ double scoreA = GetSkillFightScore(itemSum, baseScore, a.id, a.scores[scoreType], SkillDataManager.Instance.GetSkillLvs(a.id));
|
|
|
+ double scoreB = GetSkillFightScore(itemSum, baseScore, b.id, b.scores[scoreType], SkillDataManager.Instance.GetSkillLvs(b.id));
|
|
|
+ if (scoreA < scoreB)
|
|
|
+ {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else if (scoreA > scoreB)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return string.Compare(a.itemCfg.res, b.itemCfg.res);
|
|
|
+ });
|
|
|
+ return arrayList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 获取快速挑战结果
|
|
|
/// </summary>
|
|
|
/// <param name="myRoleData"></param>
|
|
@@ -342,7 +398,7 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 获取竞技场玩家战力
|
|
|
+ /// 获取玩家竞技场战力
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public int GetArenaRoleFightScore(FightRoleData roleDatas)
|
|
@@ -355,15 +411,7 @@ namespace GFGGame
|
|
|
|
|
|
double itemSum = GetItemScoreSum(roleDatas.itemScoreList);
|
|
|
double clickScore = GetPerfectClickScore(roleDatas) / ConstScoreSystem.PART_SCORE;
|
|
|
- double skillScore = 0;
|
|
|
- double skillBaseScore = itemSum + roleDatas.cardScore + roleDatas.baseScore;
|
|
|
- List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(roleDatas.cardId);
|
|
|
- for (int j = 0; j < skillCfgs.Count; j++)
|
|
|
- {
|
|
|
- PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(roleDatas.skillLvs[j], skillCfgs[j].skillId);
|
|
|
- if (skillLvlCfg == null) continue;
|
|
|
- skillScore += skillBaseScore * skillLvlCfg.fightPowerParam / 10000;
|
|
|
- }
|
|
|
+ double skillScore = GetSkillFightScore(itemSum, roleData.baseScore, roleData.cardId, roleData.cardScore, roleData.skillLvs);
|
|
|
fightScore = itemSum + clickScore + skillScore;
|
|
|
|
|
|
return (int)Math.Ceiling(fightScore);
|
|
@@ -374,24 +422,15 @@ namespace GFGGame
|
|
|
/// 获取竞技场机器人战力
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public int GetArenaRobotFightScore(List<FightRobotData> robotDatas)
|
|
|
+ public int GetArenaRobotFightScore(FightRobotData robotData)
|
|
|
{
|
|
|
double fightScore = 0;
|
|
|
- for (int i = 0; i < robotDatas.Count; i++)
|
|
|
- {
|
|
|
- double itemSum = GetItemScoreSum(robotDatas[i].itemScoreList);
|
|
|
- double clickScore = GetRobotPerfectClickScore(robotDatas[i]) / ConstScoreSystem.PART_SCORE;
|
|
|
- double skillScore = 0;
|
|
|
- double skillBaseScore = itemSum + robotDatas[i].cardScore + robotDatas[i].baseScore;
|
|
|
- List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(robotDatas[i].cardId);
|
|
|
- for (int j = 0; j < skillCfgs.Count; j++)
|
|
|
- {
|
|
|
- PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(robotDatas[i].skillLvs[j], skillCfgs[i].skillId);
|
|
|
- if (skillLvlCfg == null) continue;
|
|
|
- skillScore += skillBaseScore * skillLvlCfg.fightPowerParam / 10000;
|
|
|
- }
|
|
|
- fightScore = itemSum + clickScore + skillScore;
|
|
|
- }
|
|
|
+
|
|
|
+ double itemSum = GetItemScoreSum(robotData.itemScoreList);
|
|
|
+ double clickScore = GetRobotPerfectClickScore(robotData) / ConstScoreSystem.PART_SCORE;
|
|
|
+ double skillScore = GetSkillFightScore(itemSum, robotData.baseScore, robotData.cardId, robotData.cardScore, robotData.skillLvs);
|
|
|
+ fightScore = itemSum + clickScore + skillScore;
|
|
|
+
|
|
|
return (int)Math.Ceiling(fightScore);
|
|
|
}
|
|
|
|
|
@@ -399,7 +438,7 @@ namespace GFGGame
|
|
|
/// 所有部件主属性和
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- private double GetItemScoreSum(List<int> itemScoreList)
|
|
|
+ public double GetItemScoreSum(List<int> itemScoreList)
|
|
|
{
|
|
|
double scoreSum = 0;
|
|
|
for (int i = 0; i < itemScoreList.Count; i++)
|
|
@@ -409,6 +448,7 @@ namespace GFGGame
|
|
|
return scoreSum;
|
|
|
|
|
|
}
|
|
|
+ //玩家卓越点击战力
|
|
|
private double GetPerfectClickScore(FightRoleData roleData)
|
|
|
{
|
|
|
double clickScore = 0;
|
|
@@ -418,6 +458,7 @@ namespace GFGGame
|
|
|
}
|
|
|
return clickScore;
|
|
|
}
|
|
|
+ //机器人卓越点击战力
|
|
|
private double GetRobotPerfectClickScore(FightRobotData robotData)
|
|
|
{
|
|
|
double clickScore = 0;
|
|
@@ -428,5 +469,34 @@ namespace GFGGame
|
|
|
}
|
|
|
return clickScore;
|
|
|
}
|
|
|
+
|
|
|
+ public double GetSkillFightScore(double itemScoreSum, int baseScore, int cardId, int cardScore, List<int> skillLvs)
|
|
|
+ {
|
|
|
+ // double itemSum = itemScoreSum;
|
|
|
+ double skillScore = 0;
|
|
|
+ double skillBaseScore = itemScoreSum + cardScore + baseScore;
|
|
|
+ List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardId);
|
|
|
+ for (int j = 0; j < skillCfgs.Count; j++)
|
|
|
+ {
|
|
|
+ PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLvs[j], skillCfgs[j].skillId);
|
|
|
+ if (skillLvlCfg == null) continue;
|
|
|
+ skillScore += skillBaseScore * skillLvlCfg.fightPowerParam / 10000;
|
|
|
+ }
|
|
|
+ return skillScore;
|
|
|
+ }
|
|
|
+ // private double GetRobotSkillFightScore(FightRobotData robotData)
|
|
|
+ // {
|
|
|
+ // double itemSum = GetItemScoreSum(robotData.itemScoreList);
|
|
|
+ // double skillScore = 0;
|
|
|
+ // double skillBaseScore = itemSum + robotData.cardScore + robotData.baseScore;
|
|
|
+ // List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(robotData.cardId);
|
|
|
+ // for (int j = 0; j < skillCfgs.Count; j++)
|
|
|
+ // {
|
|
|
+ // PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(robotData.skillLvs[j], skillCfgs[j].skillId);
|
|
|
+ // if (skillLvlCfg == null) continue;
|
|
|
+ // skillScore += skillBaseScore * skillLvlCfg.fightPowerParam / 10000;
|
|
|
+ // }
|
|
|
+ // return skillScore;
|
|
|
+ // }
|
|
|
}
|
|
|
}
|