1
0
mirror of https://codeberg.org/tenplus1/mobs_monster.git synced 2025-07-11 20:50:33 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2025-03-20 12:28:17 +01:00
17 changed files with 88 additions and 3535 deletions

View File

@ -1,9 +1,9 @@
-- Translation support
local S = minetest.get_translator("mobs_monster")
-- helper function
local get_velocity = function(self)
local function get_velocity(self)
local v = self.object:get_velocity()
@ -13,6 +13,8 @@ local get_velocity = function(self)
return (v.x * v.x + v.z * v.z) ^ 0.5
end
local math_cos, math_sin = math.cos, math.sin
-- custom spider types
local spider_types = {
@ -47,7 +49,7 @@ local spider_types = {
{ nodes = {"ethereal:crystal_dirt", "ethereal:crystal_spike"},
skins = {"mobs_spider_crystal.png"},
docile = true,
docile = true, immune_to = {{"ethereal:crystal_spike", 0}},
drops = {
{name = "farming:string", chance = 1, min = 0, max = 2},
{name = "ethereal:crystal_spike", chance = 15, min = 1, max = 2}}
@ -66,8 +68,8 @@ mobs:register_mob("mobs_monster:spider", {
damage = 3,
hp_min = 10,
hp_max = 30,
armor = 200,
collisionbox = {-0.8, -0.5, -0.8, 0.8, 0, 0.8},
armor = 100,
collisionbox = {-0.7, -0.5, -0.7, 0.7, 0, 0.7},
visual_size = {x = 1, y = 1},
visual = "mesh",
mesh = "mobs_spider.b3d",
@ -95,7 +97,7 @@ mobs:register_mob("mobs_monster:spider", {
water_damage = 5,
lava_damage = 5,
light_damage = 0,
node_damage = false, -- disable damage_per_second node damage
-- node_damage = false, -- disable damage_per_second node damage
animation = {
speed_normal = 15, speed_run = 20,
stand_start = 0, stand_end = 0,
@ -122,6 +124,8 @@ mobs:register_mob("mobs_monster:spider", {
if tmp.drops then self.drops = tmp.drops end
if tmp.immune_to then self.immune_to = tmp.immune_to end
if tmp.shoot then
self.attack_type = "dogshoot"
self.arrow = "mobs_monster:cobweb"
@ -167,8 +171,8 @@ mobs:register_mob("mobs_monster:spider", {
pos.y = pos.y + prop.collisionbox[2] - 0.2
local dir_x = -math.sin(yaw) * (prop.collisionbox[4] + 0.5)
local dir_z = math.cos(yaw) * (prop.collisionbox[4] + 0.5)
local dir_x = -math_sin(yaw) * (prop.collisionbox[4] + 0.5)
local dir_z = math_cos(yaw) * (prop.collisionbox[4] + 0.5)
local nod = minetest.get_node_or_nil({
x = pos.x + dir_x,
y = pos.y + 0.5,
@ -233,7 +237,7 @@ if not mobs.custom_spawn_monster then
max_light = 8,
chance = 7000,
active_object_count = 1,
min_height = 25,
min_height = 2,
max_height = 31000
})