diff --git a/demon.lua b/demon.lua index 7ba6d15..8b492c5 100644 --- a/demon.lua +++ b/demon.lua @@ -11,13 +11,30 @@ newnode.buildable_to = true newnode.pointable = false 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", { description = "Ice Demon", type = "monster", passive = false, damage = 3, - --attack_type = "dogshoot", attack_type = "dogfight", attacks_monsters = true, hp_min = 10, @@ -25,16 +42,11 @@ mobs:register_mob("fun_caves:ice_demon", { armor = 50, collisionbox = {-0.30,-1.0,-0.30, 0.30,0.8,0.30}, visual = "mesh", - -- basic humanoid? mesh = "character.b3d", drawtype = "front", - -------------------------- - -- replace this - -------------------------- textures = { - {"fun_caves_goblin_ice2.png"}, + {"default_ice.png"}, }, - -------------------------- makes_footstep_sound = true, --sounds = { -- random = "goblins_goblin_ambient", @@ -50,7 +62,7 @@ mobs:register_mob("fun_caves:ice_demon", { drops = nil, water_damage = 0, lava_damage = 4, - --light_damage = 2, + light_damage = 2, view_range = 15, animation = { stand_start = 0, @@ -67,7 +79,6 @@ mobs:register_mob("fun_caves:ice_demon", { walkmine_end = 219, }, animation_speed = 30, - --fly = true, fly_in = 'fun_caves:freezing_vapor', do_custom = function(self) -- 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"}, {'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 +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 (!) diff --git a/sounds/goblins_goblin_ambient.ogg b/sounds/goblins_goblin_ambient.ogg new file mode 100644 index 0000000..45016d9 Binary files /dev/null and b/sounds/goblins_goblin_ambient.ogg differ diff --git a/sounds/goblins_goblin_attack.ogg b/sounds/goblins_goblin_attack.ogg new file mode 100644 index 0000000..3e660a0 Binary files /dev/null and b/sounds/goblins_goblin_attack.ogg differ diff --git a/sounds/goblins_goblin_damage.ogg b/sounds/goblins_goblin_damage.ogg new file mode 100644 index 0000000..e8aaeae Binary files /dev/null and b/sounds/goblins_goblin_damage.ogg differ diff --git a/sounds/goblins_goblin_death.ogg b/sounds/goblins_goblin_death.ogg new file mode 100644 index 0000000..aa8fb5f Binary files /dev/null and b/sounds/goblins_goblin_death.ogg differ diff --git a/sounds/goblins_goblin_pick.ogg b/sounds/goblins_goblin_pick.ogg new file mode 100644 index 0000000..670f1d7 Binary files /dev/null and b/sounds/goblins_goblin_pick.ogg differ diff --git a/sounds/wind_howl.ogg b/sounds/wind_howl.ogg new file mode 100644 index 0000000..aa70728 Binary files /dev/null and b/sounds/wind_howl.ogg differ diff --git a/sounds/wind_howl_2.ogg b/sounds/wind_howl_2.ogg new file mode 100644 index 0000000..e332173 Binary files /dev/null and b/sounds/wind_howl_2.ogg differ diff --git a/textures/fun_caves_snowflakes.png b/textures/fun_caves_snowflakes.png new file mode 100644 index 0000000..1a92348 Binary files /dev/null and b/textures/fun_caves_snowflakes.png differ