slimemonster -> new config

master
A. Demant 2018-11-22 05:11:53 +01:00
parent 3b783c0e41
commit b50676c0b5
5 changed files with 153 additions and 7 deletions

View File

@ -20,6 +20,7 @@ dofile(minerdream.path .. "/armor.lua")
dofile(minerdream.path .. "/treasure.lua")
dofile(minerdream.path .. "/experiments.lua")
--dofile(minerdream.path .. "/mobs.lua")
dofile(minerdream.path .. "/read_mobs_config.lua")
dofile(minerdream.path .. "/awards.lua")
--print(dump(minerdream.items))

View File

@ -1,7 +1,8 @@
name,attack_type,reach,damage,hp_min,hp_max,armor,collisionbox,walk_velocity,run_velocity,walk_chance,fall_speed,jump_chance,jump_height,stepheight,view_range,slimeball,egg,slimering,water_damage,lava_damage,light_damage
slime_green,dogfight,2,1,5,5,100,0.3,2,2,0,-50,30,6,1.1,16,1,100,200,0,8,0
slime_blue,dogfight,2,2,8,8,100,0.45,2,2,0,-50,30,6,1.1,16,1,100,175,0,8,0
slime_red,dogfight,2,3,12,12,100,0.6,3,3,0,-50,30,7,1.1,16,1,100,150,0,8,0
slime_yellow,dogfight,2,4,20,20,100,0.75,3,3,0,-50,30,7,1.1,16,1,100,125,0,8,0
slime_purple,dogfight,2,6,35,35,100,0.9,4,4,0,-50,30,8,1.1,16,1,100,100,0,8,0
slime_brown,dogfight,3.5,8,50,50,100,1.05,4,4,0,-50,30,9,1.2,16,1,100,75,0,8,0
name,attack_type,reach,damage,hp_min,hp_max,armor,collisionbox,walk_velocity,run_velocity,walk_chance,fall_speed,jump_chance,jump_height,stepheight,view_range,slimeball,egg,slimering,water_damage,lava_damage,light_damage,maxlight,chance,max_height
default,dogfight,2,,,,100,,,,0,-50,30,,1.1,16,1,100,,0,8,0,10,,
green,,,1,5,5,,0.3,2,2,,,,6,,,,,200,,,,,1000,0
blue,,,2,8,8,,0.45,2,2,,,,6,,,,,175,,,,,1250,-50
red,,,3,12,12,,0.6,3,3,,,,7,,,,,150,,,,,1500,-100
yellow,,,4,20,20,,0.75,3,3,,,,7,,,,,125,,,,,1750,-250
purple,,,6,35,35,,0.9,4,4,,,,8,,,,,100,,,,,2000,-500
brown,,3.5,8,50,50,,1.05,4,4,,,,9,1.2,,,,75,,,,,2000,-1200

144
read_mobs_config.lua Normal file
View File

@ -0,0 +1,144 @@
local has_value = minerdream.has_value
local mob_cols={
col_num={"reach","damage","hp_min",
"hp_max","armor","walk_velocity","run_velocity","walk_chance",
"fall_speed","jump_chance","jump_height","stepheight","floats",
"view_range","water_damage","lava_damage","light_damage","slimeball",
"egg","slimering","maxlight","chance","max_height","collisionbox"},
-- as_numeric=1,
}
local mob_definition = minerdream.import_csv(minerdream.path.."/mobs.txt",mob_cols)
--print(dump2(tool_definition))
local mob_default = {
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 2,
damage = 1,
hp_min = 5,
hp_max = 5,
armor = 100,
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
visual = "wielditem",
makes_footstep_sound = true,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
fall_speed = -50,
jump_chance = 30,
jump_height = 6,
stepheight = 1.1,
floats = 0,
view_range = 16,
water_damage = 0,
lava_damage = 8,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
}
if mob_definition["default"] ~= nil then
tmobd=table.copy(mob_definition["default"])
for _,column in pairs({"attack_type","reach","damage","hp_min",
"hp_max","armor","walk_velocity","run_velocity","walk_chance",
"fall_speed","jump_chance","jump_height","stepheight","floats",
"view_range","water_damage","lava_damage","light_damage","slimeball",
"egg","slimering","maxlight","chance","max_height"}) do
if tmobd[column] ~= nil then
mob_default[column]=tmobd[column]
end
end
if tmobd["collisionbox"] ~= nil then
local cb=tmobd["collisionbox"]
mob_default["collisionbox"] = {-1*cb, -1*cb, -1*cb, cb, cb, cb}
end
end
for i,tdef in pairs(mob_definition) do
if (i ~= "default") then
local mdef=table.copy(mob_default)
for _,column in pairs({"attack_type","reach","damage","hp_min",
"hp_max","armor","walk_velocity","run_velocity","walk_chance",
"fall_speed","jump_chance","jump_height","stepheight","floats",
"view_range","water_damage","lava_damage","light_damage","slimeball",
"egg","slimering","maxlight","chance","max_height"}) do
if tdef[column] ~= nil then
mdef[column]=tdef[column]
end
end
if tdef["collisionbox"] ~= nil then
local cb=tdef["collisionbox"]
mdef["collisionbox"] = {-1*cb, -1*cb, -1*cb, cb, cb, cb}
end
mdef.textures = {
{"minerdream:slime_"..i},
}
mdef.blood_texture = "minerdream_slimeball_"..i..".png"
mdef,drops = {
{name = "minerdream:slimeball_"..i, chance = mdef.slimeball, min = 1, max = 3},
{name = "minerdream:slime_"..i.."_egg", chance = mdef.egg, min = 1, max = 1},
{name = "minerdream:accessory_slimering", chance = mdef.slimering, min = 1, max = 1},
}
mobs:register_mob("minerdream:slime_"..i, mdef)
mobs:spawn({
name = "minerdream:slime_"..i,
nodes = {"default:stone"},
max_light = mdef.maxlight,
chance = mdef.chance,
max_height = mdef.max_height,
})
minetest.register_craftitem("minerdream:slime_"..i.."_egg", {
description = i.." slime spawnegg",
inventory_image = "minerdream_egg_"..i.."slime.png",
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.above then
minetest.env:add_entity(pointed_thing.above, "minerdream:slime_"..i)
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_node("minerdream:slime_"..i, {
tiles = {
"minerdream_slime_"..i.."_top.png",
"minerdream_slime_"..i.."_top.png",
"minerdream_slime_"..i.."_side.png",
"minerdream_slime_"..i.."_side.png",
"minerdream_slime_"..i.."_side.png",
"minerdream_slime_"..i.."_side.png"
},
drawtype = "nodebox",
wield_scale = {x=0.4,y=0.4,z=0.4},
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.5, -0.3125, 0.3125, 0.3125, 0.3125}, -- NodeBox1
{-0.375, -0.5, -0.3125, 0.375, 0.25, 0.3125}, -- NodeBox2
{-0.3125, -0.5, -0.375, 0.3125, 0.25, 0.375}, -- NodeBox3
{-0.3125, -0.4375, -0.4375, 0.3125, 0.125, 0.4375}, -- NodeBox4
{-0.375, -0.4375, -0.375, 0.375, 0.125, 0.375}, -- NodeBox5
{-0.4375, -0.4375, -0.3125, 0.4375, 0.125, 0.3125}, -- NodeBox6
{-0.25, -0.375, -0.5, 0.25, 0, 0.5}, -- NodeBox7
{-0.5, -0.375, -0.25, 0.5, 0, 0.25}, -- NodeBox8
}
}
})
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B