public override void Run() { Initialize(); _root.Blit(_clearConsole, _clearConsole.Bounds, 4, 4); var redControl = _root.GetColorControlString(TCODColor.red); _root.PrintString(4, 4, "{0}Reserve Party{1}", redControl, _root.GetStopControl()); var deadCount = FrontRowSize - Model.Party.FrontRow.Count; var selectedFrontRow = Model.MenuModel.SelectedSwitchIndex; for (var i = FrontRowSize - deadCount; i < FrontRowSize; ++i) { _borderConsole.SetForegroundColour(selectedFrontRow == i ? TCODColor.red : TCODColor.white); _borderConsole.DrawBorder(); _root.Blit(_borderConsole, _borderConsole.Bounds, StartX + ColOffset * i, 30); } var backSeat = Model.Party.BackSeat; for (var i = 0; i < backSeat.Count; ++i) { _frames[i].AssignCharacter(backSeat[i]); _frames[i].Draw(); } ICharacter selectedCharacter = null; var backRowSelected = false; foreach (var character in backSeat.Where(character => character.IsMarked)) { backRowSelected = true; selectedCharacter = character; break; } if (!backRowSelected) { foreach (var character in Model.Party.FrontRow.Where(character => character.IsMarked)) { selectedCharacter = character; break; } } if (selectedCharacter == null) { return; } _drawer.DrawStats(selectedCharacter); _lister.Draw(selectedCharacter); }
public string GetStopControl() { return(_console.GetStopControl()); }
public override void Run() { var fetchCount = 5; var printedLines = 0; do { _logConsole.Clear(); var redControl = _logConsole.GetColorControlString(TCODColor.red); var greenControl = _logConsole.GetColorControlString(TCODColor.green); var stopControl = _logConsole.GetStopControl(); _logConsole.PrintString(1, 1, "{0}Battlelog:{1}", redControl, stopControl); _logConsole.DrawBorder(); var log = _log.GetLastEntries(fetchCount); printedLines = 0; foreach (var logEntry in log) { _logBuilder.Clear(); var printArea = new Rectangle(_logArea.X, _logArea.Y + printedLines, _logArea.Width, _logArea.Height - printedLines); if (logEntry.IsCustomMessage) { _logBuilder.Append(logEntry.CustomMessage).AppendNewLine().AppendNewLine(); printedLines += _logConsole.PrintString(printArea, _logBuilder.ToString()); continue; } _logBuilder.AppendFormat("{0}{1}{2} uses {3} on {4}{5}{6}", logEntry.CasterIsEnemy ? redControl : greenControl, logEntry.CasterName, stopControl, logEntry.SpellName, logEntry.ReceiverIsEnemy ? redControl : greenControl, logEntry.SelfCast ? "self" : logEntry.ReceiverName, stopControl); if (logEntry.AttackDodged) { _logBuilder.Append(" but the attack was dodged"); } else { _logBuilder.Append(logEntry.WasHealed ? " healing for " : " dealing ") .Append(logEntry.WasHealed ? greenControl : redControl) .Append(logEntry.Value <= 0d ? "no" : RHelper.SanitizeNumber(logEntry.Value)) .Append(stopControl) .Append(logEntry.WasHealed ? " healing" : " damage"); } if (logEntry.AttackBlocked) { _logBuilder.Append(" (blocked)"); } if (logEntry.WasAfflicted) { _logBuilder.Append(" and inflicting ") .Append(logEntry.AfflictedBy); } _logBuilder.Append("!"); if (logEntry.Fatal) { _logBuilder.AppendNewLine() .AppendNewLine() .Append(logEntry.ReceiverName) .AppendNewLine(" dies!"); } _logBuilder.AppendNewLine(); printedLines += _logConsole.PrintString(printArea, _logBuilder.ToString()); } --fetchCount; } while (printedLines > MaxLogLines); _root.Blit(_logConsole, _logConsole.Bounds, _position.X, _position.Y); }