commit d6e05e03904d2355656da73c10f0731b3f61e138 Author: TheShadowZone12 Date: Thu Aug 28 09:01:22 2014 -0500 first commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..59d1e75 --- /dev/null +++ b/README.txt @@ -0,0 +1,12 @@ +So I know there are girls out there who wish there was a mod made for them +well wish no more cause straight from cg72 and shadowzone comes the.. + + GIRLYGIRL MOD!!!!!!!!!! + +Have fun playing with pink building blocks and no more wishing they wouldn't focus so much on guys!!!!!!!!!! + +The items included.. + +pink wood,cactus,ladders,chest,sand,bricks,tree,cobble,stone,tools(like picks,axes,shovels,swords),hearts,saplings. + + diff --git a/chest.lua b/chest.lua new file mode 100644 index 0000000..16b69ac --- /dev/null +++ b/chest.lua @@ -0,0 +1,141 @@ +chest_formspec = + "size[8,9]".. + "list[current_name;main;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]" + +function get_locked_chest_formspec(pos) + local spos = pos.x .. "," .. pos.y .. "," ..pos.z + local formspec = + "size[8,9]".. + "list[nodemeta:".. spos .. ";main;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]" + return formspec +end + + +minetest.register_node("girlygirl:chest", { + description = "Chest", + tiles = {"girlygirl_chest_top.png", "girlygirl_chest_top.png", "girlygirl_chest_side.png", + "girlygirl_chest_side.png", "girlygirl_chest_side.png", "girlygirl_chest_front.png"}, + paramtype2 = "facedir", + groups = {choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec",chest_formspec) + meta:set_string("infotext", "Chest") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from chest at "..minetest.pos_to_string(pos)) + end, +}) + +local function has_locked_chest_privilege(meta, player) + if player:get_player_name() ~= meta:get_string("owner") then + return false + end + return true +end + +minetest.register_node("girlygirl:chest_locked", { + description = "Locked Chest", + tiles = {"girlygirl_chest_top.png", "girlygirl_chest_top.png", "girlygirl_chest_side.png", + "girlygirl_chest_side.png", "girlygirl_chest_side.png", "girlygirl_chest_lock.png"}, + paramtype2 = "facedir", + groups = {choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name() or "") + meta:set_string("infotext", "Locked Chest (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Locked Chest") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") and has_locked_chest_privilege(meta, player) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + minetest.log("action", player:get_player_name().. + " tried to access a locked chest belonging to ".. + meta:get_string("owner").." at ".. + minetest.pos_to_string(pos)) + return 0 + end + return count + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + minetest.log("action", player:get_player_name().. + " tried to access a locked chest belonging to ".. + meta:get_string("owner").." at ".. + minetest.pos_to_string(pos)) + return 0 + end + return stack:get_count() + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + minetest.log("action", player:get_player_name().. + " tried to access a locked chest belonging to ".. + meta:get_string("owner").." at ".. + minetest.pos_to_string(pos)) + return 0 + end + return stack:get_count() + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name().. + " moves stuff in locked chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to locked chest at "..minetest.pos_to_string(pos)) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " takes stuff from locked chest at "..minetest.pos_to_string(pos)) + end, + on_rightclick = function(pos, node, clicker) + local meta = minetest.get_meta(pos) + if has_locked_chest_privilege(meta, clicker) then + minetest.show_formspec( + clicker:get_player_name(), + "girlygirl:chest_locked", + get_locked_chest_formspec(pos) + ) + end + end, +}) + diff --git a/craft.lua b/craft.lua new file mode 100644 index 0000000..ecdcc39 --- /dev/null +++ b/craft.lua @@ -0,0 +1,102 @@ +minetest.register_craftitem("girlygirl:girlystick", { + description = "Girly Stick", + inventory_image = "girlygirl_stick.png", +}) + +minetest.register_craft({ + output = 'girlygirl:girlystick 2', + recipe = { + {'default:stick'}, + {'dye:magenta'}, + {'default:stick'}, + } +}) + + +minetest.register_craft({ + output = 'girlygirl:wood 8', + recipe = { + {'girlygirl:tree'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:pick', + recipe = { + {'default:pick_diamond'}, + {'girlygirl:stick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:stonebrick', + recipe = { + {'default:stonebrick'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:chest', + recipe = { + {'default:chest'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:chest_locked', + recipe = { + {'default:chest_locked'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:cobble', + recipe = { + {'default:cobble'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:tree', + recipe = { + {'default:tree'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:leaves', + recipe = { + {'default:leaves'}, + {'girlygirl:girlystick'}, + } +}) + + +minetest.register_craft({ + output = 'girlygirl:sand', + recipe = { + {'default:sand'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:brick', + recipe = { + {'default:brick'}, + {'girlygirl:girlystick'}, + } +}) + +minetest.register_craft({ + output = 'girlygirl:magenta_block', + recipe = { + {'plasticbox:plasticbox'}, + {'girlygirl:girlystick'}, + } +}) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..0f1f0c4 --- /dev/null +++ b/init.lua @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +local cylbox = {} +local detail = 16 +local sehne +for i = 1, detail-1 do + sehne = math.sqrt(0.25 - (((i/detail)-0.5)^2)) + cylbox[i]={(i/detail)-0.5, -0.5, -sehne, (i/detail)+(1/detail)-0.5, 0.5, sehne} +end + +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ + +dofile(minetest.get_modpath("girlygirl").."/chest.lua") +dofile(minetest.get_modpath("girlygirl").."/craft.lua") +dofile(minetest.get_modpath("girlygirl").."/tools.lua") +dofile(minetest.get_modpath("girlygirl").."/tree.lua") + +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ +------------------------------------------------------------------ + +minetest.register_node("girlygirl:magenta_block", { + description = "Girly Magenta Block", + tiles = {"girlygirl_magenta.png"}, + is_ground_content = true, + groups = {cracky=3, stone=1}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("girlygirl:stonebrick", { + description = "Stone Brick", + tiles = {"girlygirl_stone_brick.png"}, + groups = {cracky=2, stone=1}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("girlygirl:sand", { + description = "Sand", + tiles = {"girlygirl_sand.png"}, + is_ground_content = true, + groups = {crumbly=3, falling_node=1, sand=1}, + sounds = default.node_sound_sand_defaults(), +}) + +minetest.register_node("girlygirl:brick", { + description = "Brick Block", + tiles = {"girlygirl_brick.png"}, + is_ground_content = false, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("girlygirl:tree", { + description = "Tree", + tiles = {"girlygirl_tree_top.png", "girlygirl_tree_top.png", "girlygirl_tree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, + paramtype = "light", + drawtype = "nodebox", + selection_box = { + type = "fixed", + fixed = cylbox, + }, + node_box = { + type = "fixed", + fixed = cylbox, + }, +}) + +minetest.register_node("girlygirl:leaves", { + description = "Leaves", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tiles = {"girlygirl_leaves.png"}, + paramtype = "light", + waving = 1, + is_ground_content = false, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + items = {'girlygirl:sapling'}, + rarity = 5, + }, + { + items = {'girlygirl:leaves'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("girlygirl:sapling", { + description = "Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"girlygirl_sapling.png"}, + inventory_image = "girlygirl_sapling.png", + wield_image = "girlygirl_sapling.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_node("girlygirl:cactus", { + description = "Cactus", + drawtype = "nodebox", + tiles = {"girlygirl_cactus_top.png", "girlygirl_cactus_top.png", "girlygirl_cactus_side.png"}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = cylbox, + }, + node_box = { + type = "fixed", + fixed = cylbox, + }, + groups = {snappy=1,choppy=3,flammable=2}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node +}) + +minetest.register_abm({ + nodenames = {"girlygirl:cactus"}, + neighbors = {"group:sand"}, + interval = 50, + chance = 20, + action = function(pos, node) + pos.y = pos.y-1 + local name = minetest.get_node(pos).name + if minetest.get_item_group(name, "sand") ~= 0 then + pos.y = pos.y+1 + local height = 0 + while minetest.get_node(pos).name == "girlygirl:cactus" and height < 10 do + height = height+1 + pos.y = pos.y+1 + end + if height < 4 then + if minetest.get_node(pos).name == "air" then + minetest.set_node(pos, {name="girlygirl:cactus"}) + end + end + end + end, +}) + +minetest.register_node("girlygirl:fence_wood", { + description = "Wooden Fence", + drawtype = "fencelike", + tiles = {"girlygirl_wood.png"}, + inventory_image = "girlygirl_fence.png", + wield_image = "girlygirl_fence.png", + paramtype = "light", + is_ground_content = false, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("girlygirl:ladder", { + description = "Ladder", + drawtype = "signlike", + tiles = {"girlygirl_ladder.png"}, + inventory_image = "girlygirl_ladder.png", + wield_image = "girlygirl_ladder.png", + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + climbable = true, + is_ground_content = false, + selection_box = { + type = "wallmounted", + }, + groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2}, + legacy_wallmounted = true, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("girlygirl:wood", { + description = "Wooden Planks", + tiles = {"girlygirl_wood.png"}, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("girlygirl:cobble", { + description = "Cobblestone", + tiles = {"girlygirl_cobble.png"}, + is_ground_content = true, + groups = {cracky=3, stone=2}, + sounds = default.node_sound_stone_defaults(), +}) + + + diff --git a/textures/girlygirl_brick.png b/textures/girlygirl_brick.png new file mode 100644 index 0000000..16c0ac2 Binary files /dev/null and b/textures/girlygirl_brick.png differ diff --git a/textures/girlygirl_cactus_side.png b/textures/girlygirl_cactus_side.png new file mode 100644 index 0000000..d16f75f Binary files /dev/null and b/textures/girlygirl_cactus_side.png differ diff --git a/textures/girlygirl_cactus_top.png b/textures/girlygirl_cactus_top.png new file mode 100644 index 0000000..7f90293 Binary files /dev/null and b/textures/girlygirl_cactus_top.png differ diff --git a/textures/girlygirl_chest_front.png b/textures/girlygirl_chest_front.png new file mode 100644 index 0000000..428cbb3 Binary files /dev/null and b/textures/girlygirl_chest_front.png differ diff --git a/textures/girlygirl_chest_lock.png b/textures/girlygirl_chest_lock.png new file mode 100644 index 0000000..098e89c Binary files /dev/null and b/textures/girlygirl_chest_lock.png differ diff --git a/textures/girlygirl_chest_side.png b/textures/girlygirl_chest_side.png new file mode 100644 index 0000000..77a6b0a Binary files /dev/null and b/textures/girlygirl_chest_side.png differ diff --git a/textures/girlygirl_chest_top.png b/textures/girlygirl_chest_top.png new file mode 100644 index 0000000..251f2bb Binary files /dev/null and b/textures/girlygirl_chest_top.png differ diff --git a/textures/girlygirl_cobble.png b/textures/girlygirl_cobble.png new file mode 100644 index 0000000..30a0f52 Binary files /dev/null and b/textures/girlygirl_cobble.png differ diff --git a/textures/girlygirl_diamondaxe.png b/textures/girlygirl_diamondaxe.png new file mode 100644 index 0000000..8571e58 Binary files /dev/null and b/textures/girlygirl_diamondaxe.png differ diff --git a/textures/girlygirl_diamondpick.png b/textures/girlygirl_diamondpick.png new file mode 100644 index 0000000..4ae8323 Binary files /dev/null and b/textures/girlygirl_diamondpick.png differ diff --git a/textures/girlygirl_diamondshovel.png b/textures/girlygirl_diamondshovel.png new file mode 100644 index 0000000..ee077e2 Binary files /dev/null and b/textures/girlygirl_diamondshovel.png differ diff --git a/textures/girlygirl_diamondsword.png b/textures/girlygirl_diamondsword.png new file mode 100644 index 0000000..5c6f0ff Binary files /dev/null and b/textures/girlygirl_diamondsword.png differ diff --git a/textures/girlygirl_ladder.png b/textures/girlygirl_ladder.png new file mode 100644 index 0000000..62439a5 Binary files /dev/null and b/textures/girlygirl_ladder.png differ diff --git a/textures/girlygirl_leaves.png b/textures/girlygirl_leaves.png new file mode 100644 index 0000000..0217c98 Binary files /dev/null and b/textures/girlygirl_leaves.png differ diff --git a/textures/girlygirl_magenta.png b/textures/girlygirl_magenta.png new file mode 100644 index 0000000..f390bc6 Binary files /dev/null and b/textures/girlygirl_magenta.png differ diff --git a/textures/girlygirl_sand.png b/textures/girlygirl_sand.png new file mode 100644 index 0000000..3dd2b76 Binary files /dev/null and b/textures/girlygirl_sand.png differ diff --git a/textures/girlygirl_sapling.png b/textures/girlygirl_sapling.png new file mode 100644 index 0000000..2c17160 Binary files /dev/null and b/textures/girlygirl_sapling.png differ diff --git a/textures/girlygirl_stick.png b/textures/girlygirl_stick.png new file mode 100644 index 0000000..b2f5a2b Binary files /dev/null and b/textures/girlygirl_stick.png differ diff --git a/textures/girlygirl_stone_brick.png b/textures/girlygirl_stone_brick.png new file mode 100644 index 0000000..c018269 Binary files /dev/null and b/textures/girlygirl_stone_brick.png differ diff --git a/textures/girlygirl_tree.png b/textures/girlygirl_tree.png new file mode 100644 index 0000000..c60102c Binary files /dev/null and b/textures/girlygirl_tree.png differ diff --git a/textures/girlygirl_tree_top.png b/textures/girlygirl_tree_top.png new file mode 100644 index 0000000..28b3fb4 Binary files /dev/null and b/textures/girlygirl_tree_top.png differ diff --git a/textures/girlygirl_wood.png b/textures/girlygirl_wood.png new file mode 100644 index 0000000..c4651de Binary files /dev/null and b/textures/girlygirl_wood.png differ diff --git a/textures/heart.png b/textures/heart.png new file mode 100644 index 0000000..d568dd3 Binary files /dev/null and b/textures/heart.png differ diff --git a/tools.lua b/tools.lua new file mode 100644 index 0000000..0ee4869 --- /dev/null +++ b/tools.lua @@ -0,0 +1,52 @@ +minetest.register_tool("girlygirl:pick_diamond", { + description = "Diamond Pickaxe", + inventory_image = "girlygirl_diamondpick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) + +minetest.register_tool("girlygirl:shovel_diamond", { + description = "Diamond Shovel", + inventory_image = "girlygirl_diamondshovel.png", + wield_image = "girlygirl_tool_diamondshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_tool("girlygirl:axe_diamond", { + description = "Diamond Axe", + inventory_image = "girlygirl_diamondaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=7}, + }, +}) + +minetest.register_tool("girlygirl:sword_diamond", { + description = "Diamond Sword", + inventory_image = "girlygirl_diamondsword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + } +}) diff --git a/tree.lua b/tree.lua new file mode 100644 index 0000000..09f9ada --- /dev/null +++ b/tree.lua @@ -0,0 +1,25 @@ +girl_tree={ + axiom="", + trunk="girlygirl:tree", + leaves="girlygirl:leaves", + angle=30, + iterations=0, + random_level=3, + trunk_type="single", + thin_branches=true, +} + +local trunks_stub = "FFFFF" +local axiom_stub = "[F&F][&^^^^F][&////F][GGf&&&GG&&&Gffff&&&G+++G&&&Gffff][GGG///&&&GG&&&GGfff&&&G+++G&&&GGfff][GGG//////&&&GG&&&GGfff&&&G+++G&&&Gffff][GGG/////////&&&GG&&&GGfff&&&G+++G&&&Gffff]" + +minetest.register_abm({ + nodenames = {"girlygirl:sapling"}, + interval = 1,--10, + chance = 1,--35, + action = function(pos, node) + minetest.add_node(pos, {name = "air"} ) + girl_tree.axiom = string.sub("TTTT"..trunks_stub, 1, math.random(4, 14))..axiom_stub + girl_tree.iterations = math.random(1, 5) + minetest.spawn_tree(pos, girl_tree) + end +})