forked from mtcontrib/death_messages
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			nalc-1.0
			...
			translate_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3cc9f5cb8d | |||
| 749320358c | |||
| 8abee494e3 | |||
| 6201e8468b | |||
| c3e233e7bf | |||
| 9205361679 | |||
| 75e9161420 | |||
| 9cdb3a8ddc | |||
|  | ef02852939 | ||
| 1124ed0d25 | |||
| 687947b07d | |||
|  | d33ad44ab5 | 
							
								
								
									
										36
									
								
								.luacheckrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								.luacheckrc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| read_globals = { | ||||
| 	"DIR_DELIM", | ||||
| 	"minetest", "core", | ||||
| 	"dump", "dump2", | ||||
| 	"vector", | ||||
| 	"VoxelManip", "VoxelArea", | ||||
| 	"PseudoRandom", "PcgRandom", | ||||
| 	"ItemStack", | ||||
| 	"Settings", | ||||
| 	"unpack", | ||||
|  | ||||
| 	table = { | ||||
| 		fields = { | ||||
| 			"copy", | ||||
| 			"indexof", | ||||
| 			"insert_all", | ||||
| 			"key_value_swap", | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	string = { | ||||
| 		fields = { | ||||
| 			"split", | ||||
| 			"trim", | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	math = { | ||||
| 		fields = { | ||||
| 			"hypot", | ||||
| 			"sign", | ||||
| 			"factorial" | ||||
| 		} | ||||
| 	}, | ||||
| } | ||||
| max_line_length = 80 | ||||
							
								
								
									
										38
									
								
								LICENSE.txt
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								LICENSE.txt
									
									
									
									
									
								
							| @@ -1,9 +1,3 @@ | ||||
|  | ||||
|  | ||||
|     Home / Licenses | ||||
|  | ||||
| GPL v3 | ||||
|  | ||||
|                     GNU GENERAL PUBLIC LICENSE | ||||
|                        Version 3, 29 June 2007 | ||||
|  | ||||
| @@ -678,35 +672,3 @@ may consider it more useful to permit linking proprietary applications with | ||||
| the library.  If this is what you want to do, use the GNU Lesser General | ||||
| Public License instead of this License.  But first, please read | ||||
| <http://www.gnu.org/philosophy/why-not-lgpl.html>. | ||||
|  | ||||
| Copy license text to clipboard | ||||
| How to apply this license | ||||
|  | ||||
| Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. | ||||
|  | ||||
| Note: The Free Software Foundation recommends taking the additional step of adding a boilerplate notice to the top of each file. The boilerplate can be found at the end of the license. | ||||
| Source | ||||
| Required | ||||
|  | ||||
|     Disclose Source | ||||
|     License and copyright notice | ||||
|     State Changes | ||||
|  | ||||
| Permitted | ||||
|  | ||||
|     Commercial Use | ||||
|     Distribution | ||||
|     Modification | ||||
|     Patent Grant | ||||
|     Private Use | ||||
|  | ||||
| Forbidden | ||||
|  | ||||
|     Hold Liable | ||||
|     Sublicensing | ||||
|  | ||||
| About Terms of Service | ||||
|  | ||||
| If you have questions or issues, it is always best to consult a legal professional. | ||||
| This site is licensed under the Creative Commons Attribution 3.0 Unported License. | ||||
| Demystified with <3 by GitHub, Inc. | ||||
|   | ||||
							
								
								
									
										12
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,12 +0,0 @@ | ||||
| Death Messages         | ||||
| ============== | ||||
|  | ||||
| A Minetest mod which sends a chat message when a player dies. | ||||
|  | ||||
| Version: 0.1.2 beta | ||||
|  | ||||
| License of source code:  | ||||
| GPL v3 | ||||
|  | ||||
| See LICENSE.txt for full legal text | ||||
|  | ||||
							
								
								
									
										17
									
								
								README.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								README.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
|   ____             _   _       __  __ | ||||
|  |  _ \  ___  __ _| |_| |__   |  \/  | ___  ___ ___  __ _  __ _  ___  ___ | ||||
|  | | | |/ _ \/ _` | __| '_ \  | |\/| |/ _ \/ __/ __|/ _` |/ _` |/ _ \/ __| | ||||
|  | |_| |  __/ (_| | |_| | | | | |  | |  __/\__ \__ \ (_| | (_| |  __/\__ \ | ||||
|  |____/ \___|\__,_|\__|_| |_| |_|  |_|\___||___/___/\__,_|\__, |\___||___/ | ||||
|                                                           |___/ | ||||
|  | ||||
| A Minetest mod which sends a chat message when a player dies. | ||||
|  | ||||
| Version: 0.1.4 | ||||
| License: GPL v3 (see LICENSE.txt) | ||||
|  | ||||
| Dependencies: | ||||
| none | ||||
|  | ||||
| Please report bugs at the github issue tracker: | ||||
| https://github.com/4Evergreen4/death_messages/issues/ | ||||
							
								
								
									
										343
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										343
									
								
								init.lua
									
									
									
									
									
								
							| @@ -1,12 +1,31 @@ | ||||
| ----------------------------------------------------------------------------------------------- | ||||
| local title	= "Death Messages" | ||||
| local version = "0.1.2" | ||||
| local mname	= "death_messages" | ||||
| ----------------------------------------------------------------------------------------------- | ||||
| dofile(minetest.get_modpath("death_messages").."/settings.txt") | ||||
| ----------------------------------------------------------------------------------------------- | ||||
| --[[ | ||||
| death_messages - A Minetest mod which sends a chat message when a player dies. | ||||
| Copyright (C) 2016  EvergreenTree | ||||
|  | ||||
| -- A table of quips for death messages | ||||
| This program is free software: you can redistribute it and/or modify | ||||
| it under the terms of the GNU General Public License as published by | ||||
| the Free Software Foundation, either version 3 of the License, or | ||||
| (at your option) any later version. | ||||
|  | ||||
| This program is distributed in the hope that it will be useful, | ||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| GNU General Public License for more details. | ||||
|  | ||||
| You should have received a copy of the GNU General Public License | ||||
| along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
| --]] | ||||
|  | ||||
| -------------------------------------------------------------------------------- | ||||
| local title = "Death Messages" | ||||
| local version = "0.1.4" | ||||
| local mname = "death_messages" | ||||
| -------------------------------------------------------------------------------- | ||||
| dofile(minetest.get_modpath("death_messages").."/settings.txt") | ||||
| -------------------------------------------------------------------------------- | ||||
|  | ||||
| -- A table of quips for death messages.  The first item in each sub table is the | ||||
| -- default message used when RANDOM_MESSAGES is disabled. | ||||
| local messages = {} | ||||
|  | ||||
| -- Another one to avoid double death messages | ||||
| @@ -20,136 +39,170 @@ local sounds   = { | ||||
| 	[2] = "death_messages_player_2", | ||||
| } | ||||
|  | ||||
| -- Translation wrapper | ||||
| local S = minetest.get_translator(mname) | ||||
|  | ||||
| -- To translate server-side in server language for irc | ||||
| local lang = minetest.settings:get("language") or "fr" | ||||
|  | ||||
| -- Lava death messages | ||||
| messages.lava = { | ||||
| 	"%s thought lava was cool. / %s pensait que la lave etait cool.", | ||||
| 	"%s felt an urgent need to touch lava. / %s s'est senti oblige de toucher la lave.", | ||||
| 	"%s fell in lava. / %s  est tombe dans la lave.", | ||||
| 	"%s died in lava. / %s  est mort(e) dans de la lave.", | ||||
| 	"%s didn't know lava was very hot. / %s ne savait pas que la lave etait vraiment chaude.", | ||||
| 	"%s destroyed Sauron's ring. / %s a detruit l'anneau de Sauron.", | ||||
| 	"%s melted into a ball of fire. / %s est devenu une boule de feu", | ||||
| 	"%s couldn't resist that warm glow of lava. / %s n'a pas pu se retenir face a cette chaude lueur de lave.", | ||||
| 	"%s dug straight down. / %s a creusé a la verticale.", | ||||
| 	"@1 thought lava was cool.", | ||||
| 	"@1 felt an urgent need to touch lava.", | ||||
| 	"@1 fell in lava.", | ||||
| 	"@1 died in lava.", | ||||
| 	"@1 didn't know lava was very hot.", | ||||
| 	"@1 destroyed Sauron's ring.", | ||||
| 	"@1 melted into a ball of fire.", | ||||
| 	"@1 couldn't resist that warm glow of lava.", | ||||
| 	"@1 dug straight down.", | ||||
| } | ||||
|  | ||||
| -- Drowning death messages | ||||
| messages.water = { | ||||
| 	"%s lacked oxygen. / %s a manque d'air.", | ||||
| 	"%s ran out of air. / %s n'avait plus d'air.", | ||||
| 	"%s tried to impersonate an anchor. / %s a essaye d'usurper l'identite d'une ancre.", | ||||
| 	"%s forgot they were not a fish. / %s a oublie qu'il/elle n'etait pas un poisson.", | ||||
| 	"%s forgot they needed to breath underwater. / %s a oublie qu'il lui fallait respirer sous l'eau.", | ||||
| 	"%s isn't good at swimming. / %s n'est pas bon(ne) en natation.", | ||||
| 	"%s looked for the secret of the Unicorn. / %s a cherche le secret de la licorne.", | ||||
| 	"%s forgot their scaphander. / %s a oublie son scaphandre.", | ||||
| 	"%s failed at swimming lessons. / %s a rate ses cours de natation.", | ||||
| 	"%s blew one too many bubbles. / %s a expiré une bulle de trop.", | ||||
| 	"@1 lacked oxygen.", | ||||
| 	"@1 ran out of air.", | ||||
| 	"@1 tried to impersonate an anchor.", | ||||
| 	"@1 forgot (s)he was not a fish.", | ||||
| 	"@1 forgot (s)he needed to breath underwater.", | ||||
| 	"@1 isn't good at swimming.", | ||||
| 	"@1 looked for the secret of the Unicorn.", | ||||
| 	"@1 forgot his/her scaphander.", | ||||
| 	"@1 failed at swimming lessons.", | ||||
| 	"@1 blew one too many bubbles.", | ||||
| } | ||||
|  | ||||
| -- Burning death messages | ||||
| messages.fire = { | ||||
| 	"%s was a bit too hot. / %s a eu un peu trop chaud.", | ||||
| 	"%s was too close to the fire. / %s a ete trop pres du feu.", | ||||
| 	"%s just got roasted. / %s vient de se faire rotir.", | ||||
| 	"%s got burnt. / %s a ete carbonise.", | ||||
| 	"%s thought they were the human torch. / %s s'est prit pour la torche.", | ||||
| 	"%s started a fire. / %s a allume le feu.", | ||||
| 	"%s burned to a crisp. / %s a brulé comme une chips.", | ||||
| 	"%s got a little too warm. / %s a eu un peu trop chaud.", | ||||
| 	"%s got too close to the camp fire. / %s s'est approche(e) trop pres du feu de camp.", | ||||
| 	"%s just got roasted, hotdog style. / %s vient de se faire rotir facon hotdog.", | ||||
| 	"%s was set aflame. More light that way. / %s s'est embrase(e). Ca fait plus de lumiere.", | ||||
| 	"@1 was a bit too hot.", | ||||
| 	"@1 was too close to the fire.", | ||||
| 	"@1 just got roasted.", | ||||
| 	"@1 got burnt.", | ||||
| 	"@1 thought (s)he was the human torch.", | ||||
| 	"@1 started a fire.", | ||||
| 	"@1 burned to a crisp.", | ||||
| 	"@1 got a little too warm.", | ||||
| 	"@1 got too close to the camp fire.", | ||||
| 	"@1 just got roasted, hotdog style.", | ||||
| 	"@1 was set aflame. More light that way.", | ||||
| } | ||||
|  | ||||
| -- Acid death messages | ||||
| messages.acid = { | ||||
| 	"%s has now parts of them missing. / %s a desormais des parties en moins.", | ||||
| 	"%s discovered that acid is fun. / %s a decouvert que l'acide, c'est fun.", | ||||
| 	"%s put their head where it melted. / %s a mis sa tete la ou elle a fondu.", | ||||
| 	"%s discovered that their body in acid, it's like sugar in water. / %s a decouvert que son corps dans l'acide, c'est comme du sucre dans de l'eau.", | ||||
| 	"%s thought they were swimming in apple juice. / %s a cru qu'il/elle se baignait dans du jus de pomme.", | ||||
| 	"%s gave their body to make an infusion / %s a donne son corps pour faire une infusion.", | ||||
| 	"%s drowned into the wrong liquid. / %s a bu la mauvaise tasse.", | ||||
| 	"%s tried to test their body's solubility in acid. / %s a voulu tester la solubilite de son corps dans l'acide." | ||||
| 	"@1 now has parts of him/her missing.", | ||||
| 	"@1 discovered that acid is fun.", | ||||
| 	"@1 put his/her head where it melted.", | ||||
| 	"@1 discovered that his/her body in acid, it's like sugar in water.", | ||||
| 	"@1 thought (s)he was swimming in apple juice.", | ||||
| 	"@1 gave his/her body to make an infusion.", | ||||
| 	"@1 drowned into the wrong liquid.", | ||||
| 	"@1 tried to test his/her body's solubility in acid.", | ||||
| } | ||||
|  | ||||
| -- Quicksands death messages | ||||
| messages.sand = { | ||||
| 	"%s learnt that sand is less fluid than water. / %s a appris que le sable est moins fluide que l'eau.", | ||||
| 	"%s joined the mummies. / %s a rejoint les momies.", | ||||
| 	"%s got themselves buried. / %s s'est fait(e) ensevelir.", | ||||
| 	"%s chose to become a fossil. / %s a choisi la voie de la fossilisation." | ||||
| 	"@1 learned that sand is less fluid than water.", | ||||
| 	"@1 joined the mummies.", | ||||
| 	"@1 got buried.", | ||||
| 	"@1 choosen to become a fossil.", | ||||
| } | ||||
|  | ||||
| -- Other death messages | ||||
| messages.other = { | ||||
| 	"%s did something fatal to them. / %s a fait quelque chose qui lui a ete fatal.", | ||||
| 	"%s died. / %s est mort(e).", | ||||
| 	"%s left this world. / %s n'est plus de ce monde.", | ||||
| 	"%s reached miner's heaven. / %s a rejoint le paradis des mineurs.", | ||||
| 	"%s lost their life. / %s a perdu la vie.", | ||||
| 	"%s saw the light. / %s a vu la lumiere.", | ||||
| 	"%s fell from a bit too high. / %s est tombe d'un peu trop haut.", | ||||
| 	"%s slipped on a banana skin. / %s a glisse sur une peau de banane.", | ||||
| 	"%s wanted to test their super powers. / %s a voulu tester ses super pouvoirs.", | ||||
| 	"%s gave up on life. / %s a decide de mourir.", | ||||
| 	"%s is somewhat dead now. / %s est plus ou moins mort(e) maintenant.", | ||||
| 	"%s passed out -permanently. / %s s'est evanoui(e) -pour toujours.", | ||||
| 	"@1 did something fatal to himself/herself.", | ||||
| 	"@1 died.", | ||||
| 	"@1 left this world.", | ||||
| 	"@1 reached miner's heaven.", | ||||
| 	"@1 lost his/her life.", | ||||
| 	"@1 saw the light.", | ||||
| 	"@1 fell from a bit too high.", | ||||
| 	"@1 slipped on a banana skin.", | ||||
| 	"@1 wanted to test his/her super powers.", | ||||
| 	"@1 gave up on life.", | ||||
| 	"@1 is somewhat dead now.", | ||||
| 	"@1 passed out permanently.", | ||||
| 	"@1 died under very mysterious conditions.", | ||||
| 	"@1 died in very mysterious circumstances.", | ||||
| 	"@1 passed away.", | ||||
| } | ||||
|  | ||||
| -- Whacking death messages | ||||
| messages.whacking = { | ||||
| 	"%s got whacked by %s. / %s s'est pris une raclee de la part de %s.", | ||||
| 	"%s's grave was dug by %s. / La tombe de %s a ete creusee par %s.", | ||||
| 	"%s got recycled by %s. / %s s'est fait recycler par %s.", | ||||
| 	"%s surely annoyed %s. / %s embetait surement %s." | ||||
| 	"@1 got whacked by @2.", | ||||
| 	"@1's grave was dug by @2.", | ||||
| 	"@1 got recycled by @2.", | ||||
| 	"@1 surely annoyed @2.", | ||||
| 	"@1 can't have any more offspring because of @2.", | ||||
| 	"@1 got beaten up by @2.", | ||||
| 	"@1 had his suffering cut short by @2.", | ||||
| 	"@1 died in excruciating pain because of @2's fault.", | ||||
| 	"@1 spent his last moments in the company of @2.", | ||||
| 	"@1's lineage was extinguished by @2.", | ||||
| 	"@1 wasn't as strong as @2.", | ||||
| 	-- Need to fill | ||||
| } | ||||
|  | ||||
| messages.monsters_whacking = { | ||||
| 	"%s got whacked by a %s. / %s s'est pris une raclee de la part d'un %s.", | ||||
| 	"Darwin said : %s was less adapted than a %s. / Darwin a dit : %s etait moins adapte qu'un %s.", | ||||
| 	"%s was transformed into a doormat by a %s. / %s s'est fait transformer en paillasson par un %s.", | ||||
| 	"@1 got whacked by a @2.", | ||||
| 	"Darwin said: @1 was less adapted than a @2.", | ||||
| 	"@1 was transformed into a doormat by a @2.", | ||||
| 	"@1 thought (s)he was stronger than a @2.", | ||||
| 	"@1 got kicked up by a @2. Next up...", | ||||
| 	"@1 felt well that he/she could not do anything against a @2.", | ||||
| 	"@1 versus @2? It's going bad!", | ||||
| 	"@1 got a memorable spanking from @2.", | ||||
| 	"@1 thought to be able to tame a @2? History shows he was wrong.", | ||||
| 	"@1 didn't have the right reflex in front of a @2.", | ||||
| 	"But what did @1 imagine versus a @2? Rest her soul.", | ||||
| 	"@1 got shipped off to the afterlife in a hurry by a @2.", | ||||
| 	"@1's attempt to reason with a @2 didn't exactly pay off.", | ||||
| 	"@1 was severely shattered by a dirty @2.", | ||||
| 	-- Need to fill | ||||
| } | ||||
|  | ||||
| -- Monsters | ||||
|  | ||||
| local monsters = { | ||||
| 	["mobs:fireball"] = "dungeon master", | ||||
| 	["mobs:dungeon_master"] = "dungeon master", | ||||
| 	["mobs:spider"] = "spider", | ||||
| 	["mobs:sand_monster"] = "sand monster", | ||||
| 	["mobs:cow"] = "cow", | ||||
| 	["mobs:creeper"] = "creeper", | ||||
| 	["mobs:dog"] = "dog", | ||||
| 	["mobs:greenbig"] = "big green slim", | ||||
| 	["mobs:greenmedium"] = "medium green slim", | ||||
| 	["mobs:greensmall"] = "small green slim", | ||||
| 	["mobs:lavabig"] = "big lava slim", | ||||
| 	["mobs:lavamedium"] = "medium lava slim", | ||||
| 	["mobs:lavasmall"] = "small lava slim", | ||||
| 	["mobs:yeti"] = "yeti", | ||||
| 	["mobs:snowball"] = "yeti", | ||||
| 	["mobs:npc"] = "npc", | ||||
| 	["mobs:npc_female"] = "female npc", | ||||
| 	["mobs:oerkki"] = "oerkki", | ||||
| 	["mobs:stone_monster"] = "stone monster", | ||||
| 	["mobs:dirt_monster"] = "dirt monster", | ||||
| 	["mobs:goat"] = "goat", | ||||
| 	["mobs:wolf"] = "wolf", | ||||
| 	["mobs:tree_monster"] = "tree monster", | ||||
| 	["mobs:mese_arrow"] = "mese monster", | ||||
| 	["mobs:zombie"] = "zombie", | ||||
| 	["mobs:minotaur"] = "minotaur", | ||||
| 	["mobs:pumba"] = "warthog", | ||||
| 	["mobs_monster:fireball"] = "dungeon master", | ||||
| 	["mobs_monster:dungeon_master"] = "dungeon master", | ||||
| 	["mobs_monster:spider"] = "spider", | ||||
| 	["mobs_monster:sand_monster"] = "sand monster", | ||||
| 	["mobs_animal:cow"] = "cow", | ||||
| 	["creeper:creeper"] = "creeper", | ||||
| 	["pmobs:dog"] = "dog", | ||||
| 	["slimes:greenbig"] = "big green slim", | ||||
| 	["slimes:greenmedium"] = "medium green slim", | ||||
| 	["slimes:greensmall"] = "small green slim", | ||||
| 	["slimes:lavabig"] = "big lava slim", | ||||
| 	["slimes:lavamedium"] = "medium lava slim", | ||||
| 	["slimes:lavasmall"] = "small lava slim", | ||||
| 	["pmobs:yeti"] = "yeti", | ||||
| 	["pmobs:snowball"] = "yeti", | ||||
| 	["pmobs:npc"] = "npc", | ||||
| 	["pmobs:npc_female"] = "female npc", | ||||
| 	["mobs_monster:oerkki"] = "oerkki", | ||||
| 	["mobs_monster:stone_monster"] = "stone monster", | ||||
| 	["mobs_monster:dirt_monster"] = "dirt monster", | ||||
| 	["mobs_animal:goat"] = "goat", | ||||
| 	["pmobs:wolf"] = "wolf", | ||||
| 	["mobs_monster:tree_monster"] = "tree monster", | ||||
| 	["mobs_monster:mese_arrow"] = "mese monster", | ||||
| 	["zombie:zombie"] = "zombie", | ||||
| 	["mobs_monster:minotaur"] = "minotaur", | ||||
| 	["mobs_animal:pumba"] = "warthog", | ||||
| 	["tsm_pyramids:mummy"] = "mummy", | ||||
| 	["mobs:shark_lg"] = "large shark", | ||||
| 	["mobs:shark_md"] = "medium shark", | ||||
| 	["mobs:pumpking"] = "pumpking", | ||||
| 	["mobs:pumpboom"] = "pumpboom", | ||||
| 	["mobs:mese_dragon"] = "mese_dragon", | ||||
| 	["mobs_sharks:shark_lg"] = "large shark", | ||||
| 	["mobs_sharks:shark_md"] = "medium shark", | ||||
| 	["mobs_sharks:shark_sm"] = "small shark", | ||||
| 	["mobs_crocs:crocodile"] = "crocodile", | ||||
| 	["mobs_crocs:crocodile_float"] = "crocodile", | ||||
| 	["mobs_crocs:crocodile_swim"] = "crocodile", | ||||
| 	["mobs_monster:lava_flan"] = "lava flan", | ||||
| 	["mobs_animal:bee"] = "bee", | ||||
| 	["mobs_animal:bunny"] = "evil bunny", | ||||
| --	["mobs:pumpking"] = "pumpking", | ||||
| --	["mobs:pumpboom"] = "pumpboom", | ||||
| --	["mobs:mese_dragon"] = "mese_dragon", | ||||
| } | ||||
|  | ||||
| local function broadcast_death(msg) | ||||
| @@ -158,7 +211,8 @@ local function broadcast_death(msg) | ||||
| 	logfilep:write(os.date("[%Y-%m-%d %H:%M:%S] ") .. msg .. "\n") | ||||
| 	logfilep:close() | ||||
| 	if irc then | ||||
| 		irc.say(msg) | ||||
| 		local tr_msg = minetest.get_translated_string(lang, msg) | ||||
| 		irc.say(tr_msg) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| @@ -166,7 +220,6 @@ local function sound_play_all(dead) | ||||
| 	for _, p in ipairs(minetest.get_connected_players()) do | ||||
| 		local player_name = p:get_player_name() | ||||
| 		if player_name and player_name ~= dead then | ||||
| 			--			minetest.sound_play("death_messages_people_1",{to_player=player_name, gain=soundset.get_gain(player_name,"other")}) | ||||
| 			minetest.sound_play("death_messages_people_1",{to_player=player_name, gain=1}) | ||||
| 		end | ||||
| 	end | ||||
| @@ -178,15 +231,14 @@ minetest.register_on_punchplayer(function(player, hitter, time, | ||||
| 		local player_name = player:get_player_name() | ||||
| 		local death_message | ||||
| 		if hitter:is_player() then | ||||
| 			death_message = string.format(messages.whacking[math.random(1,#messages.whacking)], player_name, hitter:get_player_name(), player_name, hitter:get_player_name()) | ||||
| 			death_message = S(messages.whacking[math.random(1,#messages.whacking)], player_name, hitter:get_player_name()) | ||||
| 		else | ||||
| 			local entity_name = monsters[hitter:get_luaentity().name] or "monster" | ||||
| 			death_message = string.format(messages.monsters_whacking[math.random(1, #messages.monsters_whacking)], player_name, entity_name, player_name, entity_name) | ||||
| 			death_message = S(messages.monsters_whacking[math.random(1, #messages.monsters_whacking)], player_name, entity_name) | ||||
| 		end | ||||
| 		broadcast_death(death_message) | ||||
| 		--		minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) | ||||
| 				minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=1}) | ||||
| 		sound_play_all(player:get_player_name()) | ||||
| 		minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player_name,gain=1}) | ||||
| 		sound_play_all(player_name) | ||||
| 		whacked[player_name] = true | ||||
| 	end | ||||
| end) | ||||
| @@ -200,12 +252,19 @@ minetest.register_on_respawnplayer(function(player) | ||||
| 	whacked[player:get_player_name()] = nil | ||||
| end) | ||||
|  | ||||
| if RANDOM_MESSAGES == true then | ||||
| 	minetest.register_on_dieplayer(function(player) | ||||
| local function get_message(mtype) | ||||
| 	if RANDOM_MESSAGES then | ||||
| 		return messages[mtype][math.random(1, #messages[mtype])] | ||||
| 	else | ||||
| 		return messages[mtype][1] -- 1 is the index for the non-random message | ||||
| 	end | ||||
| end | ||||
|  | ||||
| minetest.register_on_dieplayer(function(player) | ||||
| 		local player_name = player:get_player_name() | ||||
| 		local node = minetest.registered_nodes[minetest.get_node(player:getpos()).name] | ||||
| 		local node = minetest.registered_nodes[minetest.get_node(player:get_pos()).name] | ||||
| 		if minetest.is_singleplayer() then | ||||
| 			player_name = "You" | ||||
| 			player_name = S("You") | ||||
| 		end | ||||
|  | ||||
| 		local death_message = "" | ||||
| @@ -214,63 +273,35 @@ if RANDOM_MESSAGES == true then | ||||
|  | ||||
| 			-- Death by lava | ||||
| 			if node.groups.lava ~= nil then | ||||
| 				death_message = messages.lava[math.random(1,#messages.lava)] | ||||
| 				death_message = get_message("lava") | ||||
| 				-- Death by acid | ||||
| 			elseif node.groups.acid ~= nil then | ||||
| 				death_message = messages.acid[math.random(1,#messages.acid)] | ||||
| 				death_message = get_message("acid") | ||||
| 				-- Death by drowning | ||||
| 			elseif player:get_breath() == 0 and node.groups.water then | ||||
| 				death_message = messages.water[math.random(1,#messages.water)] | ||||
| 			elseif player:get_breath() == 0 then | ||||
| 				if node.groups.water ~= nil then | ||||
| 					death_message = get_message("water") | ||||
| 					-- Death in quicksand | ||||
| 				elseif node.name == "nalc:sand_source" or node.name ==  "nalc:sand_flowing" then | ||||
| 					death_message = get_message("sand") | ||||
| 				end | ||||
| 				-- Death by fire | ||||
| 			elseif node.name == "fire:basic_flame" then | ||||
| 				death_message = messages.fire[math.random(1,#messages.fire)] | ||||
| 			-- Death in quicksand | ||||
| 			elseif player:get_breath() == 0 and node.name == "default:sand_source" or node.name == "default:sand_flowing" then | ||||
| 				death_message = messages.sand[math.random(1,#messages.sand)] | ||||
| 				death_message = get_message("fire") | ||||
| 				-- Death by something else | ||||
| 			else | ||||
| 				death_message = messages.other[math.random(1,#messages.other)] | ||||
| 				death_message = get_message("other") | ||||
| 			end | ||||
|  | ||||
| 			-- Actually tell something | ||||
| 			death_message = string.format(death_message, player_name, player_name) | ||||
| 			death_message = S(death_message, player_name) | ||||
| 			broadcast_death(death_message) | ||||
| 			--			minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player_name,gain=soundset.get_gain(player_name, "other")}) | ||||
| 						minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player_name,gain=1}) | ||||
| 			minetest.sound_play(sounds[math.random(1,#sounds)], {to_player=player_name,gain=1}) | ||||
| 			sound_play_all(player_name) | ||||
| 			whacked[player_name] = true | ||||
| 		end | ||||
| 	end) | ||||
|  | ||||
| else | ||||
| 	-- Should we keep that part? | ||||
| 	minetest.register_on_dieplayer(function(player) | ||||
| 		local player_name = player:get_player_name() | ||||
| 		local node = minetest.registered_nodes[minetest.get_node(player:getpos()).name] | ||||
| 		if minetest.is_singleplayer() then | ||||
| 			player_name = "You" | ||||
| 		end | ||||
| 		if not whacked[player_name] then | ||||
| 			-- Death by lava | ||||
| 			if node.groups.lava ~= nil then | ||||
| 				minetest.chat_send_all(player_name .. " melted into a ball of fire") | ||||
| 			-- Death by drowning | ||||
| 			elseif player:get_breath() == 0 then | ||||
| 				minetest.chat_send_all(player_name .. " ran out of air.") | ||||
| 			-- Death by fire | ||||
| 			elseif node.name == "fire:basic_flame" then | ||||
| 				minetest.chat_send_all(player_name .. " burned to a crisp.") | ||||
| 			-- Death by something else | ||||
| 			else | ||||
| 				minetest.chat_send_all(player_name .. " died.") | ||||
| 			end | ||||
| 		end | ||||
| 		--		minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) | ||||
| 				minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=1}) | ||||
| 		sound_play_all(player:get_player_name()) | ||||
| 	end) | ||||
| end | ||||
|  | ||||
| ----------------------------------------------------------------------------------------------- | ||||
| minetest.log("action", "[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") | ||||
| ----------------------------------------------------------------------------------------------- | ||||
| -------------------------------------------------------------------------------- | ||||
| print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") | ||||
| -------------------------------------------------------------------------------- | ||||
|   | ||||
							
								
								
									
										101
									
								
								locale/death_messages.fr.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								locale/death_messages.fr.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | ||||
| # textdomain: death_messages | ||||
|  | ||||
| You=Tu | ||||
|  | ||||
| ## lava | ||||
| @1 thought lava was cool.=@1 pensait que la lave était cool. | ||||
| @1 felt an urgent need to touch lava.=@1 a ressenti un besoin urgent de toucher la lave. | ||||
| @1 fell in lava.=@1 est tombé(e) dans la lave. | ||||
| @1 died in lava.=@1 est mort(e) dans de la lave. | ||||
| @1 didn't know lava was very hot.=@1 ne savait pas que la lave était vraiment chaude. | ||||
| @1 destroyed Sauron's ring.=@1 a detruit l'anneau de Sauron. | ||||
| @1 melted into a ball of fire.=@1 a fondu en une boule de feu. | ||||
| @1 couldn't resist that warm glow of lava.=@1 n'a pas pu résister à cette chaude lueur de lave. | ||||
| @1 dug straight down.=@1 a creusé vers le bas. | ||||
|  | ||||
| ## Drowning | ||||
| @1 lacked oxygen.=@1 manquait d'oxygène. | ||||
| @1 ran out of air.=@1 a manqué d'air. | ||||
| @1 tried to impersonate an anchor.=@1 a tenté d'usurper l'identité d'une ancre. | ||||
| @1 forgot (s)he was not a fish.=@1 a oublié qu'il/elle n'était pas un poisson. | ||||
| @1 forgot (s)he needed to breath underwater.=@1 a oublié qu'il lui fallait respirer sous l'eau. | ||||
| @1 isn't good at swimming.=@1 n'est pas bon(ne) en natation. | ||||
| @1 looked for the secret of the Unicorn.=@1 a cherché le secret de la licorne. | ||||
| @1 forgot his/her scaphander.=@1 a oublié son scaphandre. | ||||
| @1 failed at swimming lessons.=@1 a raté ses cours de natation. | ||||
| @1 blew one too many bubbles.=@1 a expiré une bulle de trop. | ||||
|  | ||||
| ## Fire | ||||
| @1 was a bit too hot.=@1 était un peu trop chaud. | ||||
| @1 was too close to the fire.=@1 a été trop près du feu. | ||||
| @1 just got roasted.=@1 vient de se faire rotir. | ||||
| @1 got burnt.=@1 a été carbonisé. | ||||
| @1 thought (s)he was the human torch.=@1 pensait qu'elle/il était la torche humaine. | ||||
| @1 started a fire.=@1 a allumé le feu. | ||||
| @1 burned to a crisp.=@1 a brulé comme une chips. | ||||
| @1 got a little too warm.=@1 a eu un peu trop chaud. | ||||
| @1 got too close to the camp fire.=@1 s'est approché(e) trop près du feu de camp. | ||||
| @1 just got roasted, hotdog style.=@1 vient de se faire rôtir façon hotdog. | ||||
| @1 was set aflame. More light that way.=@1 s'est embrasé(e). Ça fait plus de lumière. | ||||
|  | ||||
| ## Acid | ||||
| @1 now has parts of him/her missing.=@1 a desormais des parties en moins. | ||||
| @1 discovered that acid is fun.=@1 a decouvert que l'acide, c'est fun. | ||||
| @1 put his/her head where it melted.=@1 a mis sa tête là ou elle a fondu. | ||||
| @1 discovered that his/her body in acid, it's like sugar in water.=@1 a decouvert que son corps dans l'acide, c'est comme du sucre dans de l'eau. | ||||
| @1 thought (s)he was swimming in apple juice.=@1 a cru qu'il/elle se baignait dans du jus de pomme. | ||||
| @1 gave his/her body to make an infusion.=@1 a donné son corps pour faire une infusion. | ||||
| @1 drowned into the wrong liquid.=@1 a bu la mauvaise tasse. | ||||
| @1 tried to test his/her body's solubility in acid.=@1 a voulu tester la solubilité de son corps dans l'acide. | ||||
|  | ||||
| ## Sand | ||||
| @1 learned that sand is less fluid than water.=@1 a appris que le sable est moins fluide que l'eau. | ||||
| @1 joined the mummies.=@1 a rejoint les momies. | ||||
| @1 got buried.=@1 s'est fait(e) ensevelir. | ||||
| @1 choosen to become a fossil.=@1 a choisi de devenir un fossile. | ||||
|  | ||||
| ## Other | ||||
| @1 did something fatal to himself/herself.=@1 a fait quelque chose qui lui a été fatal. | ||||
| @1 died.=@1 est mort(e). | ||||
| @1 left this world.=@1 n'est plus de ce monde. | ||||
| @1 reached miner's heaven.=@1 a rejoint le paradis des mineurs. | ||||
| @1 lost his/her life.=@1 a perdu la vie. | ||||
| @1 saw the light.=@1 a vu la lumière. | ||||
| @1 fell from a bit too high.=@1 est tombé(e) d'un peu trop haut. | ||||
| @1 slipped on a banana skin.=@1 a glissé sur une peau de banane. | ||||
| @1 wanted to test his/her super powers.=@1 a voulu tester ses super pouvoirs. | ||||
| @1 gave up on life.=@1 a decidé de mourir. | ||||
| @1 is somewhat dead now.=@1 est quelque peu mort(e) maintenant. | ||||
| @1 passed out permanently.=@1 s'est evanoui(e) pour toujours. | ||||
| @1 died under very mysterious conditions.=@1 est mort(e) dans des conditions bien mystérieuses. | ||||
| @1 died in very mysterious circumstances.=@1 est mort(e) dans de mystérieuses circonstances. | ||||
| @1 passed away.=@1 a trépassé. | ||||
|  | ||||
| ## Whacking Death | ||||
| @1 got whacked by @2.=@1 s'est pris(e) une raclée de la part de @2. | ||||
| @1's grave was dug by @2.=La tombe de @1 a été creusée par @2. | ||||
| @1 got recycled by @2.=@1 s'est fait(e) recycler par @2. | ||||
| @1 surely annoyed @2.=@1 embetait sûrement @2. | ||||
| @1 can't have any more offspring because of @2.=@1 ne pourra plus avoir de descendance à cause de @2. | ||||
| @1 got beaten up by @2.=@1 s'est fait(e) rosser par @2. | ||||
| @1 had his suffering cut short by @2.=@1 s'est vu(e) abréger ses souffrances par @2. | ||||
| @1 died in excruciating pain because of @2's fault.=@1 est mort(e) dans d'atroces souffrances par la faute de @2. | ||||
| @1 spent his last moments in the company of @2.=@1 a vécu ses derniers instants en compagnie de @2. | ||||
| @1's lineage was extinguished by @2.=La lignée de @1 s'est éteinte à cause de @2. | ||||
| @1 wasn't as strong as @2.=@1 a été moins fort(e) que @2. | ||||
|  | ||||
| ## Monster Whacking | ||||
| @1 got whacked by a @2.=@1 s'est pris une raclée de la part d'un @2. | ||||
| Darwin said: @1 was less adapted than a @2.=Darwin a dit : @1 était moins adapté(e) qu'un @2. | ||||
| @1 was transformed into a doormat by a @2.=@1 s'est fait(e) transformer en paillasson par un @2. | ||||
| @1 thought (s)he was stronger than a @2.=@1 s'est cru(e) plus fort(e) qu'un @2. | ||||
| @1 got kicked up by a @2. Next up...=@1 s'est fait(e) dégommer par un @2. Au suivant... | ||||
| @1 felt well that he/she could not do anything against a @2.=@1 sentait bien qu'il/elle ne pouvait pas faire le poids contre un @2. | ||||
| @1 versus @2? It's going bad!=@1 contre un @2 ? Ça tourne mal ! | ||||
| @1 got a memorable spanking from @2.=@1 a reçu une fessé mémorable de la part d'un @2. | ||||
| @1 thought to be able to tame a @2? History shows he was wrong.=@1 croyait pouvoir dompter un @2 ? L'histoire montre qu'il/elle a eu tort. | ||||
| @1 didn't have the right reflex in front of a @2.=@1 n'a pas eu le bon réflexe face à un @2. | ||||
| But what did @1 imagine versus a @2? Rest her soul.=Mais que s'est imaginé(e) @1 face à un @2 ? Paix à son âme. | ||||
| @1 got shipped off to the afterlife in a hurry by a @2.=@1 s'est fait(e) expédier dans l'au-delà vite fait bien fait par un @2. | ||||
| @1's attempt to reason with a @2 didn't exactly pay off.=La tentative de @1 pour raisonner un @2 n'a pas vraiment porté ses fruits. | ||||
| @1 was severely shattered by a dirty @2.=@1 s'est fait(e) sévèrement éclater par une saleté de @2. | ||||
							
								
								
									
										5
									
								
								locale/death_messages.fr.tr~
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								locale/death_messages.fr.tr~
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| # textdomain: death_messages | ||||
|  | ||||
| ## lava | ||||
| @1 thought lava was cool=@1 pensait que la lave était cool | ||||
| @1 felt an urgent need to touch lava=@1 s'est senti obligé de toucher la lave | ||||
							
								
								
									
										101
									
								
								locale/template.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								locale/template.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | ||||
| # textdomain: death_messages | ||||
|  | ||||
| You= | ||||
|  | ||||
| ## lava | ||||
| @1 thought lava was cool.= | ||||
| @1 felt an urgent need to touch lava.= | ||||
| @1 fell in lava.= | ||||
| @1 died in lava.= | ||||
| @1 didn't know lava was very hot.= | ||||
| @1 destroyed Sauron's ring.= | ||||
| @1 melted into a ball of fire.= | ||||
| @1 couldn't resist that warm glow of lava.= | ||||
| @1 dug straight down.= | ||||
|  | ||||
| ## Drowning | ||||
| @1 lacked oxygen.= | ||||
| @1 ran out of air.= | ||||
| @1 tried to impersonate an anchor.= | ||||
| @1 forgot (s)he was not a fish.= | ||||
| @1 forgot (s)he needed to breath underwater.= | ||||
| @1 isn't good at swimming.= | ||||
| @1 looked for the secret of the Unicorn.= | ||||
| @1 forgot his/her scaphander.= | ||||
| @1 failed at swimming lessons.= | ||||
| @1 blew one too many bubbles.= | ||||
|  | ||||
| ## Fire | ||||
| @1 was a bit too hot.= | ||||
| @1 was too close to the fire.= | ||||
| @1 just got roasted.= | ||||
| @1 got burnt.= | ||||
| @1 thought (s)he was the human torch.= | ||||
| @1 started a fire.= | ||||
| @1 burned to a crisp.= | ||||
| @1 got a little too warm.= | ||||
| @1 got too close to the camp fire.= | ||||
| @1 just got roasted, hotdog style.= | ||||
| @1 was set aflame. More light that way.= | ||||
|  | ||||
| ## Acid | ||||
| @1 now has parts of him/her missing.= | ||||
| @1 discovered that acid is fun.= | ||||
| @1 put his/her head where it melted.= | ||||
| @1 discovered that his/her body in acid, it's like sugar in water.=l'acide, c'est comme du sucre dans de l'eau. | ||||
| @1 thought (s)he was swimming in apple juice.= | ||||
| @1 gave his/her body to make an infusion.= | ||||
| @1 drowned into the wrong liquid.= | ||||
| @1 tried to test his/her body's solubility in acid.= | ||||
|  | ||||
| ## Sand | ||||
| @1 learned that sand is less fluid than water.= | ||||
| @1 joined the mummies.= | ||||
| @1 got buried.= | ||||
| @1 choosen to become a fossil.= | ||||
|  | ||||
| ## Other | ||||
| @1 did something fatal to himself/herself.= | ||||
| @1 died.= | ||||
| @1 left this world.= | ||||
| @1 reached miner's heaven.= | ||||
| @1 lost his/her life.= | ||||
| @1 saw the light.= | ||||
| @1 fell from a bit too high.= | ||||
| @1 slipped on a banana skin.= | ||||
| @1 wanted to test his/her super powers.= | ||||
| @1 gave up on life.= | ||||
| @1 is somewhat dead now.= | ||||
| @1 passed out permanently.= | ||||
| @1 died under very mysterious conditions.= | ||||
| @1 died in very mysterious circumstances.= | ||||
| @1 passed away.= | ||||
|  | ||||
| ## Whacking Death | ||||
| @1 got whacked by @2.= | ||||
| @1's grave was dug by @2.= | ||||
| @1 got recycled by @2.= | ||||
| @1 surely annoyed @2.= | ||||
| @1 can't have any more offspring because of @2.= | ||||
| @1 got beaten up by @2.= | ||||
| @1 had his suffering cut short by @2.= | ||||
| @1 died in excruciating pain because of @2's fault.= | ||||
| @1 spent his last moments in the company of @2.= | ||||
| @1's lineage was extinguished by @2.= | ||||
| @1 wasn't as strong as @2.= | ||||
|  | ||||
| ## Monster Whacking | ||||
| @1 got whacked by a @2.= | ||||
| Darwin said: @1 was less adapted than a @2.= | ||||
| @1 was transformed into a doormat by a @2.= | ||||
| @1 thought (s)he was stronger than a @2.= | ||||
| @1 got kicked up by a @2. Next up...= | ||||
| @1 felt well that he/she could not do anything against a @2.= | ||||
| @1 versus @2? It's going bad!= | ||||
| @1 got a memorable spanking from @2.= | ||||
| @1 thought to be able to tame a @2? History shows he was wrong.= | ||||
| @1 didn't have the right reflex in front of a @2.= | ||||
| But what did @1 imagine versus a @2? Rest her soul.= | ||||
| @1 got shipped off to the afterlife in a hurry by a @2.= | ||||
| @1's attempt to reason with a @2 didn't exactly pay off.= | ||||
| @1 was severely shattered by a dirty @2.= | ||||
							
								
								
									
										7
									
								
								mod.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								mod.conf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| name = death_messages | ||||
| title = Death Messages | ||||
| author = Evergreen | ||||
| description = Sends a chat message when a player dies (with customizable messages) | ||||
| license = GPL v3 | ||||
| forum = https://forum.minetest.net/viewtopic.php?t=8821 | ||||
| version = 0.1.4 | ||||
							
								
								
									
										
											BIN
										
									
								
								screenshot.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								screenshot.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 68 KiB | 
		Reference in New Issue
	
	Block a user