forked from VoxeLibre/VoxeLibre
Gold apples give the player effects; Added Enchanted Golden Apples (Swiftnes & Leaping instead of Absorbtion and Resistance)
This commit is contained in:
parent
b6aabfc853
commit
a92273b930
|
@ -144,17 +144,41 @@ minetest.register_craftitem("mcl_core:apple", {
|
||||||
_mcl_saturation = 2.4,
|
_mcl_saturation = 2.4,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- TODO: Status effects
|
local gapple_hunger_restore = minetest.item_eat(4)
|
||||||
|
|
||||||
|
local function eat_gapple(itemstack, placer, pointed_thing)
|
||||||
|
local regen_duration, absorbtion_factor = 5, 1
|
||||||
|
if itemstack:get_name() == "mcl_core:apple_gold_enchanted" then
|
||||||
|
regen_duration, absorbtion_factor = 20, 4
|
||||||
|
mcl_potions.fire_resistance_func(placer, 1, 300)
|
||||||
|
mcl_potions.leaping_func(placer, 1, 300)
|
||||||
|
end
|
||||||
|
mcl_potions.swiftness_func(placer, absorbtion_factor, 120) -- TODO: Absorbtion
|
||||||
|
mcl_potions.regeneration_func(placer, 2, regen_duration)
|
||||||
|
return gapple_hunger_restore(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_craftitem("mcl_core:apple_gold", {
|
minetest.register_craftitem("mcl_core:apple_gold", {
|
||||||
-- TODO: Add special highlight color when this item is special
|
-- TODO: Add special highlight color
|
||||||
description = S("Golden Apple"),
|
description = S("Golden Apple"),
|
||||||
_doc_items_longdesc = S("Golden apples are precious food items which can be eaten."),
|
_doc_items_longdesc = S("Golden apples are precious food items which can be eaten."),
|
||||||
wield_image = "mcl_core_apple_golden.png",
|
wield_image = "mcl_core_apple_golden.png",
|
||||||
inventory_image = "mcl_core_apple_golden.png",
|
inventory_image = "mcl_core_apple_golden.png",
|
||||||
stack_max = 64,
|
stack_max = 64,
|
||||||
-- TODO: Reduce to 4 when it's ready
|
on_place = eat_gapple,
|
||||||
on_place = minetest.item_eat(20),
|
on_secondary_use = eat_gapple,
|
||||||
on_secondary_use = minetest.item_eat(20),
|
groups = { food = 2, eatable = 4, can_eat_when_full = 1 },
|
||||||
groups = { food = 2, eatable = 20, can_eat_when_full = 1 },
|
_mcl_saturation = 9.6,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("mcl_core:apple_gold_enchanted", {
|
||||||
|
description = S("Enchanted Golden Apple"),
|
||||||
|
_doc_items_longdesc = S("Golden apples are precious food items which can be eaten."),
|
||||||
|
wield_image = "mcl_core_apple_golden.png" .. mcl_enchanting.overlay,
|
||||||
|
inventory_image = "mcl_core_apple_golden.png" .. mcl_enchanting.overlay,
|
||||||
|
stack_max = 64,
|
||||||
|
on_place = eat_gapple,
|
||||||
|
on_secondary_use = eat_gapple,
|
||||||
|
groups = { food = 2, eatable = 4, can_eat_when_full = 1 },
|
||||||
_mcl_saturation = 9.6,
|
_mcl_saturation = 9.6,
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,3 +5,4 @@ mcl_util
|
||||||
mcl_worlds
|
mcl_worlds
|
||||||
doc_items
|
doc_items
|
||||||
doc?
|
doc?
|
||||||
|
mcl_enchanting
|
||||||
|
|
Loading…
Reference in New Issue