Death messages thanks to Smaxx
authornemo
Mon, 01 Jun 2009 17:04:36 +0000 (2009-06-01)
changeset 2140 75e5c4fcae2a
parent 2139 5a083e71a71d
child 2141 3b06505dbd5d
Death messages thanks to Smaxx
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uLocale.pas
share/hedgewars/Data/Locale/bg.txt
share/hedgewars/Data/Locale/cs.txt
share/hedgewars/Data/Locale/de.txt
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Locale/es.txt
share/hedgewars/Data/Locale/fi.txt
share/hedgewars/Data/Locale/fr.txt
share/hedgewars/Data/Locale/it.txt
share/hedgewars/Data/Locale/ja.txt
share/hedgewars/Data/Locale/pl.txt
share/hedgewars/Data/Locale/pt-br.txt
share/hedgewars/Data/Locale/pt-pt.txt
share/hedgewars/Data/Locale/ru.txt
share/hedgewars/Data/Locale/sk.txt
share/hedgewars/Data/Locale/sv.txt
share/hedgewars/Data/Locale/tr.txt
share/hedgewars/Data/Locale/uk.txt
share/hedgewars/Data/Locale/zh_CN.txt
share/hedgewars/Data/Locale/zh_TW.txt
--- a/hedgewars/GSHandlers.inc	Mon Jun 01 00:27:57 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Mon Jun 01 17:04:36 2009 +0000
@@ -41,6 +41,7 @@
         CheckGearDrowning:= true;
         Gear^.State:= gstDrowning;
         Gear^.doStep:= @doStepDrowningGear;
+		if Gear^.Kind = gtHedgehog then AddCaption(Format(GetEventString(eidDrowned), PHedgehog(Gear^.Hedgehog)^.Name), $FFFFFF, capgrpGameState);
         end;
     PlaySound(sndSplash, false, nil)
     end
--- a/hedgewars/HHHandlers.inc	Mon Jun 01 00:27:57 2009 +0000
+++ b/hedgewars/HHHandlers.inc	Mon Jun 01 17:04:36 2009 +0000
@@ -682,7 +682,10 @@
 		Gear^.doStep:= @doStepHedgehogDead;
 		FollowGear:= Gear;
 		PrvInactive:= false;
-		AllInactive:= false
+		AllInactive:= false;
+
+		// Death message
+		AddCaption(Format(GetEventString(eidDied), PHedgehog(Gear^.Hedgehog)^.Name), $FFFFFF, capgrpGameState);
 		end;
 	exit
 	end;
--- a/hedgewars/uLocale.pas	Mon Jun 01 00:27:57 2009 +0000
+++ b/hedgewars/uLocale.pas	Mon Jun 01 17:04:36 2009 +0000
@@ -30,13 +30,19 @@
 
 	TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
 			sidConfirm, sidSuddenDeath);
+			
+	TEventId = (eidDied, eidDrowned, eidRoundStart);
 
 var trammo: array[TAmmoStrId] of string;
     trmsg: array[TMsgStrId] of string;
+	trevt: array[TEventId] of array[1..100] of string;
+	trevt_n: array[TEventId] of integer;
 
 procedure LoadLocale(FileName: string);
 function Format(fmt: shortstring; var arg: shortstring): shortstring;
 
+function GetEventString(e: TEventId): string;
+
 implementation
 uses uMisc;
 
@@ -45,6 +51,10 @@
     f: textfile;
     a, b, c: LongInt;
 begin
+
+// clear event locales
+for a:= 0 to ord(High(TEventId)) do trevt_n[TEventId(a)]:= 0;
+
 {$I-}
 Assign(f, FileName);
 reset(f);
@@ -65,12 +75,24 @@
 	case a of
 		0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammo[TAmmoStrId(b)]:= s;
 		1: if (b >=0) and (b <= ord(High(TMsgStrId))) then trmsg[TMsgStrId(b)]:= s;
+		2: if (b >=0) and (b <= ord(High(TEventId))) then begin
+			inc(trevt_n[TEventId(b)]);
+			trevt[TEventId(b)][trevt_n[TEventId(b)]]:= s;
+			end;
 		end;
 	end;
 Close(f)
 {$I+}
 end;
 
+function GetEventString(e: TEventId): string;
+begin
+	if trevt_n[e] = 0 then // no messages for this event type?
+		GetEventString:= '*missing translation*'
+	else
+		GetEventString:= trevt[e][Random(trevt_n[e]) + 1]; // Pick a random message and return it
+end;
+
 function Format(fmt: shortstring; var arg: shortstring): shortstring;
 var i: LongInt;
 begin
--- a/share/hedgewars/Data/Locale/bg.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/bg.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -45,3 +45,16 @@
 01:04=На Пауза
 01:05=Наистина ли напускате (Y/Esc)?
 01:06=Внезапна смърт!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/cs.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/cs.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pauza
 01:05=Opravdu ukončit (Y/Esc)?
 01:06=Náhlá smrt!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/de.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/de.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -46,8 +46,25 @@
 01:03=Lautstärke %1%
 01:04=Pausiert
 01:05=Wirklich beenden (Z/Esc)?
-01:06=Sudden death!
-
+01:06=Sudden Death!
 
+; Event messages
+; Hog (%1) died
+02:00=%1 hat den Löffel abgegeben!
+02:00=%1 steht wohl nicht mehr auf!
+02:00=%1 hat's nicht geschafft!
+02:00=%1 stellt sich tot!
+02:00=%1 scheint schon bessere Tage gesehen zu haben!
+; Hog (%1) drowned
+02:01=%1 geht auf Tauchstation!
+02:01=%1 sucht nach der Titanic!
+02:01=%1 hat ein nasses Grab gefunden!
+02:01=%1 schwimmt wie ein Stein!
+02:01=%1 hats ich nass gemacht!
+02:01=%1 versagt beim Seepferdchen!
+; Match starts
+02:02=Auf in die Schlacht!
+02:02=Geladen und entsichert!
+02:02=Jetzt geht's rund!
+02:02=Los geht's!
 
-
--- a/share/hedgewars/Data/Locale/en.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -46,4 +46,17 @@
 01:03=Volume %1%
 01:04=Paused
 01:05=Really quit (Y/Esc)?
-01:06=Sudden death!
+01:06=Sudden Death!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/es.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/es.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pausa
 01:05=Desea salir (Y/Esc)?
 01:06=Muerte súbita!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/fi.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/fi.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Tauko
 01:05=Poistutaanko (Y/Esc)?
 01:06=Äkkikuolema!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/fr.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/fr.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pause
 01:05=Quitter (Y/Esc)?
 01:06=Match à mort!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/it.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/it.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -48,11 +48,15 @@
 01:05=Vuoi davvero uscire (Y/Esc)?
 01:06=Sudden death!
 
-
-
-
-
-
-
-
-
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/ja.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/ja.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=休憩
 01:05=本当にやめるの (Y/Esc)?
 01:06=急に死ぬ!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/pl.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/pl.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Gra wstrzymana
 01:05=Na pewno wyjść (Y/Esc)?
 01:06=Nagła śmierć!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/pt-br.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/pt-br.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pausado
 01:05=Realmente sair (Y/Esc)?
 01:06=Morte Súbita!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/pt-pt.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/pt-pt.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -1,49 +1,62 @@
-; Portuguese locale
-
-00:00=Granada
-00:01=Bomba de fragmentos
-00:02=Bazuca
-00:03=OVNI
-00:04=Caçadeira
-00:05=Martelo Pneumático
-00:06=Saltar o turno
-00:07=Corda
-00:08=Mina
-00:09=DEagle
-00:10=Dinamite
-00:11=Taco de Basebol
-00:12=Soco de Fogo
-00:13=seg
-00:14=Paraquedas
-00:15=Ataque Aéreo
-00:16=Chuva de Minas
-00:17=Maçarico
-00:18=Construção
-00:19=Teletransporte
-00:20=Trocar de Jogador
-00:21=Morteiro
-00:22=Chicote
-00:23=Kamikaze
-00:24=Bolo de aniversário
-00:25=Sedução
-00:26=Melancia
-00:27=Granada Infernal
-00:28=Rocket-Broca
-00:29=Pistola de Bolas
-00:30=Napalm
-00:31=Avião Telecomandado
-00:32=Baixa Gravidade
-00:33=Danos Extra
-00:34=Invulnerável
-00:35=Tempo Extra
-00:36=Mira Laser
-00:37=Vampirismo
-00:38=Sniper
-
-01:00=Vamos lutar!
-01:01=Ronda empatada
-01:02=%1 venceu!
-01:03=Volume %1%
-01:04=Pausado
-01:05=Deseja realmente sair (Y/Esc)?
-01:06=Morte súbita!
+; Portuguese locale
+
+00:00=Granada
+00:01=Bomba de fragmentos
+00:02=Bazuca
+00:03=OVNI
+00:04=Caçadeira
+00:05=Martelo Pneumático
+00:06=Saltar o turno
+00:07=Corda
+00:08=Mina
+00:09=DEagle
+00:10=Dinamite
+00:11=Taco de Basebol
+00:12=Soco de Fogo
+00:13=seg
+00:14=Paraquedas
+00:15=Ataque Aéreo
+00:16=Chuva de Minas
+00:17=Maçarico
+00:18=Construção
+00:19=Teletransporte
+00:20=Trocar de Jogador
+00:21=Morteiro
+00:22=Chicote
+00:23=Kamikaze
+00:24=Bolo de aniversário
+00:25=Sedução
+00:26=Melancia
+00:27=Granada Infernal
+00:28=Rocket-Broca
+00:29=Pistola de Bolas
+00:30=Napalm
+00:31=Avião Telecomandado
+00:32=Baixa Gravidade
+00:33=Danos Extra
+00:34=Invulnerável
+00:35=Tempo Extra
+00:36=Mira Laser
+00:37=Vampirismo
+00:38=Sniper
+
+01:00=Vamos lutar!
+01:01=Ronda empatada
+01:02=%1 venceu!
+01:03=Volume %1%
+01:04=Pausado
+01:05=Deseja realmente sair (Y/Esc)?
+01:06=Morte súbita!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/ru.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Пауза
 01:05=Точно выйти (Y/Esc)?
 01:06=Скоро погибель!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/sk.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/sk.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pauza
 01:05=Naozaj skončiť (Y/Esc)?
 01:06=Rýchla smrť!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/sv.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/sv.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Pausat
 01:05=Vill du verkligen avsluta (Y/Esc)?
 01:06=Sudden death!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/tr.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/tr.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -47,3 +47,16 @@
 01:04=Duraklatıldı
 01:05=Çıkılsın mı (Y/Esc)?
 01:06=Ani ölüm!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/uk.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/uk.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -48,3 +48,15 @@
 01:05=Точно вийти (Y/Esc)?
 01:06=Незабаром погибель!
 
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/zh_CN.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/zh_CN.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -45,3 +45,16 @@
 01:04=暂停
 01:05=退出 (Y/Esc)?
 01:06=出现紧急情况!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!
--- a/share/hedgewars/Data/Locale/zh_TW.txt	Mon Jun 01 00:27:57 2009 +0000
+++ b/share/hedgewars/Data/Locale/zh_TW.txt	Mon Jun 01 17:04:36 2009 +0000
@@ -45,3 +45,16 @@
 01:04=暫停
 01:05=真的要離開嗎 (Y/Esc)?
 01:06=出現緊急狀況!
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that comming!
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+; Match starts
+02:02=Let's fight!
+02:02=Armed and ready!