Add blizzard demon and goblin sounds.

This commit is contained in:
Duane 2016-06-22 07:54:45 -05:00
parent ef9e69eb07
commit 72efe71560
9 changed files with 99 additions and 9 deletions

108
demon.lua
View file

@ -11,13 +11,30 @@ newnode.buildable_to = true
newnode.pointable = false newnode.pointable = false
minetest.register_node("fun_caves:freezing_vapor", newnode) minetest.register_node("fun_caves:freezing_vapor", newnode)
local function snow_effect(pos, radius)
minetest.add_particlespawner({
amount = 30,
time = 1,
minpos = vector.subtract(pos, radius / 2),
maxpos = vector.add(pos, radius / 2),
minvel = {x=-10, y=-10, z=-10},
maxvel = {x=10, y=10, z=10},
minacc = vector.new(),
maxacc = vector.new(),
minexptime = 1,
maxexptime = 3,
minsize = 16,
maxsize = 32,
texture = "fun_caves_snowflakes.png",
})
end
mobs:register_mob("fun_caves:ice_demon", { mobs:register_mob("fun_caves:ice_demon", {
description = "Ice Demon", description = "Ice Demon",
type = "monster", type = "monster",
passive = false, passive = false,
damage = 3, damage = 3,
--attack_type = "dogshoot",
attack_type = "dogfight", attack_type = "dogfight",
attacks_monsters = true, attacks_monsters = true,
hp_min = 10, hp_min = 10,
@ -25,16 +42,11 @@ mobs:register_mob("fun_caves:ice_demon", {
armor = 50, armor = 50,
collisionbox = {-0.30,-1.0,-0.30, 0.30,0.8,0.30}, collisionbox = {-0.30,-1.0,-0.30, 0.30,0.8,0.30},
visual = "mesh", visual = "mesh",
-- basic humanoid?
mesh = "character.b3d", mesh = "character.b3d",
drawtype = "front", drawtype = "front",
--------------------------
-- replace this
--------------------------
textures = { textures = {
{"fun_caves_goblin_ice2.png"}, {"default_ice.png"},
}, },
--------------------------
makes_footstep_sound = true, makes_footstep_sound = true,
--sounds = { --sounds = {
-- random = "goblins_goblin_ambient", -- random = "goblins_goblin_ambient",
@ -50,7 +62,7 @@ mobs:register_mob("fun_caves:ice_demon", {
drops = nil, drops = nil,
water_damage = 0, water_damage = 0,
lava_damage = 4, lava_damage = 4,
--light_damage = 2, light_damage = 2,
view_range = 15, view_range = 15,
animation = { animation = {
stand_start = 0, stand_start = 0,
@ -67,7 +79,6 @@ mobs:register_mob("fun_caves:ice_demon", {
walkmine_end = 219, walkmine_end = 219,
}, },
animation_speed = 30, animation_speed = 30,
--fly = true,
fly_in = 'fun_caves:freezing_vapor', fly_in = 'fun_caves:freezing_vapor',
do_custom = function(self) do_custom = function(self)
-- This has to happen fast. -- This has to happen fast.
@ -93,8 +104,87 @@ mobs:register_mob("fun_caves:ice_demon", {
mobs:spawn_specific("fun_caves:ice_demon", {"default:ice"}, nil, -1, 10, 300, 3000, 2, fun_caves.underzones['Caina'].lower_bound, fun_caves.underzones['Caina'].upper_bound) mobs:spawn_specific("fun_caves:ice_demon", {"default:ice"}, nil, -1, 10, 300, 3000, 2, fun_caves.underzones['Caina'].lower_bound, fun_caves.underzones['Caina'].upper_bound)
mobs:spawn_specific("fun_caves:ice_demon", {"default:ice"}, {'default:torch'}, -1, 20, 100, 300, 2, fun_caves.underzones['Caina'].lower_bound, fun_caves.underzones['Caina'].upper_bound) mobs:spawn_specific("fun_caves:ice_demon", {"default:ice"}, {'default:torch'}, -1, 20, 100, 300, 2, fun_caves.underzones['Caina'].lower_bound, fun_caves.underzones['Caina'].upper_bound)
-- Blizzard Demon -- storm that slows players -- Blizzard Demon -- storm that slows players
mobs:register_mob("fun_caves:snow_demon", {
description = "Ice Demon",
type = "monster",
passive = false,
damage = 3,
attack_type = "dogfight",
attacks_monsters = true,
hp_min = 10,
hp_max = 20,
armor = 50,
collisionbox = {-0.30,-1.0,-0.30, 0.30,0.8,0.30},
visual = "mesh",
mesh = "character.b3d",
drawtype = "front",
textures = {
{"default_snow.png"},
},
makes_footstep_sound = true,
sounds = {
random = "wind_howl_2",
warcry = "wind_howl_2",
distance = 25,
},
walk_velocity = 2,
run_velocity = 3,
jump = true,
drops = nil,
water_damage = 0,
lava_damage = 4,
light_damage = 2,
view_range = 15,
animation = {
stand_start = 0,
stand_end = 79,
sit_start = 81,
sit_end = 160,
sleep_start = 162,
sleep_end = 166,
walk_start = 168,
walk_end = 187,
mine_start = 189,
mine_end = 198,
walkmine_start = 200,
walkmine_end = 219,
},
animation_speed = 30,
on_die = function(self)
self.slowed:set_physics_override({speed=1})
self.slowed = nil
end,
do_custom = function(self)
if not self.attack then
self.fly = false
end
local pos = self.object:getpos()
snow_effect(pos, 20)
if self.attack then
self.attack:set_physics_override({speed=0.3})
self.slowed = self.attack
elseif self.slowed then
local player = self.slowed
minetest.after(20, function()
player:set_physics_override({speed=1})
end)
self.slowed = nil
end
if not fun_caves.custom_ready(self) then
return
end
fun_caves.surface_damage(self, true)
end,
})
mobs:spawn_specific("fun_caves:snow_demon", {"default:ice"}, nil, -1, 10, 300, 3000, 2, fun_caves.underzones['Caina'].lower_bound, fun_caves.underzones['Caina'].upper_bound)
-- Magma Demon -- creates lava under player (!) -- Magma Demon -- creates lava under player (!)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sounds/wind_howl.ogg Normal file

Binary file not shown.

BIN
sounds/wind_howl_2.ogg Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B