private void UpdateFOVBoard() { bool passable; bool gridChecked; if (checkPosition.Count < 1) { return; } position = checkPosition.Pop(); x = position[0]; y = position[1]; surround = coordinate.SurroundCoord(Surround.Diagonal, x, y); foreach (var grid in surround) { if (!board.IsInsideRange(FOVShape.Rhombus, maxRange, coordinate.Convert(transform.position), grid)) { continue; } passable = board.CheckBlock(SubObjectTag.Floor, grid) || board.CheckBlock(SubObjectTag.Pool, grid); gridChecked = fovTest ? (!fov.CheckFOV(FOVStatus.TEST, grid)) : (!fov.CheckFOV(FOVStatus.Insight, grid)); if (passable && gridChecked) { checkPosition.Push(grid); } if (fovTest) { fov.ChangeFOVBoard(FOVStatus.TEST, grid); } else { fov.ChangeFOVBoard(FOVStatus.Insight, grid); } } UpdateFOVBoard(); }
public void Initialize() { for (int i = 0; i < dungeon.Width; i++) { for (int j = 0; j < dungeon.Height; j++) { if (!actor.HasActor(i, j) && (dungeon.CheckBlock(SubObjectTag.Floor, i, j) || dungeon.CheckBlock(SubObjectTag.Pool, i, j))) { board[i, j] = true; } } } }
private void UpdateDistanceBoard() { if (checkPosition.Count < 1) { return; } position = checkPosition.Pop(); surround = coordinate.SurroundCoord(Surround.Diagonal, position); foreach (var grid in surround) { gridX = grid[0]; gridY = grid[1]; if (board.IndexOutOfRange(gridX, gridY)) { continue; } if (board.CheckBlock(SubObjectTag.Wall, grid)) { wallGrid.Push(grid); } else if (distanceBoard[gridX, gridY] < 0) { checkPosition.Push(grid); } distanceBoard[gridX, gridY] = board.GetDistance(source, grid); } UpdateDistanceBoard(); }
private void CoverTile(bool cover, Vector3 position) { if (dungeon.CheckBlock(SubObjectTag.Pool, position)) { dungeon.GetBlockObject(position).GetComponent <Renderer>().enabled = !cover; } }
private void PrintPool() { string label = GetComponent <GameText>().GetStringData(node, "Pool"); if (board.CheckBlock(SubObjectTag.Pool, FindObjects.GetStaticActor(SubObjectTag.Examiner) .transform.position)) { getUI(UITag.ExaminePoolLabel).text = label; } else { getUI(UITag.ExaminePoolLabel).text = ""; } }
public int GetInfectionRate() { int hp = (11 - GetComponent <HP>().CurrentHP) * 10; hp = Math.Max(0, hp); hp = Math.Min(infectionData.RateNormal, hp); int pool = dungeon.CheckBlock(SubObjectTag.Pool, coords.Convert(transform.position)) ? infectionData.RateNormal : 0; int final = hp + pool; return(final); }
public int GetMoveEnergy(int[] start, int[] end) { int baseEnergy = GetBaseEnergy(start, end); int move = energyData.Move; int pool = board.CheckBlock(SubObjectTag.Pool, start) ? energyData.ModNormal : 0; int final = baseEnergy + move + pool; if (wizard.PrintEnergyCost && GetComponent <MetaInfo>().IsPC) { message.StoreText("Move energy: " + final); } return(final); }