|
@@ -29,43 +29,42 @@ namespace GFGGame
|
|
|
{
|
|
|
|
|
|
public const int MINE = 0;
|
|
|
- public const int ENEMY = 1;
|
|
|
- public const int ROBOT = 2;
|
|
|
+ public const int TAEGET = 1;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public class ScoreSystemData : SingletonBase<ScoreSystemData>
|
|
|
{
|
|
|
- private const float _prefectScale = 0.866f;//完美缩放比
|
|
|
-
|
|
|
- private Dictionary<int, List<int>> equipDicWithPartId = new Dictionary<int, List<int>>();
|
|
|
|
|
|
/// <summary>
|
|
|
/// 将穿戴部件分组
|
|
|
/// </summary>
|
|
|
- public void SetEquipDicWithType()
|
|
|
+ public void SetEquipScoresWithPartId(FightRoleData roleData)
|
|
|
{
|
|
|
- equipDicWithPartId.Clear();
|
|
|
- var equipDatas = MyDressUpHelper.dressUpObj.itemList;
|
|
|
- for (int i = 0; i < equipDatas.Count; i++)
|
|
|
+ for (int i = 0; i < roleData.itemList.Count; i++)
|
|
|
{
|
|
|
-
|
|
|
FightScoreCfg[] typeCfgs = FightScoreCfgArray.Instance.dataArray;
|
|
|
for (int j = 0; j < typeCfgs.Length; j++)
|
|
|
{
|
|
|
FightScoreCfg cfg = typeCfgs[j];
|
|
|
- if (equipDicWithPartId.ContainsKey(cfg.id) == false)
|
|
|
+ if (roleData.pardScoreListDic.ContainsKey(cfg.id) == false)
|
|
|
{
|
|
|
- equipDicWithPartId.Add(cfg.id, new List<int>());
|
|
|
+ roleData.pardScoreListDic.Add(cfg.id, new List<int>());
|
|
|
+ }
|
|
|
+ if (roleData.pardListDic.ContainsKey(cfg.id) == false)
|
|
|
+ {
|
|
|
+ roleData.pardListDic.Add(cfg.id, new List<int>());
|
|
|
}
|
|
|
|
|
|
bool isCheckFinish = false;
|
|
|
for (int k = 0; k < cfg.subTypesArr.Length; k++)
|
|
|
{
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(equipDatas[i]);
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(roleData.itemList[i]);
|
|
|
|
|
|
if (itemCfg.subType == cfg.subTypesArr[k])
|
|
|
{
|
|
|
- equipDicWithPartId[cfg.id].Add(equipDatas[i]);
|
|
|
+ roleData.pardListDic[cfg.id].Add(roleData.itemList[i]);
|
|
|
+ roleData.pardScoreListDic[cfg.id].Add(roleData.itemScoreList[i]);
|
|
|
isCheckFinish = true;
|
|
|
break;
|
|
|
}
|
|
@@ -79,44 +78,34 @@ namespace GFGGame
|
|
|
/// 返回总主属性分
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public double GetMainScore()
|
|
|
+ public double GetMainScore(FightRoleData roleData)
|
|
|
{
|
|
|
//(部件属性分数+标签分数+人物基础分+卡牌属性分数)*4
|
|
|
|
|
|
- var equipDatas = MyDressUpHelper.dressUpObj.itemList;
|
|
|
int partScore = 0;
|
|
|
double tagScore = 0;
|
|
|
- // StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- // StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
|
|
- for (int i = 0; i < equipDatas.Count; i++)
|
|
|
+ for (int i = 0; i < roleData.itemList.Count; i++)
|
|
|
{
|
|
|
- partScore += ItemDataManager.GetItemAdditionScore(equipDatas[i], InstanceZonesDataManager.currentScoreType);
|
|
|
- tagScore = ItemDataManager.GetItemTagScore(equipDatas[i], InstanceZonesDataManager.currentFightTags);
|
|
|
-
|
|
|
+ partScore += ItemDataManager.GetItemAdditionScore(roleData.itemList[i], roleData.scoreType);
|
|
|
+ tagScore = ItemDataManager.GetItemTagScore(roleData.itemList[i], roleData.tags);
|
|
|
}
|
|
|
- int roleScore = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl)).baseScore;
|
|
|
- int cardScore = ItemDataManager.GetItemAdditionScore(InstanceZonesDataManager.currentCardId, InstanceZonesDataManager.currentScoreType);
|
|
|
|
|
|
- return (partScore + tagScore + roleScore + cardScore) * ConstScoreSystem.MAIN_SCORE;
|
|
|
+ return (partScore + tagScore + roleData.baseScore + roleData.cardScore) * ConstScoreSystem.MAIN_SCORE;
|
|
|
}
|
|
|
|
|
|
- public double GetTargetMainScore()
|
|
|
+ public double GetRobotMainScore(FightRobotData robotData)
|
|
|
{
|
|
|
//(部件属性分数+标签分数+人物基础分+卡牌属性分数)*4
|
|
|
|
|
|
int partScore = 0;
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
|
|
for (int i = 0; i < FightScoreCfgArray.Instance.dataArray.Length; i++)
|
|
|
{
|
|
|
- partScore += fightCfg.targetPartsScoreArr[i];
|
|
|
+ partScore += robotData.targetPareScorList[i];
|
|
|
}
|
|
|
- int roleScore = fightCfg.targetBaseScore;
|
|
|
- int cardScore = fightCfg.targetCardScore;
|
|
|
|
|
|
- return (partScore + roleScore + cardScore) * ConstScoreSystem.MAIN_SCORE;
|
|
|
+ return (partScore + robotData.baseScore + robotData.cardScore) * ConstScoreSystem.MAIN_SCORE;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -129,32 +118,43 @@ namespace GFGGame
|
|
|
/// <param name="type">评分部位</param>
|
|
|
/// <param name="showCard">是否展示卡牌效果</param>
|
|
|
/// <returns></returns>
|
|
|
- public int GetPartScore(int partId, int roleType, int clickType, double skillScore)
|
|
|
+ public int GetPartScore(FightRoleData roleData, int partId, int clickType, double skillScore)
|
|
|
{
|
|
|
|
|
|
//部件评分=部件基础分*部件系数
|
|
|
//点击评分=(部件基础分+(人物基础分+卡牌属性分数)*点击系数)*2.22 (新点击公式,防止点击优秀却因为未穿衣服结果是0分)
|
|
|
//卡牌评分=总属性*技能配表百分比
|
|
|
- double partScore = GetPartScore(partId, roleType);
|
|
|
+ double partBaseScore = GetPartBaseScore(roleData.pardListDic[partId], roleData.pardScoreListDic[partId]);
|
|
|
|
|
|
- double clickScore = ScoreSystemData.Instance.GetPartItemClickScore(partId, clickType, roleType);
|
|
|
+ double partScore = partBaseScore * ConstScoreSystem.PART_SCORE;
|
|
|
+
|
|
|
+ int roleScore = roleData.baseScore;
|
|
|
+ int cardScore = roleData.cardScore;
|
|
|
+
|
|
|
+ double clickCoefficient = GetPartItemClickScore(clickType);
|
|
|
+ double clickScore = (partBaseScore + (roleScore + cardScore) * clickCoefficient) * ConstScoreSystem.CLICK_SCORE;
|
|
|
|
|
|
int score = (int)Math.Ceiling(partScore + clickScore + skillScore);
|
|
|
return Math.Max(0, score);
|
|
|
- // return (int)Math.Round((partScore + skillScore));
|
|
|
}
|
|
|
- private double GetPartScore(int partId, int roleType)
|
|
|
+
|
|
|
+ public int GetRobotPartScore(FightRobotData robotData, int partId, int clickType, double skillScore)
|
|
|
{
|
|
|
- double partScore = 0;
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
- {
|
|
|
- partScore = GetPartBaseScore(partId) * ConstScoreSystem.PART_SCORE;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- partScore = GetTargetPartBaseScore(partId) * ConstScoreSystem.PART_SCORE;
|
|
|
- }
|
|
|
- return partScore;
|
|
|
+ //部件评分=部件基础分*部件系数
|
|
|
+ //点击评分=(部件基础分+(人物基础分+卡牌属性分数)*点击系数)*2.22 (新点击公式,防止点击优秀却因为未穿衣服结果是0分)
|
|
|
+ //卡牌评分=总属性*技能配表百分比
|
|
|
+ double partBaseScore = robotData.targetPareScorList[partId - 1];
|
|
|
+
|
|
|
+ double partScore = partBaseScore * ConstScoreSystem.PART_SCORE;
|
|
|
+
|
|
|
+ int roleScore = robotData.baseScore;
|
|
|
+ int cardScore = robotData.cardScore;
|
|
|
+
|
|
|
+ double clickCoefficient = GetPartItemClickScore(clickType);
|
|
|
+ double clickScore = (partBaseScore + (cardScore + roleScore) * clickCoefficient) * ConstScoreSystem.CLICK_SCORE;
|
|
|
+
|
|
|
+ int score = (int)Math.Ceiling(partScore + clickScore + skillScore);
|
|
|
+ return Math.Max(0, score);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -162,38 +162,26 @@ namespace GFGGame
|
|
|
/// </summary>
|
|
|
/// <param name="partId">评分部位</param>
|
|
|
/// <returns></returns>
|
|
|
- private double GetPartBaseScore(int partId)
|
|
|
+ private double GetPartBaseScore(List<int> partList, List<int> partScoreList)
|
|
|
{
|
|
|
double partScore = 0;
|
|
|
double tagScore = 0;
|
|
|
- if (!equipDicWithPartId.ContainsKey(partId)) return partScore;
|
|
|
+ if (partScoreList == null || partScoreList.Count == 0) return partScore;
|
|
|
|
|
|
- for (int i = 0; i < equipDicWithPartId[partId].Count; i++)
|
|
|
+ for (int i = 0; i < partScoreList.Count; i++)
|
|
|
{
|
|
|
- partScore += ItemDataManager.GetItemAdditionScore(equipDicWithPartId[partId][i], InstanceZonesDataManager.currentScoreType);
|
|
|
- tagScore += ItemDataManager.GetItemTagScore(equipDicWithPartId[partId][i], InstanceZonesDataManager.currentFightTags);
|
|
|
+ partScore += partScoreList[i];
|
|
|
+ tagScore += ItemDataManager.GetItemTagScore(partList[i], InstanceZonesDataManager.currentFightTags);
|
|
|
}
|
|
|
return partScore + tagScore;
|
|
|
}
|
|
|
|
|
|
- private double GetTargetPartBaseScore(int partId)
|
|
|
- {
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- if (fightCfg.targetPartsScoreArr.Length < FightScoreCfgArray.Instance.dataArray.Length)
|
|
|
- {
|
|
|
- ET.Log.Debug("战斗id:" + fightCfg.id + " targetPartsScore 数量不足");
|
|
|
- return 0;
|
|
|
- }
|
|
|
- return fightCfg.targetPartsScoreArr[partId - 1];
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- private double GetPartItemClickScore(int partId, int clickState, int roleType)
|
|
|
+ private double GetPartItemClickScore(int clickType)
|
|
|
{
|
|
|
//点击评分=(部件基础分+(人物基础分+卡牌属性分数)*点击系数)*2.22
|
|
|
double clickCoefficient = 0;
|
|
|
- switch (clickState)
|
|
|
+ switch (clickType)
|
|
|
{
|
|
|
case ClickType.MISS_CLICK:
|
|
|
clickCoefficient = ConstScoreSystem.MISS_SCORE;
|
|
@@ -205,118 +193,50 @@ namespace GFGGame
|
|
|
clickCoefficient = ConstScoreSystem.PERFECT_SCORE;
|
|
|
break;
|
|
|
}
|
|
|
- double clickScore = 0;
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
- {
|
|
|
- int roleScore = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl)).baseScore;
|
|
|
- int cardScore = ItemDataManager.GetItemAdditionScore(InstanceZonesDataManager.currentCardId, InstanceZonesDataManager.currentScoreType);
|
|
|
- clickScore = (GetPartBaseScore(partId) + (cardScore + roleScore) * clickCoefficient) * ConstScoreSystem.CLICK_SCORE;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- int roleScore = fightCfg.targetBaseScore;
|
|
|
- int cardScore = fightCfg.targetCardScore;
|
|
|
- clickScore = (GetTargetPartBaseScore(partId) + (cardScore + roleScore) * clickCoefficient) * ConstScoreSystem.CLICK_SCORE;
|
|
|
- }
|
|
|
- return clickScore;
|
|
|
+ return clickCoefficient;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取卡牌技能持续回合数
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public List<int> GetRoundTime(int roleType)
|
|
|
+ public List<int> GetRoundTime(int cardId, List<int> skillLvs)
|
|
|
{
|
|
|
List<int> roundTimes = new List<int>();
|
|
|
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
+ List<PassivitySkillCfg> targetSkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardId);
|
|
|
+ for (int i = 0; i < targetSkillCfgs.Count; i++)
|
|
|
{
|
|
|
- List<PassivitySkillCfg> mySkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(InstanceZonesDataManager.currentCardId);
|
|
|
- for (int i = 0; i < mySkillCfgs.Count; i++)
|
|
|
+ int skillLv = skillLvs[i];
|
|
|
+ PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, targetSkillCfgs[i].skillId);
|
|
|
+ if (skillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && UnityEngine.Random.Range(0, 10000) < skillLvlCfg.probability)
|
|
|
{
|
|
|
- int skillLv = SkillDataManager.Instance.GetSkillLv(InstanceZonesDataManager.currentLevelCfgId, mySkillCfgs[i].skillId);
|
|
|
- PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, mySkillCfgs[i].skillId);
|
|
|
- if (skillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && UnityEngine.Random.Range(0, 10000) < skillLvlCfg.probability)
|
|
|
- {
|
|
|
- roundTimes.Add(skillLvlCfg.roundTime);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- roundTimes.Add(0);
|
|
|
- }
|
|
|
+ roundTimes.Add(skillLvlCfg.roundTime);
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- List<PassivitySkillCfg> targetSkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(fightCfg.targetCardId);
|
|
|
- for (int i = 0; i < targetSkillCfgs.Count; i++)
|
|
|
+ else
|
|
|
{
|
|
|
- int skillLv = fightCfg.targetSkillLvsArr[i];
|
|
|
- PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, targetSkillCfgs[i].skillId);
|
|
|
- if (skillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && UnityEngine.Random.Range(0, 10000) < skillLvlCfg.probability)
|
|
|
- {
|
|
|
- roundTimes.Add(skillLvlCfg.roundTime);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- roundTimes.Add(0);
|
|
|
- }
|
|
|
+ roundTimes.Add(0);
|
|
|
}
|
|
|
}
|
|
|
return roundTimes;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 获取有效技能配置,过滤掉:被对方失效的、不符合作用时机、未满足触发概率的技能
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public List<PassivitySkillLvlCfg> GetValidSkills(int currentTime, int partId, int roleType, List<int> roundTimes, List<int> targetRoundTimes)
|
|
|
+ public List<PassivitySkillLvlCfg> GetValidSkills(int currentTime, int partId, int cardId, List<int> skillLvs, int targetCardId, List<int> targetSkillLvs, List<int> roundTimes, List<int> targetRoundTimes)
|
|
|
{
|
|
|
List<PassivitySkillLvlCfg> skillCfgs = new List<PassivitySkillLvlCfg>();
|
|
|
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
-
|
|
|
- int cardId = 0;
|
|
|
- int targetCardId;
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
- {
|
|
|
- cardId = InstanceZonesDataManager.currentCardId;
|
|
|
- targetCardId = fightCfg.targetCardId;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- targetCardId = InstanceZonesDataManager.currentCardId;
|
|
|
- cardId = fightCfg.targetCardId;
|
|
|
- }
|
|
|
-
|
|
|
- List<PassivitySkillCfg> mySkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardId);
|
|
|
List<PassivitySkillCfg> targetSkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(targetCardId);
|
|
|
|
|
|
List<int> nullifySkillIndex = new List<int>();
|
|
|
for (int i = 0; i < targetSkillCfgs.Count; i++)
|
|
|
{
|
|
|
- PassivitySkillCfg skillCfg = targetSkillCfgs[i];
|
|
|
- int targetSkillLv = 0;
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
- {
|
|
|
- targetSkillLv = fightCfg.targetSkillLvsArr[i];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- targetSkillLv = SkillDataManager.Instance.GetSkillLv(targetCardId, skillCfg.skillId);
|
|
|
- }
|
|
|
- PassivitySkillLvlCfg targetSkillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(targetSkillLv, skillCfg.skillId);
|
|
|
-
|
|
|
- if (targetSkillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
- || targetSkillLvlCfg.beginTime == BeginTime.PART_PREFACT_CLICK && currentTime == BeginTime.PART_PREFACT_CLICK
|
|
|
- || targetSkillLvlCfg.beginTime == BeginTime.PART_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
- || targetSkillLvlCfg.beginTime == BeginTime.PART_FIGHT_END && currentTime == BeginTime.PART_FIGHT_END
|
|
|
- || targetSkillLvlCfg.beginTime <= BeginTime.PART_SCORE_6 && currentTime == BeginTime.PART_FIGHT_BEGIN && partId == targetSkillLvlCfg.beginTime)
|
|
|
+ PassivitySkillLvlCfg targetSkillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(targetSkillLvs[i], targetSkillCfgs[i].skillId);
|
|
|
+ if (CheckIsRightTime(targetSkillLvlCfg, currentTime, partId))
|
|
|
{
|
|
|
bool isProbability = targetSkillLvlCfg.nullifySkillIndex > 0 && UnityEngine.Random.Range(0, 10000) < targetSkillLvlCfg.probability;
|
|
|
if (targetSkillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && targetRoundTimes != null && partId < targetRoundTimes[i]) isProbability = true;
|
|
@@ -324,38 +244,37 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ List<PassivitySkillCfg> mySkillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardId);
|
|
|
+
|
|
|
for (int i = 0; i < mySkillCfgs.Count; i++)
|
|
|
{
|
|
|
- PassivitySkillCfg skillCfg = mySkillCfgs[i];
|
|
|
- int mySkillLv = 0;
|
|
|
- if (roleType == RoleType.MINE)
|
|
|
- {
|
|
|
- mySkillLv = SkillDataManager.Instance.GetSkillLv(cardId, skillCfg.skillId);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- mySkillLv = fightCfg.targetSkillLvsArr[i];
|
|
|
- }
|
|
|
- PassivitySkillLvlCfg mySkillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(mySkillLv, skillCfg.skillId);
|
|
|
+ PassivitySkillLvlCfg mySkillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLvs[i], mySkillCfgs[i].skillId);
|
|
|
|
|
|
if (nullifySkillIndex.IndexOf(i + 1) >= 0) continue;//技能被对手失效
|
|
|
|
|
|
- if (mySkillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
- || mySkillLvlCfg.beginTime == BeginTime.PART_PREFACT_CLICK && currentTime == BeginTime.PART_PREFACT_CLICK
|
|
|
- || mySkillLvlCfg.beginTime == BeginTime.PART_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
- || mySkillLvlCfg.beginTime == BeginTime.PART_FIGHT_END && currentTime == BeginTime.PART_FIGHT_END
|
|
|
- || mySkillLvlCfg.beginTime <= BeginTime.PART_SCORE_6 && currentTime == BeginTime.PART_FIGHT_BEGIN && partId == mySkillLvlCfg.beginTime)
|
|
|
+ if (CheckIsRightTime(mySkillLvlCfg, currentTime, partId))
|
|
|
{
|
|
|
-
|
|
|
bool isProbability = UnityEngine.Random.Range(0, 10000) < mySkillLvlCfg.probability;
|
|
|
if (mySkillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && roundTimes != null && partId < roundTimes[i]) isProbability = true;
|
|
|
if (isProbability) skillCfgs.Add(mySkillLvlCfg);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
return skillCfgs;
|
|
|
}
|
|
|
|
|
|
+ private bool CheckIsRightTime(PassivitySkillLvlCfg skillLvlCfg, int currentTime, int partId)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (skillLvlCfg.beginTime == BeginTime.PART_ALL_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
+ || skillLvlCfg.beginTime == BeginTime.PART_PREFACT_CLICK && currentTime == BeginTime.PART_PREFACT_CLICK
|
|
|
+ || skillLvlCfg.beginTime == BeginTime.PART_FIGHT_BEGIN && currentTime == BeginTime.PART_FIGHT_BEGIN
|
|
|
+ || skillLvlCfg.beginTime == BeginTime.PART_FIGHT_END && currentTime == BeginTime.PART_FIGHT_END
|
|
|
+ || skillLvlCfg.beginTime <= BeginTime.PART_SCORE_6 && currentTime == BeginTime.PART_FIGHT_BEGIN && partId == skillLvlCfg.beginTime)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 本轮技能分数
|
|
|
/// </summary>
|
|
@@ -472,32 +391,6 @@ namespace GFGGame
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
- /// <summary>
|
|
|
- /// 0失败1优秀2完美
|
|
|
- /// </summary>
|
|
|
- /// <param name="scale"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public int GetClickType(float scale)
|
|
|
- {
|
|
|
- // float scaleX = _ui.m_comClick.m_comResult.m_imgCircle.scale.x;
|
|
|
- int clickType = ClickType.MISS_CLICK;
|
|
|
- if (FightDataManager.Instance.autoPlay == true)
|
|
|
- {
|
|
|
- return ClickType.PREFACT_CLICK;
|
|
|
- }
|
|
|
- if (scale <= _prefectScale && scale > 0.65f)
|
|
|
- {
|
|
|
- clickType = ClickType.PREFACT_CLICK;
|
|
|
- }
|
|
|
- else if (scale <= 0.216f)
|
|
|
- {
|
|
|
- clickType = ClickType.MISS_CLICK;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- clickType = ClickType.GREAT_CLICK;
|
|
|
- }
|
|
|
- return clickType;
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|