Commit 528502bc authored by Milan's avatar Milan
Browse files
parents c5a3a9a3 144c8512
default
mobs
intllib?
lucky_block?
toolranks?
intllib?
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")
......@@ -28,6 +16,7 @@ dofile(path .. "/lava_flan.lua") -- Zeg9
dofile(path .. "/mese_monster.lua")
dofile(path .. "/spider.lua") -- AspireMint
-- Lucky Blocks
dofile(path .. "/lucky_block.lua")
print ("[MOD] Mobs Redo Monsters loaded")
print (S("[MOD] Mobs Redo Monsters loaded"))
-- Support for the old multi-load method
dofile(minetest.get_modpath("intllib").."/init.lua")
......@@ -41,6 +41,7 @@ mobs:register_mob("mobs_monster:lava_flan", {
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,
......@@ -55,27 +56,34 @@ 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"})
end
local cod = self.cause_of_death or {}
local def = cod.node and minetest.registered_nodes[cod.node]
self.object:remove()
if def and def.groups and def.groups.water then
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",
})
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
end,
glow = 10,
})
......@@ -116,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)
......@@ -312,3 +323,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
})
# textdomain:mobs_monster
Cobweb=Spinnennetz
Dirt Monster=Erdmonster
Dungeon Master=Kerkermeister
Lava Flan=Lavaflan
Lava Pickaxe=Lavaspitzhacke
Lava orb=Lavakugel
Mese Monster=Mesemonster
#Obsidian Flan=
Oerkki=Oerkki
Sand Monster=Sandmonster
Spider=Spinne
Stone Monster=Steinmonster
Tree Monster=Baummonster
# textdomain:mobs_monster
#Cobweb=
#Dirt Monster=
#Dungeon Master=
#Lava Flan=
#Lava Pickaxe=
#Lava orb=
#Mese Monster=
#Obsidian Flan=
#Oerkki=
#Sand Monster=
#Spider=
#Stone Monster=
#Tree Monster=
# textdomain:mobs_monster
Cobweb=Toile d'arraignée
Dirt Monster=Monstre de terre
Dungeon Master=Maître des donjons
Lava Flan=Lave en gelée
Lava Pickaxe=Pioche de lave
Lava orb=Orbe de lave
Mese Monster=Monstre de mese
Obsidian Flan=Obsidienne en gelée
Oerkki=Oerkki
Sand Monster=Monstre de sable
Spider=Araignée
Stone Monster=Monstre de pierre
Tree Monster=Monstre de bois
# textdomain:mobs_monster
Cobweb=Ragnatela
Dirt Monster=Mostro di terra
Dungeon Master=Padrone delle segrete
Lava Flan=Sformato di lava
Lava Pickaxe=Piccone di lava
Lava orb=Sfera di lava
Mese Monster=Mostro di mese
#Obsidian Flan=
Oerkki=Oerkki
Sand Monster=Mostro di sabbia
Spider=Ragno
Stone Monster=Mostro di pietra
Tree Monster=Albero mostro
# textdomain:mobs_monster
Cobweb=Sarang Labah-labah
Dirt Monster=Raksasa Tanah
Dungeon Master=Penjaga Kurungan Bawah Tanah
Lava Flan=Raksasa Lava
Lava Pickaxe=Beliung Lava
Lava orb=Bola Lava
Mese Monster=Raksasa Mese
#Obsidian Flan=
Oerkki=Oerkki
Sand Monster=Raksasa Pasir
Spider=Labah-labah
Stone Monster=Raksasa Batu
Tree Monster=Raksasa Pokok
# textdomain:mobs_monster
Cobweb=Örümcek ağı
Dirt Monster=Toprak Canavarı
Dungeon Master=Zindan başı
Lava Flan=Lav Flan
Lava Pickaxe=Lav kazması
Lava orb=Lav küre
Mese Monster=Mese Canavarı
#Obsidian Flan=
Oerkki=Oerkki
Sand Monster=Kum Canavarı
Spider=Örümcek
Stone Monster=Taş Canavarı
Tree Monster=Ağaç Canavarı
# textdomain:mobs_monster
Cobweb=蜘蛛网
Dirt Monster=泥土怪
Dungeon Master=地穴之主
Lava Flan=岩浆饼
Lava Pickaxe=岩浆镐
Lava orb=岩浆球
Mese Monster=黄石怪
#Obsidian Flan=
Oerkki=奥尔基
Sand Monster=沙怪
Spider=蜘蛛
Stone Monster=石头怪
Tree Monster=树怪
# textdomain:mobs_monster
Cobweb=蜘蛛網
Dirt Monster=泥土怪
Dungeon Master=地穴之主
Lava Flan=岩漿餅
Lava Pickaxe=岩漿鎬
Lava orb=岩漿球
Mese Monster=黃石怪
#Obsidian Flan=
Oerkki=奧爾基
Sand Monster=沙怪
Spider=蜘蛛
Stone Monster=石頭怪
Tree Monster=樹怪
......@@ -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 =
\ No newline at end of file
Tree Monster=
......@@ -14,6 +14,7 @@ Dungeon Master = 地穴之主
Lava Flan = 岩浆饼
Lava orb = 岩浆球
Lava Pickaxe = 岩浆镐
Obsidian Flan = 黑耀石饼
#mese_monster.lua
Mese Monster = 黄石怪
......
......@@ -14,6 +14,7 @@ Dungeon Master = 地穴之主
Lava Flan = 岩漿餅
Lava orb = 岩漿球
Lava Pickaxe = 岩漿鎬
Obsidian Flan = 黑耀石餅
#mese_monster.lua
Mese Monster = 黃石怪
......
......@@ -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
......
......@@ -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
......@@ -94,9 +95,9 @@ 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)
......
No preview for this file type
......@@ -5,6 +5,9 @@ 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
......@@ -100,6 +103,7 @@ 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)
......@@ -111,14 +115,17 @@ mobs:register_mob("mobs_monster:spider", {
self.spider_timer = 0
-- need to be stopped to go onwards
if get_velocity(self) > 0.2 then
self.disable_falling = false
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)
......@@ -149,9 +156,26 @@ minetest.register_alias("mobs:cobweb", "homedecor:cobweb_corner")
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
})
......@@ -161,7 +185,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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment