12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- --Register Boomer with Mobs_Redo API, code based off of Mobs_MC under WTFPL.
- mobs:register_mob("mobs_boomer:boomer", {
- type = "monster",
- hp_min = 20,
- hp_max = 20,
- collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
- pathfinding = 1,
- visual = "mesh",
- mesh = "mobs_character.b3d",
- textures = {
- {"mobs_boomer.png"},
- },
- sounds = {
- attack = "tnt_ignite",
- --TODO: death = "",
- --TODO: damage = "",
- fuse = "tnt_ignite",
- explode = "tnt_explode",
- distance = 16,
- },
- makes_footstep_sound = true,
- walk_velocity = 1.05,
- run_velocity = 2.1,
- attack_type = "explode",
- explosion_radius = 3,
- reach = 2,
- explosion_damage_radius = 7,
- explosion_timer = 2,
- allow_fuse_reset = true,
- stop_to_explode = true,
- -- Force-ignite boomer with flint and steel and explode after 1.5 seconds.
- on_rightclick = function(self, clicker)
- if self._forced_explosion_countdown_timer ~= nil then
- return
- end
- local item = clicker:get_wielded_item()
- if item:get_name() == "fire:flint_and_steel" then
- if not minetest.settings:get_bool("creative_mode") then
- -- Wear tool
- local wdef = item:get_definition()
- item:add_wear(1000)
- -- Tool break sound
- if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then
- minetest.sound_play(wdef.sound.breaks, {pos = clicker:getpos(), gain = 0.5})
- end
- clicker:set_wielded_item(item)
- end
- self._forced_explosion_countdown_timer = self.explosion_timer
- minetest.sound_play(self.sounds.attack, {pos = self.object:getpos(), gain = 1, max_hear_distance = 16})
- end
- end,
- do_custom = function(self, dtime)
- if self._forced_explosion_countdown_timer ~= nil then
- self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
- if self._forced_explosion_countdown_timer <= 0 then
- mobs:explosion(self.object:getpos(), self.explosion_radius, 0, 1, self.sounds.explode)
- self.object:remove()
- end
- end
- end,
- maxdrops = 2,
- drops = {
- {name = "tnt:gunpowder",
- chance = 1,
- min = 0,
- max = 2,},
- },
- animation = {
- speed_normal = 30,
- speed_run = 30,
- stand_start = 0,
- stand_end = 79,
- walk_start = 168,
- walk_end = 187,
- run_start = 168,
- run_end = 187,
- punch_start = 0,
- punch_end = 79,
- },
- floats = 1,
- fear_height = 4,
- water_damage = 1,
- lava_damage = 4,
- light_damage = 0,
- view_range = 16,
- blood_amount = 0,
- })
- -- Register Spawning attributes: spawns on solid blocks by air, anywhere in the world.
- mobs:spawn_specific("mobs_boomer:boomer", {"group:cracky", "group:crumbly", "group:shovely", "group:pickaxey"}, {"air"}, 0, 7, 60, 20000, 2, -32000, 32000, false)
- -- Register Spawn Egg
- mobs:register_egg("mobs_boomer:boomer", "Boomer Spawn Egg", "wool_red.png", 1)
|