|
|
|
@ -3,11 +3,13 @@ using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Drawing.Imaging; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using TMPro; |
|
|
|
using Unity.VisualScripting; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.EventSystems; |
|
|
|
using UnityEngine.SocialPlatforms.Impl; |
|
|
|
using UnityEngine.UI; |
|
|
|
using UnityEngine.UIElements; |
|
|
|
using static TMPro.SpriteAssetUtilities.TexturePacker_JsonArray; |
|
|
|
@ -403,6 +405,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
|
|
|
|
public void SingleFunctionSettleForAwake() |
|
|
|
{ |
|
|
|
settleCount++; |
|
|
|
switch (result) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeFunction.addScoreThisTurn: |
|
|
|
@ -917,6 +920,11 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
|
|
|
|
public void OnPointerEnter(PointerEventData eventData) |
|
|
|
{ |
|
|
|
resultDescription = Name.getGemResultDescription(result, resultValue); |
|
|
|
conditionDescription = Name.getGemConditionDescription(condition, conditionValue, nodesMark, nodesColor); |
|
|
|
resetConditionDes(); |
|
|
|
resetResultDes(); |
|
|
|
SetUpInforText(); |
|
|
|
isOn = true; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1018,4 +1026,110 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra |
|
|
|
bagWeaponNode.isGemImage = condition.Equals(Name.WeaponNodeCondition.node); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void resetConditionDes() |
|
|
|
{ |
|
|
|
if (!Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
sb.Append(conditionDescription); |
|
|
|
string num = ""; |
|
|
|
switch (condition) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeCondition.everyNumNodeConvert: |
|
|
|
num = MapUnityManager.Instance.switchNodeNum.ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeCondition.everyRedNodeConvert: |
|
|
|
num = MapUnityManager.Instance.switchRedNodeNum.ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeCondition.everyBlueNodeConvert: |
|
|
|
num = MapUnityManager.Instance.switchBlueNodeNum.ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeCondition.everyYellowNodeConvert: |
|
|
|
num = MapUnityManager.Instance.switchYellowNodeNum.ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeCondition.bombbomb: |
|
|
|
num = settleCount.ToString(); |
|
|
|
break; |
|
|
|
} |
|
|
|
sb.Append("("); |
|
|
|
sb.Append(num); |
|
|
|
sb.Append(')'); |
|
|
|
conditionDescription=sb.ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
public void resetResultDes() |
|
|
|
{ |
|
|
|
if (!(Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition)||Name.WeaponNodeFunction.EveryResultSet.Contains(result))) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
sb.Append(resultDescription); |
|
|
|
string num = ""; |
|
|
|
int settleCoefficient = 1; |
|
|
|
if (settleCount != 0) |
|
|
|
{ |
|
|
|
settleCoefficient=settleCount; |
|
|
|
} |
|
|
|
switch (result) |
|
|
|
{ |
|
|
|
|
|
|
|
case Name.WeaponNodeFunction.everyRedNodeAddScore: |
|
|
|
int redNodeCount = getNodeTools.getNodesCount(Name.Color.Red); |
|
|
|
num = (settleCoefficient*redNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyYellowNodeAddScore: |
|
|
|
int yellowNodeCount = getNodeTools.getNodesCount(Name.Color.Yellow); |
|
|
|
num = (settleCoefficient * yellowNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyBlueNodeAddScore: |
|
|
|
int blueNodeCount = getNodeTools.getNodesCount(Name.Color.Blue); |
|
|
|
num = (settleCoefficient * blueNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyBlackNodeAddScore: |
|
|
|
int blackNodeCount = getNodeTools.getNodesCount(Name.Color.Black); |
|
|
|
num = (settleCoefficient * blackNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyHolyNodeAddScore: |
|
|
|
int holyNodeCount = getNodeTools.getNodesCount(Name.Color.Holy); |
|
|
|
num = (settleCoefficient * holyNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyBombAddScore: |
|
|
|
int bombCount = 0; |
|
|
|
foreach (MapUnity nodeB in getNodeTools.getAllNodes()) |
|
|
|
{ |
|
|
|
if (nodeB.blockNode != null && nodeB.blockNode is Bomb) |
|
|
|
{ |
|
|
|
bombCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
num = (bombCount * int.Parse(resultValue)).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.everyBelieverAddScore: |
|
|
|
int believerCount = 0; |
|
|
|
foreach (MapUnity nodeC in getNodeTools.getAllNodes()) |
|
|
|
{ |
|
|
|
if (nodeC.blockNode != null && nodeC.blockNode is Believer) |
|
|
|
{ |
|
|
|
believerCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
num = (believerCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString(); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeFunction.addScoreThisTurn: |
|
|
|
num=turnScore.ToString(); |
|
|
|
break; |
|
|
|
default: |
|
|
|
num = (settleCount * int.Parse(resultValue)).ToString(); |
|
|
|
break; |
|
|
|
} |
|
|
|
sb.Append("("); |
|
|
|
sb.Append(num); |
|
|
|
sb.Append(')'); |
|
|
|
resultDescription = sb.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|