Default: Add coral nodes and death ABM
authorparamat <mat.gregory@virginmedia.com>
Wed, 12 Oct 2016 00:49:31 +0000 (01:49 +0100)
committerparamat <mat.gregory@virginmedia.com>
Wed, 12 Oct 2016 22:55:46 +0000 (23:55 +0100)
Original code by Sofar.
Textures by Pithydon.
Exposure to air converts live coral to coral skeleton.
Live corals drop coral skeleton.

mods/default/README.txt
mods/default/functions.lua
mods/default/nodes.lua
mods/default/textures/default_coral_brown.png [new file with mode: 0644]
mods/default/textures/default_coral_orange.png [new file with mode: 0644]
mods/default/textures/default_coral_skeleton.png [new file with mode: 0644]

index 4d7744f734a287575ab6c69cdb4c53239ab48202..bf7481b63bf0e37ab78680cf0aee049d58da9d3e 100644 (file)
@@ -178,6 +178,11 @@ asl97 (CC BY-SA 3.0):
 KevDoy (CC BY-SA 3.0)
   heart.png
 
+Pithydon (CC BY-SA 3.0)
+  default_coral_brown.png
+  default_coral_orange.png
+  default_coral_skeleton.png
+
 Glass breaking sounds (CC BY 3.0):
   1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
   2: http://www.freesound.org/people/Tomlija/sounds/97669/
index 7770feb0c564156ff1a9b30447ee29facb102ec4..0e0ab843a1c16a4d5c37183d8165730c94c911ae 100644 (file)
@@ -471,3 +471,19 @@ function default.intersects_protection(minp, maxp, player_name, interval)
 
        return false
 end
+
+
+--
+-- Coral death near air
+--
+
+minetest.register_abm({
+       nodenames = {"default:coral_brown", "default:coral_orange"},
+       neighbors = {"air"},
+       interval = 17,
+       chance = 5,
+       catch_up = false,
+       action = function(pos, node)
+               minetest.set_node(pos, {name = "default:coral_skeleton"})
+       end,
+})
index b6ae52cba38daaff0a8c0e2bee8d2b0516a9ade6..b575704ae879a100301e4cba46be3d760aafc2f5 100644 (file)
@@ -111,8 +111,8 @@ default:mese
 default:stone_with_diamond
 default:diamondblock
 
-Plantlife (non-cubic)
----------------------
+Plantlife
+---------
 
 default:cactus
 default:papyrus
@@ -131,6 +131,13 @@ default:dry_grass_3
 default:dry_grass_4
 default:dry_grass_5
 
+Corals
+------
+
+default:coral_brown
+default:coral_orange
+default:coral_skeleton
+
 Liquids
 -------
 (1. Source 2. Flowing)
@@ -1208,6 +1215,35 @@ for i = 2, 5 do
        })
 end
 
+
+--
+-- Corals
+--
+
+minetest.register_node("default:coral_brown", {
+       description = "Brown Coral",
+       tiles = {"default_coral_brown.png"},
+       groups = {cracky = 3},
+       drop = "default:coral_skeleton",
+       sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_node("default:coral_orange", {
+       description = "Orange Coral",
+       tiles = {"default_coral_orange.png"},
+       groups = {cracky = 3},
+       drop = "default:coral_skeleton",
+       sounds = default.node_sound_stone_defaults(),
+})
+
+minetest.register_node("default:coral_skeleton", {
+       description = "Coral Skeleton",
+       tiles = {"default_coral_skeleton.png"},
+       groups = {cracky = 3},
+       sounds = default.node_sound_stone_defaults(),
+})
+
+
 --
 -- Liquids
 --
diff --git a/mods/default/textures/default_coral_brown.png b/mods/default/textures/default_coral_brown.png
new file mode 100644 (file)
index 0000000..8a775fe
Binary files /dev/null and b/mods/default/textures/default_coral_brown.png differ
diff --git a/mods/default/textures/default_coral_orange.png b/mods/default/textures/default_coral_orange.png
new file mode 100644 (file)
index 0000000..cefac62
Binary files /dev/null and b/mods/default/textures/default_coral_orange.png differ
diff --git a/mods/default/textures/default_coral_skeleton.png b/mods/default/textures/default_coral_skeleton.png
new file mode 100644 (file)
index 0000000..fa48f15
Binary files /dev/null and b/mods/default/textures/default_coral_skeleton.png differ