mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-26 12:51:29 -08:00
Add evaluation of deaths
This commit is contained in:
1
53_King/csharp/Resources/DeathsPollution.txt
Normal file
1
53_King/csharp/Resources/DeathsPollution.txt
Normal file
@@ -0,0 +1 @@
|
||||
{0} countrymen died of carbon-monoxide and dust inhalation
|
||||
1
53_King/csharp/Resources/DeathsStarvation.txt
Normal file
1
53_King/csharp/Resources/DeathsStarvation.txt
Normal file
@@ -0,0 +1 @@
|
||||
{0} countrymen died of starvation
|
||||
3
53_King/csharp/Resources/EndAlso.txt
Normal file
3
53_King/csharp/Resources/EndAlso.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
also had your left eye gouged out!
|
||||
;have also gained a very bad reputation.
|
||||
;have also been declared national fink.
|
||||
10
53_King/csharp/Resources/EndCongratulations.txt
Normal file
10
53_King/csharp/Resources/EndCongratulations.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
Congratulations!!!!!!!!!!!!!!!!!!
|
||||
You have successfully completed your {0} year term
|
||||
of office. You were, of course, extremely lucky, but
|
||||
nevertheless, it's quite an achievement. Goodbye and good
|
||||
luck - you'll probably need it if you're the type that
|
||||
plays this game.
|
||||
|
||||
|
||||
3
53_King/csharp/Resources/EndConsequences.txt
Normal file
3
53_King/csharp/Resources/EndConsequences.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
You have been thrown out of office and are now
|
||||
residing in prison.;
|
||||
You have been assassinated.
|
||||
7
53_King/csharp/Resources/EndForeignWorkers.txt
Normal file
7
53_King/csharp/Resources/EndForeignWorkers.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
The number of foreign workers has exceeded the number
|
||||
of countrymen. As a minority, they have revolted and
|
||||
taken over the country.
|
||||
{0}
|
||||
|
||||
5
53_King/csharp/Resources/EndManyDead.txt
Normal file
5
53_King/csharp/Resources/EndManyDead.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
{0} countrymen died in one year!!!!!
|
||||
due to this extreme mismanagement, you have not only
|
||||
been impeached and thrown out of office, but you
|
||||
{1}
|
||||
|
||||
7
53_King/csharp/Resources/EndMoneyLeftOver.txt
Normal file
7
53_King/csharp/Resources/EndMoneyLeftOver.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
Money was left over in the treasury which you did
|
||||
not spend. As a result, some of your countrymen died
|
||||
of starvation. The public is enraged and you have
|
||||
been forced to resign.
|
||||
|
||||
|
||||
7
53_King/csharp/Resources/EndOneThirdDead.txt
Normal file
7
53_King/csharp/Resources/EndOneThirdDead.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
Over one third of the population has died since you
|
||||
were elected to office. The people (remaining)
|
||||
hate your guts.
|
||||
{0}
|
||||
|
||||
1
53_King/csharp/Resources/FuneralExpenses.txt
Normal file
1
53_King/csharp/Resources/FuneralExpenses.txt
Normal file
@@ -0,0 +1 @@
|
||||
You were forced to spend {0} rallods on funeral expenses
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
Goodbye.
|
||||
(If you wish to continue this game at a later date, answer
|
||||
'again' when asked if you want instructions at the start
|
||||
|
||||
0
53_King/csharp/Resources/InsufficientReserves.txt
Normal file
0
53_King/csharp/Resources/InsufficientReserves.txt
Normal file
5
53_King/csharp/Resources/PollutionEffect.txt
Normal file
5
53_King/csharp/Resources/PollutionEffect.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
fish population has dwindled due to water pollution.
|
||||
;air pollution is killing game bird population.
|
||||
;mineral baths are being ruined by water pollution.
|
||||
;unpleasant smog is discouraging sun bathers.
|
||||
;hotels are looking shabby due to smog grit.
|
||||
@@ -51,6 +51,28 @@ internal static class Resource
|
||||
public static string PollutionPrompt => GetString();
|
||||
public static string PollutionError(float rallods) => string.Format(GetString(), rallods);
|
||||
|
||||
public static string DeathsStarvation(float deaths) => string.Format(GetString(), (int)deaths);
|
||||
public static string DeathsPollution(int deaths) => string.Format(GetString(), deaths);
|
||||
public static string FuneralExpenses(int expenses) => string.Format(GetString(), expenses);
|
||||
public static string InsufficientReserves => GetString();
|
||||
|
||||
private static string PollutionEffect(IRandom random) => GetStrings()[random.Next(5)];
|
||||
|
||||
private static string EndAlso(IRandom random)
|
||||
=> random.Next(10) switch
|
||||
{
|
||||
<= 3 => GetStrings()[0],
|
||||
<= 6 => GetStrings()[1],
|
||||
_ => GetStrings()[2]
|
||||
};
|
||||
|
||||
public static string EndCongratulations(int termLength) => string.Format(GetString(), termLength);
|
||||
private static string EndConsequences(IRandom random) => GetStrings()[random.Next(2)];
|
||||
public static string EndForeignWorkers(IRandom random) => string.Format(GetString(), EndConsequences(random));
|
||||
public static string EndManyDead(int deaths, IRandom random) => string.Format(GetString(), deaths, EndAlso(random));
|
||||
public static string EndMoneyLeftOver(int termLength) => string.Format(GetString(), termLength);
|
||||
public static string EndOneThirdDead(IRandom random) => string.Format(GetString(), EndConsequences(random));
|
||||
|
||||
public static string SavedYearsPrompt => GetString();
|
||||
public static string SavedYearsError(int years) => string.Format(GetString(), years);
|
||||
public static string SavedTreasuryPrompt => GetString();
|
||||
@@ -61,6 +83,8 @@ internal static class Resource
|
||||
|
||||
public static string Goodbye => GetString();
|
||||
|
||||
private static string[] GetStrings([CallerMemberName] string? name = null) => GetString(name).Split(';');
|
||||
|
||||
private static string GetString([CallerMemberName] string? name = null)
|
||||
{
|
||||
using var stream = GetStream(name);
|
||||
|
||||
Reference in New Issue
Block a user