Fix some global variable issues
This commit is contained in:
parent
04dd0d6e02
commit
46b0f638fe
@ -103,7 +103,7 @@ end
|
||||
|
||||
minetest.register_entity("mobs_mc:arrow_entity", THROWING_ARROW_ENTITY)
|
||||
|
||||
arrows = {
|
||||
local arrows = {
|
||||
{"mobs_mc:arrow", "mobs_mc:arrow_entity" },
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ if c("egg") then
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"mobs_chicken_egg.png"},
|
||||
velocity = egg_velocity,
|
||||
velocity = egg_VELOCITY,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||
|
@ -56,8 +56,8 @@ mobs:register_mob("mobs_mc:creeper", {
|
||||
local wdef = item:get_definition()
|
||||
item:add_wear(1000)
|
||||
-- Tool break sound
|
||||
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
|
||||
minetest.sound_play(wdef.sound.breaks, {pos = pt.above, gain = 0.5})
|
||||
if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then
|
||||
minetest.sound_play(wdef.sound.breaks, {pos = clicker:getpos(), gain = 0.5})
|
||||
end
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
|
@ -133,9 +133,9 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
|
||||
|
||||
minetest.set_node(pos, {name="air"})
|
||||
if math.random(1,2)==1 then
|
||||
dx = math.random(-1,1)
|
||||
dy = math.random(-1,1)
|
||||
dz = math.random(-1,1)
|
||||
local dx = math.random(-1,1)
|
||||
local dy = math.random(-1,1)
|
||||
local dz = math.random(-1,1)
|
||||
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
minetest.set_node(p, {name="air"})
|
||||
end
|
||||
@ -152,7 +152,7 @@ mobs:register_arrow(":mobs_mc:fireball2", {
|
||||
|
||||
-- direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
minetest.sound_play("tnt_explode", {pos = player:getpos(), gain = 1.5, max_hear_distance = 2*64})
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 6},
|
||||
@ -160,9 +160,9 @@ mobs:register_arrow(":mobs_mc:fireball2", {
|
||||
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
player:punch(self.object, 1.0, {
|
||||
hit_mob = function(self, mob)
|
||||
minetest.sound_play("tnt_explode", {pos = mob:getpos(), gain = 1.5, max_hear_distance = 2*64})
|
||||
mob:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 12},
|
||||
}, nil)
|
||||
|
@ -78,7 +78,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||
-- TODO: Update enderman model (enderman holding block)
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
if def.sounds and def.sounds.dug then
|
||||
minetest.sound_play(def.sounds.dug, {pos = place_pos, max_hear_distance = 16})
|
||||
minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -112,9 +112,9 @@ local spawn = {
|
||||
|
||||
local spawn_desert = table.copy(spawn)
|
||||
spawn_desert.nodes = mobs_mc.spawn.desert
|
||||
on_spawn = function(self, pos)
|
||||
local on_spawn = function(self, pos)
|
||||
local ent = self:get_luaentity()
|
||||
texture = "mobs_mc_rabbit_gold.png"
|
||||
local texture = "mobs_mc_rabbit_gold.png"
|
||||
ent.base_texture = { "mobs_mc_rabbit_gold.png" }
|
||||
self:set_properties({textures = ent.base_texture})
|
||||
end
|
||||
|
14
wither.lua
14
wither.lua
@ -108,9 +108,9 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
|
||||
|
||||
minetest.set_node(pos, {name="air"})
|
||||
if math.random(1,2)==1 then
|
||||
dx = math.random(-1,1)
|
||||
dy = math.random(-1,1)
|
||||
dz = math.random(-1,1)
|
||||
local dx = math.random(-1,1)
|
||||
local dy = math.random(-1,1)
|
||||
local dz = math.random(-1,1)
|
||||
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
minetest.set_node(p, {name="air"})
|
||||
end
|
||||
@ -127,7 +127,7 @@ mobs:register_arrow(":mobs_mc:fireball", {
|
||||
|
||||
-- direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 16})
|
||||
minetest.sound_play("tnt_explode", {pos = player:getpos(), gain = 1.5, max_hear_distance = 16})
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 8},
|
||||
@ -135,9 +135,9 @@ mobs:register_arrow(":mobs_mc:fireball", {
|
||||
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5,max_hear_distance = 16})
|
||||
player:punch(self.object, 1.0, {
|
||||
hit_mob = function(self, mob)
|
||||
minetest.sound_play("tnt_explode", {pos = mob:getpos(), gain = 1.5,max_hear_distance = 16})
|
||||
mob:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user