t"Run off" message removed when a player is killed - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 1745d9b0197327469834743afcb6a6aa47459cc8
(DIR) parent c5d428b05211298ff701a107ed49a3204e6d35fd
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Sat, 21 Oct 2000 22:37:18 +0000
"Run off" message removed when a player is killed
Diffstat:
M po/dopewars.pot | 52 ++++++++++++++++----------------
M src/message.c | 32 +++++++++++++++++--------------
M src/message.h | 5 ++---
3 files changed, 46 insertions(+), 43 deletions(-)
---
(DIR) diff --git a/po/dopewars.pot b/po/dopewars.pot
t@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-10-21 18:33+0100\n"
+"POT-Creation-Date: 2000-10-21 22:14+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
t@@ -2314,114 +2314,114 @@ msgstr ""
msgid "Do you run, or fight?"
msgstr ""
-#: src/message.c:1050
+#: src/message.c:1052
msgid "pitifully armed"
msgstr ""
-#: src/message.c:1051
+#: src/message.c:1053
msgid "lightly armed"
msgstr ""
-#: src/message.c:1052
+#: src/message.c:1054
msgid "moderately well armed"
msgstr ""
-#: src/message.c:1053
+#: src/message.c:1055
msgid "heavily armed"
msgstr ""
-#: src/message.c:1054
+#: src/message.c:1056
msgid "armed to the teeth"
msgstr ""
-#: src/message.c:1056
+#: src/message.c:1058
msgid "%s arrives with %d %tde, %s!"
msgstr ""
-#: src/message.c:1062
+#: src/message.c:1064
#, c-format
msgid "%s stands and takes it"
msgstr ""
-#: src/message.c:1064
+#: src/message.c:1066
msgid "You stand there like a dummy."
msgstr ""
-#: src/message.c:1069
+#: src/message.c:1072
#, c-format
msgid "%s has got away!"
msgstr ""
-#: src/message.c:1071
+#: src/message.c:1074
msgid "You got away!"
msgstr ""
-#: src/message.c:1076
+#: src/message.c:1080
msgid "Guns reloaded..."
msgstr ""
-#: src/message.c:1081
+#: src/message.c:1085
#, c-format
msgid "%s shoots at %s... and misses!"
msgstr ""
-#: src/message.c:1084
+#: src/message.c:1088
#, c-format
msgid "%s shoots at you... and misses!"
msgstr ""
-#: src/message.c:1087
+#: src/message.c:1091
#, c-format
msgid "You missed %s!"
msgstr ""
-#: src/message.c:1093
+#: src/message.c:1097
#, c-format
msgid "%s shoots %s dead."
msgstr ""
-#: src/message.c:1096
+#: src/message.c:1100
msgid "%s shoots at %s and kills a %tde!"
msgstr ""
-#: src/message.c:1099
+#: src/message.c:1103
#, c-format
msgid "%s shoots at %s."
msgstr ""
-#: src/message.c:1104
+#: src/message.c:1108
#, c-format
msgid "%s wasted you, man! What a drag!"
msgstr ""
-#: src/message.c:1108
+#: src/message.c:1112
msgid "%s shoots at you... and kills a %tde!"
msgstr ""
-#: src/message.c:1111
+#: src/message.c:1115
#, c-format
msgid "%s hits you, man!"
msgstr ""
-#: src/message.c:1115
+#: src/message.c:1119
#, c-format
msgid "You killed %s!"
msgstr ""
-#: src/message.c:1117
+#: src/message.c:1121
msgid "You hit %s, and killed a %tde!"
msgstr ""
-#: src/message.c:1120
+#: src/message.c:1124
#, c-format
msgid "You hit %s!"
msgstr ""
-#: src/message.c:1123
+#: src/message.c:1127
msgid " You loot the body!"
msgstr ""
-#: src/message.c:1126
+#: src/message.c:1130
#, c-format
msgid " (Health: %d)"
msgstr ""
(DIR) diff --git a/src/message.c b/src/message.c
t@@ -1017,12 +1017,8 @@ void SendFightMessage(Player *Attacker,Player *Defender,
if (Msg) {
g_string_append(text,Msg);
} else {
- FormatFightMessage(To,text,Attacker==To ? "" : GetPlayerName(Attacker),
- (Defender==To || Defender==NULL)
- ? "" : GetPlayerName(Defender),
- Defender ? Defender->Health : 0,
- Defender ? Defender->Bitches.Carried : 0,
- BitchesKilled,ArmPercent,FightPoint,Loot);
+ FormatFightMessage(To,text,Attacker,Defender,BitchesKilled,
+ ArmPercent,FightPoint,Loot);
}
if (HaveAbility(To,A_NEWFIGHT)) {
SendServerMessage(NULL,C_NONE,C_FIGHTPRINT,To,text->str);
t@@ -1040,11 +1036,17 @@ void SendFightMessage(Player *Attacker,Player *Defender,
g_string_free(text,TRUE);
}
-void FormatFightMessage(Player *To,GString *text,
- gchar *AttackName,gchar *DefendName,int Health,
- int Bitches,int BitchesKilled,int ArmPercent,
+void FormatFightMessage(Player *To,GString *text,Player *Attacker,
+ Player *Defender,int BitchesKilled,int ArmPercent,
gchar FightPoint,gboolean Loot) {
- gchar *Armament;
+ gchar *Armament,*DefendName,*AttackName;
+ int Health,Bitches;
+
+ AttackName = (!Attacker || Attacker==To ? "" : GetPlayerName(Attacker));
+ DefendName = (!Defender || Defender==To ? "" : GetPlayerName(Defender));
+ Health = Defender ? Defender->Health : 0;
+ Bitches = Defender ? Defender->Bitches.Carried : 0;
+
switch(FightPoint) {
case F_ARRIVED:
Armament= ArmPercent<10 ? _("pitifully armed") :
t@@ -1065,10 +1067,12 @@ void FormatFightMessage(Player *To,GString *text,
}
break;
case F_LEAVE: case F_LASTLEAVE:
- if (AttackName[0]) {
- g_string_sprintfa(text,_("%s has got away!"),AttackName);
- } else {
- g_string_sprintfa(text,_("You got away!"));
+ if (Attacker->Health>0) {
+ if (AttackName[0]) {
+ g_string_sprintfa(text,_("%s has got away!"),AttackName);
+ } else {
+ g_string_sprintfa(text,_("You got away!"));
+ }
}
break;
case F_RELOAD:
(DIR) diff --git a/src/message.h b/src/message.h
t@@ -170,8 +170,7 @@ void ReceiveFightMessage(gchar *Data,gchar **AttackName,gchar **DefendName,
void SendFightMessage(Player *Attacker,Player *Defender,
int BitchesKilled,gchar FightPoint,
gboolean Loot,gboolean Broadcast,gchar *Msg);
-void FormatFightMessage(Player *To,GString *text,
- gchar *AttackName,gchar *DefendName,int Health,
- int Bitches,int BitchesKilled,int ArmPercent,
+void FormatFightMessage(Player *To,GString *text,Player *Attacker,
+ Player *Defender,int BitchesKilled,int ArmPercent,
gchar FightPoint,gboolean Loot);
#endif