Exemple #1
0
 private void PrintBeastAttacks()
 {
     if (HistoricalFigure.BeastAttacks != null && HistoricalFigure.BeastAttacks.Count > 0)
     {
         HTML.AppendLine(Bold("Beast Attacks"));
         StartList(ListType.Ordered);
         foreach (BeastAttack attack in HistoricalFigure.BeastAttacks)
         {
             HTML.AppendLine(ListItem + attack.StartYear + ", " + MakeLink(attack.GetOrdinal(attack.Ordinal) + "rampage in ", attack) + attack.Site.ToLink());
             if (attack.GetSubEvents().OfType <HFDied>().Any())
             {
                 HTML.Append(" (Kills: " + attack.GetSubEvents().OfType <HFDied>().Count() + ")");
             }
         }
         EndList(ListType.Ordered);
         HTML.AppendLine(LineBreak);
     }
 }
Exemple #2
0
 private void PrintPositions()
 {
     if (HistoricalFigure.Positions.Count > 0)
     {
         HTML.AppendLine(Bold("Positions") + LineBreak);
         StartList(ListType.Ordered);
         foreach (HistoricalFigure.Position position in HistoricalFigure.Positions)
         {
             HTML.AppendLine(ListItem + position.Title + " of " + position.Entity.PrintEntity() + " (" + position.Began + " - ");
             if (position.Ended == -1)
             {
                 HTML.Append("Present)");
             }
             else
             {
                 HTML.Append(position.Ended + ")");
             }
         }
         EndList(ListType.Ordered);
     }
 }
Exemple #3
0
        private void PrintBattles()
        {
            Battle unnotableDeathBattle = null; //Temporarily make the battle that the HF died in Notable so it shows up.

            if (HistoricalFigure.Battles.Count > 0 && HistoricalFigure.Battles.Last().Collection.OfType <HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) == 1 && !HistoricalFigure.Battles.Last().Notable)
            {
                unnotableDeathBattle         = HistoricalFigure.Battles.Last();
                unnotableDeathBattle.Notable = true;
            }

            if (HistoricalFigure.Battles.Count(battle => !World.FilterBattles || battle.Notable) > 0)
            {
                HTML.AppendLine(Bold("Battles") + MakeLink("[Load]", LinkOption.LoadHFBattles));
                if (World.FilterBattles)
                {
                    HTML.Append(" (Notable)");
                }
                HTML.Append(LineBreak);
                TableMaker battleTable = new TableMaker(true);
                foreach (Battle battle in HistoricalFigure.Battles.Where(battle => (!World.FilterBattles || battle.Notable) || battle.Collection.OfType <HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) > 0))
                {
                    battleTable.StartRow();
                    battleTable.AddData(battle.StartYear.ToString());
                    battleTable.AddData(battle.ToLink());
                    if (battle.ParentCollection != null)
                    {
                        battleTable.AddData("as part of");
                        battleTable.AddData(battle.ParentCollection.ToLink());
                    }
                    string involvement = "";
                    if (battle.NotableAttackers.Count > 0 && battle.NotableAttackers.Contains(HistoricalFigure))
                    {
                        if (battle.Collection.OfType <FieldBattle>().Any(fieldBattle => fieldBattle.AttackerGeneral == HistoricalFigure) ||
                            battle.Collection.OfType <AttackedSite>().Any(attack => attack.AttackerGeneral == HistoricalFigure))
                        {
                            involvement += "Led the attack";
                        }
                        else
                        {
                            involvement += "Fought in the attack";
                        }
                    }
                    else if (battle.NotableDefenders.Count > 0 && battle.NotableDefenders.Contains(HistoricalFigure))
                    {
                        if (battle.Collection.OfType <FieldBattle>().Any(fieldBattle => fieldBattle.DefenderGeneral == HistoricalFigure) ||
                            battle.Collection.OfType <AttackedSite>().Any(attack => attack.DefenderGeneral == HistoricalFigure))
                        {
                            involvement += "Led the defense";
                        }
                        else
                        {
                            involvement += "Aided in the defense";
                        }
                    }
                    else
                    {
                        involvement += "A non combatant";
                    }

                    if (battle.GetSubEvents().OfType <HFDied>().Any(death => death.HistoricalFigure == HistoricalFigure))
                    {
                        involvement += " and died";
                    }
                    battleTable.AddData(involvement);
                    if (battle.NotableAttackers.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Attacker)
                        {
                            battleTable.AddData("and won");
                        }
                        else
                        {
                            battleTable.AddData("and lost");
                        }
                    }
                    else if (battle.NotableDefenders.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Defender)
                        {
                            battleTable.AddData("and won");
                        }
                        else
                        {
                            battleTable.AddData("and lost");
                        }
                    }

                    battleTable.AddData("Deaths: " + (battle.AttackerDeathCount + battle.DefenderDeathCount) + ")");

                    battleTable.EndRow();
                }
                HTML.AppendLine(battleTable.GetTable() + LineBreak);
            }

            if (World.FilterBattles && HistoricalFigure.Battles.Count(battle => !battle.Notable) > 0)
            {
                HTML.AppendLine(Bold("Battles") + " (Unnotable): " + HistoricalFigure.Battles.Where(battle => !battle.Notable).Count() + LineBreak + LineBreak);
            }

            if (unnotableDeathBattle != null)
            {
                unnotableDeathBattle.Notable = false;
            }
        }
Exemple #4
0
 private void PrintMiscInfo()
 {
     //if (HistoricalFigure.CurrentIdentity != null)
     //{
     //    HTML.AppendLine(Bold("Current Identity: ") + HistoricalFigure.CurrentIdentity.ToLink() + LineBreak);
     //}
     //if (HistoricalFigure.UsedIdentity != null)
     //{
     //    HTML.AppendLine(Bold("Used Identity: ") + HistoricalFigure.UsedIdentity.ToLink() + LineBreak);
     //}
     if (HistoricalFigure.Spheres.Count > 0)
     {
         string spheres = "";
         foreach (string sphere in HistoricalFigure.Spheres)
         {
             if (HistoricalFigure.Spheres.Last() == sphere && HistoricalFigure.Spheres.Count > 1)
             {
                 spheres += " and ";
             }
             else if (spheres.Length > 0)
             {
                 spheres += ", ";
             }
             spheres += sphere;
         }
         HTML.Append(Bold("Associated Spheres: ") + spheres + LineBreak);
     }
     if (HistoricalFigure.Goal != "")
     {
         HTML.AppendLine(Bold("Goal: ") + HistoricalFigure.Goal + LineBreak);
     }
     if (HistoricalFigure.ActiveInteractions.Count > 0)
     {
         string interactions = "";
         foreach (string interaction in HistoricalFigure.ActiveInteractions)
         {
             if (HistoricalFigure.ActiveInteractions.Last() == interaction && HistoricalFigure.ActiveInteractions.Count > 1)
             {
                 interactions += " and ";
             }
             else if (interactions.Length > 0)
             {
                 interactions += ", ";
             }
             interactions += interaction;
         }
         HTML.AppendLine(Bold("Active Interactions: ") + interactions + LineBreak);
     }
     if (HistoricalFigure.InteractionKnowledge.Count > 0)
     {
         string interactions = "";
         foreach (string interaction in HistoricalFigure.InteractionKnowledge)
         {
             if (HistoricalFigure.InteractionKnowledge.Last() == interaction && HistoricalFigure.InteractionKnowledge.Count > 1)
             {
                 interactions += " and ";
             }
             else if (interactions.Length > 0)
             {
                 interactions += ", ";
             }
             interactions += interaction;
         }
         HTML.AppendLine(Bold("Interaction Knowledge: ") + interactions + LineBreak);
     }
     if (HistoricalFigure.HoldingArtifacts.Count > 0)
     {
         string artifacts = "";
         foreach (Artifact artifact in HistoricalFigure.HoldingArtifacts)
         {
             if (HistoricalFigure.HoldingArtifacts.Last() == artifact && HistoricalFigure.HoldingArtifacts.Count > 1)
             {
                 artifacts += " and ";
             }
             else if (artifacts.Length > 0)
             {
                 artifacts += ", ";
             }
             artifacts += artifact.ToLink();
         }
         HTML.AppendLine(Bold("Holding Artifacts: ") + artifacts + LineBreak);
     }
     if (HistoricalFigure.Animated)
     {
         HTML.AppendLine(Bold("Animated as: ") + HistoricalFigure.AnimatedType + LineBreak);
     }
     if (HistoricalFigure.JourneyPets.Count > 0)
     {
         string pets = "";
         foreach (string pet in HistoricalFigure.JourneyPets)
         {
             if (HistoricalFigure.JourneyPets.Last() == pet && HistoricalFigure.JourneyPets.Count > 1)
             {
                 pets += " and ";
             }
             else if (pets.Length > 0)
             {
                 pets += ", ";
             }
             pets += pet;
         }
         HTML.AppendLine(Bold("Journey Pets: ") + pets + LineBreak);
     }
     HTML.AppendLine(LineBreak);
 }