This commit is contained in:
Vitaliy olkhin 2025-01-29 12:31:02 +05:00
commit 5854d64b5b
10 changed files with 209 additions and 0 deletions

22
.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
## Files related to minetest development cycle
/*.patch
# GNU Patch reject file
*.rej
## Editors and Development environments
*~
*.swp
*.bak*
*.orig
# Vim
*.vim
# Kate
.*.kate-swp
.swp.*
# Eclipse (LDT)
.project
.settings/
.buildpath
.metadata
# Idea IDE
.idea/*

13
init.lua Normal file
View File

@ -0,0 +1,13 @@
mobs_spawn_protected = 1
ma_mobs = {
settings = {}
}
ma_mobs.settings.spawn = minetest.settings:get_bool("ma_mobs.spawn") or true
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
-- Mobs
if minetest.get_modpath("vehicles") then
dofile(path .. "mobs/assaultsuit.lua")
end

3
locale/ma_mobs.ru.tr Normal file
View File

@ -0,0 +1,3 @@
# textdomain: ma_mobs
Mod with mobs developed for the Mine Apocalypse server=Мод с мобами разработан для сервера Mine Apocalypse
Assaultsuit=Штурмовой костюм

3
locale/template.txt Normal file
View File

@ -0,0 +1,3 @@
# textdomain: ma_mobs
Mod with mobs developed for the Mine Apocalypse server=
Assaultsuit=

159
mobs/assaultsuit.lua Normal file
View File

@ -0,0 +1,159 @@
local S = minetest.get_translator("ma_mobs")
mobs:register_mob("ma_mobs:assaultsuit", {
--type = "npc",
type = "monster",
visual = "mesh",
visual_size = {x = 1.20, y = 1.20},
mesh = "assaultsuit.b3d",
collisionbox = {-0.5, -0.01, -1.4, 1.4, 5.25, 1.4},
animation = {
speed_normal = 15,
speed_run = 30,
stand_start = 25,
stand_end = 75,
walk_start = 0,
walk_end = 50,
run_start = 75,
run_end = 100,
},
sounds = {
--random = "ma_mobs_assaultsuit",
shoot_attack = "mobs_fireball"
},
blood_amount = 0, -- int Количество капель крови, появляющихся при попадании.
textures = {
{"vehicles_assaultsuit.png"},
},
fear_height = 3,
runaway = false, --bool Если true , моб отступит при ударе.
fly = false,
walk_chance = 60,
jump = true,
jump_height = 8,
passive = false, --логический Моб не будет защищать себя (установите значение false для атаки).
attack_type = "dogshoot", --Если attack_type — «shoot» или «dogshoot» , то требуется имя сущности предопределенной стрелы (см. mobs:register_arrow ).
arrow = "ma_mobs:missile",
group_attack = true, --bool Если true , будет защищать находящихся поблизости мобов того же типа от атак.
pathfinding = true,
view_range = 40, --int Расстояние, на котором моб будет следовать за игроком или другими существами или атаковать их.
damage = 10, --Урон, наносимый мобом за каждую атаку в ближнем бою.
recovery_time = 1.0, --Сколько времени в секундах проходит с момента удара моба до его восстановления. По умолчанию: 0,5
--follow = {"farming:wheat"},
shoot_interval = 2, --Минимальный интервал съемки.
hp_min = 100,
hp_max = 200,
armor = 30,
lava_damage = 0,
fall_damage = 0,
water_damage = 0,
makes_footstep_sound = true,
attacks_monsters = true,
attack_animals = true, --bool Если true , будет атаковать животных, а также игроков и NPC.
reach = 3, --Range at which mob will shoot (default: 3).
drops = {
{name = "vehicles:assaultsuit_spawner", chance = 1, min = 1, max = 1}
},
--[[do_custom = function(self, dtime)
-- set needed values if not already present
if not self.v2 then
-- elf.v2 = 0
self.max_speed_forward = 6
self.max_speed_reverse = 2
self.accel = 6
self.terrain_type = 3
self.driver_attach_at = {x = 0, y = 20, z = -2}
self.driver_eye_offset = {x = 0, y = 3, z = 0}
self.driver_scale = {x = 1, y = 1}
end
-- if driver present allow control of horse
if self.driver then
mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
return true
end,]]
on_die = function(self, pos)
-- drop saddle when horse is killed while riding
-- also detach from horse properly
if self.driver then
--minetest.add_item(pos, "mobs:saddle")
--mobs.detach(self.driver, {x = 1, y = 0, z = 1})
end
end,
})
mobs:register_arrow("ma_mobs:missile", {
visual = "sprite",
visual_size = {x = 1, y = 1},
textures = {"vehicles_missile_inv.png"},
collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
velocity = 30,
tail = 1,
tail_texture = "vehicles_missile_inv.png",
tail_size = 10,
glow = 5,
expire = 0.1,
on_activate = function(self, staticdata, dtime_s)
-- make fireball indestructable
self.object:set_armor_groups({immortal = 1, fleshy = 100})
end,
-- if player has a good weapon with 7+ damage it can deflect fireball
on_punch = function(self, hitter, tflp, tool_capabilities, dir)
if hitter and hitter:is_player() and tool_capabilities and dir then
local damage = tool_capabilities.damage_groups and
tool_capabilities.damage_groups.fleshy or 1
local tmp = tflp / (tool_capabilities.full_punch_interval or 1.4)
if damage > 6 and tmp < 4 then
self.object:set_velocity({
x = dir.x * self.velocity,
y = dir.y * self.velocity,
z = dir.z * self.velocity
})
end
end
end,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
--mobs:boom(self, self.lastpos, 2)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8}
}, nil)
end,
hit_mob = function(self, player)
--mobs:boom(self, self.lastpos, 2)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8}
}, nil)
end,
-- node hit
hit_node = function(self, pos, node)
mobs:boom(self, pos, 2)
end
})
mobs:register_egg("ma_mobs:assaultsuit", S("Assaultsuit"), "ma_mobs_assaultsuit_inv.png", 1)
if ma_mobs.settings.spawn == true then
mobs:spawn({
name = "ma_mobs:assaultsuit",
nodes = {"ethereal:dry_dirt"},
--chance = 150000,
chance = 1500,
active_object_count = 1,
})
end

7
mod.conf Normal file
View File

@ -0,0 +1,7 @@
name = ma_mobs
description = Mod with mobs developed for the Mine Apocalypse server
depends = mobs, mobs_monster
optional_depends = vehicles, ethereal
min_minetest_version = 5.0
title = Mine Apocalypse (mobs)
author = VinAdmin

2
settingtypes.txt Normal file
View File

@ -0,0 +1,2 @@
#Enable spawn.
ma_mobs.spawn (Enable spawn) bool true

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B