private void Start()
 {
     //set the singleton, and retrieve preexisting tiles
     controller = this;
     if (feed)
     {
         GetTiles();
     }
 }
Ejemplo n.º 2
0
        public override void TileAction()
        {
            Game_Controller controller = Game_Controller.controller;
            //create a path from the jumpTo, then tell the player to enact it. Then do basic tile stuff.
            List <Node> mover = new List <Node>();

            mover.Add(controller.GetNodeFromWorldPos(jumpTo.transform.position));
            thisTile.node.occupant.MoveTo(mover);

            base.TileAction();
        }
Ejemplo n.º 3
0
 //Called during enemy turn.
 public override void StartTurn()
 {
     //Cant remember, but i think it was for debug...
     blocked = "";
     //set turn to not finished so that the controller waits for it.
     turnFinished = false;
     //If we dont have the controller, get it.
     if (controller == null)
     {
         controller = Game_Controller.controller;
     }
     StartCoroutine(DoTurnEnemy());
 }
Ejemplo n.º 4
0
        //used to kill the character
        public void Die()
        {
            //report to the game ui, then turn the player red.
            UIController.controller.AddTextToContainerQueue("Character '" + gameObject.name + "' has died");
            GetComponentInChildren <Renderer>().material.color = new Color(1, 0, 0, 0.25f);
            //tell the node there is no more character, and remove ally from tracking list. Finally, destroy this script
            Game_Controller c = Game_Controller.controller;

            c.SetNodeOccupant(c.GetNodeFromWorldPos(transform.position), null);
            c.allAllies.Remove(this);

            Destroy(this);
        }
Ejemplo n.º 5
0
        public override void TileAction()
        {
            //Get the main controller. Search for the door. Set the door to unlocked, then tell game ui to tell the player. Perform base tile action afterward.
            Game_Controller controller = Game_Controller.controller;

            foreach (Node node in controller.allNodes)
            {
                foreach (Edge edge in node.edges)
                {
                    if (edge.door.enabled && edge.door.prefab == door)
                    {
                        edge.door.Locked = false;
                        UIController.controller.AddTextToContainerQueue("Door Unlocked");
                    }
                }
            }

            base.TileAction();
        }
Ejemplo n.º 6
0
        // Update is called once per frame
        public override void TileAction()
        {
            //Find the door (in a horribly inefficient way), then open it. Tell the ui to tell the player. Then do basic tile stuff.
            Game_Controller controller = Game_Controller.controller;

            foreach (Node node in controller.allNodes)
            {
                foreach (Edge edge in node.edges)
                {
                    if (edge.door.enabled && edge.door.prefab == door)
                    {
                        if (!edge.door.locked && !edge.door.open)
                        {
                            edge.door.Open = true;
                            UIController.controller.AddTextToContainerQueue("Door Opened");
                        }
                    }
                }
            }

            base.TileAction();
        }