separate spawning, split out dragons, dedpue code
This commit is contained in:
parent
aeacc45c8d
commit
035f7262e7
30
arrows/dragonarrows.lua
Normal file
30
arrows/dragonarrows.lua
Normal file
@ -0,0 +1,30 @@
|
||||
local base_arrow = {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
velocity = 8,
|
||||
tail = 1, -- enable tail
|
||||
tail_texture = "dmobs_ice.png",
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
self.object:remove()
|
||||
end,
|
||||
}
|
||||
|
||||
for _,arrowtype in pairs( {"ice","lightning","poison"} ) do
|
||||
base_arrow.textures = {"dmobs_"..arrowtype..".png"},
|
||||
mobs:register_arrow("dmobs:"..arrowtype, dmobs.deepclone(base_arrow) )
|
||||
end
|
71
arrows/dragonfire.lua
Normal file
71
arrows/dragonfire.lua
Normal file
@ -0,0 +1,71 @@
|
||||
--function to register tamed dragon attacks
|
||||
|
||||
function dmobs.register_fire(fname, texture, dmg, replace_node, explode, ice, variance, size)
|
||||
minetest.register_entity(fname, {
|
||||
textures = {texture},
|
||||
velocity = 0.1,
|
||||
damage = dmg,
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
on_step = function(self, obj, pos)
|
||||
local remove = minetest.after(2, function()
|
||||
self.object:remove()
|
||||
end)
|
||||
local pos = self.object:getpos()
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= fname and obj:get_luaentity().name ~= "dmobs:dragon_red" and obj:get_luaentity().name ~= "dmobs:dragon_blue" and obj:get_luaentity().name ~= "dmobs:dragon_black" and obj:get_luaentity().name ~= "dmobs:dragon_green" and obj:get_luaentity().name ~= "dmobs:dragon_great_tame" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
obj:punch(self.launcher, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=3},
|
||||
}, nil)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
for dx=0,1 do
|
||||
for dy=0,1 do
|
||||
for dz=0,1 do
|
||||
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
|
||||
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
local n = minetest.env:get_node(p).name
|
||||
if n ~= fname and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
|
||||
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
|
||||
minetest.env:set_node(t, {name=replace_node})
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
if ice and n == "default:water_source" then
|
||||
minetest.env:set_node(t, {name="default:ice"})
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local apos = self.object:getpos()
|
||||
local part = minetest.add_particlespawner(
|
||||
6, --amount
|
||||
0.3, --time
|
||||
{x=apos.x-variance, y=apos.y-variance, z=apos.z-variance}, --minpos
|
||||
{x=apos.x+variance, y=apos.y+variance, z=apos.z+variance}, --maxpos
|
||||
{x=-0, y=-0, z=-0}, --minvel
|
||||
{x=0, y=0, z=0}, --maxvel
|
||||
{x=variance,y=-0.5-variance,z=variance}, --minacc
|
||||
{x=0.5+variance,y=0.5+variance,z=0.5+variance}, --maxacc
|
||||
0.1, --minexptime
|
||||
0.3, --maxexptime
|
||||
size, --minsize
|
||||
size+2, --maxsize
|
||||
false, --collisiondetection
|
||||
texture --texture
|
||||
)
|
||||
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
dmobs.register_fire("dmobs:fire_plyr", "dmobs_fire.png", 2, "fire:basic_flame", true, false, 0.3, 1)
|
||||
dmobs.register_fire("dmobs:ice_plyr", "dmobs_ice.png", 2, "default:ice", false, true, 0.5, 10)
|
||||
dmobs.register_fire("dmobs:poison_plyr", "dmobs_poison.png", 2, "air", false, false, 0.3, 1)
|
||||
dmobs.register_fire("dmobs:lightning_plyr", "dmobs_lightning.png", 2, "air", true, false, 0, 0.5)
|
1539
dragons.lua
1539
dragons.lua
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
mobs:register_mob("dmobs:dragon", {
|
||||
local dragondef = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
@ -62,98 +62,15 @@ mobs:register_mob("dmobs:dragon", {
|
||||
knock_back = 2,
|
||||
do_custom = step_custom,
|
||||
on_rightclick = dmobs.dragon.on_rc
|
||||
})
|
||||
}
|
||||
|
||||
mobs:register_mob("dmobs:dragon_red", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:fire",
|
||||
shoot_offset = 1,
|
||||
hp_min = 80,
|
||||
hp_max = 100,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -0.9, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon.png"},
|
||||
},
|
||||
child_texture = {
|
||||
{"dmobs_dragon_young.png"}
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
follow = {"dmobs:dragon_gem_fire"},
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 10, true, "dmobs:fire_plyr", "walk", "stand")
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
mobs:register_mob("dmobs:dragon", dmobs.deepclone(dragondef) )
|
||||
|
||||
dragondef.type = "npc"
|
||||
dragondef.attacks_monsters = true
|
||||
|
||||
dragondef.on_rightclick = dmobs.dragon.ride
|
||||
|
||||
dragondef.do_custom = dmobs.dragon_do_custom
|
||||
|
||||
mobs:register_mob("dmobs:dragon_red", dmobs.deepclone(dragondef) )
|
||||
|
@ -1,4 +1,4 @@
|
||||
mobs:register_mob("dmobs:dragon2", {
|
||||
local dragondef = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
@ -62,98 +62,16 @@ mobs:register_mob("dmobs:dragon2", {
|
||||
knock_back = 2,
|
||||
do_custom = step_custom,
|
||||
on_rightclick = dmobs.dragon.on_rc
|
||||
})
|
||||
}
|
||||
|
||||
mobs:register_mob("dmobs:dragon_black", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:lightning",
|
||||
shoot_offset = 1,
|
||||
hp_min = 80,
|
||||
hp_max = 100,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -0.9, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon2.png"},
|
||||
},
|
||||
child_texture = {
|
||||
{"dmobs_dragon_young.png"}
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
follow = {"dmobs:dragon_gem_lightning"},
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 15, true, "dmobs:lightning_plyr", "walk", "stand")
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("dmobs:dragon2", dmobs.deepclone(dragondef) )
|
||||
|
||||
dragondef.type = "npc"
|
||||
dragondef.attacks_monsters = true
|
||||
|
||||
dragondef.on_rightclick = dmobs.dragon.ride
|
||||
|
||||
dragondef.do_custom = dmobs.dragon_do_custom
|
||||
|
||||
mobs:register_mob("dmobs:dragon_black", dmobs.deepclone(dragondef) )
|
||||
|
@ -1,4 +1,4 @@
|
||||
mobs:register_mob("dmobs:dragon3", {
|
||||
local dragondef = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
@ -62,98 +62,16 @@ mobs:register_mob("dmobs:dragon3", {
|
||||
knock_back = 2,
|
||||
do_custom = step_custom,
|
||||
on_rightclick = dmobs.dragon.on_rc
|
||||
})
|
||||
}
|
||||
|
||||
mobs:register_mob("dmobs:dragon_green", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:poison",
|
||||
shoot_offset = 1,
|
||||
hp_min = 80,
|
||||
hp_max = 100,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -0.9, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon3.png"},
|
||||
},
|
||||
child_texture = {
|
||||
{"dmobs_dragon_young.png"}
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
follow = {"dmobs:dragon_gem_poison"},
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 10, true, "dmobs:poison_plyr", "walk", "stand")
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("dmobs:dragon3", dmobs.deepclone(dragondef) )
|
||||
|
||||
dragondef.type = "npc"
|
||||
dragondef.attacks_monsters = true
|
||||
|
||||
dragondef.on_rightclick = dmobs.dragon.ride
|
||||
|
||||
dragondef.do_custom = dmobs.dragon_do_custom
|
||||
|
||||
mobs:register_mob("dmobs:dragon_green", dmobs.deepclone(dragondef) )
|
||||
|
@ -1,4 +1,4 @@
|
||||
mobs:register_mob("dmobs:dragon4", {
|
||||
local dragondef = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
@ -62,98 +62,16 @@ mobs:register_mob("dmobs:dragon4", {
|
||||
knock_back = 2,
|
||||
do_custom = step_custom,
|
||||
on_rightclick = dmobs.dragon.on_rc
|
||||
})
|
||||
}
|
||||
|
||||
mobs:register_mob("dmobs:dragon_blue", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:ice",
|
||||
shoot_offset = 1,
|
||||
hp_min = 80,
|
||||
hp_max = 100,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -0.9, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon4.png"},
|
||||
},
|
||||
child_texture = {
|
||||
{"dmobs_dragon_young.png"}
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
follow = {"dmobs:dragon_gem_ice"},
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 10, true, "dmobs:ice_plyr", "walk", "stand")
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("dmobs:dragon4", dmobs.deepclone(dragondef) )
|
||||
|
||||
dragondef.type = "npc"
|
||||
dragondef.attacks_monsters = true
|
||||
|
||||
dragondef.on_rightclick = dmobs.dragon.ride
|
||||
|
||||
dragondef.do_custom = dmobs.dragon_do_custom
|
||||
|
||||
mobs:register_mob("dmobs:dragon_blue", dmobs.deepclone(dragondef) )
|
||||
|
76
dragons/great_dragon.lua
Normal file
76
dragons/great_dragon.lua
Normal file
@ -0,0 +1,76 @@
|
||||
local gdragon_base = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = false,
|
||||
damage = 5,
|
||||
reach = 4,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:lightning",
|
||||
shoot_offset = 1,
|
||||
hp_min = 140,
|
||||
hp_max = 180,
|
||||
armor = 220,
|
||||
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon_great.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=2.5, y=2.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "roar",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "dmobs:dragon_egg_great", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
}
|
||||
|
||||
mobs:register_mob("dmobs:dragon_great", dmobs.deepclone(gdragon_base) )
|
||||
|
||||
gdragon_base.type = "npc"
|
||||
gdragon_base.attacks_monsters = true
|
||||
|
||||
gdragon_base.on_rightclick = dmobs.dragon.ride
|
||||
|
||||
gdragon_base.do_custom = dmobs.dragon_do_custom
|
||||
|
||||
mobs:register_mob("dmobs:dragon_great_tame", dmobs.deepclone(gdragon_base) )
|
||||
|
||||
|
||||
mobs:register_egg("dmobs:dragon_great", "Boss Dragon", "dmobs_egg1.png", 1)
|
819
dragons/main.lua
819
dragons/main.lua
@ -15,6 +15,28 @@ end
|
||||
|
||||
local tamed_dragons = {}
|
||||
|
||||
dmobs.dragon.ride = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
dmobs.dragon.on_rc = function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
@ -23,103 +45,100 @@ dmobs.dragon.on_rc = function(self, clicker)
|
||||
if mobs:feed_tame(self, clicker, 1, false, false) then
|
||||
return
|
||||
end
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
-- detach
|
||||
lib_mount.detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
self.object:setacceleration({x=0, y=0, z=0})
|
||||
elseif not self.driver then
|
||||
-- attach
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
lib_mount.attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
dmobs.dragon.ride(self,clicker)
|
||||
end
|
||||
|
||||
-- eggs from mobs_dragon
|
||||
|
||||
minetest.register_node("dmobs:egg", {
|
||||
description = "Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_rightclick = function(pos, node, clicker, item, _)
|
||||
local wield_item = clicker:get_wielded_item():get_name()
|
||||
if wield_item == "dmobs:dragon_gem" then
|
||||
dmobs.dragon.do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 10, true, "dmobs:fire_plyr", "walk", "stand")
|
||||
|
||||
local p = {x = pos.x, y = pos.y - 1, z = pos.z}
|
||||
local name1
|
||||
for x1 = -1,1 do
|
||||
for z1 = -1,1 do
|
||||
p.x = pos.x + x1
|
||||
p.z = pos.z + z1
|
||||
local name2 = minetest.get_node(p).name
|
||||
if x1 == -1 and z1 == -1 then
|
||||
name1 = minetest.get_node(p).name
|
||||
elseif x1 == 0 and z1 == 0 then
|
||||
if name2 ~= "default:obsidian" then return end
|
||||
else
|
||||
if name2 ~= name1 then return end
|
||||
end
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- eggs from mobs_dragon --------------------------------------------------------------------------
|
||||
|
||||
local function egg_transform(pos, node, clicker, item, _)
|
||||
local wield_item = clicker:get_wielded_item():get_name()
|
||||
if wield_item == "dmobs:dragon_gem" then
|
||||
|
||||
local p = {x = pos.x, y = pos.y - 1, z = pos.z}
|
||||
local corner_name
|
||||
for x1 = -1,1 do
|
||||
for z1 = -1,1 do
|
||||
p.x = pos.x + x1
|
||||
p.z = pos.z + z1
|
||||
local nestfloor_name = minetest.get_node(p).name
|
||||
|
||||
if x1 == -1 and z1 == -1 then
|
||||
corner_name = minetest.get_node(p).name
|
||||
|
||||
elseif x1 == 0 and z1 == 0 then -- special case in centre
|
||||
-- must be obsidian
|
||||
if nestfloor_name ~= "default:obsidian" then return end
|
||||
|
||||
else
|
||||
-- else ring must all be of the same type
|
||||
if nestfloor_name ~= corner_name then return end
|
||||
end
|
||||
end
|
||||
|
||||
local dragon_type
|
||||
if name1 == "default:lava_source" then
|
||||
dragon_type = "fire"
|
||||
|
||||
elseif name1 == "default:obsidian" then
|
||||
dragon_type = "lightning"
|
||||
|
||||
elseif name1 == "default:cactus" then
|
||||
dragon_type = "poison"
|
||||
elseif name1 == "default:ice" then
|
||||
dragon_type = "ice"
|
||||
end
|
||||
|
||||
minetest.chat_send_player(clicker:get_player_name()," ... something's happening .... very... slowly....")
|
||||
|
||||
minetest.after(100,
|
||||
function(pos, dragon, pname)
|
||||
minetest.set_node(pos, {name="dmobs:dragon_egg_"..dragon_type})
|
||||
end,
|
||||
pos
|
||||
)
|
||||
|
||||
item:take_item()
|
||||
end
|
||||
end, -- rightclick function
|
||||
})
|
||||
|
||||
local dragon_type
|
||||
if corner_name == "default:lava_source" then
|
||||
dragon_type = "fire"
|
||||
|
||||
elseif corner_name == "default:obsidian" then
|
||||
dragon_type = "lightning"
|
||||
|
||||
elseif corner_name == "default:cactus" then
|
||||
dragon_type = "poison"
|
||||
|
||||
elseif corner_name == "default:ice" then
|
||||
dragon_type = "ice"
|
||||
end
|
||||
|
||||
minetest.chat_send_player(clicker:get_player_name()," ... something seems to be happening .... come back later?")
|
||||
|
||||
minetest.after(100,
|
||||
function(pos, dragon, pname)
|
||||
minetest.set_node(pos, {name="dmobs:dragon_egg_"..dragon_type})
|
||||
end,
|
||||
pos
|
||||
)
|
||||
|
||||
item:take_item()
|
||||
end
|
||||
end
|
||||
|
||||
local dragonpairs = {
|
||||
fire = "red",
|
||||
lightning = "black",
|
||||
poison = "green",
|
||||
ice = "black",
|
||||
great = "great",
|
||||
}
|
||||
|
||||
local function egghatch(pos, node, clicker, item, _)
|
||||
local wield_item = clicker:get_wielded_item():get_name()
|
||||
local eggnode = minetest.get_node(pos)
|
||||
local eggnode = minetest.get_node(pos).name
|
||||
|
||||
for nature,colour in pairs(dragonpairs) do
|
||||
if wield_item == "dmobs:dragon_gem_"..nature then
|
||||
if ( wield_item == "dmobs:dragon_gem_"..nature and eggnode:find(nature) ) or
|
||||
( wield_item == "dmobs:dragon_gem" and eggnode == "dmobs:dragon_egg_great" ) then -- special case... because inconsiderate/inconsistent naming
|
||||
|
||||
minetest.chat_send_player(clicker:get_player_name(), " ... let the hatching... begin...")
|
||||
|
||||
minetest.after(100,
|
||||
function(pos, dragon, pname)
|
||||
local neweggnode = minetest.get_node(pos).name
|
||||
if eggnode ~= neweggnode then return end -- prevent infinite hatchings
|
||||
|
||||
minetest.remove_node(pos)
|
||||
local ent = minetest.add_entity(pos, "dmobs:dragon_"..colour )
|
||||
minetest.sound_play("dmobs_chirrup",{pos=pos,max_hear_distance=20})
|
||||
@ -139,284 +158,42 @@ local function egghatch(pos, node, clicker, item, _)
|
||||
end -- for loop
|
||||
end
|
||||
|
||||
minetest.register_node("dmobs:dragon_egg_fire", {
|
||||
local base_egg = { -- base template for all dragon eggs
|
||||
description = "Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = egghatch,
|
||||
})
|
||||
|
||||
minetest.register_node("dmobs:dragon_egg_lightning", {
|
||||
description = "Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg2.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = egghatch,
|
||||
})
|
||||
|
||||
minetest.register_node("dmobs:dragon_egg_poison", {
|
||||
description = "Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg3.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = egghatch,
|
||||
})
|
||||
|
||||
minetest.register_node("dmobs:dragon_egg_ice", {
|
||||
description = "Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg4.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = egghatch,
|
||||
})
|
||||
|
||||
minetest.register_node("dmobs:egg_great", {
|
||||
description = "Great Dragon Egg",
|
||||
drawtype = "mesh",
|
||||
mesh = "egg.b3d",
|
||||
tiles = {"dmobs_egg.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {fleshy=3, dig_immediate=3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, item, _)
|
||||
local wield_item = clicker:get_wielded_item():get_name()
|
||||
if wield_item == "dmobs:dragon_gem" then
|
||||
minetest.after(100, function(pos, dragon, pname)
|
||||
minetest.remove_node(pos)
|
||||
local ent = minetest.add_entity(pos, "dmobs:dragon_great_tame")
|
||||
local obj = ent:get_luaentity()
|
||||
obj.tamed = true
|
||||
obj.owner = clicker:get_player_name()
|
||||
end, pos, clicker:get_player_name())
|
||||
item:take_item()
|
||||
end
|
||||
end
|
||||
})
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = egg_transform,
|
||||
}
|
||||
|
||||
|
||||
--saddle license
|
||||
minetest.register_node("dmobs:egg", dmobs.deepclone(base_egg) ) -- clone, to not affect the base template
|
||||
|
||||
-- **mobs_saddle.png**
|
||||
-- -------------------
|
||||
-- The MIT License (MIT)
|
||||
base_egg.groups.not_in_creative_inventory=1
|
||||
base_egg.on_rightclick = egghatch
|
||||
|
||||
-- Copyright (c) 2014 Krupnov Pavel
|
||||
base_egg.tiles = {"dmobs_egg1.png"}
|
||||
minetest.register_node("dmobs:dragon_egg_fire", dmobs.deepclone(base_egg) )
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
base_egg.tiles = {"dmobs_egg2.png"}
|
||||
minetest.register_node("dmobs:dragon_egg_lightning", dmobs.deepclone(base_egg) )
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in
|
||||
-- all copies or substantial portions of the Software.
|
||||
base_egg.tiles = {"dmobs_egg3.png"}
|
||||
minetest.register_node("dmobs:dragon_egg_poison", dmobs.deepclone(base_egg) )
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
-- THE SOFTWARE.
|
||||
base_egg.tiles = {"dmobs_egg4.png"}
|
||||
minetest.register_node("dmobs:dragon_egg_ice", dmobs.deepclone(base_egg) )
|
||||
|
||||
|
||||
-- saddle (if not already available)
|
||||
if not minetest.get_modpath("mobs_horse") then
|
||||
minetest.register_craftitem(":mobs:saddle", {
|
||||
description = "Saddle",
|
||||
inventory_image = "mobs_saddle.png"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mobs:saddle",
|
||||
recipe = {
|
||||
{"mobs:leather", "mobs:leather", "mobs:leather"},
|
||||
{"mobs:leather", "default:steel_ingot", "mobs:leather"},
|
||||
{"mobs:leather", "default:steel_ingot", "mobs:leather"}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
--arrows
|
||||
|
||||
|
||||
|
||||
--function to register tamed dragon attacks
|
||||
|
||||
function dmobs.register_fire(fname, texture, dmg, replace_node, explode, ice, variance, size)
|
||||
minetest.register_entity(fname, {
|
||||
textures = {texture},
|
||||
velocity = 0.1,
|
||||
damage = dmg,
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
on_step = function(self, obj, pos)
|
||||
local remove = minetest.after(2, function()
|
||||
self.object:remove()
|
||||
end)
|
||||
local pos = self.object:getpos()
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= fname and obj:get_luaentity().name ~= "dmobs:dragon_red" and obj:get_luaentity().name ~= "dmobs:dragon_blue" and obj:get_luaentity().name ~= "dmobs:dragon_black" and obj:get_luaentity().name ~= "dmobs:dragon_green" and obj:get_luaentity().name ~= "dmobs:dragon_great_tame" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
obj:punch(self.launcher, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=3},
|
||||
}, nil)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
for dx=0,1 do
|
||||
for dy=0,1 do
|
||||
for dz=0,1 do
|
||||
local p = {x=pos.x+dx, y=pos.y, z=pos.z+dz}
|
||||
local t = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
local n = minetest.env:get_node(p).name
|
||||
if n ~= fname and n ~="default:dirt_with_grass" and n ~="default:dirt_with_dry_grass" and n ~="default:stone" then
|
||||
if minetest.registered_nodes[n].groups.flammable --[[or math.random(1, 100) <= 1]] then
|
||||
minetest.env:set_node(t, {name=replace_node})
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
if ice and n == "default:water_source" then
|
||||
minetest.env:set_node(t, {name="default:ice"})
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local apos = self.object:getpos()
|
||||
local part = minetest.add_particlespawner(
|
||||
6, --amount
|
||||
0.3, --time
|
||||
{x=apos.x-variance, y=apos.y-variance, z=apos.z-variance}, --minpos
|
||||
{x=apos.x+variance, y=apos.y+variance, z=apos.z+variance}, --maxpos
|
||||
{x=-0, y=-0, z=-0}, --minvel
|
||||
{x=0, y=0, z=0}, --maxvel
|
||||
{x=variance,y=-0.5-variance,z=variance}, --minacc
|
||||
{x=0.5+variance,y=0.5+variance,z=0.5+variance}, --maxacc
|
||||
0.1, --minexptime
|
||||
0.3, --maxexptime
|
||||
size, --minsize
|
||||
size+2, --maxsize
|
||||
false, --collisiondetection
|
||||
texture --texture
|
||||
)
|
||||
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
dmobs.register_fire("dmobs:fire_plyr", "dmobs_fire.png", 2, "fire:basic_flame", true, false, 0.3, 1)
|
||||
dmobs.register_fire("dmobs:ice_plyr", "dmobs_ice.png", 2, "default:ice", false, true, 0.5, 10)
|
||||
dmobs.register_fire("dmobs:poison_plyr", "dmobs_poison.png", 2, "air", false, false, 0.3, 1)
|
||||
dmobs.register_fire("dmobs:lightning_plyr", "dmobs_lightning.png", 2, "air", true, false, 0, 0.5)
|
||||
|
||||
|
||||
|
||||
mobs:register_arrow("dmobs:ice", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
textures = {"dmobs_ice.png"},
|
||||
velocity = 8,
|
||||
tail = 1, -- enable tail
|
||||
tail_texture = "dmobs_ice.png",
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
self.object:remove()
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_arrow("dmobs:lightning", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
textures = {"dmobs_lightning.png"},
|
||||
velocity = 8,
|
||||
tail = 1, -- enable tail
|
||||
tail_texture = "dmobs_lightning.png",
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = node_hit,
|
||||
})
|
||||
|
||||
mobs:register_arrow("dmobs:poison", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
textures = {"dmobs_poison.png"},
|
||||
velocity = 8,
|
||||
tail = 1, -- enable tail
|
||||
tail_texture = "dmobs_poison.png",
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
self.object:remove()
|
||||
end,
|
||||
})
|
||||
base_egg.groups.not_in_creative_inventory=nil
|
||||
--base_egg.tiles = {"dmobs_dragon_egg_great.png"}
|
||||
base_egg.tiles = {"dmobs_fire.png"}
|
||||
base_egg.description = "Great Dragon Egg"
|
||||
minetest.register_node("dmobs:dragon_egg_great", dmobs.deepclone(base_egg) )
|
||||
|
||||
|
||||
--items and tools
|
||||
@ -451,10 +228,6 @@ minetest.register_craftitem("dmobs:dragon_gem", {
|
||||
-- mobs:spawn_specific("dmobs:dragon3", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)
|
||||
-- mobs:spawn_specific("dmobs:dragon4", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)
|
||||
|
||||
mobs:register_spawn("dmobs:dragon", {"default:leaves","default:dirt_with_grass"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:dragon2", {"default:pine_needles"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:dragon3", {"default:acacia_leaves","default:dirt_with_dry_grass"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:dragon4", {"default:jungleleaves"}, 20, 10, 64000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:dragon", "Wild Fire Dragon", "default_apple.png", 1)
|
||||
mobs:register_egg("dmobs:dragon2", "Wild Lightning Dragon", "default_mese_crystal.png", 1)
|
||||
@ -466,363 +239,3 @@ mobs:register_egg("dmobs:dragon_black", "Tame Lightning Dragon", "default_mese_c
|
||||
mobs:register_egg("dmobs:dragon_green", "Tame Poison Dragon", "dmobs_poison.png", 1)
|
||||
mobs:register_egg("dmobs:dragon_blue", "Tame Ice Dragon", "default_ice.png", 1)
|
||||
|
||||
|
||||
--other dragons
|
||||
|
||||
mobs:register_mob("dmobs:waterdragon", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
shoot_interval = 2.5,
|
||||
arrow = "dmobs:ice",
|
||||
shoot_offset = 0,
|
||||
pathfinding = false,
|
||||
reach = 5,
|
||||
damage = 2,
|
||||
hp_min = 100,
|
||||
hp_max = 127,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.5, -0.4, 0.4, 5, 0.4},
|
||||
visual_size = {x=4, y=4},
|
||||
visual = "mesh",
|
||||
mesh = "water_dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_waterdragon.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_dirtmonster",
|
||||
},
|
||||
view_range = 15,
|
||||
rotate = 180,
|
||||
walk_velocity = 0.01,
|
||||
run_velocity = 0.01,
|
||||
jump = false,
|
||||
drops = {
|
||||
{name = "dmobs:dragon_gem_ice", chance = 1, min = 1, max = 1},
|
||||
{name = "dmobs:dragon_gem_fire", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
floats = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
punch_start = 40,
|
||||
punch_end = 60,
|
||||
shoot_start = 20,
|
||||
shoot_end = 40,
|
||||
},
|
||||
do_custom = function(self)
|
||||
--follow thanks to TenPlus1 and Byakuren
|
||||
if not self.hydra then
|
||||
self.hydra = true -- flip switch so this part is done only once
|
||||
|
||||
-- get head position and define a few temp variables
|
||||
local pos = self.object:getpos()
|
||||
local obj, obj2, ent
|
||||
|
||||
-- add body and make it follow head
|
||||
obj = minetest.add_entity({x=pos.x+1, y=pos.y, z=pos.z}, "dmobs:waterdragon_2")
|
||||
ent = obj:get_luaentity()
|
||||
ent.following = self.object
|
||||
|
||||
-- add body and make it follow previous body segment
|
||||
obj2 = minetest.add_entity({x=pos.x-1, y=pos.y, z=pos.z}, "dmobs:waterdragon_2")
|
||||
ent = obj2:get_luaentity()
|
||||
ent.following = self.object
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("dmobs:waterdragon_2", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "shoot",
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
shoot_interval = 3,
|
||||
arrow = "dmobs:ice",
|
||||
shoot_offset = 0,
|
||||
pathfinding = false,
|
||||
reach = 5,
|
||||
damage = 2,
|
||||
hp_min = 50,
|
||||
hp_max = 60,
|
||||
armor = 50,
|
||||
collisionbox = {-0.4, -0.2, -0.4, 0.4, 5, 0.4},
|
||||
visual_size = {x=3, y=3},
|
||||
visual = "mesh",
|
||||
mesh = "water_dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_waterdragon.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "velociraptor",
|
||||
},
|
||||
view_range = 15,
|
||||
rotate = 180,
|
||||
floats = 0,
|
||||
walk_velocity = 0.01,
|
||||
run_velocity = 0.01,
|
||||
jump = false,
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
punch_start = 40,
|
||||
punch_end = 60,
|
||||
shoot_start = 20,
|
||||
shoot_end = 40,
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:waterdragon", {"default:water_source"}, 20, 10, 32000, 1, 31000, false)
|
||||
|
||||
mobs:register_egg("dmobs:waterdragon", "Boss Waterdragon", "dmobs_egg4.png", 1)
|
||||
|
||||
mobs:register_mob("dmobs:wyvern", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = false,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:poison",
|
||||
shoot_offset = 0.5,
|
||||
hp_min = 100,
|
||||
hp_max = 150,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "wyvern.b3d",
|
||||
textures = {
|
||||
{"dmobs_wyvern.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
runaway = true,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
pathfinding = true,
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
fall_speed = -2,
|
||||
jump = true,
|
||||
fly = false,
|
||||
drops = {
|
||||
{name = "dmobs:dragon_gem_poison", chance = 1, min = 1, max = 1},
|
||||
{name = "dmobs:dragon_gem_lightning", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "velociraptor",
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 20,
|
||||
speed_run = 30,
|
||||
walk_start = 33,
|
||||
walk_end = 68,
|
||||
stand_start = 1,
|
||||
stand_end = 30,
|
||||
run_start = 33,
|
||||
run_end = 68,
|
||||
punch_start = 70,
|
||||
punch_end = 89,
|
||||
},
|
||||
knock_back = 2,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:wyvern", {"default:leaves"}, 20, 10, 32000, 1, 31000, false)
|
||||
|
||||
mobs:register_egg("dmobs:wyvern", "Boss Wyvern", "dmobs_egg3.png", 1)
|
||||
|
||||
mobs:register_mob("dmobs:dragon_great", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = false,
|
||||
damage = 5,
|
||||
reach = 4,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:lightning",
|
||||
shoot_offset = 1,
|
||||
hp_min = 140,
|
||||
hp_max = 180,
|
||||
armor = 220,
|
||||
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon_great.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=2.5, y=2.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "roar",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "dmobs:egg_great", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
})
|
||||
|
||||
mobs:register_mob("dmobs:dragon_great_tame", {
|
||||
type = "npc",
|
||||
passive = false,
|
||||
attacks_monsters = true,
|
||||
damage = 5,
|
||||
reach = 4,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:lightning",
|
||||
shoot_offset = 1,
|
||||
hp_min = 140,
|
||||
hp_max = 180,
|
||||
armor = 220,
|
||||
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_dragon_great.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=2.5, y=2.5},
|
||||
makes_footstep_sound = true,
|
||||
runaway = false,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
fall_speed = 0,
|
||||
pathfinding = true,
|
||||
fall_damage = 0,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "roar",
|
||||
},
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
jump = true,
|
||||
fly = true,
|
||||
drops = {
|
||||
{name = "dmobs:egg_great", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
fall_speed = 0,
|
||||
stepheight = 10,
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 10,
|
||||
speed_run = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 22,
|
||||
stand_start = 1,
|
||||
stand_end = 22,
|
||||
run_start = 1,
|
||||
run_end = 22,
|
||||
punch_start = 22,
|
||||
punch_end = 47,
|
||||
},
|
||||
knock_back = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
local inv = clicker:get_inventory()
|
||||
if self.driver and clicker == self.driver then
|
||||
object_detach(self, clicker, {x=1, y=0, z=1})
|
||||
if inv:room_for_item("main", "mobs:saddle") then
|
||||
inv:add_item("main", "mobs:saddle")
|
||||
else
|
||||
minetest.add_item(clicker.getpos(), "mobs:saddle")
|
||||
end
|
||||
elseif not self.driver then
|
||||
if clicker:get_wielded_item():get_name() == "mobs:saddle" then
|
||||
object_attach(self, clicker, {x=0, y=12, z=4}, {x=0, y=0, z=4})
|
||||
inv:remove_item("main", "mobs:saddle")
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.driver then
|
||||
object_fly(self, dtime, 10, true, "dmobs:fire_plyr", "walk", "stand")
|
||||
if self.state == "attack" then
|
||||
self.state = "idle"
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:dragon_great", {"default:lava_source"}, 20, 0, 64000, -21000, 1000, false)
|
||||
|
||||
mobs:register_egg("dmobs:dragon_great", "Boss Dragon", "dmobs_egg1.png", 1)
|
||||
|
135
dragons/water_dragon.lua
Normal file
135
dragons/water_dragon.lua
Normal file
@ -0,0 +1,135 @@
|
||||
mobs:register_mob("dmobs:waterdragon", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogshoot",
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
shoot_interval = 2.5,
|
||||
arrow = "dmobs:ice",
|
||||
shoot_offset = 0,
|
||||
pathfinding = false,
|
||||
reach = 5,
|
||||
damage = 2,
|
||||
hp_min = 100,
|
||||
hp_max = 127,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.5, -0.4, 0.4, 5, 0.4},
|
||||
visual_size = {x=4, y=4},
|
||||
visual = "mesh",
|
||||
mesh = "water_dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_waterdragon.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_dirtmonster",
|
||||
},
|
||||
view_range = 15,
|
||||
rotate = 180,
|
||||
walk_velocity = 0.01,
|
||||
run_velocity = 0.01,
|
||||
jump = false,
|
||||
drops = {
|
||||
{name = "dmobs:dragon_gem_ice", chance = 1, min = 1, max = 1},
|
||||
{name = "dmobs:dragon_gem_fire", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
floats = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
punch_start = 40,
|
||||
punch_end = 60,
|
||||
shoot_start = 20,
|
||||
shoot_end = 40,
|
||||
},
|
||||
do_custom = function(self)
|
||||
--follow thanks to TenPlus1 and Byakuren
|
||||
if not self.hydra then
|
||||
self.hydra = true -- flip switch so this part is done only once
|
||||
|
||||
-- get head position and define a few temp variables
|
||||
local pos = self.object:getpos()
|
||||
local obj, obj2, ent
|
||||
|
||||
-- add body and make it follow head
|
||||
obj = minetest.add_entity({x=pos.x+1, y=pos.y, z=pos.z}, "dmobs:waterdragon_2")
|
||||
ent = obj:get_luaentity()
|
||||
ent.following = self.object
|
||||
|
||||
-- add body and make it follow previous body segment
|
||||
obj2 = minetest.add_entity({x=pos.x-1, y=pos.y, z=pos.z}, "dmobs:waterdragon_2")
|
||||
ent = obj2:get_luaentity()
|
||||
ent.following = self.object
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("dmobs:waterdragon_2", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "shoot",
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
shoot_interval = 3,
|
||||
arrow = "dmobs:ice",
|
||||
shoot_offset = 0,
|
||||
pathfinding = false,
|
||||
reach = 5,
|
||||
damage = 2,
|
||||
hp_min = 50,
|
||||
hp_max = 60,
|
||||
armor = 50,
|
||||
collisionbox = {-0.4, -0.2, -0.4, 0.4, 5, 0.4},
|
||||
visual_size = {x=3, y=3},
|
||||
visual = "mesh",
|
||||
mesh = "water_dragon.b3d",
|
||||
textures = {
|
||||
{"dmobs_waterdragon.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "velociraptor",
|
||||
},
|
||||
view_range = 15,
|
||||
rotate = 180,
|
||||
floats = 0,
|
||||
walk_velocity = 0.01,
|
||||
run_velocity = 0.01,
|
||||
jump = false,
|
||||
water_damage = 0,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
punch_start = 40,
|
||||
punch_end = 60,
|
||||
shoot_start = 20,
|
||||
shoot_end = 40,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("dmobs:waterdragon", "Boss Waterdragon", "dmobs_egg4.png", 1)
|
63
dragons/wyvern.lua
Normal file
63
dragons/wyvern.lua
Normal file
@ -0,0 +1,63 @@
|
||||
mobs:register_mob("dmobs:wyvern", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attacks_monsters = false,
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
attack_type = "dogshoot",
|
||||
shoot_interval = 2.5,
|
||||
dogshoot_switch = 2,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max =5,
|
||||
arrow = "dmobs:poison",
|
||||
shoot_offset = 0.5,
|
||||
hp_min = 100,
|
||||
hp_max = 150,
|
||||
armor = 100,
|
||||
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
|
||||
visual = "mesh",
|
||||
mesh = "wyvern.b3d",
|
||||
textures = {
|
||||
{"dmobs_wyvern.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
runaway = true,
|
||||
jump_chance = 30,
|
||||
walk_chance = 80,
|
||||
pathfinding = true,
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
fall_speed = -2,
|
||||
jump = true,
|
||||
fly = false,
|
||||
drops = {
|
||||
{name = "dmobs:dragon_gem_poison", chance = 1, min = 1, max = 1},
|
||||
{name = "dmobs:dragon_gem_lightning", chance = 1, min = 1, max = 1},
|
||||
},
|
||||
sounds = {
|
||||
shoot_attack = "mobs_fireball",
|
||||
random = "velociraptor",
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
view_range = 20,
|
||||
animation = {
|
||||
speed_normal = 20,
|
||||
speed_run = 30,
|
||||
walk_start = 33,
|
||||
walk_end = 68,
|
||||
stand_start = 1,
|
||||
stand_end = 30,
|
||||
run_start = 33,
|
||||
run_end = 68,
|
||||
punch_start = 70,
|
||||
punch_end = 89,
|
||||
},
|
||||
knock_back = 2,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("dmobs:wyvern", "Boss Wyvern", "dmobs_egg3.png", 1)
|
51
init.lua
51
init.lua
@ -7,15 +7,28 @@ dmobs = {}
|
||||
dofile(minetest.get_modpath("dmobs").."/api.lua")
|
||||
|
||||
-- Enable dragons (disable to remove tamed dragons and dragon bosses)
|
||||
dmobs.dragons = minetest.setting_get_bool("dmobs.dragons") or true
|
||||
dmobs.dragons = minetest.setting_getbool("dmobs.dragons") or true
|
||||
|
||||
-- Enable fireballs/explosions
|
||||
dmobs.destructive = minetest.setting_get_bool("dmobs.destructive") or false
|
||||
dmobs.destructive = minetest.setting_getbool("dmobs.destructive") or false
|
||||
|
||||
-- Table cloning to reduce code repetition
|
||||
dmobs.deepclone = function(t) -- deep-copy a table -- from https://gist.github.com/MihailJP/3931841
|
||||
if type(t) ~= "table" then return t end
|
||||
|
||||
dofile(minetest.get_modpath("dmobs").."/nodes.lua")
|
||||
local target = {}
|
||||
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/sting.lua")
|
||||
for k, v in pairs(t) do
|
||||
if k ~= "__index" and type(v) == "table" then -- omit circular reference
|
||||
target[k] = dmobs.deepclone(v)
|
||||
else
|
||||
target[k] = v
|
||||
end
|
||||
end
|
||||
return target
|
||||
end
|
||||
|
||||
-- Start loading ----------------------------------------------------------------------------------
|
||||
|
||||
local function loadmob(mobname,dir)
|
||||
dir = dir or "/mobs/"
|
||||
@ -56,14 +69,7 @@ end
|
||||
|
||||
-- dragons!!
|
||||
|
||||
|
||||
if dmobs.destructive == true then
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/fire_explosive.lua")
|
||||
else
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/fire.lua")
|
||||
end
|
||||
|
||||
if dmobs.dragons then
|
||||
if not dmobs.dragons then
|
||||
loadmob("dragon_normal","/dragons/")
|
||||
else
|
||||
loadmob("main","/dragons/")
|
||||
@ -71,4 +77,25 @@ else
|
||||
loadmob("dragon2","/dragons/")
|
||||
loadmob("dragon3","/dragons/")
|
||||
loadmob("dragon4","/dragons/")
|
||||
loadmob("water_dragon","/dragons/")
|
||||
loadmob("wyvern","/dragons/")
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/dragonfire.lua")
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/dragonarrows.lua")
|
||||
end
|
||||
|
||||
-- Arrow definitions
|
||||
|
||||
if dmobs.destructive == true then
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/fire_explosive.lua")
|
||||
else
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/fire.lua")
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath("dmobs").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("dmobs").."/arrows/sting.lua")
|
||||
|
||||
-- Spawning
|
||||
|
||||
|
||||
dofile(minetest.get_modpath("dmobs").."/spawn.lua")
|
||||
dofile(minetest.get_modpath("dmobs").."/saddle.lua")
|
||||
|
@ -53,6 +53,5 @@ mobs:register_mob("dmobs:badger", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:badger", {"default:dirt_with_grass","default:dirt"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:badger", "Badger", "default_obsidian.png", 1)
|
||||
|
@ -54,6 +54,5 @@ mobs:register_mob("dmobs:elephant", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:elephant", {"default:dirt_with_dry_grass","default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:elephant", "Elephant", "default_dry_grass.png", 1)
|
||||
|
@ -62,6 +62,5 @@ mobs:register_mob("dmobs:fox", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:fox", {"default:dirt_with_grass","default:dirt"}, 20, 10, 32000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:fox", "Fox", "wool_orange.png", 1)
|
||||
|
@ -55,6 +55,5 @@ mobs:register_mob("dmobs:gnorm", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:gnorm", {"default:dirt_with_grass","default:wood"}, 20, 10, 32000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:gnorm", "Gnorm", "default_dirt.png", 1)
|
||||
|
@ -44,6 +44,5 @@ mobs:register_mob("dmobs:golem", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:golem", {"default:stone"}, 7, 0, 16000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:golem", "Stone Golem", "default_stone.png", 1)
|
||||
|
@ -46,6 +46,5 @@ mobs:register_mob("dmobs:hedgehog", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:hedgehog", {"default:dirt_with_grass","default:pine_needles"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:hedgehog", "Hedgehog", "wool_brown.png", 1)
|
||||
|
@ -73,7 +73,5 @@ mobs:register_mob("dmobs:nyan", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:nyan", {"default:pine_needles","default:leaves"}, 20, 10, 50000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:nyan", {"nyanland:meseleaves"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:nyan", "Nyan Cat", "wool_pink.png", 1)
|
||||
|
@ -46,10 +46,4 @@ mobs:register_mob("dmobs:ogre", {
|
||||
},
|
||||
})
|
||||
|
||||
if not dmobs.dragons == true then
|
||||
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
else
|
||||
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 350, 2, 31000)
|
||||
end
|
||||
|
||||
mobs:register_egg("dmobs:ogre", "Ogre", "default_desert_sand.png", 1)
|
||||
|
@ -47,7 +47,7 @@ mobs:register_mob("dmobs:orc", {
|
||||
})
|
||||
|
||||
-- Orc (Redesign)
|
||||
mobs:register_mob("dmobs:orc_redesign", {
|
||||
mobs:register_mob("dmobs:orc2", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
reach = 1,
|
||||
@ -93,11 +93,6 @@ mobs:register_mob("dmobs:orc_redesign", {
|
||||
},
|
||||
})
|
||||
|
||||
if not dmobs.dragons == true then
|
||||
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
else
|
||||
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 3500, 2, 31000)
|
||||
end
|
||||
|
||||
mobs:register_egg("dmobs:orc_redesign", "Orc (redesign)", "default_desert_sand.png", 1)
|
||||
mobs:register_egg("dmobs:orc2", "Morgul Orc", "default_desert_sand.png", 1) -- new and improved, hey
|
||||
mobs:register_egg("dmobs:orc", "Orc", "default_desert_sand.png", 1)
|
||||
|
@ -42,6 +42,5 @@ mobs:register_mob("dmobs:owl", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:owl", {"default:leaves","default:tree"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:owl", "Owl", "default_tree.png", 1)
|
||||
|
@ -59,6 +59,5 @@ mobs:register_mob("dmobs:panda", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:panda", {"default:dirt_with_grass","ethereal:bamboo_dirt"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:panda", "Panda", "default_papyrus.png", 1)
|
||||
|
@ -65,6 +65,5 @@ mobs:register_mob("dmobs:pig", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:pig", {"default:pine_needles","default:leaves", "nyanland:cloudstone"}, 20, 10, 32000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:pig", "flying Pig", "wool_pink.png", 1)
|
||||
|
@ -71,6 +71,5 @@ end
|
||||
|
||||
mobs:register_mob("dmobs:pig_evil", pigdef)
|
||||
|
||||
mobs:register_spawn("dmobs:pig_evil", {"default:pine_needles","default:leaves"}, 20, 10, 32000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:pig_evil", "Kamikaze Pig", "wool_pink.png", 1)
|
||||
|
@ -48,6 +48,5 @@ mobs:register_mob("dmobs:rat", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:rat", {"default:stone","default:sand"}, 20, 0, 32000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:rat", "Giant Rat", "wool_grey.png", 1)
|
||||
|
@ -44,6 +44,5 @@ mobs:register_mob("dmobs:skeleton", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:skeleton", {"default:stone"}, 7, 0, 16000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:skeleton", "Skeleton", "default_dirt.png", 1)
|
||||
|
@ -54,6 +54,5 @@ mobs:register_mob("dmobs:tortoise", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:tortoise", {"default:clay","default:sand"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:tortoise", "Tortoise", "default_grass.png", 1)
|
||||
|
@ -44,6 +44,5 @@ mobs:register_mob("dmobs:treeman", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:treeman", {"default:leaves", "default:pine_needles"}, 7, 0, 16000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:treeman", "Treeman", "default_tree.png", 1)
|
||||
|
@ -43,8 +43,6 @@ mobs:register_mob("dmobs:wasp", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:wasp", {"default:dirt_with_grass"}, 20, 10, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:wasp", {"dmobs:hive"}, 20, 10, 16000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:wasp", "Wasp", "dmobs_wasp_bg.png", 1)
|
||||
|
||||
@ -108,6 +106,5 @@ mobs:register_mob("dmobs:wasp_leader", {
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:wasp_leader", {"default:dirt_with_grass","dmobs:hive"}, 20, 10, 64000, 2, 31000)
|
||||
|
||||
mobs:register_egg("dmobs:wasp_leader", "King of Sting", "dmobs_wasp_bg.png", 1)
|
||||
|
@ -58,6 +58,5 @@ mobs:register_mob("dmobs:whale", {
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("dmobs:whale", {"default:water_source"}, 20, 10, 15000, -20, 1000)
|
||||
|
||||
mobs:register_egg("dmobs:whale", "Whale", "default_water_source.png", 1)
|
||||
|
43
saddle.lua
Normal file
43
saddle.lua
Normal file
@ -0,0 +1,43 @@
|
||||
--saddle license
|
||||
|
||||
-- **mobs_saddle.png**
|
||||
-- -------------------
|
||||
-- The MIT License (MIT)
|
||||
|
||||
-- Copyright (c) 2014 Krupnov Pavel
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in
|
||||
-- all copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
-- THE SOFTWARE.
|
||||
|
||||
|
||||
-- saddle (if not already available)
|
||||
if not minetest.get_modpath("mobs_horse") then
|
||||
minetest.register_craftitem(":mobs:saddle", {
|
||||
description = "Saddle",
|
||||
inventory_image = "mobs_saddle.png"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mobs:saddle",
|
||||
recipe = {
|
||||
{"mobs:leather", "mobs:leather", "mobs:leather"},
|
||||
{"mobs:leather", "default:steel_ingot", "mobs:leather"},
|
||||
{"mobs:leather", "default:steel_ingot", "mobs:leather"}
|
||||
}
|
||||
})
|
||||
end
|
49
spawn.lua
Normal file
49
spawn.lua
Normal file
@ -0,0 +1,49 @@
|
||||
-- friendlies
|
||||
|
||||
mobs:register_spawn("dmobs:nyan", {"default:pine_needles","default:leaves"}, 20, 10, 50000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:nyan", {"nyanland:meseleaves"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
mobs:register_spawn("dmobs:hedgehog", {"default:dirt_with_grass","default:pine_needles"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:whale", {"default:water_source"}, 20, 10, 15000, -20, 1000)
|
||||
mobs:register_spawn("dmobs:owl", {"default:leaves","default:tree"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:gnorm", {"default:dirt_with_grass","default:wood"}, 20, 10, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:tortoise", {"default:clay","default:sand"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:elephant", {"default:dirt_with_dry_grass","default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:badger", {"default:dirt_with_grass","default:dirt"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:pig", {"default:pine_needles","default:leaves", "nyanland:cloudstone"}, 20, 10, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:panda", {"default:dirt_with_grass","ethereal:bamboo_dirt"}, 20, 10, 15000, 2, 31000)
|
||||
|
||||
-- baddies
|
||||
|
||||
mobs:register_spawn("dmobs:wasp", {"default:dirt_with_grass"}, 20, 10, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:wasp", {"dmobs:hive"}, 20, 10, 16000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:wasp_leader", {"default:dirt_with_grass","dmobs:hive"}, 20, 10, 64000, 2, 31000)
|
||||
|
||||
mobs:register_spawn("dmobs:golem", {"default:stone"}, 7, 0, 16000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:pig_evil", {"default:pine_needles","default:leaves"}, 20, 10, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:fox", {"default:dirt_with_grass","default:dirt"}, 20, 10, 32000, 2, 31000)
|
||||
|
||||
if not dmobs.dragons then
|
||||
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
|
||||
else
|
||||
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 3500, 2, 31000)
|
||||
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 350, 2, 31000)
|
||||
end
|
||||
|
||||
|
||||
mobs:register_spawn("dmobs:rat", {"default:stone","default:sand"}, 20, 0, 32000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:treeman", {"default:leaves", "default:pine_needles"}, 7, 0, 16000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:skeleton", {"default:stone"}, 7, 0, 16000, 2, 31000)
|
||||
|
||||
-- dragons
|
||||
|
||||
mobs:register_spawn("dmobs:dragon", {"default:leaves","default:dirt_with_grass"}, 20, 10, 64000, 2, 31000)
|
||||
|
||||
mobs:register_spawn("dmobs:dragon2", {"default:pine_needles"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:dragon3", {"default:acacia_leaves","default:dirt_with_dry_grass"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:dragon4", {"default:jungleleaves"}, 20, 10, 64000, 2, 31000)
|
||||
mobs:register_spawn("dmobs:waterdragon", {"default:water_source"}, 20, 10, 32000, 1, 31000, false)
|
||||
mobs:register_spawn("dmobs:wyvern", {"default:leaves"}, 20, 10, 32000, 1, 31000, false)
|
||||
mobs:register_spawn("dmobs:dragon_great", {"default:lava_source"}, 20, 0, 64000, -21000, 1000, false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user