|
|
|
@ -3,7 +3,11 @@ using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using Unity.VisualScripting; |
|
|
|
using UnityEngine; |
|
|
|
using static Cinemachine.DocumentationSortingAttribute; |
|
|
|
using static Name; |
|
|
|
|
|
|
|
public class WeaponManager : Singleton<WeaponManager> |
|
|
|
{ |
|
|
|
@ -318,6 +322,116 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
return gem; |
|
|
|
} |
|
|
|
|
|
|
|
public WeaponNodeDataPair getRandomConditionWithLevel(string level) |
|
|
|
{ |
|
|
|
string condition = ""; |
|
|
|
WeaponNodeDataPair result= new WeaponNodeDataPair(); |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerBasicConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerElementaryConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerIntermediateConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerAdvancedConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string conditionValue = ""; |
|
|
|
List<string> nodesMark = new List<string>(); |
|
|
|
List<string> nodesColor = new List<string>(); |
|
|
|
conditionValue = getConditionValueWithLevel(level, ref condition, ref nodesMark, ref nodesColor); |
|
|
|
result.conditionOrResult = condition; |
|
|
|
result.value = conditionValue; |
|
|
|
result.nodesMark = nodesMark.ToArray(); |
|
|
|
result.nodesColor = nodesColor.ToArray(); |
|
|
|
result.description = Name.getGemConditionDescription(condition, conditionValue, nodesMark.ToArray(), nodesColor.ToArray()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public WeaponNodeDataPair getRandomResultWithLevel(string level) |
|
|
|
{ |
|
|
|
string condition = ""; |
|
|
|
WeaponNodeDataPair resultData = new WeaponNodeDataPair(); |
|
|
|
string result = ""; |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerBasicResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerElementaryResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerIntermediateResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerAdvancedResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
string resultValue = getResultValueWithLevel(level, ref result, Name.none, Name.none); |
|
|
|
resultData.conditionOrResult = condition; |
|
|
|
resultData.value = resultValue; |
|
|
|
resultData.description = Name.getGemResultDescription(result, resultValue); |
|
|
|
return resultData; |
|
|
|
} |
|
|
|
public GameObject getRandomAddScoreWeaponNodeForPlayerWithLevel(string level) |
|
|
|
{ |
|
|
|
GameObject gem = Instantiate(Resources.Load<GameObject>(Name.WeaponNode.PrefabPath + Name.WeaponNode.PrefabName)); |
|
|
|
string condition = ""; |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerBasicConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerElementaryConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerIntermediateConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerAdvancedConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string conditionValue = ""; |
|
|
|
List<string> nodesMark = new List<string>(); |
|
|
|
List<string> nodesColor = new List<string>(); |
|
|
|
string result = ""; |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerBasicAddScoreResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerElementaryResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerIntermediateResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerAdvancedResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string resultValue = ""; |
|
|
|
conditionValue = getConditionValueWithLevel(level, ref condition, ref nodesMark, ref nodesColor); |
|
|
|
resultValue = getResultValueWithLevel(level, ref result, condition, conditionValue); |
|
|
|
WeaponNode weaponNode = gem.GetComponent<WeaponNode>(); |
|
|
|
weaponNode.result = result; |
|
|
|
weaponNode.resultValue = resultValue; |
|
|
|
weaponNode.condition = condition; |
|
|
|
weaponNode.conditionValue = conditionValue; |
|
|
|
weaponNode.nodesMark = nodesMark.ToArray(); |
|
|
|
weaponNode.nodesColor = nodesColor.ToArray(); |
|
|
|
return gem; |
|
|
|
} |
|
|
|
public GameObject getRandomWeaponNodeForPlayerWithLevelDiff(int levelDiff) |
|
|
|
{ |
|
|
|
GameObject gem = Instantiate(Resources.Load<GameObject>(Name.WeaponNode.PrefabPath + Name.WeaponNode.PrefabName)); |
|
|
|
@ -626,16 +740,16 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "1", "2", }, 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "1" }, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "2", "3", }, 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "2", }, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "3", "4", "5" }, 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "3" }, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "4", "5" }, 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(new HashSet<string> { "4"}, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
break; |
|
|
|
@ -647,16 +761,16 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(3, 5), 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(10, 11), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(4, 6), 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(7, 9), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(5, 7), 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(5, 6), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(6, 8), 1).ElementAt(0); |
|
|
|
conditionValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(3, 4), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
break; |
|
|
|
@ -697,16 +811,16 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(3, 5), 1).ElementAt(0); |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(3, 5), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(5, 8), 1).ElementAt(0); |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(6, 8), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(9, 12), 1).ElementAt(0); |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(9, 12), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GetIntegerRangeAsStrings(14, 18), 1).ElementAt(0); |
|
|
|
part3 = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(14, 18), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
sb.Append(part3); |
|
|
|
@ -760,7 +874,7 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(3, 7), 1).ElementAt(0); |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(3, 5), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(6, 12), 1).ElementAt(0); |
|
|
|
@ -797,7 +911,7 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(1, 2), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(2, 3), 1).ElementAt(0); |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(3, 3), 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
resultValue = MathTool.GetRandomElements(MathTool.GenerateIntegerSet(4, 5), 1).ElementAt(0); |
|
|
|
@ -872,6 +986,257 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public string getWeaponNodeResultRarity(string result, string resultValue) |
|
|
|
{ |
|
|
|
string rarity=Name.none; |
|
|
|
Dictionary<string,HashSet<string>> addScoreDict = new Dictionary<string, HashSet<string>> |
|
|
|
{ { Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(5, 7) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(8, 12) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(13, 18) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(23, 30) }}; |
|
|
|
Dictionary<string, HashSet<string>> mulScoreDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(1, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(4, 6) }}; |
|
|
|
Dictionary<string, HashSet<string>> nodeCountDict = new Dictionary<string, HashSet<string>> |
|
|
|
{ { Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(3, 5) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(6, 12) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(14, 18) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(20, 25) }}; |
|
|
|
Dictionary<string, HashSet<string>> allNodeCountDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(2, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(4, 6) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(7, 9) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(10, 12) }}; |
|
|
|
Dictionary<string, HashSet<string>> drawCardDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 2) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(3, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(4, 5) }}; |
|
|
|
Dictionary<string, HashSet<string>> everyNodeAddScoreDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 1) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(2, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(4, 5) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(6, 8) }}; |
|
|
|
Dictionary<string, HashSet<string>> isIgnoreConditionDict = new Dictionary<string, HashSet<string>>(); |
|
|
|
Dictionary<string, HashSet<string>> VolcanoDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 1) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(2, 2) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(3, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(4, 4) }}; |
|
|
|
|
|
|
|
switch (result) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeFunction.addScore: |
|
|
|
foreach(KeyValuePair<string, HashSet<string>> kvp in addScoreDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity= kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.mulScore: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in mulScoreDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.repetWeaponNode: |
|
|
|
rarity = Name.WeaponNodeLevel.Advanced; |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.redNodeCount: |
|
|
|
case Name.WeaponNodeFunction.blueNodeCount: |
|
|
|
case Name.WeaponNodeFunction.yellowNodeCount: |
|
|
|
case Name.WeaponNodeFunction.mostNodeCount: |
|
|
|
case Name.WeaponNodeFunction.leastNodeCount: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in nodeCountDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.allNodeCount: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in allNodeCountDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.drawCard: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in drawCardDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyRedNodeAddScore: |
|
|
|
case Name.WeaponNodeFunction.everyYellowNodeAddScore: |
|
|
|
case Name.WeaponNodeFunction.everyBlueNodeAddScore: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in everyNodeAddScoreDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.NodeItem.Volcano: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in VolcanoDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(resultValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.isIgnoreCondition: |
|
|
|
rarity = Name.WeaponNodeLevel.Advanced; |
|
|
|
break; |
|
|
|
} |
|
|
|
return rarity; |
|
|
|
} |
|
|
|
|
|
|
|
public string getWeaponNodeConditionRarity(string condition, string conditionValue, string[] nodesColor) |
|
|
|
{ |
|
|
|
string rarity = Name.none; |
|
|
|
Dictionary<string, HashSet<string>> everyNumNodeConvertDict = new Dictionary<string, HashSet<string>> |
|
|
|
{ { Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(10, 11) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(7, 9) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(5, 6) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(3, 4) }}; |
|
|
|
Dictionary<string, HashSet<string>> cardConditionPatternDict = new Dictionary<string, HashSet<string>> |
|
|
|
{ { Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(3, 5) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(6, 8) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(9, 12) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(14, 18) }}; |
|
|
|
Dictionary<string, HashSet<string>> nodeCountDict = new Dictionary<string, HashSet<string>> |
|
|
|
{ { Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(3, 5) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(6, 12) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(14, 18) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(20, 25) }}; |
|
|
|
Dictionary<string, HashSet<string>> allNodeCountDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(2, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(4, 6) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(7, 9) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(10, 12) }}; |
|
|
|
Dictionary<string, HashSet<string>> drawCardDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 2) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(3, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(4, 5) }}; |
|
|
|
Dictionary<string, HashSet<string>> everyNodeAddScoreDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 1) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(2, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(4, 5) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(6, 8) }}; |
|
|
|
Dictionary<string, HashSet<string>> isIgnoreConditionDict = new Dictionary<string, HashSet<string>>(); |
|
|
|
Dictionary<string, HashSet<string>> VolcanoDict = new Dictionary<string, HashSet<string>>{ |
|
|
|
{ Name.WeaponNodeLevel.Basic, MathTool.GenerateIntegerSet(1, 1) }, |
|
|
|
{ Name.WeaponNodeLevel.Elementary, MathTool.GenerateIntegerSet(2, 2) }, |
|
|
|
{ Name.WeaponNodeLevel.Intermediate, MathTool.GenerateIntegerSet(3, 3) }, |
|
|
|
{ Name.WeaponNodeLevel.Advanced, MathTool.GenerateIntegerSet(4, 4) }}; |
|
|
|
Match match = System.Text.RegularExpressions.Regex.Match(condition, Name.Regex.cardConditionPattern); |
|
|
|
if (match.Success) |
|
|
|
{ |
|
|
|
string firstPart = match.Groups[1].Value; // 第一部分
|
|
|
|
string op = match.Groups[2].Value; // 运算符部分
|
|
|
|
string secondPart = match.Groups[3].Value; // 第二部分
|
|
|
|
int firstPartCount = CardManager.Instance.evaluateExpression(firstPart); |
|
|
|
int secondPartCount = CardManager.Instance.evaluateExpression(secondPart); |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in cardConditionPatternDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(secondPart)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
return rarity; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
switch (condition) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeCondition.everyNumNodeConvert: |
|
|
|
foreach (KeyValuePair<string, HashSet<string>> kvp in everyNumNodeConvertDict) |
|
|
|
{ |
|
|
|
if (kvp.Value.Contains(conditionValue)) |
|
|
|
{ |
|
|
|
rarity = kvp.Key; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeCondition.node: |
|
|
|
if (nodesColor.Length == 3) |
|
|
|
{ |
|
|
|
rarity = Name.WeaponNodeLevel.Basic; |
|
|
|
} |
|
|
|
else if (nodesColor.Length == 4) |
|
|
|
{ |
|
|
|
rarity = Name.WeaponNodeLevel.Elementary; |
|
|
|
} |
|
|
|
else if (nodesColor.Length == 5) |
|
|
|
{ |
|
|
|
rarity = Name.WeaponNodeLevel.Intermediate; |
|
|
|
} |
|
|
|
else if (nodesColor.Length == 6) |
|
|
|
{ |
|
|
|
rarity = Name.WeaponNodeLevel.Advanced; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return rarity; |
|
|
|
} |
|
|
|
|
|
|
|
public string getRarityWithLevelDiff(string rarity,int levelDiff) |
|
|
|
{ |
|
|
|
string newRarity = ""; |
|
|
|
switch (rarity) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
if (levelDiff == 0) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Basic; |
|
|
|
}else if (levelDiff == 1) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Elementary; |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
if (levelDiff == 0) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Elementary; |
|
|
|
} |
|
|
|
else if (levelDiff == 1) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Intermediate; |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
if (levelDiff == 0) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Intermediate; |
|
|
|
} |
|
|
|
else if (levelDiff == 1) |
|
|
|
{ |
|
|
|
newRarity = Name.WeaponNodeLevel.Advanced; |
|
|
|
} |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
newRarity = Name.WeaponNodeLevel.Advanced; |
|
|
|
break; |
|
|
|
} |
|
|
|
return newRarity; |
|
|
|
} |
|
|
|
|
|
|
|
public void ClearAllChildren(Transform parent) |
|
|
|
{ |
|
|
|
// ������ʱ�б��洢�����壨������ѭ�����ļ��ϣ�
|
|
|
|
|