update
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ public class Dice : MonoBehaviour {
|
||||
public int[] diceResult = { 0, 0 };
|
||||
public List<int> ujertek = new List<int>();
|
||||
public int valasztottErtek; //a jatekos altal valasztott dobott ertek helye
|
||||
private bool locked = false; //ne lehessen ujra kivalasztani a masikat ha mar tortent egy valasztas
|
||||
[SerializeField] private bool locked = false; //ne lehessen ujra kivalasztani a masikat ha mar tortent egy valasztas
|
||||
public bool adrenalinMegerosites = false;
|
||||
public GameObject adrenalinHasznalat;
|
||||
public Button confirm;
|
||||
@@ -41,7 +41,7 @@ public class Dice : MonoBehaviour {
|
||||
public bool dobottEgyszer = false; //tudjon ujra dobni vagy nem
|
||||
public int ujradobasszamlalo;
|
||||
|
||||
private bool ugynokDobasErtek = false; //ertek valasztashoz hogy tudja az ugynok csapat miatt lett meghivva
|
||||
[SerializeField] private bool ugynokDobasErtek = false; //ertek valasztashoz hogy tudja az ugynok csapat miatt lett meghivva
|
||||
private bool elsoDobas = true;
|
||||
private void Awake() {
|
||||
upgrade = FindObjectOfType<Upgrade>();
|
||||
@@ -95,7 +95,6 @@ public class Dice : MonoBehaviour {
|
||||
}else{
|
||||
//ugynok csapat szama
|
||||
ugynok.UgynokSorsolas(movement.jelenlegi_x, movement.jelenlegi_y, valasztottErtek);
|
||||
|
||||
//-1 energia
|
||||
energiasav.csokkenEnergia(1);
|
||||
|
||||
@@ -108,7 +107,7 @@ public class Dice : MonoBehaviour {
|
||||
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio);
|
||||
}else{
|
||||
//ugynok csapat szama
|
||||
ugynok.UgynokSorsolas(movement.jelenlegi_x, movement.jelenlegi_y, valasztottErtek);
|
||||
ugynok.UgynokSorsolas(movement.jelenlegi_x, movement.jelenlegi_y, valasztottErtek);
|
||||
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio);
|
||||
}
|
||||
}
|
||||
@@ -119,6 +118,8 @@ public class Dice : MonoBehaviour {
|
||||
|
||||
if(!ugynokDobasErtek)
|
||||
ap.UpdateAkciopont(getValasztottErtek() + upgrade.akcio[upgrade.getAkcioIndex()]);
|
||||
else
|
||||
ugynokDobasErtek = false;
|
||||
|
||||
if(elsoDobas){
|
||||
//jatek kezdeskor elso dobas ugynok csapat meghatarozas kezdo helyszinen
|
||||
|
||||
@@ -11,6 +11,7 @@ public class Kezdohelyszin : MonoBehaviour
|
||||
public TMP_Text eredmenyText;
|
||||
public Button nextButton;
|
||||
|
||||
private float time;
|
||||
private int random;
|
||||
|
||||
private Dice dice;
|
||||
@@ -18,6 +19,12 @@ public class Kezdohelyszin : MonoBehaviour
|
||||
private void Awake() {
|
||||
dice = FindObjectOfType<Dice>();
|
||||
nextButton.interactable = false;
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
time = 4f;
|
||||
#else
|
||||
time = 5f;
|
||||
#endif
|
||||
}
|
||||
|
||||
public void KezdoHelyszinSorsolas(int x, int y, string helynev){
|
||||
@@ -28,7 +35,7 @@ public class Kezdohelyszin : MonoBehaviour
|
||||
}
|
||||
|
||||
private IEnumerator waitForDiceAnimation(string helynev){
|
||||
yield return new WaitForSeconds(5f);
|
||||
yield return new WaitForSeconds(time);
|
||||
|
||||
eredmenyText.text = "A kezdőhelyszíned: " + helynev;
|
||||
nextButton.interactable = true;
|
||||
|
||||
@@ -27,33 +27,28 @@ public class TurnManager : MonoBehaviour
|
||||
public void nextTurn() {
|
||||
dice.setLocked(false);
|
||||
dice.dobottEgyszer = false;
|
||||
akciopont.resetAkciopont();
|
||||
energia.csokkenEnergia(upgrade.energia[upgrade.getEnergiaIndex()]);
|
||||
energia.granatAktivalva = false; //ha aktivalva lett a granat a korben deaktivalja
|
||||
turnCounter++;
|
||||
dice.hely1.sprite = null;
|
||||
dice.hely2.sprite = null;
|
||||
dice.ujradobasszamlalo = upgrade.ujradobas[upgrade.getUjradobasIndex()] + 1;
|
||||
dice.diceResult = new int[2];
|
||||
Debug.Log("ujradobasszamlalo: " + dice.ujradobasszamlalo);
|
||||
|
||||
akciopont.resetAkciopont();
|
||||
|
||||
energia.csokkenEnergia(upgrade.energia[upgrade.getEnergiaIndex()]);
|
||||
energia.granatAktivalva = false; //ha aktivalva lett a granat a korben deaktivalja
|
||||
|
||||
turnCounter++;
|
||||
|
||||
jatekmanager.vanertelme = true;
|
||||
jatekmanager.JatekosVesztett();
|
||||
jatekmanager.JatekosNyert();
|
||||
|
||||
if (jatekmanager.jatekosnyert == false && jatekmanager.jatekosvesztett == false)
|
||||
{
|
||||
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.KorKezdet); //a jatekmanager atvalt a korkezdet eventre
|
||||
|
||||
Debug.Log("kovetkezo kor " + turnCounter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (energiavesztese > 29)
|
||||
{
|
||||
jatekmanager.Instance.UpdateGameState(GameState.Vesztett); //a jatekmanager atvalt a vesztett eventre
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -75,6 +75,10 @@ public class jatekmanager : MonoBehaviour
|
||||
public GameObject palyaSprite;
|
||||
public GameObject playerSprite;
|
||||
|
||||
public GameObject eredmenyPanel;
|
||||
public TMP_Text eredmenyText;
|
||||
public TMP_Text pontszam;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
@@ -217,6 +221,7 @@ public class jatekmanager : MonoBehaviour
|
||||
nyomozas.SetActive(false);
|
||||
hackeles.SetActive(false);
|
||||
helyszinaktivalasBtn.gameObject.SetActive(false);
|
||||
harc.SetActive(false);
|
||||
//test.SetActive(false);
|
||||
|
||||
//ha ugynok state-el vegezne kapcsoljon vissza mindent
|
||||
@@ -530,8 +535,11 @@ public class jatekmanager : MonoBehaviour
|
||||
|
||||
if (jatekosnyert)
|
||||
{
|
||||
vegpontozas.pontkiiras();
|
||||
SceneManager.LoadScene("JatekosNyert");
|
||||
//vegpontozas.pontkiiras();
|
||||
//SceneManager.LoadScene("JatekosNyert");
|
||||
eredmenyText.text = "Nyertél";
|
||||
pontszam.text = "Pontszámod: " + vegpontozas.OsszpontSzamalas().ToString();
|
||||
eredmenyPanel.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -808,8 +816,11 @@ public class jatekmanager : MonoBehaviour
|
||||
|
||||
if (jatekosvesztett)
|
||||
{
|
||||
vegpontozas.pontkiiras();
|
||||
SceneManager.LoadScene("JatekosVesztett");
|
||||
//vegpontozas.pontkiiras();
|
||||
//SceneManager.LoadScene("JatekosVesztett");
|
||||
eredmenyText.text = "Vesztettél";
|
||||
pontszam.text = "Pontszámod: " + vegpontozas.OsszpontSzamalas().ToString();
|
||||
eredmenyPanel.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ public class movement : MonoBehaviour
|
||||
eromulepes1.SetActive(true);
|
||||
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
||||
jelenlegi_x = 1;
|
||||
jelenlegi_y = 1;
|
||||
jelenlegi_y = 1;
|
||||
kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Erőmű");
|
||||
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public class movement : MonoBehaviour
|
||||
eromulepes1.SetActive(true);
|
||||
moveCounter++;
|
||||
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -827,7 +827,6 @@ public class movement : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
public void Update()
|
||||
{
|
||||
tavolsag = math.abs(tavolsag);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user