|
|
|
@ -44,7 +44,7 @@ public class getNodeTools |
|
|
|
public static void playerMoveToNextNode(MapUnity mapNode) |
|
|
|
{ |
|
|
|
//角色移动
|
|
|
|
if ( mapNode.blocked == false) |
|
|
|
/*if ( mapNode.blocked == false) |
|
|
|
{ |
|
|
|
if (GameManager.Instance.playerOn != null) |
|
|
|
{ |
|
|
|
@ -61,24 +61,12 @@ public class getNodeTools |
|
|
|
GameManager.Instance.playerOn = mapNode; |
|
|
|
GameObject playerObject = GameObject.Find("player"); |
|
|
|
playerObject.transform.position = new Vector3(mapNode.transform.position.x, 0.5f, mapNode.transform.position.z); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
public static void playerTeleportToNode(MapUnity mapNode) |
|
|
|
{ |
|
|
|
//角色移动
|
|
|
|
if (mapNode.blocked == false ) |
|
|
|
{ |
|
|
|
if (GameManager.Instance.playerOn != null) |
|
|
|
{ |
|
|
|
GameManager.Instance.playerOn.playerOn = false; |
|
|
|
GameManager.Instance.playerOn.effectInfluenced = false; |
|
|
|
} |
|
|
|
mapNode.playerOn = true; |
|
|
|
GameManager.Instance.playerOn = mapNode; |
|
|
|
GameObject playerObject = GameObject.Find("player"); |
|
|
|
playerObject.transform.position = new Vector3(mapNode.transform.position.x, 0.5f, mapNode.transform.position.z); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static void RandomPollute(HashSet<MapUnity> set, int num) |
|
|
|
@ -247,17 +235,6 @@ public class getNodeTools |
|
|
|
public static HashSet<MapUnity> getAllNodesExceptEnemyAndPlayer() |
|
|
|
{ |
|
|
|
HashSet<MapUnity> set = new HashSet<MapUnity>(); |
|
|
|
for (int i = 0; i < GameManager.Instance.X.Count; i++) |
|
|
|
{ |
|
|
|
for (int j = 0; j < GameManager.Instance.X[i].Y.Count; j++) |
|
|
|
{ |
|
|
|
if ( !GameManager.Instance.X[i].Y[j].Equals(GameManager.Instance.playerOn)) |
|
|
|
{ |
|
|
|
set.Add(GameManager.Instance.X[i].Y[j]); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return set; |
|
|
|
} |
|
|
|
|
|
|
|
@ -335,17 +312,17 @@ public class getNodeTools |
|
|
|
|
|
|
|
public static int getPlayerAroundNodesCount(string color) |
|
|
|
{ |
|
|
|
MapUnity playerNode = GameManager.Instance.playerOn; |
|
|
|
HashSet<MapUnity> set = new HashSet<MapUnity> { playerNode }; |
|
|
|
getCircleNode(set, 1); |
|
|
|
//MapUnity playerNode = GameManager.Instance.playerOn;
|
|
|
|
//HashSet<MapUnity> set = new HashSet<MapUnity> { playerNode };
|
|
|
|
//getCircleNode(set, 1);
|
|
|
|
int colorCount = 0; |
|
|
|
foreach(MapUnity mapUnity in set) |
|
|
|
/*foreach(MapUnity mapUnity in set) |
|
|
|
{ |
|
|
|
if (mapUnity.whoColour.Equals(Name.stringAroundColorToint(color))) |
|
|
|
{ |
|
|
|
colorCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return colorCount; |
|
|
|
} |
|
|
|
|
|
|
|
@ -391,10 +368,6 @@ public class getNodeTools |
|
|
|
return canPass; |
|
|
|
} |
|
|
|
/*if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))*/ |
|
|
|
if (currentNode.Equals(GameManager.Instance.playerOn)) |
|
|
|
{ |
|
|
|
canPass = false; |
|
|
|
} |
|
|
|
|
|
|
|
if (canPass) |
|
|
|
{ |
|
|
|
@ -411,10 +384,6 @@ public class getNodeTools |
|
|
|
canPass = false; |
|
|
|
return canPass; |
|
|
|
} |
|
|
|
if (currentNode.Equals(GameManager.Instance.playerOn)) |
|
|
|
{ |
|
|
|
canPass = false; |
|
|
|
} |
|
|
|
|
|
|
|
if (canPass) |
|
|
|
{ |
|
|
|
@ -710,9 +679,10 @@ public class getNodeTools |
|
|
|
bool canPass = false; |
|
|
|
HashSet<MapUnity> shootAbleSet = new HashSet<MapUnity>(); |
|
|
|
shootAbleSet.Add(currentNode); |
|
|
|
canAttack = true; |
|
|
|
getCircleNodeForRemoteAttack(shootAbleSet,attackRange); |
|
|
|
Debug.Log("shootAbleSet大小是" + shootAbleSet.Count); |
|
|
|
if (shootAbleSet.Contains(GameManager.Instance.playerOn)) |
|
|
|
/*if (shootAbleSet.Contains(GameManager.Instance.playerOn)) |
|
|
|
{ |
|
|
|
inShootRange = true; |
|
|
|
} |
|
|
|
@ -724,7 +694,7 @@ public class getNodeTools |
|
|
|
if (Usermanager.playerAbnormalCondition.ContainsKey(AbnormalCondition.Invisible)) |
|
|
|
{ |
|
|
|
canAttack = false; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return canAttack; |
|
|
|
} |
|
|
|
|
|
|
|
@ -735,7 +705,7 @@ public class getNodeTools |
|
|
|
bool canPass = false; |
|
|
|
HashSet<MapUnity> shootAbleSet = new HashSet<MapUnity>(); |
|
|
|
shootAbleSet.Add(currentNode); |
|
|
|
getCircleNodeForRemoteAttack(shootAbleSet, attackRange); |
|
|
|
/*getCircleNodeForRemoteAttack(shootAbleSet, attackRange); |
|
|
|
Debug.Log("shootAbleSet大小是" + shootAbleSet.Count); |
|
|
|
if (shootAbleSet.Contains(GameManager.Instance.playerOn)) |
|
|
|
{ |
|
|
|
@ -745,7 +715,7 @@ public class getNodeTools |
|
|
|
if (canPass && inShootRange) |
|
|
|
{ |
|
|
|
canAttack = true; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return canAttack; |
|
|
|
} |
|
|
|
|
|
|
|
@ -762,8 +732,8 @@ public class getNodeTools |
|
|
|
|
|
|
|
public static void setEffectRangePreview(string effectRange, float euler, MapUnity currentNode,CardEntity cardEntity) |
|
|
|
{ |
|
|
|
MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>(); |
|
|
|
Debug.Log("½Ç¶ÈÊÇ"+euler); |
|
|
|
//MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>();
|
|
|
|
/*Debug.Log("½Ç¶ÈÊÇ"+euler); |
|
|
|
var handlers = new Dictionary<string, EffectRangeHandler> |
|
|
|
{ |
|
|
|
{EffectRange.range1,new EffectRangeHandler1(currentNode,euler) }, |
|
|
|
@ -812,7 +782,7 @@ public class getNodeTools |
|
|
|
if (handlers.TryGetValue(effectRange, out var handler)) |
|
|
|
{ |
|
|
|
cardEntity.influencePreviewPool = handler.HandleAngleWithResult(euler); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
//cardEntity.influencePreviewPool=MathTool.RemoveDuplicates(cardEntity.influencePreviewPool);
|
|
|
|
/* if (effectRange.Equals(EffectRange.range8_2) || effectRange.Equals(EffectRange.range6_3)) |
|
|
|
{ |
|
|
|
@ -909,7 +879,7 @@ public class getNodeTools |
|
|
|
|
|
|
|
public static HashSet<MapUnity> setEffectRangePreviewNoCard(string effectRange, float euler, MapUnity currentNode) |
|
|
|
{ |
|
|
|
MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>(); |
|
|
|
/*MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>(); |
|
|
|
var handlers = new Dictionary<string, EffectRangeHandler> |
|
|
|
{ |
|
|
|
{EffectRange.range1,new EffectRangeHandler1(currentNode,euler) }, |
|
|
|
@ -930,14 +900,14 @@ public class getNodeTools |
|
|
|
{EffectRange.range7_2,new EffectRangeHandler7_2(currentNode,euler) }, |
|
|
|
{EffectRange.range8_1,new EffectRangeHandler8_1(currentNode,euler) }, |
|
|
|
{EffectRange.range8_2,new EffectRangeHandler8_2(playerOnNode,euler) }, |
|
|
|
}; |
|
|
|
};*/ |
|
|
|
|
|
|
|
HashSet<MapUnity> influencePreviewPool = new HashSet<MapUnity>(); |
|
|
|
|
|
|
|
if (handlers.TryGetValue(effectRange, out var handler)) |
|
|
|
/*if (handlers.TryGetValue(effectRange, out var handler)) |
|
|
|
{ |
|
|
|
influencePreviewPool = handler.HandleAngleWithResult(euler); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
return influencePreviewPool; |
|
|
|
} |
|
|
|
|