forked from VoxeLibre/VoxeLibre
Merge branch 'master' of https://git.minetest.land/MineClone2/MineClone2
This commit is contained in:
commit
46541a4adc
|
@ -960,7 +960,7 @@ mobs:register_mob("mobs_mc:villager", {
|
||||||
"mobs_mc_villager_smith.png", --hat
|
"mobs_mc_villager_smith.png", --hat
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
walk_velocity = 1.2,
|
walk_velocity = 1.2,
|
||||||
run_velocity = 2.4,
|
run_velocity = 2.4,
|
||||||
|
|
|
@ -28,7 +28,7 @@ mobs:register_mob("mobs_mc:evoker", {
|
||||||
"blank.png", --no hat
|
"blank.png", --no hat
|
||||||
-- TODO: Attack glow
|
-- TODO: Attack glow
|
||||||
} },
|
} },
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 6,
|
damage = 6,
|
||||||
walk_velocity = 0.2,
|
walk_velocity = 0.2,
|
||||||
|
|
|
@ -36,7 +36,7 @@ mobs:register_mob("mobs_mc:illusioner", {
|
||||||
-- TODO: more sounds
|
-- TODO: more sounds
|
||||||
distance = 16,
|
distance = 16,
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
walk_velocity = 0.6,
|
walk_velocity = 0.6,
|
||||||
run_velocity = 2,
|
run_velocity = 2,
|
||||||
jump = true,
|
jump = true,
|
||||||
|
|
|
@ -30,7 +30,7 @@ mobs:register_mob("mobs_mc:vindicator", {
|
||||||
-- TODO: Glow when attacking (mobs_mc_vindicator.png)
|
-- TODO: Glow when attacking (mobs_mc_vindicator.png)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 13,
|
damage = 13,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
|
|
|
@ -45,7 +45,7 @@ mobs:register_mob("mobs_mc:villager_zombie", {
|
||||||
{"mobs_mc_zombie_smith.png"},
|
{"mobs_mc_zombie_smith.png"},
|
||||||
{"mobs_mc_zombie_villager.png"}
|
{"mobs_mc_zombie_villager.png"}
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 3,
|
damage = 3,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
|
|
|
@ -25,7 +25,7 @@ mobs:register_mob("mobs_mc:witch", {
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_witch.png"},
|
{"mobs_mc_witch.png"},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=2.75, y=2.75},
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
damage = 2,
|
damage = 2,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
|
|
|
@ -149,8 +149,8 @@ armor.set_player_armor = function(self, player)
|
||||||
if level then
|
if level then
|
||||||
local texture = def.texture or item:gsub("%:", "_")
|
local texture = def.texture or item:gsub("%:", "_")
|
||||||
local enchanted_addition = (mcl_enchanting.is_enchanted(item) and mcl_enchanting.overlay or "")
|
local enchanted_addition = (mcl_enchanting.is_enchanted(item) and mcl_enchanting.overlay or "")
|
||||||
table.insert(textures, texture..".png"..enchanted_addition)
|
table.insert(textures, "("..texture..".png"..enchanted_addition..")")
|
||||||
preview = "player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..""..(preview and "^"..preview or "")
|
preview = "(player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..")"..(preview and "^"..preview or "")
|
||||||
armor_level = armor_level + level
|
armor_level = armor_level + level
|
||||||
items = items + 1
|
items = items + 1
|
||||||
mcl_armor_points = mcl_armor_points + (def.groups["mcl_armor_points"] or 0)
|
mcl_armor_points = mcl_armor_points + (def.groups["mcl_armor_points"] or 0)
|
||||||
|
|
|
@ -19,7 +19,7 @@ function mcl_cocoas.place(itemstack, placer, pt, plantname)
|
||||||
-- Am I right-clicking on something that has a custom on_rightclick set?
|
-- Am I right-clicking on something that has a custom on_rightclick set?
|
||||||
if placer and not placer:get_player_control().sneak then
|
if placer and not placer:get_player_control().sneak then
|
||||||
if minetest.registered_nodes[under.name] and minetest.registered_nodes[under.name].on_rightclick then
|
if minetest.registered_nodes[under.name] and minetest.registered_nodes[under.name].on_rightclick then
|
||||||
return minetest.registered_nodes[under.name].on_rightclick(pointed_thing.under, under, placer, itemstack) or itemstack
|
return minetest.registered_nodes[under.name].on_rightclick(pt.under, under, placer, itemstack) or itemstack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -85,14 +85,15 @@ minetest.register_craftitem("mcl_end:crystal", {
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
local pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||||
local node = minetest.get_node(pos).name
|
local node = minetest.get_node(pos)
|
||||||
|
local node_name = node.name
|
||||||
if placer and not placer:get_player_control().sneak then
|
if placer and not placer:get_player_control().sneak then
|
||||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].on_rightclick then
|
||||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
return minetest.registered_nodes[node_name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if find_crystal(pos) then return itemstack end
|
if find_crystal(pos) then return itemstack end
|
||||||
if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then
|
if node_name == "mcl_core:obsidian" or node_name == "mcl_core:bedrock" then
|
||||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 303 B |
|
@ -96,6 +96,8 @@ minetest.register_globalstep(function(dtime)
|
||||||
|
|
||||||
local player_velocity = player:get_velocity() or player:get_player_velocity()
|
local player_velocity = player:get_velocity() or player:get_player_velocity()
|
||||||
|
|
||||||
|
local wielded = player:get_wielded_item()
|
||||||
|
|
||||||
-- controls head bone
|
-- controls head bone
|
||||||
local pitch = - degrees(player:get_look_vertical())
|
local pitch = - degrees(player:get_look_vertical())
|
||||||
local yaw = degrees(player:get_look_horizontal())
|
local yaw = degrees(player:get_look_horizontal())
|
||||||
|
@ -107,13 +109,19 @@ minetest.register_globalstep(function(dtime)
|
||||||
player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw)
|
player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw)
|
||||||
player_vel_yaws[name] = player_vel_yaw
|
player_vel_yaws[name] = player_vel_yaw
|
||||||
|
|
||||||
-- controls right and left arms pitch when shooting a bow or punching
|
-- controls right and left arms pitch when shooting a bow
|
||||||
if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then
|
if string.find(wielded:get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then
|
||||||
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35))
|
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35))
|
||||||
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35))
|
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35))
|
||||||
|
-- when punching
|
||||||
elseif controls.LMB and player:get_attach() == nil then
|
elseif controls.LMB and player:get_attach() == nil then
|
||||||
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0))
|
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0))
|
||||||
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
|
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
|
||||||
|
-- when holding an item.
|
||||||
|
elseif wielded:get_name() ~= "" then
|
||||||
|
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(20,0,0))
|
||||||
|
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
|
||||||
|
-- resets arms pitch
|
||||||
else
|
else
|
||||||
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
|
player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0))
|
||||||
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(0,0,0))
|
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(0,0,0))
|
||||||
|
|
|
@ -72,7 +72,7 @@ minetest.register_on_joinplayer(function(player)
|
||||||
minetest.after(0, function(player)
|
minetest.after(0, function(player)
|
||||||
wieldview:update_wielded_item(player)
|
wieldview:update_wielded_item(player)
|
||||||
local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode")
|
local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode")
|
||||||
itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(-90, 0, 45))
|
itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45))
|
||||||
itementity:get_luaentity().wielder = name
|
itementity:get_luaentity().wielder = name
|
||||||
end, player)
|
end, player)
|
||||||
end)
|
end)
|
||||||
|
@ -106,14 +106,18 @@ minetest.register_entity("wieldview:wieldnode", {
|
||||||
if player then
|
if player then
|
||||||
local wielded = player:get_wielded_item()
|
local wielded = player:get_wielded_item()
|
||||||
local itemstring = wielded:get_name()
|
local itemstring = wielded:get_name()
|
||||||
|
|
||||||
if self.itemstring ~= itemstring then
|
if self.itemstring ~= itemstring then
|
||||||
local def = minetest.registered_items[itemstring]
|
local def = minetest.registered_items[itemstring]
|
||||||
self.object:set_properties({glow = def and def.light_source or 0})
|
self.object:set_properties({glow = def and def.light_source or 0})
|
||||||
|
|
||||||
|
-- wield item as cubic
|
||||||
if armor.textures[self.wielder].wielditem == "blank.png" then
|
if armor.textures[self.wielder].wielditem == "blank.png" then
|
||||||
self.object:set_properties({textures = {itemstring}})
|
self.object:set_properties({textures = {itemstring}})
|
||||||
else
|
else -- wield item as flat
|
||||||
self.object:set_properties({textures = {""}})
|
self.object:set_properties({textures = {""}})
|
||||||
end
|
end
|
||||||
|
|
||||||
self.itemstring = itemstring
|
self.itemstring = itemstring
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue