volvagia and savanna village
parent
d1a753bfbe
commit
37fab69529
|
@ -256,7 +256,13 @@ minetest.register_entity("hyrule_mapgen:windmill", {
|
|||
physical = true,
|
||||
on_activate = function(self)
|
||||
self.object:set_animation({x=1, y=40}, 5, 0)
|
||||
end
|
||||
end,
|
||||
on_step = function(self)
|
||||
local pos = self.object:getpos()
|
||||
if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "hyrule_mapgen:windmill_node" then
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_entity("hyrule_mapgen:butterfly", {
|
||||
|
|
|
@ -1564,6 +1564,32 @@ minetest.register_on_generated(function(minp, maxp)
|
|||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp)
|
||||
if maxp.y < -1 or maxp.y > 11000 then
|
||||
return
|
||||
end
|
||||
local grass = minetest.find_nodes_in_area(minp, maxp,
|
||||
{"default:dirt_with_dry_grass"})
|
||||
for n = 1, #grass do
|
||||
if math.random(1, village_rarity) == 1 then
|
||||
local pos = {x = grass[n].x, y = grass[n].y, z = grass[n].z }
|
||||
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "air" then
|
||||
minetest.place_schematic(pos, minetest.get_modpath("hyrule_mapgen").."/schematics/savanna_village.mts", random, {}, true)
|
||||
local shopkeeper = minetest.env:add_entity({x=pos.x+6, y=pos.y+6, z=pos.z+2}, "mobs_npc:shopkeeper")
|
||||
local windmill = minetest.env:add_entity({x=pos.x+23, y=pos.y+13, z=pos.z+29}, "hyrule_mapgen:windmill")
|
||||
local obj = minetest.env:add_entity({x=pos.x+9, y=pos.y+9, z=pos.z+33}, "mobs_npc:npc_custom")
|
||||
local npc = obj:get_luaentity()
|
||||
npc.text = "I'll make you something nice for 500 green rupees"
|
||||
npc.reward_text = "Here you go"
|
||||
npc.item = "default:sword_bronze"
|
||||
npc.reward_item = "hyruletools:green_rupee"
|
||||
npc.item_count = 500
|
||||
npc.zdir = -1
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp)
|
||||
if maxp.y < -1 or maxp.y > 11000 then
|
||||
return
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -17,12 +17,12 @@ mobs:register_mob("mobs_loz:volvagia", {
|
|||
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},
|
||||
collisionbox = {-1, -2, -1, 1, 2, 1},
|
||||
visual_size = {x=3, y=3},
|
||||
visual = "mesh",
|
||||
mesh = "volvagia.b3d",
|
||||
textures = {
|
||||
{"volvagia.png"},
|
||||
{"mobs_volvagia.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -31,8 +31,8 @@ mobs:register_mob("mobs_loz:volvagia", {
|
|||
},
|
||||
view_range = 25,
|
||||
rotate = 180,
|
||||
walk_velocity = 0.01,
|
||||
run_velocity = 0.01,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 5,
|
||||
jump = false,
|
||||
drops = {
|
||||
{name = "hyruletools:firestone", chance = 1, min = 3, max = 5},
|
||||
|
@ -53,17 +53,19 @@ mobs:register_mob("mobs_loz:volvagia", {
|
|||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_start = 2,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_start = 2,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_start = 2,
|
||||
run_end = 20,
|
||||
punch_start = 40,
|
||||
punch_end = 60,
|
||||
punch_start = 20,
|
||||
punch_end = 42,
|
||||
shoot_start = 20,
|
||||
shoot_end = 40,
|
||||
shoot_end = 42,
|
||||
},
|
||||
fly = true,
|
||||
fly_in = "air",
|
||||
on_die = function(self, pos)
|
||||
mobs:explosion(pos, 2, 1, 1)
|
||||
minetest.add_particlespawner(
|
||||
|
|
|
@ -260,8 +260,15 @@ mobs:register_mob("mobs_npc:npc_custom", {
|
|||
on_rightclick = function(self, clicker)
|
||||
local pos = self.object:getpos()
|
||||
if self.reward_item ~= nil and clicker:get_wielded_item():get_name() == self.reward_item then
|
||||
if self.item_count == nil then
|
||||
self.item_ready = true
|
||||
self.rewarding = true
|
||||
clicker:get_wielded_item():take_item()
|
||||
elseif clicker:get_wielded_item():get_count() == self.item_count then
|
||||
self.item_ready = true
|
||||
self.rewarding = true
|
||||
clicker:get_wielded_item():take_item()
|
||||
end
|
||||
elseif self.reward_item == nil then
|
||||
self.item_ready = true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue