private void DrawMonsters() { var halfWidth = VirtualConsole.instance.width / 2; var halfHeight = ((VirtualConsole.instance.height - 15) / 2) + 15; for (int x = posX - halfWidth; x < posX + halfWidth; x++) { for (int y = posY - halfHeight; y < posY + halfHeight; y++) { if (Visible(x, y) && GetProjectiles(x, y) != "") { continue; } if (GetMonsters(x, y) == "") { continue; } DisplayCharacter dc = null; if (x >= 0 && y >= 0 && x < MapFloor.xSize && y < MapFloor.ySize) { dc = currentFloor.monsters[x, y].display; } if (dc != null && Visible(x, y)) { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, dc.character, dc.color.r, dc.color.g, dc.color.b, dc.bgColor.r, dc.bgColor.g, dc.bgColor.b); } } } }
private void DrawMap() { var halfWidth = VirtualConsole.instance.width / 2; var halfHeight = ((VirtualConsole.instance.height - 15) / 2) + 15; for (int x = posX - halfWidth; x < posX + halfWidth; x++) { for (int y = posY - halfHeight; y < posY + halfHeight; y++) { if (x == posX && y == posY) { continue; } DisplayCharacter dc = null; if (Visible(x, y) && GetMonsters(x, y) != "") { continue; } if (Visible(x, y) && GetProjectiles(x, y) != "") { continue; } if (y - posY + halfHeight <= 15) { continue; } if (x >= 0 && y >= 0 && x < MapFloor.xSize && y < MapFloor.ySize) { dc = currentFloor.layout[x, y]; } if (dc != null && Visible(x, y)) { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, dc.character, dc.color.r, dc.color.g, dc.color.b, dc.bgColor.r, dc.bgColor.g, dc.bgColor.b); } else if (Visible(x, y)) { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, Get(x, y)); } else if (dc != null && Seen(x, y)) { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, dc.character, dc.color.r / 4f, dc.color.g / 4f, dc.color.b / 4f, dc.bgColor.r / 4f, dc.bgColor.g / 4f, dc.bgColor.b / 4f); } else { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, " "); } } } VirtualConsole.Set(halfWidth, halfHeight, "@"); }
private void DrawProjectiles() { var halfWidth = VirtualConsole.instance.width / 2; var halfHeight = ((VirtualConsole.instance.height - 15) / 2) + 15; for (int x = posX - halfWidth; x < posX + halfWidth; x++) { for (int y = posY - halfHeight; y < posY + halfHeight; y++) { if (GetProjectiles(x, y) == "") { continue; } DisplayCharacter dc = null; if (x >= 0 && y >= 0 && x < MapFloor.xSize && y < MapFloor.ySize) { dc = currentFloor.projectiles[x, y].display; } if (dc != null && Visible(x, y)) { VirtualConsole.Set(x - posX + halfWidth, y - posY + halfHeight, dc.character, dc.color.r, dc.color.g, dc.color.b, dc.bgColor.r, dc.bgColor.g, dc.bgColor.b); } if (currentFloor.projectiles[x, y].blastStage > -1) { var proj = currentFloor.projectiles[x, y]; for (int x2 = proj.x - proj.blastStage; x2 <= proj.x + proj.blastStage; x2++) { for (int y2 = proj.y - proj.blastStage; y2 <= proj.y + proj.blastStage; y2++) { if (Visible(x2, y2)) { VirtualConsole.Set(x2 - posX + halfWidth, y2 - posY + halfHeight, dc.character, dc.color.r, dc.color.g, dc.color.b, dc.bgColor.r, dc.bgColor.g, dc.bgColor.b); } } } } } } }