Craftings, Randomly spawning amonguses and more

This commit is contained in:
Kacper Kostka 2023-01-22 20:51:24 +01:00
parent aeba15798b
commit e1ea32ec0e
8 changed files with 243 additions and 41 deletions

View File

@ -1,4 +1,3 @@
title = SussyCraft
description = SUSSY LITTLE BAKA UWU
disabled_settings = enable_server
author = kacperks, Looki2000

View File

@ -53,19 +53,19 @@ minetest.register_node("amogus_blocks:planks", {
description = "Planks",
tiles = {"Planks.png"},
drop = 'amogus_blocks:planks', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:planks', groups = {choppy = 3},
})
minetest.register_node("amogus_blocks:purpleblock", {
description = "Purple Block",
tiles = {"purpleblock.png"},
drop = 'amogus_blocks:purpleblock', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:purpleblock', groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:redblock", {
description = "Red Block",
tiles = {"redblock.png"},
drop = 'amogus_blocks:redblock', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:redblock', groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:glowing_block", {
description = "Glowing Block",
@ -96,7 +96,19 @@ minetest.register_node("amogus_blocks:grass", {
"g.png"
},
drop = 'amogus_blocks:dirt', groups = {cracky=3, stone=1},
drop = {
max_items = 2,
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
},
}, groups = {crumbly=3},
})
minetest.register_node("amogus_blocks:wood", {
@ -104,7 +116,7 @@ minetest.register_node("amogus_blocks:wood", {
tiles = {"wood.png"},
drop = 'amogus_items:wooden_plank',
groups = {cracky = 3, stone = 1},
groups = {choppy = 3, flammable = 3, wood = 1},
})
minetest.register_node("amogus_blocks:water", {
@ -172,19 +184,43 @@ minetest.register_node("amogus_blocks:water", {
minetest.register_node("amogus_blocks:dirt", {
description = "Dirt",
tiles = {"d.png"},
groups = {cracky = 3, stone = 1},
--sounds = default.node_sound_dirt_defaults({
-- footstep = {name = "default_grass_footstep", gain = 0.4},
--}),
groups = {crumbly = 3},
--drop = {'amogus_blocks:dirt', 'amogus_items:rock'},
-- drop dirt and amogus_items:rock
drop = {
max_items = 2,
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
},
},
drop = 'amogus_blocks:amogus_blocks', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:dirt',
})
minetest.register_node("amogus_blocks:stone", {
description = "Stone",
tiles = {"stone.png"},
-- drop 10 times amogus_items:rock
drop = {
max_items = 10,
items = {
{
items = {'amogus_items:rock'},
rarity = 1,
},
},
},
--sounds = default.node_sound_stone_defaults(),
groups = {cracky = 3, stone = 1},
})
@ -229,3 +265,26 @@ minetest.register_node("amogus_blocks:lucky_block", {
end
})
minetest.register_node("amogus_blocks:amogus_spawner", {
description = "Amogus Spawner",
tiles = {"amogus_spawner.png"},
on_generated = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("spawned", 0)
meta:set_int("interval", math.random(1,4))
minetest.get_node_timer(pos):start(meta:get_int("interval"))
end,
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local spawned = meta:get_int("spawned")
if spawned < 30 then
minetest.add_entity({x = pos.x, y = pos.y + 1, z = pos.z}, "amogus_entities:amogus")
spawned = spawned + 1
meta:set_int("spawned", spawned)
minetest.get_node_timer(pos):start(meta:get_int("interval"))
else
minetest.remove_node(pos)
end
end
})

View File

@ -0,0 +1,58 @@
minetest.register_craft({
output = "amogus_items:goldenaxe",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", ""},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", ""},
{"", "amogus_items:wooden_plank", ""},
}
})
minetest.register_craft({
output = "amogus_items:stonepickaxe",
recipe = {
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
{"", "amogus_items:wooden_plank", ""},
{"", "amogus_items:wooden_plank", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenplumba",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", "amogus_items:gold_ingot"},
}
})
minetest.register_craft({
output = "amogus_items:susplumba",
recipe = {
{"amogus_items:sussium_ingot", "amogus_items:sussium_ingot", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:wooden_plank", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:wooden_plank", "amogus_items:sussium_ingot"},
}
})
minetest.register_craft({
output = "amogus_blocks:grey_bricks",
recipe = {
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
}
})
minetest.register_craft({
output = "amogus_blocks:bricks",
recipe = {
{"", "amogus_blocks:redblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:planks",
recipe = {
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
}
})

View File

@ -1,9 +1,6 @@
local loot_texture = {
"amogus_entity.png",
"amogus_entity_b.png",
"amogus_entity_br.png",
"amogus_entity_g.png",
}
-- create a random number from 0 to 3
local entity = {
physical = true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
@ -12,10 +9,7 @@ local entity = {
visual_size = {x=10, y=10, z=10},
mesh = "amogus_entity.obj",
textures = {"amogus_entity.png"},
-- get a random texture from loot_texture table
--textures = {loot_texture[math.random(#loot_texture)]},
textures = {"amogus_entity.png",},
on_rightclick = function(self, clicker)
minetest.chat_send_player(clicker:get_player_name(), "WHY ARE YOU SUCH SUSSY BAKA?")
end,
@ -48,7 +42,6 @@ local entity = {
-- kill itself (debugging)
--self.object:remove()
end,

View File

@ -133,4 +133,37 @@ minetest.register_decoration({
flags = "place_center_x, place_center_z",
rotation = "random",
})
--minetest.register_abm({
-- label = "Spawn random entities",
-- nodenames = {"group:soil", "group:crumbly", "group:choppy", "group:snappy", "group:cracky"},
-- interval = 15,
-- chance = 50,
-- action = function(pos)
-- local r = math.random(1, 500)
-- if r <= 50 then
-- minetest.add_entity({x = pos.x + math.random(-10, 10),
-- y = pos.y + 1,
-- z = pos.z + math.random(-10, 10)}, "amogus_entities:amogus")
-- minetest.sound_play("amogus_sound", {
-- pos = pos,
-- gain = 1.0,
-- max_hear_distance = 5
-- })
-- end
-- end
--})
minetest.register_on_generated(function(minp, maxp, seed)
--local is_newchunk = true
--for , pos in ipairs(minetest.find_nodes_in_area(minp, maxp, "mymod:amogus_spawner")) do
--is_new_chunk = false
-- break
--end
--if is_new_chunk then
for i = 1, math.random(10, 15) do
minetest.add_entity({x = minp.x + math.random(16), y = minp.y + 1, z = minp.z + math.random(16)}, "amogus_entities:amogus")
--minetest.sound_play("amogus_sound", { pos = pos,gain = 1.0,max_hear_distance = 5})
end
--end
end)

View File

@ -1,15 +1,17 @@
minetest.register_item(":", { -- Hand
type = "none",
wield_image = "plumba.png",
wield_scale = {x=.3,y=2,z=2.5},
range = 5,
tool_capabilities = {
max_drop_level = 0,
full_punch_interval = 0.4,
damage_groups = {fleshy = 1, snappy = 8, cracky=8, choppy=8, crumbly=8},
}
type = "none",
wield_image = "coke.png",
wield_scale = {x=.3,y=2,z=2.5},
range = 5,
tool_capabilities = {
max_drop_level = 0,
full_punch_interval = 0.4,
groupcaps = {
choppy = {times = {[1] = 2, [2] = 1.5, [3] = 1.0}, uses = 20, maxlevel = 1},
crumbly = {times = {[1] = 0.5, [2] = 0.3, [3] = 0.2}, uses = 20, maxlevel = 1},
},
damage_groups = {fleshy = 1, snappy = 1, cracky=1},
}
})
minetest.register_craftitem("amogus_items:amogus", {
description = "Amogus",
@ -122,25 +124,69 @@ minetest.register_craftitem("amogus_items:wooden_plank", {
minetest.register_craftitem("amogus_items:gold_ingot", {
description = "Gold Ingot",
inventory_image = "gold_ingot.png",
})minetest.register_craftitem("amogus_items:rock", {
description = "Rock",
inventory_image = "rocks.png",
})
minetest.register_craftitem("amogus_items:sussium_ingot", {
description = "Sussium Ingot",
inventory_image = "sussium_ingot.png",
})
--add theese items goldenpickaxe, stonepickaxe and allow them slowly break nodes and destroy it after 30 uses
minetest.register_tool("amogus_items:goldenpickaxe", {
description = "Golden Pickaxe",
inventory_image = "goldenpick.png",
minetest.register_tool("amogus_items:goldenplumba", {
description = "Golden Plumba",
inventory_image = "goldenplumba.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky={times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=1},
full_punch_interval = 0.1,
max_drop_level = 3,
groupcaps = {
unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy=2},
damage_groups = {fleshy = 10},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
minetest.node_dig(pointed_thing.under, minetest.get_node(pointed_thing.under), user)
end
itemstack:add_wear(65535/10)
return itemstack
end,
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:susplumba", {
description = "Sus Plumba",
inventory_image = "plumba.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level = 3,
groupcaps = {
unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 10},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
minetest.node_dig(pointed_thing.under, minetest.get_node(pointed_thing.under), user)
end
itemstack:add_wear(65535/40)
return itemstack
end,
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:stonepickaxe", {
description = "Stone Pickaxe",
inventory_image = "stone_pick.png",
@ -153,4 +199,18 @@ minetest.register_tool("amogus_items:stonepickaxe", {
damage_groups = {fleshy=2},
},
sound = {breaks = "default_tool_breaks"},
})
})
minetest.register_tool("amogus_items:goldenaxe", {
description = "Golden Axe",
inventory_image = "goldenaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 182 B