Commit 8213c0ed authored by blert2112's avatar blert2112
Browse files

added pumpkin king, adjusted zombie

parent 576b3243
name = name,
type = def.type,
visual = def.visual,
mesh = def.mesh,
textures = {
{"mobs_medved.png"},
},
visual_size = def.visual_size or {x = 1, y = 1},
collisionbox = def.collisionbox,
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
animation = def.animation,
makes_footstep_sound = def.makes_footstep_sound or false,
sounds = def.sounds or {},
hp_min = def.hp_min or 5,
hp_max = def.hp_max or 10,
armor = def.armor,
recovery_time = def.recovery_time or 0.5,
knock_back = def.knock_back or 3,
blood_amount = def.blood_amount or 5,
blood_texture = def.blood_texture or "mobs_blood.png",
light_damage = def.light_damage or 0,
water_damage = def.water_damage or 0,
lava_damage = def.lava_damage or 0,
fall_damage = def.fall_damage or 1,
passive = def.passive or false,
damage = def.damage,
attack_type = def.attack_type,
arrow = def.arrow,
shoot_interval = def.shoot_interval,
shoot_offset = def.shoot_offset or 0,
attacks_monsters = def.attacks_monsters or false,
group_attack = def.group_attack or false,
view_range = def.view_range or 5,
walk_chance = def.walk_chance or 50,
walk_velocity = def.walk_velocity or 1,
run_velocity = def.run_velocity or 2,
stepheight = def.stepheight or 0.6,
jump = def.jump or true,
jump_height = def.jump_height or 6,
jump_chance = def.jump_chance or 0,
fly = def.fly,
fly_in = def.fly_in or "air",
fall_speed = def.fall_speed or -10, -- must be lower than -2 (default: -10)
floats = def.floats or 1, -- floats in water by default
lifetimer = def.lifetimer or 180, -- 3 minutes
drops = def.drops or {},
follow = def.follow or "",
replace_rate = def.replace_rate,
replace_what = def.replace_what,
replace_with = def.replace_with,
replace_offset = def.replace_offset or 0,
**CODE**
--------
See Mobs.Redo license
**MODELS/TEXTURES**
-------------------
GPL v3
Author/origin: Team NPX, Not-So-Simple-Mobs
**SOUNDS**
----------
Artist/origin: Team NPX, Not-So-Simple-Mobs
if mobs.mod and mobs.mod == "redo" then
local ENABLE_SPAWN_NODE = true
local ENABLE_PUMPKIN_BOOM = true
mobs:register_mob("mobs_pumpking:pumpking", {
type = "monster",
visual = "mesh",
mesh = "pumpking.x",
textures = {
{"pumpking.png"}
},
visual_size = {x=3, y=3},
collisionbox = {-0.85, 0.00, -0.85, 0.85, 5.3, 0.85},
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 165, stand_end = 210,
walk_start = 61, walk_end = 110,
run_start = 0, run_end = 50,
punch_start = 150, punch_end = 165
},
makes_footstep_sound = true,
sounds = {
random = "king"
},
hp_min = 85,
hp_max = 90,
armor = 30,
knock_back = 1,
light_damage = 10,
water_damage = 5,
lava_damage = 5,
fall_damage = 20,
damage = 8,
attack_type = "dogfight",
view_range = 25,
stepheight = 1.1,
drops = {
{name = "farming:jackolantern", chance = 1, min = 1, max = 1}
},
lifetimer = 180, -- 3 minutes
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
do_custom = function(self)
if ENABLE_PUMPKIN_BOOM and self.lifetimer <= self.shoot_interval then
p = self.object:getpos()
p.y = p.y + 1
minetest.add_entity(p, "mobs_pumpking:pumpboom")
minetest.after(5.0, function(pos, str) minetest.add_entity(pos, str) end,
p, "mobs_pumpking:pumpboom")
self.shoot_interval = self.shoot_interval - 45
end
end
})
local l_spawn_elevation_min = minetest.setting_get("water_level")
if l_spawn_elevation_min then
l_spawn_elevation_min = l_spawn_elevation_min + 2
else
l_spawn_elevation_min = 2
end
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("mobs_pumpking:pumpking",
{"default:dirt_with_grass", "default:dirt"},
{"air"},
-1, 6, 30, 100000, 1, l_spawn_elevation_min, 31000
)
mobs:register_egg("mobs_pumpking:pumpking", "Pumpkin King", "pumpking.png", 1)
if ENABLE_PUMPKIN_BOOM then
mobs:register_mob("mobs_pumpking:pumpboom", {
type = "monster",
visual = "mesh",
mesh = "pumpboom.x",
textures = {
{"pumpboom.png"}
},
visual_size = {x=3, y=3},
collisionbox = {-0.80, -0.3, -0.80, 0.80, 0.80, 0.80},
rotate = 270,
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 30,
walk_start = 81, walk_end = 97,
run_start = 81, run_end = 97,
punch_start = 100, punch_end = 120
},
sounds = {
random = "pump"
},
hp_min = 2,
hp_max = 5,
armor = 200,
light_damage = 2,
water_damage = 2,
lava_damage = 2,
fall_damage = 3,
damage = 4,
attack_type = "explode",
group_attack = true,
view_range = 15,
walk_velocity = 2,
run_velocity = 4,
drops = {
{name = "farming:pumpkin_seed", chance = 1, min = 1, max = 4}
}
})
end
-- spawner block
if ENABLE_SPAWN_NODE then
minetest.register_node("mobs_pumpking:pumpking_spawner", {
description = "Pumpkin King Spawner",
tiles = {"pumpboom.png"},
is_ground_content = false,
groups = {cracky=3, stone=1, mob_spawner=1},
sounds = default.node_sound_stone_defaults({
dug = {name="king", gain=0.25}
})
})
minetest.register_abm({
nodenames = {"mobs_pumpking:pumpking_spawner"},
interval = 180.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.add_entity(pos, "mobs_pumpking:pumpking")
end
})
end
end
This diff is collapsed.
This diff is collapsed.
......@@ -2,6 +2,7 @@
if mobs.mod and mobs.mod == "redo" then
local ENABLE_SPAWN_NODE = true
local ENABLE_MINI_ZOMBIE = true
-- zombie
mobs:register_mob("mobs_zombie:zombie", {
......@@ -43,9 +44,9 @@ if mobs.mod and mobs.mod == "redo" then
{name = "mobs_zombie:rotten_flesh", chance = 1, min = 1, max = 3,}
},
lifetimer = 180, -- 3 minutes
shoot_interval = 135, -- (lifetimer - (lifetimer / 4))
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
do_custom = function(self)
if self.lifetimer <= self.shoot_interval then
if ENABLE_MINI_ZOMBIE and self.lifetimer <= self.shoot_interval then
if math.random(100) <= 50 then
minetest.add_entity(self.object:getpos(), "mobs_zombie:zombie_mini")
end
......@@ -63,46 +64,48 @@ if mobs.mod and mobs.mod == "redo" then
mobs:register_egg("mobs_zombie:zombie", "Zombie", "zombie_head.png", 0)
-- mini zombie
mobs:register_mob("mobs_zombie:zombie_mini", {
type = "monster",
visual = "mesh",
mesh = "creatures_mob.x",
textures = {
{"mobs_zombie.png"},
},
visual_size = {x = 0.5, y = 0.5},
collisionbox = {-0.125, -0.5, -0.15, 0.125, 0.375, 0.15},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death"
},
hp_min = 20,
hp_max = 45,
armor = 150,
knock_back = 1,
lava_damage = 10,
damage = 6,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.8,
run_velocity = 0.8,
jump = false,
drops = {
{name = "mobs_zombie:rotten_flesh", chance = 1, min = 1, max = 1,}
}
})
if ENABLE_MINI_ZOMBIE then
mobs:register_mob("mobs_zombie:zombie_mini", {
type = "monster",
visual = "mesh",
mesh = "creatures_mob.x",
textures = {
{"mobs_zombie.png"},
},
visual_size = {x = 0.5, y = 0.5},
collisionbox = {-0.125, -0.5, -0.15, 0.125, 0.375, 0.15},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death"
},
hp_min = 20,
hp_max = 45,
armor = 150,
knock_back = 1,
lava_damage = 10,
damage = 6,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.8,
run_velocity = 0.8,
jump = false,
drops = {
{name = "mobs_zombie:rotten_flesh", chance = 1, min = 1, max = 1,}
}
})
end
-- rotten flesh
minetest.register_craftitem("mobs_zombie:rotten_flesh", {
......
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