Add transparent texture
parent
ecc6c16d42
commit
692fd3d659
Binary file not shown.
After Width: | Height: | Size: 128 B |
|
@ -28,8 +28,7 @@ mobs:register_mob("mobs:blacksmith",{
|
||||||
if self.state ~= "path" and self.state ~= "working" then
|
if self.state ~= "path" and self.state ~= "working" then
|
||||||
blacksmith_formspec(self,clicker)
|
blacksmith_formspec(self,clicker)
|
||||||
else
|
else
|
||||||
minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(self,"mobs:icon_notice",5)
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
walk_chance = 1,
|
walk_chance = 1,
|
||||||
|
@ -62,6 +61,7 @@ mobs:register_mob("mobs:blacksmith",{
|
||||||
lifetimer = false,
|
lifetimer = false,
|
||||||
avoid_nodes = {"fire:basic_flame","default:water_source","default:water_flowing","default:lava_source","default:lava_flowing"},
|
avoid_nodes = {"fire:basic_flame","default:water_source","default:water_flowing","default:lava_source","default:lava_flowing"},
|
||||||
avoid_range = 4,
|
avoid_range = 4,
|
||||||
|
icon = "mobs:icon_sell",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- list of active blacksmiths... I'm not sure how this is going to work when an entity is unloaded
|
-- list of active blacksmiths... I'm not sure how this is going to work when an entity is unloaded
|
||||||
|
@ -71,8 +71,7 @@ function blacksmith_formspec(self,player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if active_blacksmiths[name] == nil then
|
if active_blacksmiths[name] == nil then
|
||||||
mobs:face_pos(self,player:getpos())
|
mobs:face_pos(self,player:getpos())
|
||||||
minetest.sound_play("mobs_blacksmith_what",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_what",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(self,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = {entity=self,inventory=nil,player=player,furnace=nil,active=false}
|
active_blacksmiths[name] = {entity=self,inventory=nil,player=player,furnace=nil,active=false}
|
||||||
local formspec = "size[8,6.25]"..
|
local formspec = "size[8,6.25]"..
|
||||||
"list[current_player;main;0,2.5;8,4;]"..
|
"list[current_player;main;0,2.5;8,4;]"..
|
||||||
|
@ -82,8 +81,7 @@ function blacksmith_formspec(self,player)
|
||||||
"button_exit[5,1;2,1;cancel;Cancel]"
|
"button_exit[5,1;2,1;cancel;Cancel]"
|
||||||
minetest.show_formspec(name,"blacksmith",formspec)
|
minetest.show_formspec(name,"blacksmith",formspec)
|
||||||
else
|
else
|
||||||
minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(self,"mobs:icon_notice",5)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -114,7 +112,6 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
local stack = inv:get_stack("src",1)
|
local stack = inv:get_stack("src",1)
|
||||||
if stack:get_count() == 0 then
|
if stack:get_count() == 0 then
|
||||||
chat.local_chat(player:getpos(),"Blacksmith: Please give me something to smelt",3)
|
chat.local_chat(player:getpos(),"Blacksmith: Please give me something to smelt",3)
|
||||||
mobs.put_icon(blacksmith,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = nil
|
active_blacksmiths[name] = nil
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
@ -138,8 +135,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
local crNeeded = (stack:get_count() * 2)
|
local crNeeded = (stack:get_count() * 2)
|
||||||
if money.get(name) < crNeeded then
|
if money.get(name) < crNeeded then
|
||||||
chat.local_chat(player:getpos(),"Blacksmith: Sorry, you don't have enough money. I charge 2cr per lump.")
|
chat.local_chat(player:getpos(),"Blacksmith: Sorry, you don't have enough money. I charge 2cr per lump.")
|
||||||
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(blacksmith,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = nil
|
active_blacksmiths[name] = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -154,15 +150,13 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
chat.local_chat(player:getpos(),"Blacksmith: Sorry, I can't get to the furance.",3)
|
chat.local_chat(player:getpos(),"Blacksmith: Sorry, I can't get to the furance.",3)
|
||||||
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(blacksmith,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = nil
|
active_blacksmiths[name] = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
chat.local_chat(player:getpos(),"Blacksmith: Sorry, I don't see a furance in this area.",3)
|
chat.local_chat(player:getpos(),"Blacksmith: Sorry, I don't see a furance in this area.",3)
|
||||||
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6})
|
minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5})
|
||||||
mobs.put_icon(blacksmith,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = nil
|
active_blacksmiths[name] = nil
|
||||||
-- TODO Get invnetory and throw item toward player
|
-- TODO Get invnetory and throw item toward player
|
||||||
end
|
end
|
||||||
|
@ -207,7 +201,6 @@ function blacksmith_globalstep(dtime)
|
||||||
bs.entity.state = "standing"
|
bs.entity.state = "standing"
|
||||||
bs.entity.set_animation(bs.entity,"stand")
|
bs.entity.set_animation(bs.entity,"stand")
|
||||||
chat.local_chat(bs.entity.object:getpos(),"Blacksmith: "..name.." your ingots are ready!",25)
|
chat.local_chat(bs.entity.object:getpos(),"Blacksmith: "..name.." your ingots are ready!",25)
|
||||||
mobs.put_icon(bs.entity,"mobs:icon_notice",5)
|
|
||||||
active_blacksmiths[name] = nil -- I think it's all byref so bs = nil should also work
|
active_blacksmiths[name] = nil -- I think it's all byref so bs = nil should also work
|
||||||
meta:set_int("in_use",0)
|
meta:set_int("in_use",0)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue