diff --git a/Assets/Scripts/jatekmanager.cs b/Assets/Scripts/jatekmanager.cs index 4d61fde..0b3fc6d 100644 --- a/Assets/Scripts/jatekmanager.cs +++ b/Assets/Scripts/jatekmanager.cs @@ -177,6 +177,7 @@ public class jatekmanager : MonoBehaviour public void Pause() { + uzenetBox.text = "A játék meg lett állítva"; pauseMenuUI.SetActive(true); //ido megallitasa hogy megalljon a jatek SetTimeScale(0f); @@ -263,6 +264,7 @@ public class jatekmanager : MonoBehaviour private async void HandleUgynokValasztas() { + uzenetBox.text = "Válaszd ki az ügynökcsapat létszámát, az egyik kockára nyomva. (a kisebb választása 1 energia vesztésével jár)"; //kapcsolja ki addig a mezoket amig nem valasztott ugynokcsapat szamot movement.oneone_Collider.gameObject.SetActive(false); movement.onetwo_Collider.gameObject.SetActive(false); @@ -289,6 +291,8 @@ public class jatekmanager : MonoBehaviour private async void HandleNev() { + uzenetBox.text = "Írd be a neved a név mezőbe"; + movement.oneone_Collider.gameObject.SetActive(false); movement.onetwo_Collider.gameObject.SetActive(false); movement.onethree_Collider.gameObject.SetActive(false); @@ -320,6 +324,7 @@ public class jatekmanager : MonoBehaviour private async void HandleFejlesztes() { + uzenetBox.text = "Válassz fejlesztést"; energiafejlesztés.SetActive(true); akciofejlesztés.SetActive(true); harcfejlesztés.SetActive(true); @@ -337,6 +342,7 @@ public class jatekmanager : MonoBehaviour private async void HandleAkcio() { + uzenetBox.text = "Válassz akciókat!"; //itt a movement bekapcsol kovetkezokor.SetActive(true); betarazas.SetActive(true); diff --git a/Assets/Scripts/movement.cs b/Assets/Scripts/movement.cs index 44cb4c8..5169974 100644 --- a/Assets/Scripts/movement.cs +++ b/Assets/Scripts/movement.cs @@ -279,19 +279,27 @@ public class movement : MonoBehaviour ugynok.setElozoHelyszin(jelenlegi_x, jelenlegi_y); } - public void Update() + public void Ujmovement() { - tavolsag = math.abs(tavolsag); ugynok.ugynokMegolveElozoHelyen(); // player mozgatasa es konzolra iratas if (Input.GetKeyDown(KeyCode.Mouse0) && oneone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) + Debug.Log("Player clicked on the collider: " + oneone_Collider.gameObject.name); + tavolsag = math.abs((1) - jelenlegi_x) + math.abs((1) - jelenlegi_y); + if (eromulepes1.activeSelf == true & eromulepes2.activeSelf == true) { - for (int y = 0; y < h; y++) + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) { - if (helyek[y, x].Equals("oneone")) + player.transform.position = oneone.transform.position; + jelenlegi_x = 1; + jelenlegi_y = 1; + if (targyak.lathatatlanOltozetAktivalva) { Debug.Log("Player clicked on the collider: " + oneone_Collider.gameObject.name); tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); @@ -344,23 +352,46 @@ public class movement : MonoBehaviour } } } + else + { + eromulepes1.SetActive(true); + moveCounter++; + eromulepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } } + } if (Input.GetKeyDown(KeyCode.Mouse0) && twoone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) + Debug.Log("Player clicked on the collider: " + twoone_Collider.gameObject.name); + tavolsag = math.abs((2) - jelenlegi_x) + math.abs((1) - jelenlegi_y); + if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) { - for (int y = 0; y < h; y++) + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) { - if (helyek[y, x].Equals("twoone")) + if (jelenlegi_x == 1 && jelenlegi_y == 2) { - Debug.Log("Player clicked on the collider: " + twoone_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) + tavolsag = 2; + } + if (twoonecount < 2) + { + player.transform.position = twoone.transform.position; + jelenlegi_x = 2; + jelenlegi_y = 1; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -414,25 +445,59 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } } - + twoonecount = twoonecount + 1; + Debug.Log(ap.akciopont); Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + if (feketepiaclepes1.activeSelf == true) + { + feketepiaclepes2.SetActive(true); + moveCounter++; + feketepiaclepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + feketepiaclepes1.SetActive(true); + moveCounter++; + feketepiaclepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); } + else + { + Debug.Log("Maximum ketszer lephetsz egy mez?re"); + } + } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } } } if (Input.GetKeyDown(KeyCode.Mouse0) && threeone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) + + Debug.Log("Player clicked on the collider: " + threeone_Collider.gameObject.name); + tavolsag = math.abs((3) - jelenlegi_x) + math.abs((1) - jelenlegi_y); + if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) { - for (int y = 0; y < h; y++) + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) { - if (helyek[y, x].Equals("threeone")) + if (threeonecount < 2) { - Debug.Log("Player clicked on the collider: " + threeone_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) + player.transform.position = threeone.transform.position; + jelenlegi_x = 3; + jelenlegi_y = 1; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -482,26 +547,84 @@ public class movement : MonoBehaviour { Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } + threeonecount++; + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + if (metrolepes1.activeSelf == true) + { + metrolepes2.SetActive(true); + moveCounter++; + metrolepes2.GetComponent().text = moveCounter.ToString(); } + else + { + metrolepes1.SetActive(true); + moveCounter++; + metrolepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); + } } + } if (Input.GetKeyDown(KeyCode.Mouse0) && onetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("onetwo")) - { - Debug.Log("Player clicked on the collider: " + onetwo_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + onetwo_Collider.gameObject.name); + tavolsag = math.abs((1) - jelenlegi_x) + math.abs((2) - jelenlegi_y); + + if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (jelenlegi_x == 2 && jelenlegi_y == 1) + { + tavolsag = 2; + } + if (onetwocount < 2) + { + player.transform.position = onetwo.transform.position; + jelenlegi_x = 1; + jelenlegi_y = 2; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; + } + else + { + //ap.akciopont = ap.akciopont - tavolsag; + ap.UpdateAkciopont(-tavolsag); + } + onetwocount++; + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + if (szervereklepes1.activeSelf == true) + { + szervereklepes2.SetActive(true); + moveCounter++; + szervereklepes2.GetComponent().text = moveCounter.ToString(); } else { @@ -556,25 +679,43 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + } if (Input.GetKeyDown(KeyCode.Mouse0) && twotwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("twotwo")) - { - Debug.Log("Player clicked on the collider: " + twotwo_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + twotwo_Collider.gameObject.name); + tavolsag = math.abs((2) - jelenlegi_x) + math.abs((2) - jelenlegi_y); + + if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (twotwocount < 2) + { + player.transform.position = twotwo.transform.position; + jelenlegi_x = 2; + jelenlegi_y = 2; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -625,26 +766,67 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + twotwocount++; + if (kingcasinolepes1.activeSelf == true) + { + kingcasinolepes2.SetActive(true); + moveCounter++; + kingcasinolepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + kingcasinolepes1.SetActive(true); + moveCounter++; + kingcasinolepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + + } if (Input.GetKeyDown(KeyCode.Mouse0) && threetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("threetwo")) - { - Debug.Log("Player clicked on the collider: " + threetwo_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + threetwo_Collider.gameObject.name); + tavolsag = math.abs((3) - jelenlegi_x) + math.abs((2) - jelenlegi_y); + + if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (jelenlegi_x == 2 && jelenlegi_y == 3) + { + tavolsag = 2; + } + if (threetwocount < 2) + { + player.transform.position = threetwo.transform.position; + jelenlegi_x = 3; + jelenlegi_y = 2; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -699,26 +881,63 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + threetwocount++; + if (feltoltolepes1.activeSelf == true) + { + feltoltolepes2.SetActive(true); + moveCounter++; + feltoltolepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + feltoltolepes1.SetActive(true); + moveCounter++; + feltoltolepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + + } if (Input.GetKeyDown(KeyCode.Mouse0) && onethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("onethree")) - { - Debug.Log("Player clicked on the collider: " + onethree_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + onethree_Collider.gameObject.name); + tavolsag = math.abs((1) - jelenlegi_x) + math.abs((3) - jelenlegi_y); + + if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (onethreecount < 2) + { + player.transform.position = onethree.transform.position; + jelenlegi_x = 1; + jelenlegi_y = 3; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -769,26 +988,67 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } } - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + onethreecount++; + if (kutatolaborlepes1.activeSelf == true) + { + kutatolaborlepes2.SetActive(true); + moveCounter++; + kutatolaborlepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + kutatolaborlepes1.SetActive(true); + moveCounter++; + kutatolaborlepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); + } } + + } if (Input.GetKeyDown(KeyCode.Mouse0) && twothree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("twothree")) - { - Debug.Log("Player clicked on the collider: " + twothree_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + twothree_Collider.gameObject.name); + tavolsag = math.abs((2) - jelenlegi_x) + math.abs((3) - jelenlegi_y); + + if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (jelenlegi_x == 3 && jelenlegi_y == 2) + { + tavolsag = 2; + } + if (twothreecount < 2) + { + player.transform.position = twothree.transform.position; + jelenlegi_x = 2; + jelenlegi_y = 3; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -843,27 +1103,64 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + twothreecount++; + if (kriptoklublepes1.activeSelf == true) + { + kriptoklublepes2.SetActive(true); + moveCounter++; + kriptoklublepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + kriptoklublepes1.SetActive(true); + moveCounter++; + kriptoklublepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + + + } if (Input.GetKeyDown(KeyCode.Mouse0) && threethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[x, y].Equals("threethree")) - { - Debug.Log("Player clicked on the collider: " + threethree_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + threethree_Collider.gameObject.name); + tavolsag = math.abs((3) - jelenlegi_x) + math.abs((3) - jelenlegi_y); + + if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (threethreecount < 2) + { + player.transform.position = threethree.transform.position; + jelenlegi_x = 3; + jelenlegi_y = 3; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -914,26 +1211,63 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + threethreecount++; + if (cyberplazalepes1.activeSelf == true) + { + cyberplazalepes2.SetActive(true); + moveCounter++; + cyberplazalepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + cyberplazalepes1.SetActive(true); + moveCounter++; + cyberplazalepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + + } if (Input.GetKeyDown(KeyCode.Mouse0) && onefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("onefour")) - { - Debug.Log("Player clicked on the collider: " + onefour_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + onefour_Collider.gameObject.name); + tavolsag = math.abs((1) - jelenlegi_x) + math.abs((4) - jelenlegi_y); + + if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (onefourcount < 2) + { + player.transform.position = onefour.transform.position; + jelenlegi_x = 1; + jelenlegi_y = 4; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -984,26 +1318,63 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); } } - + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + onefourcount++; + if (hadiuzemlepes1.activeSelf == true) + { + hadiuzemlepes2.SetActive(true); + moveCounter++; + hadiuzemlepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + hadiuzemlepes1.SetActive(true); + moveCounter++; + hadiuzemlepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mez?n belul akarsz lepni"); + } } + + } if (Input.GetKeyDown(KeyCode.Mouse0) && twofour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("twofour")) - { - Debug.Log("Player clicked on the collider: " + twofour_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); - if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) + Debug.Log("Player clicked on the collider: " + twofour_Collider.gameObject.name); + tavolsag = math.abs((2) - jelenlegi_x) + math.abs((4) - jelenlegi_y); + + if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (twofourcount < 2) + { + player.transform.position = twofour.transform.position; + jelenlegi_x = 2; + jelenlegi_y = 4; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; } else { @@ -1054,25 +1425,79 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + twofourcount++; + if (konyvtarlepes1.activeSelf == true) + { + konyvtarlepes2.SetActive(true); + moveCounter++; + konyvtarlepes2.GetComponent().text = moveCounter.ToString(); + } + else + { + konyvtarlepes1.SetActive(true); + moveCounter++; + konyvtarlepes1.GetComponent().text = moveCounter.ToString(); + } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + } if (Input.GetKeyDown(KeyCode.Mouse0) && threefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) { - for (int x = 0; x < w; x++) - { - for (int y = 0; y < h; y++) - { - if (helyek[y, x].Equals("threefour")) - { - Debug.Log("Player clicked on the collider: " + threefour_Collider.gameObject.name); - tavolsag = math.abs((x + 1) - jelenlegi_x) + math.abs((y + 1) - jelenlegi_y); + Debug.Log("Player clicked on the collider: " + threefour_Collider.gameObject.name); + tavolsag = math.abs((3) - jelenlegi_x) + math.abs((4) - jelenlegi_y); - if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) + if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); + } + else + { + if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) + { + if (threefourcount < 2) + { + player.transform.position = threefour.transform.position; + jelenlegi_x = 3; + jelenlegi_y = 4; + if (targyak.lathatatlanOltozetAktivalva) { - Debug.Log("Maximum ketszer lephetsz egy mezore"); + targyak.lathatatlanOltozetAktivalva = false; + } + else + { + //ap.akciopont = ap.akciopont - tavolsag; + ap.UpdateAkciopont(-tavolsag); + } + Debug.Log(ap.akciopont); + Debug.Log("ugynok sorsolas"); + //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); + jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott + dice.CallRenderDice(true); + ugynok.ugynokMegolveElozoHelyen(); + threefourcount++; + if (korhazlepes1.activeSelf == true) + { + korhazlepes2.SetActive(true); + moveCounter++; + korhazlepes2.GetComponent().text = moveCounter.ToString(); } else { @@ -1123,9 +1548,19 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } + jatekmanager.JatekosVesztett(); + } + else + { + Debug.Log("Maximum ketszer lephetsz egy mezore"); } } + else + { + Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); + } } + } } } \ No newline at end of file