Add ruby to bonusbox and dungeon_loot, NPC cleanup

This commit is contained in:
MoNTE48 2020-03-07 17:04:28 +01:00
parent 14c21cee0d
commit 2680b11d69
6 changed files with 65 additions and 90 deletions

View File

@ -2,10 +2,11 @@
-- {item_name, minimum, maximum}
local items_ore = {
{"default:steel_ingot", 1, 3},
{"default:gold_ingot", 1, 3},
{"default:diamond", 1, 1},
{"default:emerald", 1, 1},
{"default:gold_ingot", 1, 3},
{"default:steel_ingot", 1, 3}
{"default:ruby", 1, 1}
}
local items_food = {

View File

@ -1,8 +1,8 @@
dungeon_loot = {}
dungeon_loot.CHESTS_MIN = 1
dungeon_loot.CHESTS_MAX = 3
dungeon_loot.STACKS_PER_CHEST_MAX = 8
dungeon_loot = {
CHESTS_MIN = 1,
CHESTS_MAX = 3,
STACKS_PER_CHEST_MAX = 8
}
local modpath = minetest.get_modpath("dungeon_loot")
dofile(modpath .. "/loot.lua")

View File

@ -60,7 +60,10 @@ dungeon_loot.registered_loot = {
{name = "default:sandstonesmooth", chance = 0.8, count = {4, 32}, y = {-64, 256}, types = {"sandstone"}},
{name = "default:mossycobble", chance = 0.8, count = {4, 32}, types = {"desert"}},
{name = "default:dirt", chance = 0.6, count = {2, 16}, y = {-64, 256}},
{name = "default:obsidian", chance = 0.25, count = {1, 3}, y = {-32, -64}}
{name = "default:obsidian", chance = 0.25, count = {1, 3}, y = {-32, -64}},
-- ruby
{name = "default:ruby", chance = 0.2, count = {1, 2}}
}
function dungeon_loot.register(t)

View File

@ -10,6 +10,22 @@ mobs.npc_drops = {
"default:shovel_steel", "farming:bread", "bucket:bucket_water"
}
local mtextures = {}
local mcount = 1
for i = 1, 3 do
for j = 1, 3 do
for k = 1, 3 do
mtextures[mcount] = {
"mobs_npc_man.png" .. "^" ..
"mobs_npc_man_hair" .. i .. ".png" .. "^" ..
"mobs_npc_man_pants" .. j .. ".png" .. "^" ..
"mobs_npc_man_shirt" .. k .. ".png", b, b, b
}
mcount = mcount + 1
end
end
end
mobs:register_mob("mobs_npc:npc_man", {
type = "npc",
damage = 2,
@ -23,44 +39,7 @@ mobs:register_mob("mobs_npc:npc_man", {
collisionbox = {-0.35, -1.0, -0.35, 0.35, 0.8, 0.35},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair1.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt3.png", b, b, b},
--===--
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair2.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt3.png", b, b, b},
--===--
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants1.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants2.png^mobs_npc_man_shirt3.png", b, b, b},
--=--
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt1.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt2.png", b, b, b},
{"mobs_npc_man.png^mobs_npc_man_hair3.png^mobs_npc_man_pants3.png^mobs_npc_man_shirt3.png", b, b, b}
},
textures = mtextures,
--[[child_texture = {
{"mobs_npc_baby.png", b, b, b}
},]]
@ -119,6 +98,22 @@ mobs:register_mob("mobs_npc:npc_man", {
end]]
})
local wtextures = {}
local wcount = 1
for i = 1, 3 do
for j = 1, 3 do
for k = 1, 3 do
wtextures[wcount] = {
"mobs_npc_woman.png" .. "^" ..
"mobs_npc_woman_hair" .. i .. ".png" .. "^" ..
"mobs_npc_woman_pants" .. j .. ".png" .. "^" ..
"mobs_npc_woman_shirt" .. k .. ".png", b, b, b
}
wcount = wcount + 1
end
end
end
mobs:register_mob("mobs_npc:npc_woman", {
type = "npc",
damage = 1,
@ -132,44 +127,7 @@ mobs:register_mob("mobs_npc:npc_woman", {
collisionbox = {-0.35, -1.0, -0.35, 0.35, 0.8, 0.35},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair1.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt3.png", b, b, b},
--===--
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair2.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt3.png", b, b, b},
--===--
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants1.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants2.png^mobs_npc_woman_shirt3.png", b, b, b},
--=--
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt1.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt2.png", b, b, b},
{"mobs_npc_woman.png^mobs_npc_woman_hair3.png^mobs_npc_woman_pants3.png^mobs_npc_woman_shirt3.png", b, b, b}
},
textures = wtextures,
--[[child_texture = {
{"mobs_npc_baby.png", b, b, b}
},]]

View File

@ -102,18 +102,28 @@ mobs.human = {
{"farming:bread 8", "default:emerald 2", 5},
{"default:clay 8", "default:emerald 1", 12},
{"default:brick 8", "default:emerald 2", 17},
{"default:glass 8", "default:emerald 2", 17},
{"default:glass 8", "default:gold_ingot 2", 17},
{"default:obsidian 16", "default:emerald 8", 50},
{"default:diamond 1", "default:emerald 2", 40},
{"farming:wheat 8", "default:emerald 2", 17},
{"default:tree 4", "default:emerald 1", 20},
{"default:stone 8", "default:emerald 2", 17},
{"default:tree 16", "default:gold_ingot 2", 20},
{"default:stone 8", "default:emerald 1", 17},
{"default:sapling 1", "default:emerald 1", 7},
{"default:pick_gold 1", "default:emerald 2", 7},
{"default:sword_gold 1", "default:emerald 2", 17},
{"default:shovel_gold 1", "default:emerald 1", 17},
{"default:cactus 4", "default:emerald 2", 40},
{"default:sugarcane 4", "default:emerald 2", 40}
{"default:sugarcane 4", "default:emerald 2", 40},
{"default:ruby 1", "default:emerald 4", 20},
{"default:ruby 2", "default:emerald 7", 20},
{"default:ruby 1", "default:diamond 5", 30},
{"default:ruby 2", "default:diamond 9", 30},
{"default:obsidian 32", "default:emerald 1", 25},
{"default:emerald 1", "default:obsidian 32", 25},
{"farming_addons:carrot_golden 2", "default:diamond 1", 25},
{"farming_addons:seed_melon 1", "default:diamond 1", 30},
{"farming_addons:seed_pumpkin 1", "default:diamond 1", 30},
{"default:gold_ingot 2", "farming_addons:potato 1", 25}
}
}
@ -148,7 +158,7 @@ function mobs.add_goods(self, _, race)
end
end
if math.random(0, 100) > race.items[random_trade][3] then
if math.random(100) > race.items[random_trade][3] then
self.trades[trade_index] = {
race.items[random_trade][1],
race.items[random_trade][2]

View File

@ -203,10 +203,13 @@ function mob_class:set_velocity(v)
local yaw = (self.object:get_yaw() or 0) + self.rotate
-- nil check for velocity
v = v or 0
-- set velocity with hard limit of 10
self.object:set_velocity({
x = max(-10, min((sin(yaw) * -v) + c_x, 10)),
y = max(-10, min(self.object:get_velocity().y, 10)),
y = max(-10, min((self.object:get_velocity().y or 0), 10)),
z = max(-10, min((cos(yaw) * v) + c_y, 10))
})
end