tAdd US and UK spellings of "armor" - vaccinewars - be a doctor and try to vacc… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d5c1c4e5e14040cbe2e2e30d3ed5321890288c78 | |
parent 190bdd0689f4afb8ee5637c2a0aac876caaa4364 | |
Author: Ben Webb <[email protected]> | |
Date: Wed, 9 Dec 2020 23:47:41 -0800 | |
Add US and UK spellings of "armor" | |
Use the US spelling of "armor" by default but translate | |
it to "armour" in the UK translation. Allow both spellings | |
in the config file. | |
Diffstat: | |
M doc/configfile.html | 8 ++++---- | |
M doc/example-igneous | 16 ++++++++-------- | |
M src/dopewars.c | 28 +++++++++++++++++++++------- | |
M src/dopewars.h | 4 ++-- | |
M src/gui_client/optdialog.c | 4 ++-- | |
M src/serverside.c | 20 ++++++++++---------- | |
6 files changed, 47 insertions(+), 33 deletions(-) | |
--- | |
diff --git a/doc/configfile.html b/doc/configfile.html | |
t@@ -371,7 +371,7 @@ drugs.</dd> | |
<dt><b>Gun[<i>3</i>].Damage=<i>4</i></b></dt> | |
<dd>Defines gun number <i>3</i> to do up to <i>4</i> points of damage.</dd> | |
-<dt><b>PlayerArmour=<i>100</i></b></dt> | |
+<dt><b>PlayerArmor=<i>100</i></b> or <b>PlayerArmour=<i>100</i></b></dt> | |
<dd>Sets the percentage armor rating of each player to <i>100</i> - this | |
defines the amount of health that you lose when you are successfully hit. | |
If 100, you lose the same number of health points as the gun's damage. | |
t@@ -379,7 +379,7 @@ If more than 100, you lose fewer health points, and if les… | |
<b>more</b> health points than the gun's damage. This rating applies only | |
when you have no bitches.</dd> | |
-<dt><b>BitchArmour=<i>50</i></b></dt> | |
+<dt><b>BitchArmor=<i>50</i></b> or <b>BitchArmour=<i>50</i></b></dt> | |
<dd>Sets the percentage armor rating of each bitch to <i>50</i>.</dd> | |
<dt><b>NumCop=<i>3</i></b></dt> | |
t@@ -398,10 +398,10 @@ will never be attacked by the cops.</dd> | |
<dd>Names more than one deputy accompanying the first cop | |
<i>"deputies"</i>.</dd> | |
-<dt><b>Cop[<i>1</i>].Armour=<i>4</i></b></dt> | |
+<dt><b>Cop[<i>1</i>].Armor=<i>4</i></b> or <b>Cop[<i>1</i>].Armour=<i>4</i></b… | |
<dd>Sets the armor rating of the first cop to <i>4%</i>.</dd> | |
-<dt><b>Cop[<i>1</i>].DeputyArmour=<i>3</i></b></dt> | |
+<dt><b>Cop[<i>1</i>].DeputyArmor=<i>3</i></b> or <b>Cop[<i>1</i>].DeputyArmour… | |
<dd>Sets the armor rating of the first cop's deputies to <i>3%</i>.</dd> | |
<dt><b>Cop[<i>1</i>].AttackPenalty=<i>30</i></b></dt> | |
diff --git a/doc/example-igneous b/doc/example-igneous | |
t@@ -368,14 +368,14 @@ Cop[1].DeputiesName = "deputies" | |
Cop[2].DeputiesName = "deputies" | |
Cop[3].DeputiesName = "cops" | |
Cop[4].DeputiesName = "Thugs" | |
-Cop[1].Armour = 4 | |
-Cop[2].Armour = 15 | |
-Cop[3].Armour = 50 | |
-Cop[4].Armour = 36 | |
-Cop[1].DeputyArmour = 3 | |
-Cop[2].DeputyArmour = 4 | |
-Cop[3].DeputyArmour = 6 | |
-Cop[4].DeputyArmour = 12 | |
+Cop[1].Armor = 4 | |
+Cop[2].Armor = 15 | |
+Cop[3].Armor = 50 | |
+Cop[4].Armor = 36 | |
+Cop[1].DeputyArmor = 3 | |
+Cop[2].DeputyArmor = 4 | |
+Cop[3].DeputyArmor = 6 | |
+Cop[4].DeputyArmor = 12 | |
Cop[1].MinDeputies = 2 | |
Cop[2].MinDeputies = 4 | |
Cop[3].MinDeputies = 6 | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -225,7 +225,7 @@ gboolean UseSocks; | |
int NumTurns = 31; | |
-int PlayerArmour = 100, BitchArmour = 50; | |
+int PlayerArmor = 100, BitchArmor = 50; | |
struct LOG Log; | |
t@@ -476,10 +476,16 @@ struct GLOBALS Globals[] = { | |
N_("Maximum number of drugs at each location"), | |
(void **)(&Location), &StaticLocation, | |
sizeof(struct LOCATION), "Location", &NumLocation, NULL, FALSE, 1, -1}, | |
- {&PlayerArmour, NULL, NULL, NULL, NULL, "PlayerArmour", | |
+ {&PlayerArmor, NULL, NULL, NULL, NULL, "PlayerArmour", | |
N_("% resistance to gunshots of each player"), | |
NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 100}, | |
- {&BitchArmour, NULL, NULL, NULL, NULL, "BitchArmour", | |
+ {&PlayerArmor, NULL, NULL, NULL, NULL, "PlayerArmor", | |
+ N_("% resistance to gunshots of each player"), | |
+ NULL, NULL, 0, "", NULL, NULL, FALSE, 0, 100}, | |
+ {&BitchArmor, NULL, NULL, NULL, NULL, "BitchArmour", | |
+ N_("% resistance to gunshots of each bitch"), | |
+ NULL, NULL, 0, "", NULL, NULL, FALSE, 1, 100}, | |
+ {&BitchArmor, NULL, NULL, NULL, NULL, "BitchArmor", | |
N_("% resistance to gunshots of each bitch"), | |
NULL, NULL, 0, "", NULL, NULL, FALSE, 1, 100}, | |
{NULL, NULL, NULL, &StaticCop.Name, NULL, "Name", | |
t@@ -494,11 +500,19 @@ struct GLOBALS Globals[] = { | |
N_("Name of each cop's deputies"), | |
(void **)(&Cop), &StaticCop, sizeof(struct COP), "Cop", &NumCop, | |
NULL, FALSE, 0, 0}, | |
- {&StaticCop.Armour, NULL, NULL, NULL, NULL, "Armour", | |
+ {&StaticCop.Armor, NULL, NULL, NULL, NULL, "Armour", | |
+ N_("% resistance to gunshots of each cop"), | |
+ (void **)(&Cop), &StaticCop, sizeof(struct COP), "Cop", &NumCop, | |
+ NULL, FALSE, 1, 100}, | |
+ {&StaticCop.Armor, NULL, NULL, NULL, NULL, "Armor", | |
N_("% resistance to gunshots of each cop"), | |
(void **)(&Cop), &StaticCop, sizeof(struct COP), "Cop", &NumCop, | |
NULL, FALSE, 1, 100}, | |
- {&StaticCop.DeputyArmour, NULL, NULL, NULL, NULL, "DeputyArmour", | |
+ {&StaticCop.DeputyArmor, NULL, NULL, NULL, NULL, "DeputyArmour", | |
+ N_("% resistance to gunshots of each deputy"), | |
+ (void **)(&Cop), &StaticCop, sizeof(struct COP), "Cop", &NumCop, | |
+ NULL, FALSE, 1, 100}, | |
+ {&StaticCop.DeputyArmor, NULL, NULL, NULL, NULL, "DeputyArmor", | |
N_("% resistance to gunshots of each deputy"), | |
(void **)(&Cop), &StaticCop, sizeof(struct COP), "Cop", &NumCop, | |
NULL, FALSE, 1, 100}, | |
t@@ -1674,8 +1688,8 @@ void CopyCop(struct COP *dest, struct COP *src) | |
AssignName(&dest->Name, _(src->Name)); | |
AssignName(&dest->DeputyName, _(src->DeputyName)); | |
AssignName(&dest->DeputiesName, _(src->DeputiesName)); | |
- dest->Armour = src->Armour; | |
- dest->DeputyArmour = src->DeputyArmour; | |
+ dest->Armor = src->Armor; | |
+ dest->DeputyArmor = src->DeputyArmor; | |
dest->AttackPenalty = src->AttackPenalty; | |
dest->DefendPenalty = src->DefendPenalty; | |
dest->MinDeputies = src->MinDeputies; | |
diff --git a/src/dopewars.h b/src/dopewars.h | |
t@@ -201,7 +201,7 @@ extern gboolean UseSocks; | |
#endif | |
extern int NumTurns; | |
-extern int PlayerArmour, BitchArmour; | |
+extern int PlayerArmor, BitchArmor; | |
#define MAXLOG 6 | |
t@@ -222,7 +222,7 @@ extern int PlayerArmour, BitchArmour; | |
struct COP { | |
gchar *Name, *DeputyName, *DeputiesName; | |
- gint Armour, DeputyArmour; | |
+ gint Armor, DeputyArmor; | |
gint AttackPenalty, DefendPenalty; | |
gint MinDeputies, MaxDeputies; | |
gint GunIndex; | |
diff --git a/src/gui_client/optdialog.c b/src/gui_client/optdialog.c | |
t@@ -837,8 +837,8 @@ void OptDialog(GtkWidget *widget, gpointer data) | |
{ N_("Name of several deputies"), "DeputiesName" }, | |
{ N_("Minimum no. of deputies"), "MinDeputies" }, | |
{ N_("Maximum no. of deputies"), "MaxDeputies" }, | |
- { N_("Cop armor"), "Armour" }, | |
- { N_("Deputy armor"), "DeputyArmour" }, | |
+ { N_("Cop armor"), "Armor" }, | |
+ { N_("Deputy armor"), "DeputyArmor" }, | |
{ NULL, NULL } | |
}; | |
diff --git a/src/serverside.c b/src/serverside.c | |
t@@ -2808,24 +2808,24 @@ static Player *GetFireTarget(Player *Play) | |
return NULL; | |
} | |
-static int GetArmour(Player *Play) | |
+static int GetArmor(Player *Play) | |
{ | |
- int Armour; | |
+ int Armor; | |
if (IsCop(Play)) { | |
if (Play->Bitches.Carried == 0) | |
- Armour = Cop[Play->CopIndex - 1].Armour; | |
+ Armor = Cop[Play->CopIndex - 1].Armor; | |
else | |
- Armour = Cop[Play->CopIndex - 1].DeputyArmour; | |
+ Armor = Cop[Play->CopIndex - 1].DeputyArmor; | |
} else { | |
if (Play->Bitches.Carried == 0) | |
- Armour = PlayerArmour; | |
+ Armor = PlayerArmor; | |
else | |
- Armour = BitchArmour; | |
+ Armor = BitchArmor; | |
} | |
- if (Armour == 0) | |
- Armour = 1; | |
- return Armour; | |
+ if (Armor == 0) | |
+ Armor = 1; | |
+ return Armor; | |
} | |
/* | |
t@@ -2863,7 +2863,7 @@ void Fire(Player *Play) | |
for (j = 0; j < Play->Guns[i].Carried; j++) { | |
Damage += brandom(0, Gun[i].Damage); | |
} | |
- Damage = Damage * 100 / GetArmour(Defend); | |
+ Damage = Damage * 100 / GetArmor(Defend); | |
if (Damage == 0) | |
Damage = 1; | |
HandleDamage(Defend, Play, Damage, &BitchesKilled, &Loot); |