Compare commits

33 Commits

Author SHA1 Message Date
6b69a3e23d Merge remote-tracking branch 'upstream/master' 2020-08-25 20:06:32 +02:00
a42877ef78 added 5.x translations 2020-08-25 10:53:02 +01:00
deea6597da update translation detection 2020-08-25 09:56:43 +01:00
7be2f3bd63 Merge remote-tracking branch 'upstream/master' 2020-08-19 21:24:25 +02:00
fd1807e746 updated locale (thanks IFRFSX) 2020-08-19 13:03:32 +01:00
ca10e7e1f6 Merge remote-tracking branch 'upstream/master' 2020-07-17 22:40:01 +02:00
3c3d65796a since lava flan live in lava, set self.fly_in so they dont slow down when moving around 2020-06-28 14:52:17 +01:00
a39eec8822 use mobs:add_mob() to add obsidian flan, also lava damages ob flan 2020-06-22 21:24:57 +01:00
a6b6795eb4 tweak obsidian flan node breakage 2020-06-21 20:52:52 +01:00
592c4aca50 Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-20 15:39:41 +02:00
475e0f5624 use global particle effect function for sand/lava monster 2020-06-20 10:08:15 +01:00
4477466120 tidy on_die function, add sounds 2020-06-19 20:44:52 +01:00
abae5bada4 add obsidian flan 2020-06-19 20:26:21 +01:00
4f135de146 spider has new jump attack 2020-06-19 16:07:55 +01:00
b6591fa9a7 tweak spider climbing feature 2020-05-23 14:56:00 +01:00
55d3d4b547 Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-05-09 14:24:36 +02:00
674afa91e5 nil check for player when using lava pick 2020-05-08 20:40:08 +01:00
2fdfd7f84c deinterlaced lava flan image 2020-04-23 20:05:55 +01:00
ded074939a fix lava flan textures to remove annoying interlace handling errors 2020-04-23 08:51:38 +01:00
ffc136296e add sanity check to spiders 2020-04-11 17:56:51 +01:00
33a314934a spiders now spawn on ethereal's cold dirt 2020-04-07 09:22:37 +01:00
5674b6328e Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-02-29 18:08:15 +01:00
2663922651 chinese local added (thanks IFRFSX) 2020-02-14 11:24:22 +00:00
cd5909697b lava flan glow in dark 2020-01-09 09:42:49 +00:00
3ddd27e515 Merge branch 'master' of yunohost.local:mtcontrib/mobs_monster into nalc-1.2-dev 2019-12-22 13:58:23 +01:00
e6d4b185b3 code tidy ' to " 2019-08-05 09:52:25 +01:00
822450e2c7 add pickaxe group to lava pick 2019-06-03 10:02:26 +01:00
133766d0ab Merge branch 'master' into nalc-1.2 2019-05-10 00:58:32 +02:00
947adeeb79 update license.txt 2019-04-18 14:31:46 +01:00
6cf5b95fc9 lava pick heals lava flan when hit, increased water damage 2019-02-23 10:36:37 +00:00
86e5f4ed09 tweaked tool damage for sand, stone and tree monsters 2019-02-11 09:27:22 +00:00
eeb6a8e138 added mobs:force_capture() example to sand monster 2018-12-20 11:14:52 +00:00
d6420071ab add do_custom function so that spiders can climb walls 2018-11-29 12:15:56 +00:00
24 changed files with 662 additions and 63 deletions

View File

@ -1,5 +1,5 @@
default
mobs
intllib?
lucky_block?
toolranks?
intllib?

View File

@ -1,23 +1,11 @@
local path = minetest.get_modpath("mobs_monster")
-- Intllib
local S
if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter()
end
else
S = function(s) return s end
end
-- Load support for intllib.
local path = minetest.get_modpath(minetest.get_current_modname())
local S = minetest.get_translator and minetest.get_translator("mobs_monster") or
dofile(path .. "/intllib.lua")
mobs.intllib = S
-- Monsters
dofile(path .. "/dirt_monster.lua") -- PilzAdam
dofile(path .. "/dungeon_master.lua")
dofile(path .. "/oerkki.lua")
@ -29,6 +17,7 @@ dofile(path .. "/mese_monster.lua")
dofile(path .. "/spider.lua") -- AspireMint
dofile(path .. "/minotaur.lua") -- NALC(sys4 fork MFF) Kalabasa
-- Lucky Blocks
dofile(path .. "/lucky_block.lua")
print ("[MOD] Mobs Redo 'Monsters' loaded")
print (S("[MOD] Mobs Redo Monsters loaded"))

3
intllib.lua Normal file
View File

@ -0,0 +1,3 @@
-- Support for the old multi-load method
dofile(minetest.get_modpath("intllib").."/init.lua")

View File

@ -35,9 +35,13 @@ 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
},
fly_in = {"default:lava_source", "default:lava_flowing"},
animation = {
speed_normal = 15,
speed_run = 15,
@ -52,28 +56,36 @@ mobs:register_mob("mobs_monster:lava_flan", {
},
on_die = function(self, pos)
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "fire:basic_flame"})
local cod = self.cause_of_death or {}
local def = cod.node and minetest.registered_nodes[cod.node]
if def and def.groups and def.groups.water then
pos.y = pos.y + 1
mobs:effect(pos, 40, "tnt_smoke.png", 3, 5, 2, 0.5, nil, false)
minetest.sound_play("fire_extinguish_flame",
{pos = pos, max_hear_distance = 12, gain = 1.5}, true)
self.object:remove()
if math.random(4) == 1 then
mobs:add_mob(pos, {
name = "mobs_monster:obsidian_flan",
})
end
else
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "fire:basic_flame"})
end
mobs:effect(pos, 40, "fire_basic_flame.png", 2, 3, 2, 5, 10, nil)
self.object:remove()
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,
glow = 10,
})
@ -112,6 +124,9 @@ local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
-- does player exist?
if not digger then return end
-- are we holding Lava Pick?
if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then
return old_handle_node_drops(pos, drops, digger)
@ -159,8 +174,9 @@ minetest.register_tool(":mobs:pick_lava", {
groupcaps={
cracky = {times={[1]=1.80, [2]=0.80, [3]=0.40}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=6,fire=1},
damage_groups = {fleshy = 6, fire = 1},
},
groups = {pickaxe = 1}
})
minetest.register_craft({
@ -180,3 +196,136 @@ minetest.override_item("mobs:pick_lava", {
description = toolranks.create_description("Lava Pickaxe", 0, 1),
after_use = toolranks.new_afteruse})
end
-- obsidian flan
mobs:register_mob("mobs_monster:obsidian_flan", {
type = "monster",
passive = false,
attack_type = "shoot",
shoot_interval = 0.5,
shoot_offset = 1.0,
arrow = "mobs_monster:obsidian_arrow",
reach = 2,
damage = 3,
hp_min = 10,
hp_max = 35,
armor = 30,
visual_size = {x = 0.6, y = 0.6},
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.8, 0.3},
visual = "mesh",
mesh = "zmobs_lava_flan.x",
textures = {
{"mobs_obsidian_flan.png"},
},
blood_texture = "default_obsidian.png",
makes_footstep_sound = true,
sounds = {
random = "mobs_lavaflan",
-- war_cry = "mobs_lavaflan",
},
walk_velocity = 0.1,
run_velocity = 0.5,
jump = false,
view_range = 10,
floats = 0,
drops = {
{name = "default:obsidian_shard", chance = 1, min = 1, max = 5},
{name = "default:obsidian", chance = 3, min = 0, max = 2},
},
water_damage = 0,
lava_damage = 8,
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,
}
})
mobs:register_egg("mobs_monster:obsidian_flan", S("Obsidian Flan"),
"default_obsidian.png", 1)
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
-- mese arrow (weapon)
mobs:register_arrow("mobs_monster:obsidian_arrow", {
visual = "sprite",
-- visual = "wielditem",
visual_size = {x = 0.5, y = 0.5},
textures = {"default_obsidian_shard.png"},
velocity = 6,
-- rotate = 180,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_node = function(self, pos, node)
if mobs_griefing == false or minetest.is_protected(pos, "") then
return
end
local texture = "default_dirt.png" --fallback texture
local radius = 1
local def = minetest.registered_nodes[node]
if def then
node = { name = node }
end
if def and def.tiles and def.tiles[1] then
texture = def.tiles[1]
end
-- do not break obsidian or diamond blocks or unbreakable nodes
if (def.groups and def.groups.level and def.groups.level > 1)
or def.groups.unbreakable then
return
end
minetest.add_particlespawner({
amount = 32,
time = 0.1,
minpos = vector.subtract(pos, radius / 2),
maxpos = vector.add(pos, radius / 2),
minvel = {x = -3, y = 0, z = -3},
maxvel = {x = 3, y = 5, z = 3},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.8,
maxexptime = 2.0,
minsize = radius * 0.33,
maxsize = radius,
texture = texture,
-- ^ only as fallback for clients without support for `node` parameter
node = node,
collisiondetection = true,
})
minetest.set_node(pos, {name = "air"})
local snd = def.sounds and def.sounds.dug or "default_dig_crumbly"
minetest.sound_play(snd, {pos = pos, max_hear_distance = 12, gain = 1.0}, true)
end
})

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

37
locale/mobs_monster.de.tr Normal file
View File

@ -0,0 +1,37 @@
# German Translation for mobs_monster mod
# Deutsche Übersetzung der mobs_monster Mod
# last update: 2016/June/10
# Author: Xanthin
#dirtmonster.lua
Dirt Monster=Erdmonster
#dungeonmaster.lua
Dungeon Master=Kerkermeister
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[MOD] Mobs Redo 'Monsters' geladen
#lava_flan.lua
Lava Flan=Lavaflan
Lava orb=Lavakugel
Lava Pickaxe=Lavaspitzhacke
#mese_monster.lua
Mese Monster=Mesemonster
#oerkki.lua
Oerkki=Oerkki
#sandmonster.lua
Sand Monster=Sandmonster
#spider.lua
Spider=Spinne
Cobweb=Spinnennetz
#stonemonster.lua
Stone Monster=Steinmonster
#treemonster.lua
Tree Monster=Baummonster

34
locale/mobs_monster.fr.tr Normal file
View File

@ -0,0 +1,34 @@
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster= Monstre de terre
#dungeonmaster.lua
Dungeon Master=Maître des donjons
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[MOD] Mobs Redo 'Monstres' chargé
#lava_flan.lua
Lava Flan=Flan de lave
Lava orb=Orbe de lave
Lava Pickaxe=Pioche de lave
#mese_monster.lua
Mese Monster=Monstre de Mese
#oerkki.lua
Oerkki=Oerkki
#sandmonster.lua
Sand Monster=Monstre de sable
#spider.lua
Spider=Araignée
Cobweb=Toile d'arraignée
#stonemonster.lua
Stone Monster=Monstre de pierre
#treemonster.lua
Tree Monster=Monstre de bois

38
locale/mobs_monster.it.tr Normal file
View File

@ -0,0 +1,38 @@
# ITALIAN LOCALE FILE FOR THE MOBS MONSTER MODULE
# Copyright (c) 2014 Krupnov Pavel and 2016 TenPlus1
# This file is distributed under the same license as the MOBS MONSTER package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
#dirtmonster.lua
Dirt Monster=Mostro di terra
#dungeonmaster.lua
Dungeon Master=Padrone delle segrete
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[MOD] Mobs Redo 'Monsters' caricato
#lava_flan.lua
Lava Flan=Sformato di lava
Lava orb=Sfera di lava
Lava Pickaxe=Piccone di lava
#mese_monster.lua
Mese Monster=Mostro di mese
#oerkki.lua
Oerkki=Oerkki
#sandmonster.lua
Sand Monster=Mostro di sabbia
#spider.lua
Spider=Ragno
Cobweb=Ragnatela
#stonemonster.lua
Stone Monster=Mostro di pietra
#treemonster.lua
Tree Monster=Albero mostro

35
locale/mobs_monster.ms.tr Normal file
View File

@ -0,0 +1,35 @@
# Malay translations of mobs_monster mod
# using template from 2016/June/10, translated on 2018/February/05
#dirtmonster.lua
Dirt Monster=Raksasa Tanah
#dungeonmaster.lua
Dungeon Master=Penjaga Kurungan Bawah Tanah
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[MODS] Mobs Redo 'Monsters' telah dimuatkan
#lava_flan.lua
Lava Flan=Raksasa Lava
Lava orb=Bola Lava
Lava Pickaxe=Beliung Lava
#mese_monster.lua
Mese Monster=Raksasa Mese
#oerkki.lua
Oerkki=Oerkki
#sandmonster.lua
Sand Monster=Raksasa Pasir
#spider.lua
Spider=Labah-labah
Cobweb=Sarang Labah-labah
#stonemonster.lua
Stone Monster=Raksasa Batu
#treemonster.lua
Tree Monster=Raksasa Pokok

39
locale/mobs_monster.tr.tr Normal file
View File

@ -0,0 +1,39 @@
# Türkçe çeviri by Admicos
# Turkish translation by Admicos
# Son düzenleme: 26 Nisan 2017
# Last edit: 26 April 2017
#dirtmonster.lua
Dirt Monster=Toprak Canavarı
#dungeonmaster.lua
Dungeon Master=Zindan başı
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[MOD] Mobs Redo 'Canavarlar' yüklendi
#lava_flan.lua
Lava Flan=Lav Flan
Lava orb=Lav küre
Lava Pickaxe=Lav kazması
#mese_monster.lua
Mese Monster=Mese Canavarı
#oerkki.lua
Oerkki=Oerkki
#sandmonster.lua
Sand Monster=Kum Canavarı
#spider.lua
Spider=Örümcek
Cobweb=Örümcek ağı
#stonemonster.lua
Stone Monster=Taş Canavarı
#treemonster.lua
Tree Monster=Ağaç Canavarı

View File

@ -0,0 +1,36 @@
# Template for translations of mobs_monster mod
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster=泥土怪
#dungeonmaster.lua
Dungeon Master=地穴之主
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[模组] Mobs Redo 'Monsters' 已加载
#lava_flan.lua
Lava Flan=岩浆饼
Lava orb=岩浆球
Lava Pickaxe=岩浆镐
Obsidian Flan=黑耀石饼
#mese_monster.lua
Mese Monster=黄石怪
#oerkki.lua
Oerkki=奥尔基
#sandmonster.lua
Sand Monster=沙怪
#spider.lua
Spider=蜘蛛
Cobweb=蜘蛛网
#stonemonster.lua
Stone Monster=石头怪
#treemonster.lua
Tree Monster=树怪

View File

@ -0,0 +1,36 @@
# Template for translations of mobs_monster mod
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster=泥土怪
#dungeonmaster.lua
Dungeon Master=地穴之主
#init.lua
[MOD] Mobs Redo 'Monsters' loaded=[模組] Mobs Redo 'Monsters' 已加載
#lava_flan.lua
Lava Flan=岩漿餅
Lava orb=岩漿球
Lava Pickaxe=岩漿鎬
Obsidian Flan=黑耀石餅
#mese_monster.lua
Mese Monster=黃石怪
#oerkki.lua
Oerkki=奧爾基
#sandmonster.lua
Sand Monster=沙怪
#spider.lua
Spider=蜘蛛
Cobweb=蜘蛛網
#stonemonster.lua
Stone Monster=石頭怪
#treemonster.lua
Tree Monster=樹怪

View File

@ -2,34 +2,35 @@
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster =
Dirt Monster=
#dungeonmaster.lua
Dungeon Master =
Dungeon Master=
#init.lua
[MOD] Mobs Redo 'Monsters' loaded =
[MOD] Mobs Redo 'Monsters' loaded=
#lava_flan.lua
Lava Flan =
Lava orb =
Lava Pickaxe =
Lava Flan=
Lava orb=
Lava Pickaxe=
Obsidian Flan=
#mese_monster.lua
Mese Monster =
Mese Monster=
#oerkki.lua
Oerkki =
Oerkki=
#sandmonster.lua
Sand Monster =
Sand Monster=
#spider.lua
Spider =
Cobweb =
Spider=
Cobweb=
#stonemonster.lua
Stone Monster =
Stone Monster=
#treemonster.lua
Tree Monster =
Tree Monster=

36
locale/zh_CN.txt Normal file
View File

@ -0,0 +1,36 @@
# Template for translations of mobs_monster mod
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster = 泥土怪
#dungeonmaster.lua
Dungeon Master = 地穴之主
#init.lua
[MOD] Mobs Redo 'Monsters' loaded = [模组] Mobs Redo 'Monsters' 已加载
#lava_flan.lua
Lava Flan = 岩浆饼
Lava orb = 岩浆球
Lava Pickaxe = 岩浆镐
Obsidian Flan = 黑耀石饼
#mese_monster.lua
Mese Monster = 黄石怪
#oerkki.lua
Oerkki = 奥尔基
#sandmonster.lua
Sand Monster = 沙怪
#spider.lua
Spider = 蜘蛛
Cobweb = 蜘蛛网
#stonemonster.lua
Stone Monster = 石头怪
#treemonster.lua
Tree Monster = 树怪

36
locale/zh_TW.txt Normal file
View File

@ -0,0 +1,36 @@
# Template for translations of mobs_monster mod
# last update: 2016/June/10
#dirtmonster.lua
Dirt Monster = 泥土怪
#dungeonmaster.lua
Dungeon Master = 地穴之主
#init.lua
[MOD] Mobs Redo 'Monsters' loaded = [模組] Mobs Redo 'Monsters' 已加載
#lava_flan.lua
Lava Flan = 岩漿餅
Lava orb = 岩漿球
Lava Pickaxe = 岩漿鎬
Obsidian Flan = 黑耀石餅
#mese_monster.lua
Mese Monster = 黃石怪
#oerkki.lua
Oerkki = 奧爾基
#sandmonster.lua
Sand Monster = 沙怪
#spider.lua
Spider = 蜘蛛
Cobweb = 蜘蛛網
#stonemonster.lua
Stone Monster = 石頭怪
#treemonster.lua
Tree Monster = 樹怪

View File

@ -11,7 +11,7 @@ Dungeon Master
Lava Flan
- Cute as they may look lava flan wallow in their namesake (no, not flans) and get curious about players who wander by, forgetting that they can burn you and cause damage. They have a 1 in 5 chance of dropping lava orb when killed.
- Cute as they may look lava flan wallow in their namesake (no, not flans) and get curious about players who wander by, forgetting that they can burn you and cause damage. They have a 1 in 5 chance of dropping lava orb when killed, but if they die in water then pray they dont solidify into an obsidian flan that shoots shards and destroys all around them.
Mese Monster

View File

@ -3,7 +3,8 @@ local S = mobs.intllib
-- custom particle effects
local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow)
local effect = function(
pos, amount, texture, min_size, max_size, radius, gravity, glow)
radius = radius or 2
min_size = min_size or 0.5
@ -79,6 +80,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()
@ -87,10 +96,25 @@ mobs:register_mob("mobs_monster:sand_monster", {
]]
on_die = function(self, pos)
pos.y = pos.y + 0.5
effect(pos, 30, "mobs_sand_particles.png", 0.1, 2, 3, 5)
mobs:effect(pos, 30, "mobs_sand_particles.png", .1, 2, 3, 5)
pos.y = pos.y + 0.25
effect(pos, 30, "mobs_sand_particles.png", 0.1, 2, 3, 5)
mobs:effect(pos, 30, "mobs_sand_particles.png", .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,15 @@
local S = mobs.intllib
local get_velocity = function(self)
local v = self.object:get_velocity()
-- sanity check
if not v then return 0 end
return (v.x * v.x + v.z * v.z) ^ 0.5
end
-- Spider by AspireMint (CC-BY-SA 3.0 license)
@ -95,6 +104,78 @@ 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.5 then
self.disable_falling = nil
return
end
local pos = self.object:get_pos()
local yaw = self.object:get_yaw()
-- sanity check
if not yaw then return end
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.x = 0 ; v.y = 0
v.y = self.jump_height
mobs:set_animation(self, "jump")
self.object:set_velocity(v)
end,
-- make spiders jump at you on attack
custom_attack = function(self, pos)
local vel = self.object:get_velocity()
self.object:set_velocity({
x = vel.x * self.run_velocity,
y = self.jump_height * 1.5,
z = vel.z * self.run_velocity
})
self.pausetimer = 0.5
return true -- continue rest of attack function
end
})
@ -103,7 +184,7 @@ mobs:spawn({
name = "mobs_monster:spider",
nodes = {
"default:dirt_with_rainforest_litter", "default:snowblock",
"default:snow", "ethereal:crystal_dirt"
"default:snow", "ethereal:crystal_dirt", "ethereal:cold_dirt"
},
min_light = 0,
max_light = 8,

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},
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

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,