mobs_mc/bat.lua
maikerumine f23e0a544d MERGED AMC -(https://github.com/22i/minecraft-voxel-blender-models)
#### Links [blender
models](https://github.com/22i/minecraft-voxel-blender-models),
[mobs_mc](https://github.com/maikerumine/mobs_mc), [how to recreate mobs
from textures with Blender and Gimp](http://imgur.com/a/Iqg88)

Minecraft mobs were remade in blender

Credits:
[toby109tt](https://github.com/tobyplowy) mapping fixes - better 2d
planes
2017-05-22 22:39:07 -04:00

169 lines
4.0 KiB
Lua

--MCmobs v0.2
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### BAT
--###################
mobs:register_mob("mobs_mc:1bat", {
type = "animal",
passive = true,
runaway = true,
stepheight = 1.2,
hp_min = 30,
hp_max = 60,
armor = 150,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
rotate = -180,
visual = "mesh",
mesh = "bat.b3d",
textures = {
{"bat.png"},
},
visual_size = {x=1, y=1},
walk_velocity = 3,
run_velocity = 3,
jump = true,
animation = {
speed_normal = 80, speed_run = 80,
stand_start = 0, stand_end = 40,
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
})
mobs:register_egg("mobs_mc:1bat", "Bat", "bat_inv.png", 0)
mobs:register_mob("mobs_mc:ghast", {
type = "monster",
pathfinding = true,
group_attack = true,
hp_max = 90,
collisionbox = {-1.45, -1.45, -1.45 ,1.45, 1.45, 1.45},
visual_size = {x=3.0, y=3.0},
-- textures = {
-- {"ghast_top.png", "ghast_bottom.png", "ghast_front.png", "ghast_sides.png", "ghast_sides.png", "ghast_sides.png"}
-- },
textures = {
{"ghast_white.png", "ghast_white.png", "ghast_front.png", "ghast_white.png", "ghast_white.png", "ghast_white.png"}
},
visual = "cube",
blood_texture ="mobs_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
shoot = "mobs_fireball",
death = "zombiedeath",
damage = "ghast_damage",
attack = "mobs_fireball",
random = "mobs_eerie",
},
walk_velocity = .8,
run_velocity = 2.6,
damage = 1,
armor = 100,
drops = {
{name = "default:lava_source 1",
chance = 3,
min = 1,
max = 4,},
{name = "mobs_mc:ghast_tear",
chance = 6,
min = 0,
max = 1,},
{name = "mobs_mc:ghast_head",
chance = 50,
min = 0,
max = 1,},
},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
fall_damage = 0,
view_range = 16,
--attack_type = "dogshoot",
attack_type = "dogshoot",
arrow = "mobs_monster:fireball",
shoot_interval = 3.5,
shoot_offset = 1,
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
--'dogshoot_count_max' number of seconds before switching above modes.
dogshoot_switch = 1,
dogshoot_count_max =1,
passive = false,
jump = true,
jump_height = 4,
floats=1,
fly = true,
jump_chance = 98,
fear_height = 120,
})
--mobs:register_spawn("mobs_mc:ghast", {"default:flowing_lava", "nether:rack","air"}, 17, -1, 5000, 1, -2000)
mobs:spawn_specific("mobs_mc:ghast", {"default:flowing_lava", "nether:rack","air"},{"air"},0, 17, 20, 5000, 2, -3610, -2100)
-- fireball (weapon)
mobs:register_arrow(":mobs_monster:fireball", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
textures = {"mcl_mobitems_fireball.png"},
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
-- node hit, bursts into flame
hit_node = function(self, pos, node)
mobs:explosion(pos, 1, 1, 0)
end
})
minetest.register_craftitem("mobs_mc:ghast_tear", {
description = "Ghast Tear",
_doc_items_longdesc = "A ghast tear is an item used in potion brewing. It is dropped from dead ghasts.",
wield_image = "mcl_mobitems_ghast_tear.png",
inventory_image = "mcl_mobitems_ghast_tear.png",
groups = { brewitem = 1 },
stack_max = 64,
})
-- spawn eggs
mobs:register_egg("mobs_mc:ghast", "Ghast", "ghast_front.png")
if minetest.setting_get("log_mods") then
minetest.log("action", "MC Ghast loaded")
end