void think() { stepCounter++; pathData.Push(next); correctPath.Push(next); if (!currentMap.statusOfCurrentPosition(next).Equals("isMainHost")) { if (stepCounter > 10) { if (currentMap.statusOfCurrentPosition(next).Equals("isHost")) { success = true; attackerIdentity.setSuccessful(); sendPathToGameData(); gameHealth.loseWealth(30); return; } } next = currentMap.getNextPosition(next, pathData); if (next.Equals("err")) { correctPath.Pop(); next = correctPath.Pop(); } } else { success = true; attackerIdentity.setSuccessful(); sendPathToGameData(); gameHealth.loseWealth(50); return; } }
public void setMarked(string location) { if (marked && !locationsVisited.Contains(location)) { health.loseWealth(5); formData.citizenStopped(); sendDestroyedCitizenToGameData(); Destroy(gameObject); } else { marked = true; renderers[2].gameObject.SetActive(true); renderers[1].gameObject.SetActive(false); locationsVisited.Push(location); } }