Merge branch 'master' into nalc-1.2

This commit is contained in:
Sys Quatre 2019-05-10 00:58:32 +02:00
commit 133766d0ab
6 changed files with 114 additions and 6 deletions

View File

@ -35,9 +35,12 @@ mobs:register_mob("mobs_monster:lava_flan", {
drops = {
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1},
},
water_damage = 5,
water_damage = 8,
lava_damage = 0,
light_damage = 0,
immune_to = {
{"mobs:pick_lava", -2}, -- lava pick heals 2 health
},
animation = {
speed_normal = 15,
speed_run = 15,

View File

@ -19,3 +19,14 @@ 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.
mobs.fireball.png was originally made by Sapier and edited by Benrob:
-- Animals Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
-- (c) Sapier
-- Contact sapier a t gmx net

View File

@ -79,6 +79,14 @@ mobs:register_mob("mobs_monster:sand_monster", {
punch_start = 74,
punch_end = 105,
},
immune_to = {
{"default:shovel_wood", 3}, -- shovels deal more damage to sand monster
{"default:shovel_stone", 3},
{"default:shovel_bronze", 4},
{"default:shovel_steel", 4},
{"default:shovel_mese", 5},
{"default:shovel_diamond", 7},
},
--[[
custom_attack = function(self, p)
local pos = self.object:get_pos()
@ -91,6 +99,21 @@ mobs:register_mob("mobs_monster:sand_monster", {
pos.y = pos.y + 0.25
effect(pos, 30, "mobs_sand_particles.png", 0.1, 2, 3, 5)
end,
--[[
on_rightclick = function(self, clicker)
local tool = clicker:get_wielded_item()
local name = clicker:get_player_name()
if tool:get_name() == "default:sand" then
self.owner = name
self.type = "npc"
mobs:force_capture(self, clicker)
end
end,
]]
})

View File

@ -1,6 +1,12 @@
local S = mobs.intllib
local get_velocity = function(self)
local v = self.object:get_velocity()
return (v.x * v.x + v.z * v.z) ^ 0.5
end
-- Spider by AspireMint (CC-BY-SA 3.0 license)
@ -95,6 +101,57 @@ mobs:register_mob("mobs_monster:spider", {
return true -- run only once, false/nil runs every activation
end,
-- custom function to make spiders climb vertical facings
do_custom = function(self, dtime)
-- quarter second timer
self.spider_timer = (self.spider_timer or 0) + dtime
if self.spider_timer < 0.25 then
return
end
self.spider_timer = 0
-- need to be stopped to go onwards
if get_velocity(self) > 0.2 then
self.disable_falling = false
return
end
local pos = self.object:get_pos()
local yaw = self.object:get_yaw()
pos.y = pos.y + self.collisionbox[2] - 0.2
local dir_x = -math.sin(yaw) * (self.collisionbox[4] + 0.5)
local dir_z = math.cos(yaw) * (self.collisionbox[4] + 0.5)
local nod = minetest.get_node_or_nil({
x = pos.x + dir_x,
y = pos.y + 0.5,
z = pos.z + dir_z
})
-- get current velocity
local v = self.object:get_velocity()
-- can only climb solid facings
if not nod or not minetest.registered_nodes[nod.name]
or not minetest.registered_nodes[nod.name].walkable then
self.disable_falling = nil
v.y = 0
self.object:set_velocity(v)
return
end
--print ("----", nod.name, self.disable_falling, dtime)
-- turn off falling if attached to facing
self.disable_falling = true
-- move up facing
v.y = self.jump_height
mobs:set_animation(self, "jump")
self.object:set_velocity(v)
end
})

View File

@ -53,6 +53,14 @@ mobs:register_mob("mobs_monster:stone_monster", {
punch_start = 40,
punch_end = 63,
},
immune_to = {
{"default:pick_wood", 0}, -- wooden pick doesnt hurt stone monster
{"default:pick_stone", 4}, -- picks deal more damage to stone monster
{"default:pick_bronze", 5},
{"default:pick_steel", 5},
{"default:pick_mese", 6},
{"default:pick_diamond", 7},
},
})

View File

@ -43,11 +43,17 @@ mobs:register_mob("mobs_monster:tree_monster", {
lava_damage = 0,
light_damage = 2,
fall_damage = 0,
-- immune_to = {
-- {"default:axe_diamond", 5},
-- {"default:sapling", -5}, -- saplings heal
-- {"all", 0},
-- },
immune_to = {
{"default:axe_wood", 0}, -- wooden axe doesnt hurt wooden monster
{"default:axe_stone", 4}, -- axes deal more damage to tree monster
{"default:axe_bronze", 5},
{"default:axe_steel", 5},
{"default:axe_mese", 7},
{"default:axe_diamond", 9},
{"default:sapling", -5}, -- default and jungle saplings heal
{"default:junglesapling", -5},
-- {"all", 0}, -- only weapons on list deal damage
},
animation = {
speed_normal = 15,
speed_run = 15,