diff --git a/shit/simple_grow/init.lua b/shit/simple_grow/init.lua deleted file mode 100644 index 53a3149..0000000 --- a/shit/simple_grow/init.lua +++ /dev/null @@ -1,132 +0,0 @@ ---[[ -{ - { - k_grow_time, -- k * STANDART_GROW_TIME - image, - drop, - groups, - chance - } -} -]]-- - -STANDART_SPGROW_TIME = 120 - -local TRANSFORMS = {} - -function register_plant_with_full_stages(grow_table) - - for stage in ipairs(grow_table) do - if grow_table[stage].chance > 1 then - grow_table[stage].chance = 1 - end - - minetest.register_node(grow_table[stage].name, { - description = grow_table[stage].name, - drawtype = "plantlike", - walkable = false, - tile_images = {grow_table[stage].image}, - inventory_image = grow_table[stage].image, - wield_image = grow_table[stage].image, - paramtype = "light", - drop = grow_table[stage].drop, - groups = grow_table[stage].groups, - sounds = default.node_sound_leaves_defaults(), - }) - - if (#(grow_table) > stage) then - minetest.register_abm({ - nodenames = { grow_table[stage].name }, - interval = grow_table[stage].time * STANDART_SPGROW_TIME, - chance = grow_table[stage].chance, - action = function (pos, node) - if math.random() < grow_table[stage].chance then - minetest.env:add_node(pos, {name = grow_table[stage + 1].name}) - end - end - }) - end - end -end - -function register_simple_plant(name, final_description, stage_max, stage_time, image_template, final_drop) - -- number of stages of growth [1 .. stage_max] - -- image template .. [1 .. stage_max] .. ".png" --> png - local ngrow_table = {} - local cur_drop = '' - - for i=1, stage_max do - cur_drop = '' - if i == stage_max then - cur_drop = final_drop - end - - table.insert(ngrow_table, { - name = name .. i, - time = stage_time, - image = image_template .. i .. ".png", - drop = cur_drop, - groups = {snappy=3}, - chance = 0.6 - }) - end - - register_plant_with_full_stages(ngrow_table) -end - -function register_transform_plant(grow_table) - - for stage in ipairs(grow_table) do - if grow_table[stage].chance > 1 then - grow_table[stage].chance = 1 - end - - minetest.register_node(grow_table[stage].name, { - description = grow_table[stage].name, - drawtype = "plantlike", - walkable = false, - tile_images = {grow_table[stage].image}, - inventory_image = grow_table[stage].image, - wield_image = grow_table[stage].image, - paramtype = "light", - drop = grow_table[stage].drop, - groups = grow_table[stage].groups, - sounds = default.node_sound_leaves_defaults(), - }) - - if (grow_table[stage].transform ~= nil) then - - TRANSFORMS[grow_table[stage].name] = grow_table[stage].transform - - minetest.register_abm({ - nodenames = { grow_table[stage].name }, - interval = grow_table[stage].time * STANDART_SPGROW_TIME, - chance = grow_table[stage].chance, - action = function (pos, node) - if math.random() < grow_table[stage].chance then - local rnd = 1 - if #(TRANSFORMS[node.name]) > 1 then - rnd = math.random(#(TRANSFORMS[node.name])) - end - local transform = TRANSFORMS[node.name][rnd] - - if transform.oldname ~= nil then - minetest.env:add_node(pos, {name = transform.oldname}) - end - - local trans_coord = { - x = pos.x + transform.x, - y = pos.y + transform.y, - z = pos.z + transform.z - } - if minetest.env:get_node(trans_coord).name == 'air' then - minetest.env:add_node(trans_coord, {name = transform.newname}) - else - minetest.env:add_node(pos, {name = transform.newname}) - end - end - end - }) - end - end -end \ No newline at end of file diff --git a/shit/simple_plant/depends.txt b/shit/simple_plant/depends.txt deleted file mode 100644 index 3a4ca9b..0000000 --- a/shit/simple_plant/depends.txt +++ /dev/null @@ -1 +0,0 @@ -simple_grow diff --git a/shit/simple_plant/init.lua b/shit/simple_plant/init.lua deleted file mode 100644 index 818fc1d..0000000 --- a/shit/simple_plant/init.lua +++ /dev/null @@ -1,137 +0,0 @@ -minetest.register_craftitem('simple_plant:seed0', { - inventory_image = 'seed0.png', - stack_max = 99, - usable = true, - on_use = function(itemstack, user, pointed_thing) - -- Must be pointing to node - if pointed_thing.type == 'node' then - n = minetest.env:get_node(pointed_thing.under) - if n.name == 'default:dirt_with_grass' then - minetest.env:add_node(pointed_thing.above, {name='simple_plant:splant1'}) - end - itemstack:take_item() - end - return itemstack - end, -}) - -register_plant_with_full_stages({ - { - name = 'simple_plant:splant1', - time = 0.5, - image = 'stage1.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:splant2', - time = 0.5, - image = 'stage2.png', - drop = 'default:iron_lump', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:splant3', - time = 0.5, - image = 'stage3.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:splant4', - time = 0.5, - image = 'stage4.png', - drop = 'default:clay_brick 4', - groups = {snappy=3}, - chance = 0.4 - }, -}) ---------------------- -register_simple_plant('simple_plant:n', 'Odd flower', 6, 0.5, 'n', 'simple_plant:n_seed 5') - -minetest.register_craftitem('simple_plant:n_seed', { - description = 'N seed', - inventory_image = 'n_seed.png', - stack_max = 99, - usable = true, - on_use = function(itemstack, user, pointed_thing) - -- Must be pointing to node - if pointed_thing.type == 'node' then - n = minetest.env:get_node(pointed_thing.under) - if n.name == 'default:dirt_with_grass' then - minetest.env:add_node(pointed_thing.above, {name='simple_plant:n1'}) - end - itemstack:take_item() - end - return itemstack - end, -}) ------------------------- -minetest.register_craftitem('simple_plant:strange_seed', { - description = 'Strange seed', - inventory_image = 'seed_strange.png', - stack_max = 99, - usable = true, - on_use = function(itemstack, user, pointed_thing) - -- Must be pointing to node - if pointed_thing.type == 'node' then - n = minetest.env:get_node(pointed_thing.under) - if n.name == 'default:dirt_with_grass' then - minetest.env:add_node(pointed_thing.above, {name='simple_plant:sp1'}) - end - itemstack:take_item() - end - return itemstack - end, -}) - -register_transform_plant({ - { - name = 'simple_plant:sp1', - transform = {{newname = 'simple_plant:sp2', x =0, y=0, z=0}}, - time = 0.5, - image = 'sp1.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:sp2', - transform = {{newname = 'simple_plant:sp_fin', oldname ='simple_plant:sp_stem', x =0, y=1, z=0}, - {newname = 'simple_plant:sp_fin', oldname ='simple_plant:sp_stem2', x =0, y=1, z=0}}, - time = 0.5, - image = 'sp2.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:sp_stem', - transform = nil, - time = 0.5, - image = 'sp_stem.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:sp_stem2', - transform = nil, - time = 0.5, - image = 'sp_stem2.png', - drop = '', - groups = {snappy=3}, - chance = 0.7 - }, - { - name = 'simple_plant:sp_fin', - time = 0.5, - image = 'sp_fin.png', - drop = 'simple_plant:strange_seed', - groups = {snappy=3}, - chance = 0.7 - } -}) \ No newline at end of file diff --git a/shit/simple_plant/textures/n1.png b/shit/simple_plant/textures/n1.png deleted file mode 100644 index 4f842a9..0000000 Binary files a/shit/simple_plant/textures/n1.png and /dev/null differ diff --git a/shit/simple_plant/textures/n2.png b/shit/simple_plant/textures/n2.png deleted file mode 100644 index 76a2bf3..0000000 Binary files a/shit/simple_plant/textures/n2.png and /dev/null differ diff --git a/shit/simple_plant/textures/n3.png b/shit/simple_plant/textures/n3.png deleted file mode 100644 index 96b96e6..0000000 Binary files a/shit/simple_plant/textures/n3.png and /dev/null differ diff --git a/shit/simple_plant/textures/n4.png b/shit/simple_plant/textures/n4.png deleted file mode 100644 index d6bf025..0000000 Binary files a/shit/simple_plant/textures/n4.png and /dev/null differ diff --git a/shit/simple_plant/textures/n5.png b/shit/simple_plant/textures/n5.png deleted file mode 100644 index 5200438..0000000 Binary files a/shit/simple_plant/textures/n5.png and /dev/null differ diff --git a/shit/simple_plant/textures/n6.png b/shit/simple_plant/textures/n6.png deleted file mode 100644 index 9b52a8d..0000000 Binary files a/shit/simple_plant/textures/n6.png and /dev/null differ diff --git a/shit/simple_plant/textures/n_seed.png b/shit/simple_plant/textures/n_seed.png deleted file mode 100644 index 9dca4a0..0000000 Binary files a/shit/simple_plant/textures/n_seed.png and /dev/null differ diff --git a/shit/simple_plant/textures/seed0.png b/shit/simple_plant/textures/seed0.png deleted file mode 100644 index 94e0b43..0000000 Binary files a/shit/simple_plant/textures/seed0.png and /dev/null differ diff --git a/shit/simple_plant/textures/seed_strange.png b/shit/simple_plant/textures/seed_strange.png deleted file mode 100644 index 2ee8bce..0000000 Binary files a/shit/simple_plant/textures/seed_strange.png and /dev/null differ diff --git a/shit/simple_plant/textures/sp1.png b/shit/simple_plant/textures/sp1.png deleted file mode 100644 index ff31ad6..0000000 Binary files a/shit/simple_plant/textures/sp1.png and /dev/null differ diff --git a/shit/simple_plant/textures/sp2.png b/shit/simple_plant/textures/sp2.png deleted file mode 100644 index e6d4b26..0000000 Binary files a/shit/simple_plant/textures/sp2.png and /dev/null differ diff --git a/shit/simple_plant/textures/sp_fin.png b/shit/simple_plant/textures/sp_fin.png deleted file mode 100644 index 3c2d97d..0000000 Binary files a/shit/simple_plant/textures/sp_fin.png and /dev/null differ diff --git a/shit/simple_plant/textures/sp_stem.png b/shit/simple_plant/textures/sp_stem.png deleted file mode 100644 index e5f3460..0000000 Binary files a/shit/simple_plant/textures/sp_stem.png and /dev/null differ diff --git a/shit/simple_plant/textures/sp_stem2.png b/shit/simple_plant/textures/sp_stem2.png deleted file mode 100644 index 0cf4553..0000000 Binary files a/shit/simple_plant/textures/sp_stem2.png and /dev/null differ diff --git a/shit/simple_plant/textures/stage1.png b/shit/simple_plant/textures/stage1.png deleted file mode 100644 index d2dc3e4..0000000 Binary files a/shit/simple_plant/textures/stage1.png and /dev/null differ diff --git a/shit/simple_plant/textures/stage2.png b/shit/simple_plant/textures/stage2.png deleted file mode 100644 index 18a0cad..0000000 Binary files a/shit/simple_plant/textures/stage2.png and /dev/null differ diff --git a/shit/simple_plant/textures/stage3.png b/shit/simple_plant/textures/stage3.png deleted file mode 100644 index d846cb1..0000000 Binary files a/shit/simple_plant/textures/stage3.png and /dev/null differ diff --git a/shit/simple_plant/textures/stage4.png b/shit/simple_plant/textures/stage4.png deleted file mode 100644 index fd0b4ce..0000000 Binary files a/shit/simple_plant/textures/stage4.png and /dev/null differ