void ContinuePeep(ConsoleKeyInfo keyPressed) { Log.AddLine("You continue peeping..."); WorldRendering.drawInCircleFOV(lastPeepX, lastPeepY, visibilityRadius); WorldRendering.drawUnitsInCircle(lastPeepX, lastPeepY, visibilityRadius); this.Draw(); if (keyPressed.Key == ConsoleKey.Spacebar || keyPressed.Key == ConsoleKey.Escape) { isPeeping = false; Log.ReplaceLastLine("You recoiled and looked around."); } }
void peepDialogue() { Log.AddLine("Peep in which direction?"); ConsoleKeyInfo keyPressed = Console.ReadKey(true); KeyToVector.ProcessInput(keyPressed); int peepX = CoordX + KeyToVector.x, peepY = CoordY + KeyToVector.y; if (peepX == CoordX && peepY == CoordY) { int randomMessageNumber = MyRandom.getRandomInt(3); switch (randomMessageNumber) { case 0: Log.AddLine("You feel SO introversive for a moment"); break; case 1: Log.AddLine("You peep yourself. So interesting"); break; case 2: Log.AddLine("If you wanna, hm, look at yourself, get a room, please."); break; } return; } //don't peep through walls anymore! :D if (World.IsPassable(peepX, peepY) || World.IsDoorPresent(peepX, peepY)) { isPeeping = true; lastPeepX = peepX; lastPeepY = peepY; WorldRendering.drawInCircleFOV(peepX, peepY, visibilityRadius); WorldRendering.drawUnitsInCircle(peepX, peepY, visibilityRadius); this.Draw(); Console.ForegroundColor = ConsoleColor.Gray; Timing.AddActionTime(TimeCost.CloseDoorCost(this)); Log.ReplaceLastLine("You carefully peep in that direction... Press space or esc to stop"); keyPressed = Console.ReadKey(true); if (keyPressed.Key == ConsoleKey.Spacebar || keyPressed.Key == ConsoleKey.Escape) { isPeeping = false; Log.ReplaceLastLine("You carefully peep in that direction..."); } } else { Log.ReplaceLastLine("You try to peep through this, but in vain."); } }
void shootDialogue() { if (Inv.Wielded.Range == 1) { Log.AddLine("You can't shoot with the " + Inv.Wielded.DisplayName + "!"); return; } Log.AddLine("Which target? (tab - next, f - fire, esc - cancel)"); bool nextTargetPlease = true; while (nextTargetPlease) { nextTargetPlease = false; foreach (Actor currTarget in World.AllActors) { if (WorldLOS.VisibleLineExist(CoordX, CoordY, currTarget.CoordX, currTarget.CoordY)) { WorldRendering.drawInCircleFOV(CoordX, CoordY, visibilityRadius); WorldRendering.drawUnitsInCircle(CoordX, CoordY, visibilityRadius); this.Draw(); currTarget.DrawHighlighted(); Console.ForegroundColor = ConsoleColor.Red; WorldRendering.DrawLineNotInclusive(CoordX, CoordY, currTarget.CoordX, currTarget.CoordY, '*'); ConsoleKeyInfo keyPressed = Console.ReadKey(true); if (keyPressed.Key == ConsoleKey.Tab) { nextTargetPlease = true; continue; } if (keyPressed.Key == ConsoleKey.Escape) { Log.AddOneFromList(StringFactory.CancelStrings()); return; } if (keyPressed.Key == ConsoleKey.F) { Attack.RangedAttack(this, currTarget); return; } } } } Log.ReplaceLastLine("No targets in range!"); }