-- Ice Demon -- creates and moves ice nodes local newnode = fun_caves.clone_node('default:ice') newnode.description = "Freezing vapor" newnode.tiles = {'fun_caves_wisp.png'} newnode.sunlight_propagates = true newnode.use_texture_alpha = true newnode.walkable = false 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 = "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_ice.png"}, }, makes_footstep_sound = true, --sounds = { -- random = "goblins_goblin_ambient", -- warcry = "goblins_goblin_attack", -- attack = "goblins_goblin_attack", -- damage = "goblins_goblin_damage", -- death = "goblins_goblin_death", -- distance = 15, --}, walk_velocity = 2, run_velocity = 3, jump = true, drops = { {name = "default:ice", chance = 3, min = 1, max = 3}, {name = "fun_caves:eternal_ice_crystal", chance = 10, min = 1, max = 1}, }, 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, fly_in = 'fun_caves:freezing_vapor', do_custom = function(self) -- This has to happen fast. if self.attack then self.fly = true local pos = self.attack:getpos() pos.y = pos.y - 0 fun_caves.search_replace(pos, 1, {'default:ice', 'air'}, 'fun_caves:freezing_vapor') end if not fun_caves.custom_ready(self) then return end if not self.attack then self.fly = false end fun_caves.surface_damage(self, true) end, }) 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, -- change to dogshoot? 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 = { {name = "default:snow", chance = 3, min = 1, max = 3}, {name = "fun_caves:eternal_ice_crystal", chance = 10, min = 1, max = 1}, }, 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 (!)