Nahrát soubory do 'mobs_monster'

This commit is contained in:
Milan2018 2020-02-27 15:12:45 +01:00
parent bf7f992739
commit b93e905ff9
5 changed files with 338 additions and 0 deletions

182
mobs_monster/lava_flan.lua Normal file
View file

@ -0,0 +1,182 @@
local S = mobs.intllib
-- Lava Flan by Zeg9 (additional textures by JurajVajda)
mobs:register_mob("mobs_monster:lava_flan", {
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 35,
armor = 80,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
visual = "mesh",
mesh = "zmobs_lava_flan.x",
textures = {
{"zmobs_lava_flan.png"},
{"zmobs_lava_flan2.png"},
{"zmobs_lava_flan3.png"},
},
blood_texture = "fire_basic_flame.png",
makes_footstep_sound = false,
sounds = {
random = "mobs_lavaflan",
war_cry = "mobs_lavaflan",
},
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
view_range = 10,
floats = 1,
drops = {
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1},
},
water_damage = 5,
lava_damage = 0,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 8,
walk_start = 10,
walk_end = 18,
run_start = 20,
run_end = 28,
punch_start = 20,
punch_end = 28,
},
on_die = function(self, pos)
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "fire:basic_flame"})
end
self.object:remove()
minetest.add_particlespawner({
amount = 20,
time = 0.25,
minpos = pos,
maxpos = pos,
minvel = {x = -2, y = -2, z = -2},
maxvel = {x = 2, y = 2, z = 2},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.1,
maxexptime = 1,
minsize = 1.0,
maxsize = 2.0,
texture = "fire_basic_flame.png",
})
end,
})
mobs:spawn({
name = "mobs_monster:lava_flan",
nodes = {"default:lava_source"},
chance = 1500,
active_object_count = 1,
max_height = 0,
})
mobs:register_egg("mobs_monster:lava_flan", S("Lava Flan"), "default_lava.png", 1)
mobs:alias_mob("mobs:lava_flan", "mobs_monster:lava_flan") -- compatibility
-- lava orb
minetest.register_craftitem(":mobs:lava_orb", {
description = S("Lava orb"),
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
minetest.register_craft({
type = "fuel",
recipe = "mobs:lava_orb",
burntime = 80,
})
-- Lava Pick (digs and smelts at same time)
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
-- are we holding Lava Pick?
if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then
return old_handle_node_drops(pos, drops, digger)
end
-- reset new smelted drops
local hot_drops = {}
-- loop through current node drops
for _, drop in pairs(drops) do
-- get cooked output of current drops
local stack = ItemStack(drop)
local output = minetest.get_craft_result({
method = "cooking",
width = 1,
items = {drop}
})
-- if we have cooked result then add to new list
if output
and output.item
and not output.item:is_empty() then
table.insert(hot_drops,
ItemStack({
name = output.item:get_name(),
count = output.item:to_table().count,
})
)
else -- if not then return normal drops
table.insert(hot_drops, stack)
end
end
return old_handle_node_drops(pos, hot_drops, digger)
end
minetest.register_tool(":mobs:pick_lava", {
description = S("Lava Pickaxe"),
inventory_image = "mobs_pick_lava.png",
tool_capabilities = {
full_punch_interval = 0.4,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=1.80, [2]=0.80, [3]=0.40}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_craft({
output = "mobs:pick_lava",
recipe = {
{"mobs:lava_orb", "mobs:lava_orb", "mobs:lava_orb"},
{"", "default:obsidian_shard", ""},
{"", "default:obsidian_shard", ""},
}
})
-- Add [toolranks] mod support if found
if minetest.get_modpath("toolranks") then
minetest.override_item("mobs:pick_lava", {
original_description = "Lava Pickaxe",
description = toolranks.create_description("Lava Pickaxe", 0, 1),
after_use = toolranks.new_afteruse})
end

21
mobs_monster/license.txt Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,19 @@
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"spw", "mobs:dungeon_master", 1, nil, nil, 3, "Billy"},
{"spw", "mobs:sand_monster", 3},
{"spw", "mobs:stone_monster", 3, nil, nil, 3, "Bob"},
{"spw", "mobs:dirt_monster", 3},
{"spw", "mobs:tree_monster", 3},
{"spw", "mobs:oerkki", 3},
{"exp"},
{"spw", "mobs:spider", 5},
{"spw", "mobs:mese_monster", 2},
{"spw", "mobs:lava_flan", 3},
{"nod", "default:chest", 0, {
{name = "mobs:lava_orb", max = 1}}},
})
end

View file

@ -0,0 +1,111 @@
local S = mobs.intllib
-- Mese Monster by Zeg9
mobs:register_mob("mobs_monster:mese_monster", {
type = "monster",
passive = false,
damage = 3,
attack_type = "shoot",
shoot_interval = 0.5,
arrow = "mobs_monster:mese_arrow",
shoot_offset = 2,
hp_min = 10,
hp_max = 25,
armor = 80,
collisionbox = {-0.5, -1.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "zmobs_mese_monster.x",
textures = {
{"zmobs_mese_monster.png"},
},
blood_texture = "default_mese_crystal_fragment.png",
makes_footstep_sound = false,
sounds = {
random = "mobs_mesemonster",
},
view_range = 10,
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
jump_height = 8,
fall_damage = 0,
fall_speed = -6,
stepheight = 2.1,
drops = {
{name = "default:mese_crystal", chance = 9, min = 1, max = 3},
{name = "default:mese_crystal_fragment", chance = 1, min = 1, max = 9},
},
water_damage = 1,
lava_damage = 1,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 14,
walk_start = 15,
walk_end = 38,
run_start = 40,
run_end = 63,
punch_start = 40,
punch_end = 63,
},
})
mobs:spawn({
name = "mobs_monster:mese_monster",
nodes = {"default:stone"},
max_light = 7,
chance = 5000,
active_object_count = 1,
max_height = -20,
})
mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1)
mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") -- compatiblity
-- mese arrow (weapon)
mobs:register_arrow("mobs_monster:mese_arrow", {
visual = "sprite",
-- visual = "wielditem",
visual_size = {x = 0.5, y = 0.5},
textures = {"default_mese_crystal_fragment.png"},
--textures = {"default:mese_crystal_fragment"},
velocity = 6,
-- rotate = 180,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 2},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 2},
}, nil)
end,
hit_node = function(self, pos, node)
end
})
-- 9x mese crystal fragments = 1x mese crystal
minetest.register_craft({
output = "default:mese_crystal",
recipe = {
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
}
})

5
mobs_monster/mod.conf Normal file
View file

@ -0,0 +1,5 @@
name = mobs_monster
release = 370
author = TenPlus1
description = Adds many types of monster.
title = Mobs Monster