public void SpawnCharacter(Gameboard gameboard, GameObject[] allSteps)
    {
        this.gameboard = gameboard;
        this.allSteps  = allSteps;

        pathList         = new List <GameObject>();
        nodeList         = new List <Node>();
        stepList         = new List <GameObject>();
        routeList        = new List <GameObject>();
        allRouteList     = new List <List <GameObject> >();
        choiceMarkerList = new List <GameObject>();
        specialDieList   = new List <string>();

        standardDie = "do2"; //Id för vanlig d6 tärning

        boardCameraMovement = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BoardCameraMovement>();
        dieManagerScript    = GameObject.FindGameObjectWithTag("DieManager").GetComponent <DieManagerScript>();


        cameraPos = new Vector3(0, 0, 0);

        foreach (GameObject step in allSteps)
        {
            if (step.GetComponent <StepScript>().stepId == GetComponent <PlayerScript>().stepId)
            {
                activeStep = step;
                break;
            }
        }
        playerMove = PlayerMove.rollDie;

        hasTarget = false;
    }
Example #2
0
 public void Start()
 {
     boardCamMove = board.GetComponent <BoardCameraMovement>();
     coord        = GetComponent <UnitTileCheck>().coordinate;
     //AddBlock();
     tileBuffCheck(coord);
     setPRating();
     origPRating = pRating;
 }
Example #3
0
 public void setInhabitant()
 {
     boardCamMove = board.GetComponent <BoardCameraMovement>();
     foreach (BoardCameraMovement.boardTile bTile in boardCamMove.allTiles)
     {
         if (coord == bTile.pos)
         {
             currentTile      = bTile;
             bTile.inhabitant = gameObject;
         }
     }
 }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     if (flameBombSelected)
     {
         bcm = tileMap.GetComponent <BoardCameraMovement>();
         foreach (GameObject unit in bcm.units)
         {
             if (unit.name == "Wizard")
             {
                 unit.GetComponent <SpriteRenderer>().color = new Color(0.5f, 0.5f, 0.5f, 0.3f);
             }
         }
         if (Input.GetMouseButtonUp(0))
         {
             coordinate = new Vector3Int(bcm.coordinate.x, bcm.coordinate.y, 0);
             if (bcm.targetTile != null)
             {
                 foreach (BoardCameraMovement.boardTile bTile in bcm.allTiles)
                 {
                     if (bTile.pos == coordinate)
                     {
                         if (bTile.inhabitant == null || bTile.inhabitant.name != "Wizard")
                         {
                             int endPoint = bcm.turnCount + 18;
                             foreach (BoardCameraMovement.burningTile burningTile in bcm.burningTiles)
                             {
                                 if (burningTile.bTile.pos == coordinate)
                                 {
                                     bcm.removeBurningTile(burningTile);
                                     break;
                                 }
                             }
                             bcm.newBurnTile(coordinate, endPoint);
                             bcm.turnSwitch();
                             break;
                         }
                     }
                 }
             }
             flameBombSelected = false;
             foreach (GameObject unit in bcm.units)
             {
                 if (unit.name == "Wizard")
                 {
                     unit.GetComponent <SpriteRenderer>().color = unit.GetComponent <Interactable>().colour;
                 }
             }
         }
     }
 }
Example #5
0
    public void MouseDown()
    {
        BoardCameraMovement boardCamMove = board.GetComponent <BoardCameraMovement>();

        if (boardCamMove.currentTurn == "wizard")
        {
            units = GameObject.FindGameObjectsWithTag("Unit");
            if (faction == "wizard")
            {
                unitSelected = true;
            }
            foreach (GameObject unit in units)
            {
                if (!unit.GetComponent <Interactable>().unitSelected)
                {
                    unit.GetComponent <SpriteRenderer>().color = new Color(0.5f, 0.5f, 0.5f, 0.3f);
                }
            }
            if (this.faction == "wizard")
            {
                RadialMenuSpawner.ins.SpawnMenu(this);
            }
        }
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     cameraComp   = camera.GetComponent <Camera>();
     boardCamMove = tilemap.GetComponent <BoardCameraMovement>();
     zOut();
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     interactable = GetComponent <Interactable>();
     board        = GameObject.Find("Tilemap");
     bcm          = board.GetComponent <BoardCameraMovement>();
 }
Example #8
0
 // Use this for initialization
 void Start()
 {
     boardCam = GameObject.Find("Grid").GetComponentInChildren <BoardCameraMovement>();
 }
Example #9
0
 void Start()
 {
     BCM = board.GetComponent <BoardCameraMovement>();
 }
Example #10
0
 public void Start()
 {
     boardTilemap = GameObject.Find("Tilemap");
     board        = boardTilemap.GetComponent <Tilemap>();
     boardCamMove = board.GetComponent <BoardCameraMovement>();
 }