Add XP (#141)
This commit is contained in:
parent
22ccef8e1f
commit
1dc4d28264
@ -1,12 +1,12 @@
|
|||||||
HUD_SB_SIZE = {x = 24, y = 24}
|
HUD_SB_SIZE = {x = 24, y = 24}
|
||||||
HUD_HEALTH_POS = {x = 0.5, y = 1}
|
HUD_HEALTH_POS = {x = 0.5, y = 1}
|
||||||
HUD_HEALTH_OFFSET = {x = -248, y = -93}
|
HUD_HEALTH_OFFSET = {x = -248, y = -110}
|
||||||
HUD_AIR_POS = {x = 0.5, y = 1}
|
HUD_AIR_POS = {x = 0.5, y = 1}
|
||||||
HUD_AIR_OFFSET = {x = 6, y = -124}
|
HUD_AIR_OFFSET = {x = 6, y = -124}
|
||||||
HUD_HUNGER_POS = {x = 0.5, y = 1}
|
HUD_HUNGER_POS = {x = 0.5, y = 1}
|
||||||
HUD_HUNGER_OFFSET = {x = 6, y = -93}
|
HUD_HUNGER_OFFSET = {x = 6, y = -110}
|
||||||
HUD_ARMOR_POS = {x = 0.5, y = 1}
|
HUD_ARMOR_POS = {x = 0.5, y = 1}
|
||||||
HUD_ARMOR_OFFSET = {x = -248, y = -124}
|
HUD_ARMOR_OFFSET = {x = -248, y = -124}
|
||||||
|
|
||||||
-- read hud.conf settings
|
-- read hud.conf settings
|
||||||
function hud.read_conf()
|
function hud.read_conf()
|
||||||
|
@ -26,11 +26,18 @@ mobs:register_mob("mobs_animal:pig", {
|
|||||||
jump = true,
|
jump = true,
|
||||||
follow = {"default:apple", "farming:potato"},
|
follow = {"default:apple", "farming:potato"},
|
||||||
view_range = 5,
|
view_range = 5,
|
||||||
drops = {
|
drops = function(pos)
|
||||||
{name = "mobs:pork_raw", chance = 1, min = 1, max = 1},
|
if rawget(_G, "experience") then
|
||||||
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1},
|
--experience.add_orb(math.random(1,3), pos) -- random amount between 1 and 3
|
||||||
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1}
|
experience.add_orb(3, pos)
|
||||||
},
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{name = "mobs:pork_raw", chance = 1, min = 1, max = 1},
|
||||||
|
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1},
|
||||||
|
{name = "mobs:pork_raw", chance = 2, min = 1, max = 1}
|
||||||
|
}
|
||||||
|
end,
|
||||||
water_damage = 0,
|
water_damage = 0,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
|
@ -665,6 +665,8 @@ end
|
|||||||
|
|
||||||
-- drop items
|
-- drop items
|
||||||
function mob_class:item_drop()
|
function mob_class:item_drop()
|
||||||
|
local pos = self.object:get_pos()
|
||||||
|
self.drops = type(self.drops) == "function" and self.drops(pos) or self.drops
|
||||||
|
|
||||||
-- check for nil or no drops
|
-- check for nil or no drops
|
||||||
if not self.drops or #self.drops == 0 then
|
if not self.drops or #self.drops == 0 then
|
||||||
@ -682,7 +684,6 @@ function mob_class:item_drop()
|
|||||||
and self.cause_of_death.puncher:is_player() or nil
|
and self.cause_of_death.puncher:is_player() or nil
|
||||||
|
|
||||||
local obj, item, num
|
local obj, item, num
|
||||||
local pos = self.object:get_pos()
|
|
||||||
|
|
||||||
for n = 1, #self.drops do
|
for n = 1, #self.drops do
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
experience?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user