asd
This commit is contained in:
bance
2023-01-24 18:39:30 +01:00
parent 000358024d
commit d653d740f1
11 changed files with 757 additions and 189 deletions

View File

@@ -21557,9 +21557,9 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 197904225}
- m_Target: {fileID: 197904216}
m_TargetAssemblyTypeName: TurnManager, Assembly-CSharp
m_MethodName: nextTurn
m_MethodName:
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -40005,3 +40005,47 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2141320753}
m_CullTransparentMesh: 1
--- !u!1 &2142951057
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2142951059}
- component: {fileID: 2142951058}
m_Layer: 0
m_Name: jatekmanager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2142951058
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142951057}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6423cb96f98604ea1be2455ae7cff97d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &2142951059
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142951057}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.5465274, y: -1.4268839, z: -0.07916484}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -21,6 +21,8 @@ public class Dice : MonoBehaviour {
public bool getLocked() { return locked; }
public void setLocked(bool locked) { this.locked = locked; }
public int dobott = 0;
private void Start() {
upgrade = FindObjectOfType<Upgrade>();
ap = FindObjectOfType<Akciopont>();
@@ -76,5 +78,7 @@ public class Dice : MonoBehaviour {
hely2.sprite = diceSides[diceResult[1]-1];
hely2.size = new Vector2(38, 38);
dobott++;
}
}

View File

@@ -9,8 +9,12 @@ public class Elet : MonoBehaviour
public int elet = 2;
private int elet_vesztve = 0;
private int elet_megszerezve = 2;
private jatekmanager jatekmanager;
private void Start() {
jatekmanager = FindObjectOfType<jatekmanager>();
for (int i = 0; i < elet_megszerezve; i++) {
elet_text[i].text = "O";
}
@@ -32,7 +36,11 @@ public class Elet : MonoBehaviour
}
public void Eletvesztes() {
if(elet_vesztve > 4) return;
if (elet_vesztve > 4)
{
jatekmanager.jatekosvesztett = true;
return;
}
if (elet_megszerezve > elet +1) return;
//if(elet < 0) return;

View File

@@ -0,0 +1,501 @@
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using TMPro;
using UnityEngine;
public class jatekmanager : MonoBehaviour
{
//game objectek implementálása
public GameObject energiafejlesztés;
public GameObject akciofejlesztés;
public GameObject harcfejlesztés;
public GameObject ujradobasfejlesztés;
public GameObject hackfejlesztés;
public GameObject kovetkezokor;
public GameObject betarazas;
public GameObject nyomozas;
public GameObject hackeles;
public GameObject rolldice;
public GameObject test;
//script-ek implementalasa
private Elet elet;
private Akciok akciok;
private Targyak targyak;
private Dice dice;
private Upgrade upgrade;
private Akciopont akciopont;
private movement movement;
private TurnManager turnManager;
private Source source;
//ügynökcsapatok implementálása
public TMP_Text[] oneone;
public TMP_Text[] twoone;
public TMP_Text[] threeone;
public TMP_Text[] onetwo;
public TMP_Text[] twotwo;
public TMP_Text[] threetwo;
public TMP_Text[] onethree;
public TMP_Text[] twothree;
public TMP_Text[] threethree;
public TMP_Text[] onefour;
public TMP_Text[] twofour;
public TMP_Text[] threefour;
//nyert es vesztett bool lethrehozas
public bool jatekosnyert = false;
public bool jatekosvesztett = false;
private void Start()
{
elet = FindObjectOfType<Elet>();
akciok = FindObjectOfType<Akciok>();
targyak = FindObjectOfType<Targyak>();
dice = FindObjectOfType<Dice>();
upgrade = FindObjectOfType<Upgrade>();
akciopont = FindObjectOfType<Akciopont>();
movement = FindObjectOfType<movement>();
turnManager = FindObjectOfType<TurnManager>();
source = FindObjectOfType<Source>();
}
// Update is called once per frame
void Update()
{
//amig a játékos vesztett bool nem egyenlo true-val vagy a nyert bool nem egyenlo true-val
while (jatekosnyert != true || jatekosvesztett != true)
{
//a jatekos mikor belép semmit ne tudjon csinálni csak dobni a kockával, hogy elkezdje a játékot
//Itt a movement script kikapcsol
energiafejlesztés.SetActive(false);
akciofejlesztés.SetActive(false);
harcfejlesztés.SetActive(false);
ujradobasfejlesztés.SetActive(false);
hackfejlesztés.SetActive(false);
kovetkezokor.SetActive(false);
betarazas.SetActive(false);
nyomozas.SetActive(false);
hackeles.SetActive(false);
test.SetActive(false);
while (dice.dobott < upgrade.getUjradobasIndex() + 1 && dice.getLocked() != true)
{
//eddig újradobhat
}
rolldice.SetActive(false);
//a játékos választ a két érték között
if (upgrade.canUpgrade == true)
{
//ha a kisebbet választotta akkor jelennek meg a fejlesztés gombjai
energiafejlesztés.SetActive(true);
akciofejlesztés.SetActive(true);
harcfejlesztés.SetActive(true);
ujradobasfejlesztés.SetActive(true);
hackfejlesztés.SetActive(true);
kovetkezokor.SetActive(true);
}
else
{
//ha a nagyobbat választotta akkor jelennek meg az akciók gombjai
//itt a movement bekapcsol
kovetkezokor.SetActive(true);
betarazas.SetActive(true);
nyomozas.SetActive(true);
hackeles.SetActive(true);
}
if (akciopont.akciopont == 0)
{
//movement kikapcs
energiafejlesztés.SetActive(false);
akciofejlesztés.SetActive(false);
harcfejlesztés.SetActive(false);
ujradobasfejlesztés.SetActive(false);
hackfejlesztés.SetActive(false);
rolldice.SetActive(false);
betarazas.SetActive(false);
nyomozas.SetActive(false);
hackeles.SetActive(false);
test.SetActive(false);
kovetkezokor.SetActive(true);
}
//amint rányom a kör vége gombra 0 legyen az akciópont és megint csak a dobás legyen elérhető
}
}
public void JatekosNyert()
{
if (source.isNyitva == true && source.oszlop == movement.jelenlegi_y && source.sor[0] == movement.jelenlegi_x) //+ ugynokcsapat oles a helyszinen
{
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 1)
{
if (oneone[0].text.Equals("X") && oneone[1].text.Equals("X") && oneone[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 2)
{
if (onetwo[0].text.Equals("X") && onetwo[1].text.Equals("X") && onetwo[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 3)
{
if (onethree[0].text.Equals("X") && onethree[1].text.Equals("X") && onethree[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 1)
{
if (twoone[0].text.Equals("X") && twoone[1].text.Equals("X") && twoone[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 2)
{
if (twotwo[0].text.Equals("X") && twotwo[1].text.Equals("X") && twotwo[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 3)
{
if (twothree[0].text.Equals("X") && twothree[1].text.Equals("X") && twothree[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 1)
{
if (threeone[0].text.Equals("X") && threeone[1].text.Equals("X") && threeone[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 2)
{
if (threetwo[0].text.Equals("X") && threetwo[1].text.Equals("X") && threetwo[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 3)
{
if (threethree[0].text.Equals("X") && threethree[1].text.Equals("X") && threethree[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 4)
{
if (onefour[0].text.Equals("X") && onefour[1].text.Equals("X") && onefour[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 4)
{
if (twofour[0].text.Equals("X") && twofour[1].text.Equals("X") && twofour[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 4)
{
if (threefour[0].text.Equals("X") && threefour[1].text.Equals("X") && threefour[2].text.Equals("X"))
{
jatekosnyert = true;
}
}
}
}
public void JatekosVesztett()
{
//ha kinyilik a forras de mar voltal ott ketszer
if (source.isNyitva == true)
{
if (source.sor[0] == 1 && source.oszlop == 1)
{
if (movement.eromulepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 1)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 2 && source.oszlop == 1)
{
if (movement.feketepiaclepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 1)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 3 && source.oszlop == 1)
{
if (movement.metrolepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 1)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 1 && source.oszlop == 2)
{
if (movement.szervereklepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 2)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 2 && source.oszlop == 2)
{
if (movement.kingcasinolepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 2)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 3 && source.oszlop == 2)
{
if (movement.feltoltolepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 2)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 1 && source.oszlop == 3)
{
if (movement.kutatolaborlepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 3)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 2 && source.oszlop == 3)
{
if (movement.kriptoklublepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 3)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 3 && source.oszlop == 3)
{
if (movement.cyberplazalepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 3)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 1 && source.oszlop == 4)
{
if (movement.hadiuzemlepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 1 && movement.jelenlegi_y == 4)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 2 && source.oszlop == 4)
{
if (movement.konyvtarlepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 2 && movement.jelenlegi_y == 4)
{
}
else
{
jatekosvesztett = false;
}
}
}
if (source.sor[0] == 3 && source.oszlop == 4)
{
if (movement.korhazlepes2.activeSelf == true)
{
if (movement.jelenlegi_x == 3 && movement.jelenlegi_y == 4)
{
}
else
{
jatekosvesztett = false;
}
}
}
}
//ha elfogy a töltényed mielőtt végzel a source-nál lévő ügynökcsapatokkal
if (source.isNyitva == true && akciok.toltenyszamlalo >= 24)
{
if (source.sor[0] == 1 && source.oszlop == 1)
{
if (oneone[0].text.Equals("X") == false || oneone[1].text.Equals("X") == false || oneone[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 2 && source.oszlop == 1)
{
if (twoone[0].text.Equals("X") == false || twoone[1].text.Equals("X") == false || twoone[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 3 && source.oszlop == 1)
{
if (threeone[0].text.Equals("X") == false || threeone[1].text.Equals("X") == false || threeone[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 1 && source.oszlop == 2)
{
if (onetwo[0].text.Equals("X") == false || onetwo[1].text.Equals("X") == false || onetwo[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 2 && source.oszlop == 2)
{
if (twotwo[0].text.Equals("X") == false || twotwo[1].text.Equals("X") == false || twotwo[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 3 && source.oszlop == 2)
{
if (threetwo[0].text.Equals("X") == false || threetwo[1].text.Equals("X") == false || threetwo[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 1 && source.oszlop == 3)
{
if (onethree[0].text.Equals("X") == false || onethree[1].text.Equals("X") == false || onethree[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 2 && source.oszlop == 3)
{
if (twothree[0].text.Equals("X") == false || twothree[1].text.Equals("X") == false || twothree[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 3 && source.oszlop == 3)
{
if (threethree[0].text.Equals("X") == false || threethree[1].text.Equals("X") == false || threethree[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 1 && source.oszlop == 4)
{
if (onefour[0].text.Equals("X") == false || onefour[1].text.Equals("X") == false || onefour[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 2 && source.oszlop == 4)
{
if (twofour[0].text.Equals("X") == false || twofour[1].text.Equals("X") == false || twofour[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
if (source.sor[0] == 3 && source.oszlop == 4)
{
if (threefour[0].text.Equals("X") == false || threefour[1].text.Equals("X") == false || threefour[2].text.Equals("X") == false)
{
jatekosvesztett = true;
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6423cb96f98604ea1be2455ae7cff97d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: