2015-03-19 00:10:30 +01:00
|
|
|
|
|
|
|
-- Bunny by ExeterDad
|
|
|
|
|
|
|
|
mobs:register_mob("mobs:bunny", {
|
|
|
|
-- animal, monster, npc
|
|
|
|
type = "animal",
|
|
|
|
-- is it aggressive
|
|
|
|
passive = true,
|
|
|
|
-- health & armor
|
2015-06-10 17:14:58 +02:00
|
|
|
hp_min = 3, hp_max = 6, armor = 200,
|
2015-03-19 00:10:30 +01:00
|
|
|
-- textures and model
|
|
|
|
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_bunny.b3d",
|
2015-05-22 10:37:17 +02:00
|
|
|
drawtype = "front",
|
Update mobs mod
- api.lua (many improves, chicken egg more frequent, NPC attack nearly
mobs, textures code, etc…)
- Bee (spawn on group:flower now, textures code updated)
- Bunny (textures code updated)
- Chicken (two times more eggs, textures code updated)
- Cow (textures code updated)
- Creeper (finish reorganize the code, textures code updated, new eggs
inventory texture)
- Dirt Monster (textures code updated)
- Dungeon Master (textures code updated)
- init.lua (small credits tweaks)
- Kitten (textures code updated, now drop sometimes farming:string)
- Lava Flan (textures code updated, now 3 can spawn per chunck)
- Mese Monster (textures code updated)
- NPC (textures code updated, revert give raw meat versus health code
for tests)
- Oerkki (textures code updated, now 1 light damage)
- Rat (textures code updated)
- Sand Monster (textures code updated)
- Sheep (textures code updated, now give 2 to 3 wool when sheared)
- Spider (textures code updated, change credits, comments our
modifications)
- Stone Monster (textures code updated)
- Tree Monster (textures code updated)
- Warthog (textures code updated)
- Wolf (finish reorganize the code, textures code updated, add spawner
egg and an inventory texture)
- Tweaks some sounds
2015-03-31 19:32:46 +02:00
|
|
|
textures = {
|
|
|
|
{"mobs_bunny_grey.png"},
|
|
|
|
{"mobs_bunny_brown.png"},
|
|
|
|
{"mobs_bunny_white.png"},
|
2015-07-15 23:31:54 +02:00
|
|
|
{"mobs_bunny_evil.png"},
|
2015-03-19 00:10:30 +01:00
|
|
|
},
|
|
|
|
-- sounds
|
|
|
|
sounds = {},
|
|
|
|
makes_footstep_sound = false,
|
|
|
|
-- speed and jump
|
2015-05-22 10:37:17 +02:00
|
|
|
walk_velocity = 1, run_velocity = 2,
|
2015-03-19 00:10:30 +01:00
|
|
|
jump = true,
|
2015-05-22 10:37:17 +02:00
|
|
|
-- drops meat when dead
|
2015-03-19 00:10:30 +01:00
|
|
|
drops = {
|
|
|
|
{name = "mobs:meat_raw",
|
|
|
|
chance = 1, min = 1, max = 2,},
|
|
|
|
},
|
|
|
|
-- damaged by
|
|
|
|
water_damage = 1,
|
2015-04-11 21:45:03 +02:00
|
|
|
lava_damage = 4,
|
2015-03-19 00:10:30 +01:00
|
|
|
light_damage = 0,
|
|
|
|
-- model animation
|
|
|
|
animation = {
|
|
|
|
speed_normal = 15,
|
|
|
|
stand_start = 1, stand_end = 15,
|
|
|
|
walk_start = 16, walk_end = 24,
|
2015-05-22 10:37:17 +02:00
|
|
|
punch_start = 16, punch_end = 24,
|
2015-03-19 00:10:30 +01:00
|
|
|
},
|
|
|
|
-- follows carrot from farming redo
|
|
|
|
follow = "farming:carrot",
|
2015-03-20 22:57:10 +01:00
|
|
|
view_range = 8,
|
|
|
|
-- eat carrots
|
|
|
|
replace_rate = 80,
|
|
|
|
replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"},
|
|
|
|
replace_with = "air",
|
2015-03-19 00:10:30 +01:00
|
|
|
-- right click to pick up rabbit
|
|
|
|
on_rightclick = function(self, clicker)
|
|
|
|
local item = clicker:get_wielded_item()
|
2015-05-22 10:37:17 +02:00
|
|
|
local name = clicker:get_player_name()
|
|
|
|
|
2015-04-11 21:45:03 +02:00
|
|
|
if item:get_name() == "farming_plus:carrot_item"
|
|
|
|
or item:get_name() == "farming:carrot" then
|
2015-05-22 10:37:17 +02:00
|
|
|
-- take item
|
2015-03-19 00:10:30 +01:00
|
|
|
if not minetest.setting_getbool("creative_mode") then
|
|
|
|
item:take_item()
|
|
|
|
clicker:set_wielded_item(item)
|
|
|
|
end
|
2015-05-22 10:37:17 +02:00
|
|
|
-- feed and tame
|
2015-03-19 00:10:30 +01:00
|
|
|
self.food = (self.food or 0) + 1
|
2015-05-22 10:37:17 +02:00
|
|
|
if self.food > 3 then
|
2015-03-19 00:10:30 +01:00
|
|
|
self.food = 0
|
|
|
|
self.tamed = true
|
2015-05-22 10:37:17 +02:00
|
|
|
-- make owner
|
2015-07-15 23:31:54 +02:00
|
|
|
if self.owner == "" then
|
2015-05-22 10:37:17 +02:00
|
|
|
self.owner = name
|
|
|
|
end
|
2015-03-19 00:10:30 +01:00
|
|
|
end
|
|
|
|
return
|
|
|
|
end
|
2015-07-15 23:31:54 +02:00
|
|
|
|
2015-05-22 10:37:17 +02:00
|
|
|
-- Monty Python tribute
|
|
|
|
if item:get_name() == "mobs:lava_orb" then
|
|
|
|
-- take item
|
|
|
|
if not minetest.setting_getbool("creative_mode") then
|
|
|
|
item:take_item()
|
|
|
|
clicker:set_wielded_item(item)
|
|
|
|
end
|
|
|
|
self.object:set_properties({
|
|
|
|
textures = {"mobs_bunny_evil.png"},
|
|
|
|
})
|
|
|
|
self.type = "monster"
|
|
|
|
self.state = "attack"
|
|
|
|
self.object:set_hp(20)
|
|
|
|
return
|
|
|
|
end
|
2015-04-11 21:45:03 +02:00
|
|
|
|
2015-07-15 23:31:54 +02:00
|
|
|
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
|
2015-05-22 10:37:17 +02:00
|
|
|
end,
|
|
|
|
attack_type = "dogfight",
|
|
|
|
damage = 5,
|
2015-03-19 00:10:30 +01:00
|
|
|
})
|
2015-07-16 19:02:10 +02:00
|
|
|
mobs:spawn_specific("mobs:bunny", {"default:dirt_with_grass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000)
|
|
|
|
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)
|