diff --git a/dungeon.lua b/dungeon.lua index d3ff211..e953bef 100644 --- a/dungeon.lua +++ b/dungeon.lua @@ -150,10 +150,19 @@ if fun_caves.register_status then if not player then return end + local player_name = player:get_player_name() + if not player_name or player_name == '' then + return + end + + local damage = 1 + if fun_caves.db.status and fun_caves.db.status[player_name] and fun_caves.db.status[player_name]['poisoned'] and fun_caves.db.status[player_name]['poisoned']['damage'] then + damage = tonumber(fun_caves.db.status[player_name]['poisoned']['damage']) + end local hp = player:get_hp() if hp and type(hp) == 'number' then - hp = hp - 1 + hp = hp - damage player:set_hp(hp) end end, diff --git a/horror.lua b/horror.lua new file mode 100644 index 0000000..52662d4 --- /dev/null +++ b/horror.lua @@ -0,0 +1,67 @@ +-- This code and all associated textures and models were +-- originated by DOOMED , and published in +-- the horror mod, under the GPL 2.1 license and CC-by-SA 3. +-- https://forum.minetest.net/viewtopic.php?f=9&t=12961&hilit=doomed + +mobs:register_mob("fun_caves:manticore", { + type = "monster", + passive = false, + attacks_monsters = true, + damage = 5, + reach = 4, + attack_type = "dogfight", + hp_min = 15, + hp_max = 28, + armor = 70, + collisionbox = {-0.7, -0.5, -0.7, 0.7, 1.5, 0.7}, + visual = "mesh", + mesh = "manticore.b3d", + textures = { + {"manticore.png"}, + }, + blood_texture = "mobs_blood.png", + visual_size = {x=2.5, y=2.5}, + makes_footstep_sound = true, + walk_velocity = 3, + run_velocity = 5, + jump = true, + drops = { + {name = "mobs:meat_raw", chance = 1, min = 1, max = 9}, + }, + water_damage = 2, + lava_damage = 1, + light_damage = 0, + view_range = 20, + animation = { + speed_normal = 10, + speed_run = 20, + walk_start = 1, + walk_end = 11, + stand_start = 1, + stand_end = 11, + run_start = 1, + run_end = 11, + punch_start = 11, + punch_end = 26, + }, + do_custom = function(self) + if not (self and fun_caves.custom_ready and fun_caves.set_status and fun_caves.surface_damage and fun_caves.custom_ready(self)) then + return + end + + if self.attack and math.random(3) == 1 then + local player_name = self.attack:get_player_name() + if player_name and player_name ~= '' then + minetest.chat_send_player(player_name, minetest.colorize('#FF0000', 'You\'ve been poisoned!')) + fun_caves.set_status(player_name, 'poisoned', 2 ^ math.random(8), {damage = 1}) + end + end + + fun_caves.surface_damage(self) + end, +}) + +--mobs:spawn_specific("horror:manticore", {"default:dirt_with_grass"}, {"default:stone"}, 20, 0, 300, 15000, 2, -100, 11000) + +mobs:register_egg("fun_caves:manticore", "Manticore", "default_dirt.png", 1) + diff --git a/mobs.lua b/mobs.lua index 2b52c01..474cedc 100644 --- a/mobs.lua +++ b/mobs.lua @@ -819,6 +819,7 @@ if fun_caves.path then dofile(fun_caves.path.."/zombie.lua") dofile(fun_caves.path.."/goblin.lua") dofile(fun_caves.path.."/demon.lua") + dofile(fun_caves.path.."/horror.lua") end fun_caves.dungeon_spawns = {} @@ -843,6 +844,7 @@ local t_mobs = { "fun_caves:goblin_king", "fun_caves:zombie", "fun_caves:zombie", + 'fun_caves:manticore', "dmobs:orc", "dmobs:orc", "dmobs:orc", diff --git a/models/manticore.b3d b/models/manticore.b3d new file mode 100644 index 0000000..f81d28a Binary files /dev/null and b/models/manticore.b3d differ diff --git a/textures/manticore.png b/textures/manticore.png new file mode 100644 index 0000000..5b96c10 Binary files /dev/null and b/textures/manticore.png differ