Skip to content

Commit

Permalink
Default: Add coral nodes and death ABM
Browse files Browse the repository at this point in the history
Original code by Sofar.
Textures by Pithydon.
Exposure to air converts live coral to coral skeleton.
Live corals drop coral skeleton.
  • Loading branch information
paramat committed Oct 12, 2016
1 parent 7b30c26 commit 3d26b33
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mods/default/README.txt
Expand Up @@ -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/
Expand Down
16 changes: 16 additions & 0 deletions mods/default/functions.lua
Expand Up @@ -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,
})
40 changes: 38 additions & 2 deletions mods/default/nodes.lua
Expand Up @@ -111,8 +111,8 @@ default:mese
default:stone_with_diamond
default:diamondblock
Plantlife (non-cubic)
---------------------
Plantlife
---------
default:cactus
default:papyrus
Expand All @@ -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)
Expand Down Expand Up @@ -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
--
Expand Down
Binary file added mods/default/textures/default_coral_brown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/default/textures/default_coral_orange.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/default/textures/default_coral_skeleton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d26b33

Please sign in to comment.