|
|
|
@ -103,7 +103,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
Debug.Log("结算成功节点1"); |
|
|
|
//score = 0;
|
|
|
|
//scoreMul = 0f;
|
|
|
|
score += turnScore; |
|
|
|
|
|
|
|
if (isIgnoreCondition||ConditionCheck(position)) |
|
|
|
{ |
|
|
|
Debug.Log("结算成功节点2"+"位置"+position); |
|
|
|
@ -118,6 +118,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
score += turnScore; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void SettleWeaponNodeForPlayerTurnEnd(int position) |
|
|
|
@ -149,6 +150,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
extraMostNodeCount = 0; |
|
|
|
extraLeastNodeCount = 0; |
|
|
|
extraAllNodeCount = 0; |
|
|
|
turnScore = 0; |
|
|
|
Debug.Log("结算成功节点3"); |
|
|
|
string[] keys = result.Split("_"); |
|
|
|
for (int j = 0; j < keys.Length; j++) |
|
|
|
@ -255,6 +257,23 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
public void SingleFunctionSettle(string result, string resultValue,ref int score) |
|
|
|
{ |
|
|
|
//score += turnScore;
|
|
|
|
if (condition.Equals(Name.WeaponNodeCondition.everyNumNodeConvert)) |
|
|
|
{ |
|
|
|
for (int i = 0; i < MapUnityManager.Instance.switchNodeNum / int.Parse(conditionValue); i++) |
|
|
|
{ |
|
|
|
BasicSingleFunctionSettle(result, resultValue,ref score); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
BasicSingleFunctionSettle(result, resultValue, ref score); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void BasicSingleFunctionSettle(string result, string resultValue, ref int score) |
|
|
|
{ |
|
|
|
switch (result) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeFunction.addScore: |
|
|
|
@ -262,7 +281,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
Debug.Log("score=" + score); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.mulScore: |
|
|
|
score = (int)(score*(1+float.Parse(resultValue))); |
|
|
|
score = (int)(score * (1 + float.Parse(resultValue))); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.redNodeCount: |
|
|
|
extraRedNodeCount += int.Parse(resultValue); |
|
|
|
@ -295,7 +314,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
Transform weaponSlot = WeaponManager.Instance.playerWeaponNodeList.GetChild(int.Parse(resultValue)); |
|
|
|
Transform weaponNode = weaponSlot.GetChild(0); |
|
|
|
WeaponNode node = weaponNode.transform.GetComponent<WeaponNode>(); |
|
|
|
SingleFunctionSettle(node.result, node.resultValue,ref score); |
|
|
|
SingleFunctionSettle(node.result, node.resultValue, ref score); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyRedNodeAddScore: |
|
|
|
int redNodeCount = getNodeTools.getNodesCount(Name.Color.Red); |
|
|
|
@ -319,9 +338,9 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyBombAddScore: |
|
|
|
int bombCount = 0; |
|
|
|
foreach(MapUnity nodeB in getNodeTools.getAllNodes()) |
|
|
|
foreach (MapUnity nodeB in getNodeTools.getAllNodes()) |
|
|
|
{ |
|
|
|
if(nodeB.blockNode!=null&& nodeB.blockNode is Bomb) |
|
|
|
if (nodeB.blockNode != null && nodeB.blockNode is Bomb) |
|
|
|
{ |
|
|
|
bombCount++; |
|
|
|
} |
|
|
|
@ -340,10 +359,10 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
score += believerCount * int.Parse(resultValue); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.addScoreThisTurn: |
|
|
|
turnScore+= int.Parse(resultValue); |
|
|
|
turnScore += int.Parse(resultValue); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.bomb: |
|
|
|
foreach(MapUnity nodeC in MathTool.GetRandomElements(getNodeTools.getAllNodes(), int.Parse(resultValue))) |
|
|
|
foreach (MapUnity nodeC in MathTool.GetRandomElements(getNodeTools.getAllNodes(), int.Parse(resultValue))) |
|
|
|
{ |
|
|
|
CardManager.Instance.setItemForSingeNode(Name.NodeItem.Bomb, nodeC, Name.itemBelong.none); |
|
|
|
} |
|
|
|
@ -546,7 +565,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
if(MapUnityManager.Instance.switchNodeNum>= int.Parse(conditionValue)) |
|
|
|
{ |
|
|
|
check=true; |
|
|
|
MapUnityManager.Instance.switchNodeNum-= int.Parse(conditionValue); |
|
|
|
//MapUnityManager.Instance.switchNodeNum-= int.Parse(conditionValue);
|
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|