public void Start()
 {
     scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();
     guiController = scriptManager.guiController;
     turnController = scriptManager.turnController;
     infopanel = scriptManager.infopanel;
 }
Пример #2
0
    void Start()
    {
        sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> ();
        Socket = sc.Socket;

        tc = GameObject.Find ("TurnController").GetComponent<TurnController> ();
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        rb = GetComponent<Rigidbody2D> ();

        sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> ();
        tc = GameObject.Find ("TurnController").GetComponent<TurnController> ();
        Socket = sc.Socket;
    }
Пример #4
0
	// Use this for initialization
	void Start () {
		tc=this;
		currentTurn=Random.Range(0,5);
		throwerSprr.sprite=antiSpr[currentTurn];
		if (currentTurn==0)
			sabotagerSprr.sprite=antiSpr[1];
		else
			sabotagerSprr.sprite=antiSpr[0];
	}
    public void Start()
    {
        scriptmanager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();

        cameraDefaultPosition = Camera.main.gameObject.transform.position;
        cameraDefaultRotation = Camera.main.gameObject.transform.rotation;

        turnController = scriptmanager.turnController;
    }
    public void Start()
    {
        scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();
        spriteModels = scriptManager.spriteModels;
        turnController = scriptManager.turnController;
        messageController = scriptManager.messageController;
        cameraController = scriptManager.cameraController;

        grid = scriptManager.grid;
    }
    void Start()
    {
        scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();
        turnController = scriptManager.turnController;
        dumbComputer = scriptManager.dumbComputer;
        messageController = scriptManager.messageController;
        gridscr = scriptManager.grid;
        placeunits = scriptManager.placeUnits;
        cameraController = scriptManager.cameraController;

        playerPieces = GameObject.Find("PlayerPieces");
    }
Пример #8
0
 void Awake()
 {
     turnController = new TurnController();
 }
Пример #9
0
        public IEnumerator InitializeGame()
        {
            // ACA DEBERIA RECIBIR LA CONFIGURATION DATA DE CADA UNO
            // UNA VEZ QUE MIRROR ME DIGA "OK HERMANO", LOS DOS JUGADORES MANDARON SU CONFIGURATION DATA
            // ENTONCES AHI PUEDO VENIR A INITIALIZE GAME Y COMPROBAR LA PARTE DE FIREBASE Y SUS CONEXIONES

            // 0d- CHEQUEAR QUE LA BASE DE DATOS ESTE INITIALIZED
            //yield return WaitForDatabaseToLoad(); // REACTIVAR CUANDO FUNCIONE BIEN LA DB
            // 0- CHEQUEAR QUE LOS DOS JUGADORES ESTEN EN LINEA Y LISTOS PARA JUGAR.
            // 0b- CHEQUEAR QUE LOS DOS JUGADORES EXISTAN

            // 4- CARGAR EL DECK SELECCIONADO DE CADA JUGADOR
            // 4b- CHEQUEAR QUE SEA UN DECK VALIDO
            // 4c- SI ES INVALIDO SACAMOS TODO A LA MIERDA, SI ES VALID CREAMOS LOS DECKS DE CADA PLAYER


            // CREATE PLAYERS STATE
            // 1 - CREAR PLAYERS Y USERS
            // 0c- SEGUN EL JUGADOR QUE HAYA CREADO LA PARTIDA ESE SERA EL PLAYER ONE, NO SIGNIFICA QUE VA A EMPEZAR PRIMERO
            playerManager = new PlayerManager();
            playerManager.CreatePlayers();
            playerManager.CreateNewUser(null);


            // CREATE BOARD STATE
            // 3- IR CREANDO EL BOARD
            board2DManager = new Board2DManager(board2DManagerUI, 5, 7);
            //Motion motion = board2DManager.CreateBoard(playerManager.GetPlayer(), OnBoardComplete);
            //InvokerMotion.AddNewMotion(motion);
            //InvokerMotion.StartExecution(this);

            Animotion motion = board2DManager.CreateBoardAnimotion(playerManager.GetPlayer(), OnBoardComplete);

            InvokerAnimotion.AddNewMotion(motion);
            InvokerAnimotion.StartExecution(this);



            // CREATE TURNS STATE => ESTO LO DEBERIA HACER EL SERVER PARA QUE NO LO HAGA CADA JUGADOR Y SE PUEDE HACKEAR
            // 2- ASIGNAR LOS PLAYER AL TURN MANAGER
            turnController = new TurnController(playerManager.GetPlayer());
            // 2b - DECIDIR QUE PLAYER COMIENZA PRIMERO
            turnController.DecideStarterPlayer();


            // CREATE MANAGER STATE
            // 3b - Inicializar los managers generales  ESTOS LOS VA A TENER EL GAME... ASI QUE SEGURO LO HAGAMOS DESDE AHI
            spawnManager    = new SpawnManager(spawnManagerUI, this);
            combineManager  = new CombineManager(this, combineManagerUI);
            movementManager = new MovementManager(this, moveManagerUI);
            actionsManager  = new ActionsManager();
            yield return(null);


            // LOADCOLLECTIONSTATE  => LAS COLLECTION LAS DEBERIA TENER EL SERVER Y PASARSELAS A CADA JUGADOR
            // 3- CARGAR LA GAME COLLECTION
            InGameCardCollectionManager inGameCardCollectionManager = new InGameCardCollectionManager(this, OnCardCollectionLoadComplete);

            //inGameCardCollectionManager.LoadAllCollection(users);// REACTIVAR CUANDO FUNCIONE BIEN LA DB
            inGameCardCollectionManager.LoadAllCollectionJson(playerManager.GetUsers().ToArray());
            while (isCardCollectionLoaded == false)
            {
                if (logOn)
                {
                    Debug.Log("WAITING FOR CARD COLLECTION TO LOAD");
                }
                yield return(null);
            }
            if (logOn)
            {
                Debug.Log("GAME CARD COLLECTION LOADED");
            }


            // CREATEDECKSTATE
            cardManager = new CardController(inGameCardCollectionManager, cardManagerUI, this);
            // VOLVER A ACTIVAR QUE ESTA ES LA FORMA DE CARGAR EL DECK SEGUN LA INFO DE LOS PLAYERS
            //cardManager.LoadDeckFromConfigurationData(playerManager.GetPlayer()[0], playerManager.playerConfigurationData);
            //cardManager.LoadDeckFromConfigurationData(playerManager.GetPlayer()[1], playerManager.playerConfigurationData);
            cardManager.LoadDeckTest(playerManager.GetPlayer()[0]);
            cardManager.LoadDeckTest(playerManager.GetPlayer()[1]);


            // WAIT FOR BOARD TO LOAD STATE
            while (isBoardLoaded == false)
            {
                if (logOn)
                {
                    Debug.Log("WAITING FOR BOARD TO LOAD");
                }
                yield return(null);
            }



            // INITIALIZECONTROLLERSTATE
            // 5 - INICIALIZAMOS LOS CONTROLES
            mouseController    = new MouseController(0, board2DManager, Camera.main);
            keyBoardController = new KeyBoardController(0, board2DManager, Camera.main);
            tileSelectionManagerUI.SetController(board2DManager, mouseController, keyBoardController);


            // STARTGAMESTATE => ACA DEBERIA MANDAR CADA JUGADOR QUE ESTA READY, Y AHI EL SERVER EMITIRIA EL NUEVO STATE PARA CADA UNO
            // CREAMOS EL STATE INICIAL
            AdministrationState AdminState = new AdministrationState(10, this, 1);
            TurnState           turnState  = new TurnState(50, this);

            InitialAdministrationStateA initialAdminStateA = new InitialAdministrationStateA(40, this, 4);
            //Motion bannerMotion = informationUIManager.SetAndShowBanner(initialAdminStateA.stateName, 0.5f);
            //InvokerMotion.AddNewMotion(bannerMotion);
            //InvokerMotion.StartExecution(this);
            //Debug.Log("CREATING BANNER");
            Animotion bannerMotion = informationUIManager.SetAndShowBannerAnimotion(initialAdminStateA.stateName, 0.5f);

            InvokerAnimotion.AddNewMotion(bannerMotion);
            InvokerAnimotion.StartExecution(this);

            IState changePhaseState = new ChangePhaseState(this, initialAdminStateA);

            baseStateMachine = new BaseStateMachine(this);
            baseStateMachine.PushState(changePhaseState, true);
            baseStateMachine.Initialize();



            // DEBERIA DIVIR PLAYER == BASE NEXUS Y GAME PLAYER == JUGADOR EN SI QUE VA A ENVIAR LOS COMANDOS...
            // PODRIAMOS TENER UN GAME PLAYER QUE LO UNICA QUE VA A TENER ES UNA ID
            // ENTONCES CUANDO
            // game.actionsManager.IncrementPlayerActions(game.turnController.CurrentPlayerTurn, managmentPoints);
            // ESTO DEBARA CAMBIARSE game.turnController.CurrentPlayerTurn
            // SI UN JUGADOR APRETA UNA UNIDAD... COMO SABEMOS SI MOSTRAR O NO LA UI DE LOS BOTONES
            // POR QUE SOLO PODEMOS MOSTRARLA EN TURN STATE, OK, Y SOLO CON UNIDADES NUESTRAS OK
            // Y SI ACTIVAMOS EL BOTON ENTONCES IGUAL SIEMPRE VAMOS A SER NOSOTROS TECNICAMENTE...
            // POR QUE EL BOTON SE CREA CON EL OCUPIER O CON EL PLAYER EN ESTE CASO...
            //
            //
            // YA QUE ESTOY ENTRANDO A UN NUEVO STATE game.actionsManager.IncrementPlayerActions LO DEBARIA REALIZAR EL SERVER
            //

            // REALIZA SI O SI JUGADOR
            //// 1 - SUSCRIBIRSE AL EVENTO DE SELECCION ESTO SI LO TIENE QUE HACER EL JUGADOR
            //gmMachine.tileSelectionManagerUI.onTileSelected += ExecuteAction;
            //ExecuteAction(Tile action)
            //if (action == null)
            //{
            //    gmMachine.abilityButtonCreationUI.SetUnit(game.turnController.CurrentPlayerTurn);
            //}
            // ESTO LO HACE EL SERVER, VUELVE A REAHBILITAR LOS BOTONES DEL JUGADOR PARA SPAWN O TAKE CARD

            // SOLO JUGADOR YA QUE ES PARA LA UI
            //// NOS SUSCRIBIMOS AL EVENTO DE CAMBIAR EL TIEMPO
            //gameTimer.OnTimePass += gmMachine.uiGeneralManagerInGame.UpdateTime;



            // DEBE REALIZARLO SERVER
            //// 2 - TENGO QUE SETEAR LOS ACTIONS POINTS PARA ESTE JUGADOR
            //game.actionsManager.IncrementPlayerActions(game.turnController.CurrentPlayerTurn, managmentPoints);

            // DEBE REALIZARLO SERVER Y ENVIAR EL END STATE EN TODO CASO
            //// COMENZAMOS EL CONTADOR DE TIEMPO
            //base.OnEnter();

            // DEBE REALIZARLO SERVER ????
            //gmMachine.abilityButtonCreationUI.SetUnit(game.turnController.CurrentPlayerTurn);
        }
Пример #10
0
 void Awake()
 {
     turnController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<TurnController> ();
     endTurnButton = GameObject.Find("EndTurnButton").GetComponent<Button>();
 }
Пример #11
0
 void Start()
 {
     cards = new List<CardScript>();
     buttons = new List<Button>();
     tc = GameObject.FindObjectOfType<TurnController>();
 }
    void Start()
    {
        #region "Singleton"
        if (turnController == null)
        {
            turnController = this;
        }
        else
        {
            Destroy(this);
        }
        #endregion

        fighters      = new List <Fighter>();
        fighters_turn = 2;

        GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
        Debug.Log("Jugadores agregados");
        players_cant = players.Length;
        Debug.Log(players_cant);

        GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
        Debug.Log("Enemigos agregados");
        enemies_cant = enemies.Length;
        Debug.Log(enemies_cant);

        foreach (GameObject player in players)
        {
            Fighter temp = player.GetComponent <Fighter>();
            Debug.Log(temp);

            if (player_1 == null)
            {
                player_1 = temp;
            }
            else
            {
                player_2 = temp;
            }

            fighters.Add(temp);
        }
        foreach (GameObject enemy in enemies)
        {
            Fighter temp = enemy.GetComponent <Fighter>();
            Debug.Log(temp);

            /*Buscar como agregarlos dinamicamente para seleccionar enemigo o aliado*/
            if (enemy_1 == null)
            {
                enemy_1 = temp;
            }
            else
            {
                enemy_2 = temp;
            }

            fighters.Add(temp);
        }

        fighters_cant = fighters.Count;

        battleLoseEvent        = new BattleLoseEvent();
        battleWinEvent         = new BattleWinEvent();
        objectiveSelectedEvent = new ObjectiveSelectedEvent();
        endTurnEvent           = new EndTurnEvent();

        if (enemySelected == null)
        {
            enemySelected = enemies[Random.value > 0.5f ? 0 : 1];
        }
        if (playerSelected == null)
        {
            playerSelected = players[Random.value > 0.5 ? 0 : 1];
        }
        if (fighterSelected == null)
        {
            fighterSelected = (Random.value > 0.5f ? playerSelected : enemySelected);
        }

        fighters_turn = (int)Random.Range(0, 3);

        this.NextTurn();

        StartCoroutine(ObjectiveSelected());
        StartCoroutine(MoveSpotlight());
    }
Пример #13
0
 private void Init()
 {
     PlayerTurnController = new TurnController(this);
     PlayerNetConn        = new ClientTCP( );
 }
Пример #14
0
 protected void Awake()
 {
     turnController = GameObject.FindObjectOfType <TurnController>();
     body           = GetComponent <Rigidbody>();
 }
    public void SpecialCasesInit()
    {
        //Console.WriteLine("PK : Attack Switch Case: Initalizing");

        enemyStats = GameObject.FindGameObjectWithTag("Enemy").GetComponent<EnemyPokemonHandler>();
        playerStats = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerPokemonHandler>();
        attackCalc = GameObject.FindGameObjectWithTag("Attacks").GetComponent<AttackDamageCalc>();
        //genAttacks = GameObject.FindGameObjectWithTag("Attacks").GetComponent<GenerateAttacks>();
        attacks = GameObject.FindGameObjectWithTag("AttackData").GetComponent<PokemonAttacks>();
        tc = GameObject.FindGameObjectWithTag("TurnController").GetComponent<TurnController>();

        //Console.WriteLine("PK : Attack Switch Case: Initalized");
    }
Пример #16
0
 public void EnableStatusCheck()
 {
     turnC = GameObject.Find("TurnController(Clone)").GetComponent <TurnController>();
 }
Пример #17
0
 void Awake()
 {
     Startup.OnTutorialStartEvent += Noobify;
     turnController = GetComponent <TurnController>();
     timeKeeper     = GetComponent <TimeKeeper>();
 }
Пример #18
0
 void Start()
 {
     _turnController = GameObject.FindObjectOfType <TurnController>();
 }
Пример #19
0
 private void Awake()
 {
     instance = this;
 }
Пример #20
0
    private void Awake()
    {
        Instance = this;

        turnController = GetComponent <TurnController>();
    }
Пример #21
0
        public HudWidget(TurnController controller)
        {
            _controller = controller;

            controller.OnTurnEnd += () => Dirty = true;
        }
Пример #22
0
 void Start()
 {
     UpdateTileType();
     turn = GameObject.FindObjectOfType <TurnController>();
 }
Пример #23
0
 protected void Awake()
 {
     text           = GetComponent <Text>();
     turnController = GameObject.FindObjectOfType <TurnController>();
     turnController.onActionPointsChange += TurnController_onActionPointsChange;
 }
Пример #24
0
 public MapWidget(TurnController controller)
 {
     _controller            = controller;
     _controller.OnTurnEnd += ReactNewTurn;
     ReactNewTurn();
 }
 // Use this for initialization
 void Start()
 {
     tempID = Random.Range(0, 151);
     attackData = GameObject.FindGameObjectWithTag("AttackData").GetComponent<PokemonAttacks>();
     pokeDex = GameObject.FindGameObjectWithTag("Library").GetComponent<PokemonLibrary>();
     gif = this.GetComponent<GifRenderer>();
     gui = GameObject.FindGameObjectWithTag("GUIScripts").GetComponent<GUIScript>();
     tc = GameObject.FindGameObjectWithTag("TurnController").GetComponent<TurnController>();
     Init();
 }
Пример #26
0
 // Use this for initialization
 void Start()
 {
     turnController = Camera.main.GetComponent <TurnController>();
     initialise     = Camera.main.GetComponent <InitialiseActionButtons>();
 }
Пример #27
0
 void Awake()
 {
     _instance = this;
 }
 void Start() // Adding Occupied spaces
 {
     scriptManager = GameObject.Find("ScriptManager").GetComponent<ScriptManager>();
     turnController = scriptManager.turnController;
 }
Пример #29
0
 void Start()
 {
     turnInfo = GameObject.Find("GameManager").GetComponent <GameManager> ().GetTurnController();
 }
Пример #30
0
 protected void Awake()
 {
     turnController = GameObject.FindObjectOfType <TurnController>();
     turnController.onTurnChange += TurnController_onTurnChange;
 }
Пример #31
0
 protected virtual void Awake()
 {
     owner = GetComponent <TurnController>();
 }
Пример #32
0
 protected void Awake()
 {
     turnController = GameObject.FindObjectOfType <TurnController>();
 }
Пример #33
0
 private void Start()
 {
     _turnController = FindObjectOfType <TurnController>();
 }
 public CardTargetFiltterManager(TurnController turnController, Board2DManager board2D)
 {
     this.turnController = turnController;
     cardTargetManager   = new CardTargetManager(board2D);
     cardFiltterManager  = new CardFiltterManager();
 }
        private void OnGUIDebug()
        {
            if (Mod == null || !Mod.Enabled)
            {
                return;
            }

            GUILayout.Label($"Time Scale: {Time.timeScale:f2}x");
            GUILayout.Label($"Game Time: {Game.Instance.Player.GameTime}");

            CombatController combat      = Mod.Core.Combat;
            TurnController   currentTurn = combat.CurrentTurn;

            GUILayout.Space(10f);
            GUILayout.Label($"Combat Initialized: {combat.Initialized}");

            GUILayout.Space(10f);
            if (GUILayout.Button("Reset Current Turn", GUILayout.ExpandWidth(false)) && currentTurn != null)
            {
                combat.StartTurn(currentTurn.Unit);
            }

            GUILayout.Space(10f);
            GUILayout.Label($"Turn Status: {currentTurn?.Status}");
            GUILayout.Label($"Time Waited For AI: {currentTurn?.TimeWaitedForIdleAI:f4}");
            GUILayout.Label($"Time Waited To End Turn: {currentTurn?.TimeWaitedToEndTurn:f4}");
            GUILayout.Label($"Time Moved: {currentTurn?.TimeMoved:f4}");
            GUILayout.Label($"Time Moved (Special): {currentTurn?.TimeMovedInForceMode:f4}");
            GUILayout.Label($"Time Moved (5-Foot Step): {currentTurn?.TimeMovedByFiveFootStep:f4}");
            GUILayout.Label($"Feet Moved (5-Foot Step): {currentTurn?.MetersMovedByFiveFootStep / Feet.FeetToMetersRatio:f4}");
            GUILayout.Label($"Has Normal Movement: {currentTurn?.HasNormalMovement()}");
            GUILayout.Label($"Has 5-Foot Step: {currentTurn?.HasFiveFootStep()}");
            GUILayout.Label($"Has Free Touch: {currentTurn?.Unit.HasFreeTouch()}");
            GUILayout.Label($"Prepared Spell Combat: {currentTurn?.Unit.PreparedSpellCombat()}");
            GUILayout.Label($"Prepared Spell Strike: {currentTurn?.Unit.PreparedSpellStrike()}");

            GUILayout.Space(10f);
            GUILayout.Label("Current Unit:");
            GUILayout.Label(currentTurn?.Unit.ToString().Color(RGBA.yellow));
            GUILayout.Label($"Free Action: {currentTurn?.Commands.Raw[0]}");
            GUILayout.Label($"Standard Action: {currentTurn?.Commands.Standard}" +
                            $" (IsFullRoundAction: {currentTurn?.Commands.Raw[1].IsFullRoundAction()}" +
                            $", IsFreeTouch: {currentTurn?.Commands.Raw[1].IsFreeTouch()}" +
                            $", IsSpellCombat: {currentTurn?.Commands.Raw[1].IsSpellCombatAttack()}" +
                            $", IsSpellStrike: {currentTurn?.Commands.Raw[1].IsSpellstrikeAttack()})");
            GUILayout.Label($"Move Action: {currentTurn?.Commands.Raw[3]}");
            GUILayout.Label($"Swift Action: {currentTurn?.Commands.Raw[2]}");

            IEnumerable <UnitEntityData> units = combat.SortedUnits;

            if (units.Any())
            {
                GUILayout.Space(10f);
                using (new GUILayout.HorizontalScope())
                {
                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Unit ID");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label($"{unit}");
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Name");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label($"{unit.CharacterName}");
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Init");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(unit.CombatState.Initiative.ToString());
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Init_C");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(HightlightedCooldownText(unit.CombatState.Cooldown.Initiative));
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Std_C");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(HightlightedCooldownText(unit.CombatState.Cooldown.StandardAction));
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Move_C");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(HightlightedCooldownText(unit.CombatState.Cooldown.MoveAction));
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("Swift_C");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(HightlightedCooldownText(unit.CombatState.Cooldown.SwiftAction));
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("AoO_C");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(HightlightedCooldownText(unit.CombatState.Cooldown.AttackOfOpportunity));
                        }
                    }

                    using (new GUILayout.VerticalScope())
                    {
                        GUILayout.Label("AoO");
                        foreach (UnitEntityData unit in units)
                        {
                            GUILayout.Label(unit.CombatState.AttackOfOpportunityCount.ToString());
                        }
                    }

                    GUILayout.FlexibleSpace();
                }
            }
        }
Пример #36
0
 void Awake()
 {
     playerHealth = GetComponent<PlayerHealth> ();
     turnController = GameObject.FindGameObjectWithTag ("GameController").GetComponent<TurnController> ();
 }
 private void Awake()
 {
     player         = FindObjectOfType <PlayerMovement>();
     turnController = FindObjectOfType <TurnController>();
     health         = FindObjectOfType <Health>();
 }
Пример #38
0
    //ADD: Magic
    void Awake()
    {
        //initialize all component variables
        Stats = GetComponent<AttributesScript>();
        KnownAbilities = GetComponent<CharacterKnownAbilities>();
        Status = GetComponent<CharacterStatus>();
        Equipment = GetComponent<CharacterEquipment>();

        Move = GameObject.FindGameObjectWithTag("Controller").GetComponent<MovementScript>();
        pathFind = GameObject.FindGameObjectWithTag("Controller").GetComponent<PathfindingScript>();
        findValid = GameObject.FindGameObjectWithTag("Controller").GetComponent<FindValidPoints>();
        Draw = GameObject.FindGameObjectWithTag("Controller").GetComponent<DrawSquaresScript>();
        Controller = GameObject.FindGameObjectWithTag("Controller").GetComponent<TurnController>();
        Magic = GameObject.FindGameObjectWithTag("Controller").GetComponent<MagicList>();
        Skills = GameObject.FindGameObjectWithTag("Controller").GetComponent<SkillList>();

        Items = GameObject.FindGameObjectWithTag("ItemManager").GetComponent<AllItemsList>();
        if(GetComponent<MouseControlScript>()){
            Mouse = GetComponent<MouseControlScript>();
            isPlayer = true;
        }

        skillSelected = "";
    }
Пример #39
0
    // Use this for initialization
    void Start()
    {
        spriteImage = GetComponent <SpriteRenderer>();

        animationController = GetComponent <Animator>();

        TR_petrified   = transform.Find("S_Petrified");
        petrifiedImage = TR_petrified.GetComponentInChildren <SpriteRenderer>();

        TR_special   = transform.Find("S_Special");
        specialImage = TR_special.GetComponentInChildren <SpriteRenderer>();

        TR_magic   = transform.Find("S_Magic");
        magicImage = TR_magic.GetComponentInChildren <SpriteRenderer>();

        GO_guardUp   = GameObject.FindWithTag("S_GuardUp");
        guardUpImage = GO_guardUp.GetComponent <SpriteRenderer>();

        TR_win   = transform.Find("S_Win");
        winImage = TR_win.GetComponentInChildren <SpriteRenderer>();

        TR_wounded   = transform.Find("S_Wounded");
        woundedImage = TR_wounded.GetComponentInChildren <SpriteRenderer>();

        TR_dead   = transform.Find("S_Dead");
        deadImage = TR_dead.GetComponentInChildren <SpriteRenderer>();

        enemy              = GameObject.FindWithTag("Enemy");
        enemyController    = enemy.GetComponent <Enemy>();
        turnController     = gameManager.GetComponent <TurnController>();
        paladinController  = paladin.GetComponent <Paladin>();
        valkyrieController = valkyrie.GetComponent <Valkyrie>();

        AudioSource[] audios = GetComponents <AudioSource>();
        takeDamageSound = audios[0];
        attackSound     = audios[1];
        magicSound      = audios[2];

        b_isDead    = false;
        b_isWounded = false;

        blueButtonImage   = blueButton.GetComponent <Image>();
        greenButtonImage  = greenButton.GetComponent <Image>();
        orangeButtonImage = orangeButton.GetComponent <Image>();
        redButtonImage    = redButton.GetComponent <Image>();

        //Initialise Stats



        //Derived Stats
        attackPower  = STRENGTH * 10; // 200 avg damage
        magicPower   = SPIRIT * 10;   // 1000 avg earth spell damage
        dodge        = AGILITY * 2;   // 16% Chance of dodging
        defencePower = DEFENCE * 2;   //6%
        special      = 0;
        health       = MAX_HEALTH;
        magic        = MAX_MAGIC;



        tileIds       = new List <int>();
        selectedOrder = new List <int>();
        tileIds.Add(1);
        tileIds.Add(2);
        tileIds.Add(3);
        tileIds.Add(4);

        UpdateStats();
    }
Пример #40
0
 // Start is called before the first frame update
 void Start()
 {
     controller = TurnController.GetInstance();
     mainCamera = Camera.main;
 }
    private void Init()
    {
        Console.WriteLine("PK : Attack Damage Calculator: Initalizing");
        enemyStats = GameObject.FindGameObjectWithTag("Enemy").GetComponent<EnemyPokemonHandler>();
        if(enemyStats == null)
        {
            Debug.LogError("No Enemy Stats");
        }
        playerStats = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerPokemonHandler>();
        if(playerStats == null)
        {
            Debug.Log("No Player Stats");
        }

        attacks = GameObject.FindGameObjectWithTag("AttackData").GetComponent<PokemonAttacks>();
        //genAttacks = GameObject.FindGameObjectWithTag("Attacks").GetComponent<GenerateAttacks>();
        attack_Switch_Case = GameObject.FindGameObjectWithTag("Attacks").GetComponent<Attack_Switch_Case>();
        damage_mult = GameObject.FindGameObjectWithTag("dmg_mult").GetComponent<PokemonDamageMultipliers>();
        tc = GameObject.FindGameObjectWithTag("TurnController").GetComponent<TurnController>();
        Console.WriteLine("PK : Attack Damage Calculator: Initalized");
    }
 private void InitActualTurnText()
 {
     m_cTurnController = GameObject.FindGameObjectWithTag("GameController").GetComponent<TurnController>();
     m_tActualTurnText = GameObject.FindGameObjectWithTag("ActualTurn_Text").GetComponent<UnityEngine.UI.Text>();
     UpdateActualTurnText();
 }
Пример #43
0
 public void Start()
 {
     GameObject gameHandler = GameObject.Find ("_GameHandler");
     if (gameHandler != null)
         turnController = gameHandler.GetComponent<TurnController> ();
 }
Пример #44
0
 public bool Execute(TurnController turnController)
 {
     turnController.EndTurn();
     return(true);
 }
Пример #45
0
 void Start()
 {
     storeCalculator = GameObject.Find("Calculator").GetComponent <StoreCalculator>();
     turnController  = GameObject.Find("NextTurn").GetComponent <TurnController>();
     type            = GameObject.Find("LoseInput").GetComponent <Dropdown>();
 }
Пример #46
0
    void Awake()
    {
        wc = GameObject.Find ("ShootButton").GetComponent<WeaponController> ();
        tc = GameObject.Find ("TurnController").GetComponent<TurnController> ();
        sc = GameObject.Find ("ServerConnect").GetComponent<ServerConnect> ();
        sw = GameObject.Find ("StopWatch").GetComponent<StopWatch>();

        Socket = sc.Socket;

        an = GetComponentInChildren<Animator>();
        rb = GetComponent<Rigidbody2D> ();

        Physics2D.IgnoreLayerCollision (15, 10);
        Physics2D.IgnoreLayerCollision (15, 11);
    }
Пример #47
0
 void Start()
 {
     controller = GameObject.FindGameObjectWithTag("TurnController").GetComponent <TurnController>();
     item       = transform.parent.gameObject.GetComponent <InventoryItem>();
     inventory  = GetComponentInParent <Inventory>();
 }
Пример #48
0
 private void SetTurnController()
 {
     this.turnController = new TurnController(this);
 }