From c3b8c7c447048cd6c646e82a6222b972b20256fe Mon Sep 17 00:00:00 2001 From: Mossmanikin Date: Thu, 10 Oct 2013 14:41:57 +0200 Subject: [PATCH] More seaweed , different generation circumstances --- along_shore/along_shore_settings.txt | 7 ++ along_shore/generating.lua | 79 +++++++++++++++--- along_shore/init.lua | 2 +- along_shore/nodes.lua | 41 ++++++--- .../textures/along_shore_seaweed_1.png | Bin 0 -> 358 bytes .../textures/along_shore_seaweed_2.png | Bin 0 -> 364 bytes .../textures/along_shore_seaweed_3.png | Bin 0 -> 383 bytes .../textures/along_shore_seaweed_4.png | Bin 0 -> 301 bytes along_shore/textures/credit_textures.txt | 10 ++- .../along_shore_pondscum_1.png | Bin 10 files changed, 109 insertions(+), 30 deletions(-) create mode 100644 along_shore/textures/along_shore_seaweed_1.png create mode 100644 along_shore/textures/along_shore_seaweed_2.png create mode 100644 along_shore/textures/along_shore_seaweed_3.png create mode 100644 along_shore/textures/along_shore_seaweed_4.png rename along_shore/textures/{ => old & unused}/along_shore_pondscum_1.png (100%) diff --git a/along_shore/along_shore_settings.txt b/along_shore/along_shore_settings.txt index e4562c0..d155d07 100644 --- a/along_shore/along_shore_settings.txt +++ b/along_shore/along_shore_settings.txt @@ -11,5 +11,12 @@ Lilypads_Rarity = 33 -- larger values make lillypads more rare (100 means chanc +Seaweed_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + + +Seaweed_Rarity = 33 -- larger values make lillypads more rare (100 means chance of 0 %) + + + diff --git a/along_shore/generating.lua b/along_shore/generating.lua index 0f2fba2..acebd5e 100644 --- a/along_shore/generating.lua +++ b/along_shore/generating.lua @@ -1,12 +1,15 @@ +-- MM: all temperature values have nothing to do with the circumstances under which real plants grow +-- MM: they are just used to get a result that looks "good" or more or less believable + ----------------------------------------------------------------------------------------------- -- LiLy PaDS ----------------------------------------------------------------------------------------------- abstract_along_shore.grow_lilypad = function(pos) local right_here = {x=pos.x, y=pos.y+1, z=pos.z} - local lily_type = math.random(1,6) + local lily_type = math.random(1,2) if lily_type == 1 then - minetest.add_node(right_here, {name="along_shore:lilypads_"..math.random(1,3), param2=math.random(0,3)}) + minetest.add_node(right_here, {name="along_shore:lilypads_"..math.random(1,4), param2=math.random(0,3)}) end if lily_type == 2 then if minetest.get_modpath("flowers_plus") ~= nil then @@ -19,7 +22,7 @@ abstract_along_shore.grow_lilypad = function(pos) for i in pairs(LiLy_PaDS) do local NR = LiLy_PaDS[i][1] local PaD = LiLy_PaDS[i][2] - local chance = math.random(1, 4) + local chance = math.random(1,4) if chance == NR then minetest.add_node(right_here, {name=PaD, param2=math.random(0,3)}) end @@ -28,16 +31,6 @@ abstract_along_shore.grow_lilypad = function(pos) minetest.add_node(right_here, {name="along_shore:lilypads_"..math.random(1,4), param2=math.random(0,3)}) end end - --if lily_type == 3 then - --minetest.add_node(right_here, {name="along_shore:pondscum_1", param2=1}) - --end - if lily_type >= 3 then - if minetest.get_modpath("flowers_plus") ~= nil then - minetest.add_node(right_here, {name="flowers:seaweed", param2=1}) - else - minetest.add_node(right_here, {name="along_shore:pondscum_1", param2=1}) - end - end end plantslib:register_generate_plant({ @@ -51,6 +44,66 @@ plantslib:register_generate_plant({ near_nodes_vertical = 1, near_nodes_count = 1, plantlife_limit = -0.9, + temp_max = -0.22, -- MM: checked perlin values ingame, seemed to make sense + temp_min = 0.22, -- MM: checked perlin values ingame, seemed to make sense }, "abstract_along_shore.grow_lilypad" +) + +----------------------------------------------------------------------------------------------- +-- Sea WeeD +----------------------------------------------------------------------------------------------- +abstract_along_shore.grow_seaweed = function(pos) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + minetest.add_node(right_here, {name="along_shore:seaweed_"..math.random(1,4), param2=math.random(1,3)}) +end + +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = Seaweed_Max_Count, + rarity = Seaweed_Rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 4, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + "abstract_along_shore.grow_seaweed" +) + +-- seaweed at beaches +-- MM: not satisfied with it, but some beaches should have some algae +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = Seaweed_Max_Count, + rarity = Seaweed_Rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:sand"}, + near_nodes_size = 1, + near_nodes_vertical = 0, + near_nodes_count = 3, + plantlife_limit = -0.9, + temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere + temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere + }, + "abstract_along_shore.grow_seaweed" +) +plantslib:register_generate_plant({ + surface = {"default:sand"}, + max_count = Seaweed_Max_Count*2, + rarity = Seaweed_Rarity/2, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:water_source"}, + near_nodes_size = 1, + near_nodes_vertical = 0, + near_nodes_count = 3, + plantlife_limit = -0.9, + temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere + temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere + }, + "abstract_along_shore.grow_seaweed" ) \ No newline at end of file diff --git a/along_shore/init.lua b/along_shore/init.lua index 8fe0a1c..f4fb47e 100644 --- a/along_shore/init.lua +++ b/along_shore/init.lua @@ -1,6 +1,6 @@ ----------------------------------------------------------------------------------------------- local title = "Along the Shore" -local version = "0.0.2" +local version = "0.0.3" local mname = "along_shore" ----------------------------------------------------------------------------------------------- diff --git a/along_shore/nodes.lua b/along_shore/nodes.lua index d4d3ad5..7a3d82b 100644 --- a/along_shore/nodes.lua +++ b/along_shore/nodes.lua @@ -49,32 +49,47 @@ for i in pairs(LiLy_PaDS) do end ----------------------------------------------------------------------------------------------- --- PoND SCuM +-- Sea WeeD ----------------------------------------------------------------------------------------------- -local PoND_SCuM = { {1} } +minetest.register_alias("along_shore:pondscum_1", "along_shore:seaweed_1") + +local PoND_SCuM = { {1}, {2}, {3}, {4} } for i in pairs(PoND_SCuM) do local NR = PoND_SCuM[i][1] local iNV = NR - 1 - minetest.register_node("along_shore:pondscum_"..NR, { - description = "Pond Scum", - drawtype = "signlike", -- idea here is: you can smack it against a wall and it stays there + minetest.register_node("along_shore:seaweed_"..NR, { + description = "Seaweed", + --drawtype = "signlike", -- MM: idea here is: you can smack it against a wall and it stays there + drawtype = "nodebox", -- MM: think rotation is more important than previous idea tiles = { - "along_shore_pondscum_"..NR..".png", - "along_shore_pondscum_"..NR..".png^[transformFY", -- mirror + "along_shore_seaweed_"..NR..".png", + "along_shore_seaweed_"..NR..".png^[transformFY", -- mirror "along_shore_empty.png" }, - inventory_image = "along_shore_pondscum_"..NR..".png", - wield_image = "along_shore_pondscum_"..NR..".png", + inventory_image = "along_shore_seaweed_2.png", + wield_image = "along_shore_seaweed_2.png", paramtype = "light", - paramtype2 = "wallmounted", + paramtype2 = "facedir", sunlight_propagates = true, buildable_to = true, walkable = false, - selection_box = {type = "wallmounted"}, - groups = {dig_immediate=2,not_in_creative_inventory=iNV}, - drop = "along_shore:pondscum_1", + node_box = {type = "fixed", fixed = super_flat}, + selection_box = {type = "fixed", fixed = quite_flat}, + groups = {dig_immediate=2,not_in_creative_inventory=iNV,flower=1}, + drop = "along_shore:seaweed_1", sounds = default.node_sound_leaves_defaults(), liquids_pointable = true, + on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing + local direction = minetest.dir_to_facedir(placer:get_look_dir()) + if minetest.get_node(pt.above).name=="air" then + minetest.set_node(pt.above, {name="along_shore:seaweed_"..math.random(1,4), param2=direction}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end + end, }) end \ No newline at end of file diff --git a/along_shore/textures/along_shore_seaweed_1.png b/along_shore/textures/along_shore_seaweed_1.png new file mode 100644 index 0000000000000000000000000000000000000000..51f791db7f453a8485ba8b323babde53a53d0aae GIT binary patch literal 358 zcmV-s0h#`ZP)H;LN@>a0QX5mK~y+T zZIe3=!Y~j-bBWN<(@-H=B#w{+KuN<1s5pDjv+`DB2c!tc-r4zhGfms?yv(cX<#Va^ z{XMTfoU_i_h5_*So>qbUy9OZe_Bys^yi+e>Yv2n96tM@OiZ&wlI7?Nn#tqqRf?Q?0 z9@P~|%F>edB-tsGk?w}08sy5VA}yx13Q})u05r7g^U$)8V9ch=fMSzYopuE70#uG* zL(^~Cpczl6LWX3bAor8iCXF};Na;Co8J@Y=yc&3YId#bQW^yt!%(`~HDwBh8fRdH0 za;)o00i~s!dCxNNZWi>Hpq$Lkcg)0YpvH~vtNR1|0e=7!lvI6;>1s;*b z3=BdgAk26#O}+vsC{^MbQ4*Y=R#Ki=l*$m0n3-3i=jR%tP-d)Ws%L2E{@KYKsOp8M zi(`m||I*2Ze1{AKSpIfixNtc@F-m3L1a=3{!`wk1%MM4(x_p$AqeWG_vvzm&?v37S zxBf8>Klr$0#hFi1&wmS?H(j{>mB5_5+iYbUu1(hAC=z`CyKqIx!OzL;D`Mn!2Rw<@ zUgvzJ{GwF=r)X{PnR&7tZD(R`N2bPDNB8 zb~7$DE-^7j^FlWO008?*L_t(IPi>Pi4gxU@1n(2j(9=*MS|pyp1E8eg1ysB}+yusK zPIuBNiS4Y{YiF9~ueHX~KlZoxeqR1I?AO<^Z1@Jh2OR_hQm89Q29U#b)6o;vjF;!v zM+|_T(>9$SyCw($86+@%Sm~=W&6-Xx8SJ{IMF}TmkpYp7;=)vWiJG;i76x+}dzO_Q zskWs+)=MD2VC-chlTu#lnT?BP!!BSZ8(Nno2*`T6Z+i);&oF@YRI1qpX{QDF|#c-v2~Ww0dkPkBIz$5 dS@r+-LO+r0`lbjxw2=S+002ovPDHLkV1le_mz4kj literal 0 HcmV?d00001 diff --git a/along_shore/textures/along_shore_seaweed_4.png b/along_shore/textures/along_shore_seaweed_4.png new file mode 100644 index 0000000000000000000000000000000000000000..2fccd04e2765c75ee93e3b146e8cafcd41db3430 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=BeG%-Ex}lN~51RpJ^^5}cn_Ql40p$`Fv4nOCCc=Nh6=W~^tbXK3jD*~uKJYNe-( zV~B3pmwdeb?=QBP$ z{hIZ;F4}*#R>RGk1?t+FS66TqJ$O7zopr0Lf@_YybcN literal 0 HcmV?d00001 diff --git a/along_shore/textures/credit_textures.txt b/along_shore/textures/credit_textures.txt index 8bd27bd..fc88ec4 100644 --- a/along_shore/textures/credit_textures.txt +++ b/along_shore/textures/credit_textures.txt @@ -10,14 +10,18 @@ FOLDER TEXTURE AUTHORS along_shore_lilypads_2.png Mossmanikin, Neuromancer along_shore_lilypads_3.png Mossmanikin, Neuromancer along_shore_lilypads_4.png Mossmanikin, Neuromancer - along_shore_pondscum_1.png Mossmanikin, Neuromancer - flowers_seaweed.png Mossmanikin, VanessaE + along_shore_seaweed_1.png Neuromancer, VanessaE + along_shore_seaweed_2.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_3.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_4.png Mossmanikin, Neuromancer, VanessaE + flowers_seaweed.png Neuromancer, VanessaE flowers_waterlily.png Mossmanikin, VanessaE flowers_waterlily_22.5.png Mossmanikin, VanessaE flowers_waterlily_45.png Mossmanikin, VanessaE flowers_waterlily_67.5.png Mossmanikin, VanessaE ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -../along_shore/textures/old & unused lillypad3Flower16x.png Neuromancer +../along_shore/textures/old & unused along_shore_pondscum_1.png Neuromancer + lillypad3Flower16x.png Neuromancer LillyPad3x16.png Neuromancer lillyPad5x16.png Neuromancer MultiLilly16x.png Neuromancer diff --git a/along_shore/textures/along_shore_pondscum_1.png b/along_shore/textures/old & unused/along_shore_pondscum_1.png similarity index 100% rename from along_shore/textures/along_shore_pondscum_1.png rename to along_shore/textures/old & unused/along_shore_pondscum_1.png