This commit is contained in:
2022-11-16 17:09:07 +01:00
parent e693778d21
commit 1b6252cc0c
8 changed files with 471 additions and 124 deletions

View File

@@ -13,8 +13,20 @@ public class Akciok : MonoBehaviour
private Akciopont ap;
//
//Nyomozashoz
private movement movement;
private string[,] nyomozasok =
{
{"ures", "ures", "ures", "" },
{"ures", "ures", "ures", "" },
{"ures", "ures", "ures", "" },
{"ures", "ures", "ures", "" },
};
private void Start() {
ap = FindObjectOfType<Akciopont>();
movement= FindObjectOfType<movement>();
//kezdesnel karikazza be az elso harom adott toltenyt
for (int i = 0; i < tolteny_index; i++) {
@@ -58,5 +70,34 @@ public class Akciok : MonoBehaviour
} else {
Debug.Log("Nincs eleg tolteny");
}
}
}
//Nyomozas
public void Nyomozas() {
if (ap.akciopont <= 0) {
Debug.Log("nincs eleg akciopont");
return;
}
ap.akciopont--;
int atirandox = (movement.jelenlegi_x - 1);
int atirandoy = (movement.jelenlegi_y - 1);
if (nyomozasok[atirandox, atirandoy] == "nyomozott") {
Debug.Log("Itt mar nyomoztal");
return;
} else {
nyomozasok[atirandoy, atirandox] = "nyomozott";
}
for (int i = 0; i < nyomozasok.GetLength(0); i++) {
string sor = "";
for (int j = 0; j < nyomozasok.GetLength(1); j++) {
sor += nyomozasok[i, j] + " ";
}
Debug.Log(sor);
}
}
}

View File

@@ -25,8 +25,7 @@ public class Energia : MonoBehaviour
energiasav_text[getEnergiasavIndex()].text = "X";
setEnegiasavIndex(getEnergiasavIndex() + 1);
}
}
Debug.Log("energia csokkent");
}

View File

@@ -8,9 +8,9 @@ public class helyszinaktivalas : MonoBehaviour
public Upgrade upgrade;
private Akciopont akciopont;
public movement movement;
int jelenlegi_x;
int jelenlegi_y;
bool canUpgrade;
//int movement.jelenlegi_x;
//int movement.movement.jelenlegi_y;
bool canUpgrade = false;
// Start is called before the first frame update
void Start()
@@ -22,38 +22,38 @@ public class helyszinaktivalas : MonoBehaviour
}
// Update is called once per frame
void Update()
/*void Update()
{
jelenlegi_x = movement.jelenlegi_x;
jelenlegi_y = movement.jelenlegi_y;
movement.jelenlegi_x = movement.jelenlegi_x;
movement.jelenlegi_y = movement.jelenlegi_y;
canUpgrade = false;
}
}*/
public void HelyszinAktivalas()
{
//1-es mezõ
if (jelenlegi_x == 1 && jelenlegi_y == 1)
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 1)
{
//ügynökcsapat ölés bárhol töltény nélkül
}
//2-es mezõ
if (jelenlegi_x == 2 && jelenlegi_y == 1)
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 1)
{
canUpgrade = true;
//1 fejlesztés ingyen
}
//3-es mezõ
if (jelenlegi_x == 3 && jelenlegi_y == 1)
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 1)
{
//behuzni a boxcollidereket es kattintásra átváltani a játékos helyét
}
//4-es mezõ
if (jelenlegi_x == 1 && jelenlegi_y == 2)
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 2)
{
//kapsz egy tárgyat
}
//5-es mezõ
if (jelenlegi_x == 2 && jelenlegi_y == 2)
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 2)
{
dice.setLocked(false);
/*if (dobas % 2 == 0)
@@ -67,18 +67,18 @@ public class helyszinaktivalas : MonoBehaviour
*/
}
//6-es mezõ
if (jelenlegi_x == 3 && jelenlegi_y == 2)
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 2)
{
//+1 akció
}
//7-es mezõ
if (jelenlegi_x == 1 && jelenlegi_y == 3)
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 3)
{
canUpgrade = true;
//1 fejlesztés ingyen
}
//8-es mezõ
if (jelenlegi_x == 2 && jelenlegi_y == 3)
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 3)
{
dice.setLocked(false);
/*dob két kockával
@@ -86,22 +86,22 @@ public class helyszinaktivalas : MonoBehaviour
a másik -X energia*/
}
//9-es mezõ
if (jelenlegi_x == 3 && jelenlegi_y == 3)
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 3)
{
//kapsz egy tárgyat
}
//10-es mezõ
if (jelenlegi_x == 1 && jelenlegi_y == 4)
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 4)
{
//+4 töltény
}
//11-es mezõ
if (jelenlegi_x == 2 && jelenlegi_y == 4)
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 4)
{
//Dobj! Megkapod a tárgyat.
}
//12-es mezõ
if (jelenlegi_x == 3 && jelenlegi_y == 4)
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 4)
{
//+1 élet
}

View File

@@ -4,7 +4,9 @@ using UnityEngine;
public class nyomozas : MonoBehaviour
{
public movement movement;
private movement movement;
private Akciopont ap;
private string[,] nyomozasok =
{
{"ures", "ures", "ures", "" },
@@ -13,28 +15,48 @@ public class nyomozas : MonoBehaviour
{"ures", "ures", "ures", "" },
{"", "", "", "" }
};
int jelenlegi_x;
int jelenlegi_y;
//int jelenlegi_x;
//int jelenlegi_y;
// Start is called before the first frame update
void Start()
{
movement = FindObjectOfType<movement>();
movement = FindObjectOfType<movement>();
ap = FindObjectOfType<Akciopont>();
}
// Update is called once per frame
void Update()
/*void Update()
{
int jelenlegi_x = movement.jelenlegi_x;
int jelenlegi_y = movement.jelenlegi_y;
}
}*/
public void Nyomozas()
{
int atirandox = (jelenlegi_x -1);
int atirandoy = (jelenlegi_y - 1);
nyomozasok[atirandoy, atirandox] = "nyomozott";
if (ap.akciopont <= 0) {
Debug.Log("nincs eleg akciopont");
return;
}
ap.akciopont--;
int atirandox = (movement.jelenlegi_x - 1);
int atirandoy = (movement.jelenlegi_y - 1);
if (nyomozasok[atirandox, atirandoy] == "nyomozott") {
Debug.Log("Itt mar nyomoztal");
return;
} else {
nyomozasok[atirandoy, atirandox] = "nyomozott";
}
for (int i = 0; i < nyomozasok.GetLength(0); i++) {
string sor = "";
for (int j = 0; j < nyomozasok.GetLength(1); j++) {
sor += nyomozasok[i, j] + " ";
}
Debug.Log(sor);
}
}
}

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Mathematics;
public class vegpontozas : MonoBehaviour
{
@@ -10,20 +10,18 @@ public class vegpontozas : MonoBehaviour
private Upgrade FejlesztesPont;
private Targyak targyak;
private Akciok akciok;
public bool foundsource;
private Elet elet;
public bool foundsource;
int osszpont = 0;
int elhasznaltelet = 0;
int tolteny = 0;
int megszerzetttargyak = 0;
int tolteny;
int megszerzetttargyak;
int fejlesztespont;
int energiapont;
int megmaradtelet;
// Start is called before the first frame update
void Start()
{
energia = FindObjectOfType<Energia>();
energia = FindObjectOfType<Energia>();
FejlesztesPont = FindObjectOfType<Upgrade>();
targyak = FindObjectOfType<Targyak>();
@@ -32,15 +30,15 @@ public class vegpontozas : MonoBehaviour
foundsource = false;
}
// Update is called once per frame
void Update()
public int OsszpontSzamalas()
{
energiapont = energia.energiasav_text.Length - (energia.getEnergiasavIndex() + 1);
megmaradtelet = elet.elet;
tolteny = akciok.betarazott_tolteny;
megszerzetttargyak = targyak.targy_szamlalo;
energiapont = Convert.ToInt32(energia.energiasav_text) - energia.getEnergiasavIndex();
fejlesztespont = FejlesztesPont.fejlesztes_szamlalo;
megmaradtelet = elet.elet;
osszpont = (energiapont * 2) + (megmaradtelet * 2) + (fejlesztespont / 3) + (tolteny / 2) + megszerzetttargyak;
return osszpont;
}
}