Update mobs_mc

This commit is contained in:
Wuzzy 2017-07-12 22:09:37 +02:00
parent a24f34f1b5
commit 519ee63a57
16 changed files with 33 additions and 31 deletions

View File

@ -114,7 +114,6 @@ local throwing_shoot_arrow = function(itemstack, player)
player:get_inventory():remove_item("main", arrow[1]) player:get_inventory():remove_item("main", arrow[1])
end end
local playerpos = player:getpos() local playerpos = player:getpos()
--local obj = minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --current
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc
local dir = player:get_look_dir() local dir = player:get_look_dir()
obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22}) obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})

View File

@ -23,7 +23,7 @@ Origin of those models:
## Textures ## Textures
* Most mob and item textures from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/), a texture pack for Minecraft. * Mob and item textures from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/), a texture pack for Minecraft.
* Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/) * Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/)
* License: CC BY-SA 4.0 * License: CC BY-SA 4.0
* “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i * “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i

View File

@ -99,7 +99,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
local cow = minetest.add_entity(pos, "mobs_mc:cow") local cow = minetest.add_entity(pos, "mobs_mc:cow")
cow:setyaw(oldyaw) cow:setyaw(oldyaw)
if not minetest.setting_getbool("creative_mode") then if not minetest.settings:get_bool("creative_mode") then
item:add_wear(mobs_mc.misc.shears_wear) item:add_wear(mobs_mc.misc.shears_wear)
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item) clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
end end
@ -145,6 +145,6 @@ mobs:alias_mob("mobs_animal:cow", "mobs_mc:cow")
mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0) mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0)
mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0) mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0)
if minetest.setting_get("log_mods") then if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Cow loaded") minetest.log("action", "MC Cow loaded")
end end

View File

@ -40,7 +40,7 @@ mobs:register_mob("mobs_mc:creeper", {
attack_type = "explode", attack_type = "explode",
explosion_radius = 3, explosion_radius = 3,
-- TODO: Disable Mobs Redo fire explosion_fire = false,
-- Force-ignite creeper with flint and steel and explode after 1.5 seconds. -- Force-ignite creeper with flint and steel and explode after 1.5 seconds.
-- TODO: Make creeper flash after doing this as well. -- TODO: Make creeper flash after doing this as well.

View File

@ -108,7 +108,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
local pos = self.object:getpos() local pos = self.object:getpos()
local n = minetest.env:get_node(pos).name local n = minetest.get_node(pos).name
if self.timer == 0 then if self.timer == 0 then
self.timer = os.time() self.timer = os.time()
@ -118,7 +118,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
self.object:remove() self.object:remove()
end end
local objects = minetest.env:get_objects_inside_radius(pos, 1) local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
local name = obj:get_entity_name() local name = obj:get_entity_name()
if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then
@ -131,13 +131,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
end end
end end
minetest.env:set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
if math.random(1,2)==1 then if math.random(1,2)==1 then
dx = math.random(-1,1) dx = math.random(-1,1)
dy = math.random(-1,1) dy = math.random(-1,1)
dz = math.random(-1,1) dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
minetest.env:set_node(p, {name="air"}) minetest.set_node(p, {name="air"})
end end
end end
}) })
@ -146,7 +146,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
mobs:register_arrow(":mobs_mc:fireball2", { mobs:register_arrow(":mobs_mc:fireball2", {
visual = "sprite", visual = "sprite",
visual_size = {x = 1.5, y = 1.5}, visual_size = {x = 1.5, y = 1.5},
textures = {"fire_basic_flame.png"}, textures = {"mobs_mc_dragon_fireball.png"},
--textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "}, --textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "},
velocity = 6, velocity = 6,
@ -171,7 +171,7 @@ mobs:register_arrow(":mobs_mc:fireball2", {
-- node hit, bursts into flame -- node hit, bursts into flame
hit_node = function(self, pos, node) hit_node = function(self, pos, node)
mobs:explosion(pos, 3, 1, 1) mobs:explosion(pos, 3, 0, 1)
--from tnt --from tnt
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64}) minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
@ -179,4 +179,3 @@ mobs:register_arrow(":mobs_mc:fireball2", {
}) })
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0) mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0)

View File

@ -21,7 +21,7 @@ local place_frequency = 10
mobs:register_mob("mobs_mc:enderman", { mobs:register_mob("mobs_mc:enderman", {
type = "monster", type = "monster",
runaway = true, runaway = true,
pathfinding = 2, pathfinding = 1,
stepheight = 1.2, stepheight = 1.2,
hp_min = 40, hp_min = 40,
hp_max = 40, hp_max = 40,

View File

@ -113,5 +113,6 @@ COLISIONBOX in minetest press f5 to see where you are looking at then put these
-- --
-- --
if minetest.settings:get_bool("log_mods") then
print ("[MOD] Mobs Redo 'MC' loaded") minetest.log("action", "[MOD] Mobs Redo 'MC' loaded")
end

View File

@ -138,6 +138,9 @@ mobs:register_mob("mobs_mc:llama", {
}) })
--spawn
--mobs:register_spawn("mobs_mc:llama", mobs_mc.spawn.savanna, minetest.LIGHT_MAX+1, 0, 15000, 1, 40)
-- spawn eggs -- spawn eggs
mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0) mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0)

View File

@ -88,6 +88,8 @@ mobs:register_mob("mobs_mc:parrot", {
--spawn --spawn
-- TODO: Increase spawn chance if polished
--mobs:spawn_specific("mobs_mc:parrot", mobs_mc.spawn.jungle, {"air"}, 0, minetest.LIGHT_MAX+1, 20, 20000, 2, 15, 20)
-- spawn eggs -- spawn eggs
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0) mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)

View File

@ -177,9 +177,6 @@ mobs:alias_mob("mobs:pig", "mobs_mc:pig")
mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0) mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0)
if minetest.settings:get("log_mods") then if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Pig loaded") minetest.log("action", "MC Pig loaded")
end end

View File

@ -169,6 +169,6 @@ mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon
-- compatibility -- compatibility
mobs:alias_mob("mobs:bunny", "mobs_mc:rabbit") mobs:alias_mob("mobs:bunny", "mobs_mc:rabbit")
if minetest.setting_get("log_mods") then if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Bunny loaded") minetest.log("action", "MC Bunny loaded")
end end

View File

@ -85,10 +85,10 @@ mobs:register_mob("mobs_mc:sheep", {
replace_what = mobs_mc.replace.sheep, replace_what = mobs_mc.replace.sheep,
-- Properly regrow wool after eating grass -- Properly regrow wool after eating grass
on_replace = function(self, pos, oldnode, newnode) on_replace = function(self, pos, oldnode, newnode)
self.gotten = false
if not self.color or not colors[self.color] then if not self.color or not colors[self.color] then
self.color = "unicolor_white" self.color = "unicolor_white"
end end
self.gotten = false
self.drops = { self.drops = {
{name = mobs_mc.items.mutton_raw, {name = mobs_mc.items.mutton_raw,
chance = 1, chance = 1,

View File

@ -49,7 +49,7 @@ mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_sil
-- Monster egg blocks (Minetest Game) -- Monster egg blocks (Minetest Game)
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
local spawn_silverfish = function(pos, oldnode, oldmetadata, digger) local spawn_silverfish = function(pos, oldnode, oldmetadata, digger)
if not minetest.setting_getbool("creative_mode") then if not minetest.settings:get_bool("creative_mode") then
minetest.add_entity(pos, "mobs_mc:silverfish") minetest.add_entity(pos, "mobs_mc:silverfish")
end end
end end

View File

@ -60,7 +60,7 @@ mobs:register_mob("mobs_mc:squid", {
-- Spawn near the water surface -- Spawn near the water surface
local water = tonumber(minetest.setting_get("water_level")) or 0 local water = tonumber(minetest.settings:get("water_level")) or 0
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height --name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("mobs_mc:squid", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 5500, 3, water-16, water) mobs:spawn_specific("mobs_mc:squid", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 5500, 3, water-16, water)

View File

@ -31,7 +31,7 @@ mobs:register_mob("mobs_mc:witch", {
damage = 2, damage = 2,
walk_velocity = 1.2, walk_velocity = 1.2,
run_velocity = 2.4, run_velocity = 2.4,
pathfinding = 2, pathfinding = 1,
group_attack = true, group_attack = true,
attack_type = "dogshoot", attack_type = "dogshoot",
arrow = "mobs:potion_arrow", arrow = "mobs:potion_arrow",

View File

@ -58,7 +58,7 @@ mobs:register_mob("mobs_mc:wither", {
light_damage = 0, light_damage = 0,
attack_type = "dogshoot", attack_type = "dogshoot",
explosion_radius = 3, explosion_radius = 3,
explosion_fire = 0, explosion_fire = false,
dogshoot_stop = true, dogshoot_stop = true,
arrow = "mobs_mc:fireball", arrow = "mobs_mc:fireball",
reach = 5, reach = 5,
@ -83,7 +83,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
local pos = self.object:getpos() local pos = self.object:getpos()
local n = minetest.env:get_node(pos).name local n = minetest.get_node(pos).name
if self.timer == 0 then if self.timer == 0 then
self.timer = os.time() self.timer = os.time()
@ -93,7 +93,7 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
self.object:remove() self.object:remove()
end end
local objects = minetest.env:get_objects_inside_radius(pos, 1) local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
local name = obj:get_entity_name() local name = obj:get_entity_name()
if name~="mobs_mc:roar_of_the_dragon" and name ~= "mobs_mc:wither" then if name~="mobs_mc:roar_of_the_dragon" and name ~= "mobs_mc:wither" then
@ -106,13 +106,13 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
end end
end end
minetest.env:set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
if math.random(1,2)==1 then if math.random(1,2)==1 then
dx = math.random(-1,1) dx = math.random(-1,1)
dy = math.random(-1,1) dy = math.random(-1,1)
dz = math.random(-1,1) dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
minetest.env:set_node(p, {name="air"}) minetest.set_node(p, {name="air"})
end end
end end
}) })
@ -120,8 +120,9 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", {
-- fireball (weapon) -- fireball (weapon)
mobs:register_arrow(":mobs_mc:fireball", { mobs:register_arrow(":mobs_mc:fireball", {
visual = "sprite", visual = "sprite",
visual_size = {x = 1.5, y = 1.5}, visual_size = {x = 0.75, y = 0.75},
textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "}, -- TODO: 3D projectile, replace tetxture
textures = {"mobs_mc_TEMP_wither_projectile.png"},
velocity = 6, velocity = 6,
-- direct hit, no fire... just plenty of pain -- direct hit, no fire... just plenty of pain