Skip to content

Commit

Permalink
Event Ordering and Formatting Fixes (#135)
Browse files Browse the repository at this point in the history
* fixed event order, now more significant events will be on top

* cossmetic update of the text art

* added missing space after number of looses

* even more missing spaces added back
  • Loading branch information
valdisz authored Sep 14, 2023
1 parent 99de2e3 commit 4903157
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions events-battle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ const Event pvpBattle(BattleFact* fact) {
<< " between " << oneOf(TWO_SIDES) // between hostile forces
<< " happened in the " << fact->location.GetTerrainName(true) // happened in the plains
<< " of " << fact->location.province // of Cefelat
<< " where " << lost << plural(lost, "combatant", "combatants") // where 75 combatants
<< " where " << lost << " " << plural(lost, "combatant", "combatants") // where 75 combatants
<< " " << plural(lost, "was", "were") << " killed." // were killed
;

Expand Down Expand Up @@ -446,7 +446,7 @@ const Event pvpBattle(BattleFact* fact) {
buffer
<< " happened in the " << fact->location.GetTerrainName(true) // happened in the plains
<< " of " << fact->location.province // of Cefelat
<< " where " << lost << plural(lost, "combatant", "combatants") // where 75 combatants
<< " where " << lost << " " << plural(lost, "combatant", "combatants") // where 75 combatants
<< " " << plural(lost, "was", "were") << " killed." // were killed
;

Expand Down Expand Up @@ -496,7 +496,7 @@ const Event pvpBattle(BattleFact* fact) {
<< " and " << fact->defender.factionName
<< " happened in the " << fact->location.GetTerrainName(true) // happened in the plains
<< " of " << fact->location.province // of Cefelat
<< " where " << lost << plural(lost, "combatant", "combatants") // where 75 combatants
<< " where " << lost << " " << plural(lost, "combatant", "combatants") // where 75 combatants
<< " " << plural(lost, "was", "were") << " killed." // were killed
;

Expand Down
9 changes: 5 additions & 4 deletions events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ void Events::AddFact(FactBase *fact) {
}

bool compareEvents(const Event &first, const Event &second) {
return first.score < second.score;
// return true if first should go before second
return first.score > second.score;
}

std::list<string> wrapText(std::string input, std::size_t width) {
Expand Down Expand Up @@ -383,10 +384,10 @@ std::string Events::Write(std::string worldName, std::string month, int year) {
}

text += "(__ _ _ _ _ _ _ _ _ __)\n";
text += " `-._.-' (___ _) `-._.-' `-._.-' ) ( `-._.-' `-._.-' (__ _ ) `-._.-'\n";
text += " '-._.-' (___ _) '-._.-' '-._.-' ) ( '-._.-' '-._.-' (__ _ ) '-._.-'\n";
text += " ( _ __) (_ _) (_ ___)\n";
text += " (__ _) `-._.-' (___ _)\n";
text += " `-._.-' `-._.-'\n";
text += " (__ _) '-._.-' (___ _)\n";
text += " '-._.-' '-._.-'\n";

return text;
}

0 comments on commit 4903157

Please sign in to comment.