Cleaning up old files and using a night-vision lite method.

This commit is contained in:
Brandon 2020-06-20 21:17:45 -04:00
parent 162faa7e60
commit 9836d631f9
11 changed files with 49 additions and 3 deletions

View File

@ -422,3 +422,8 @@ function mcl_potions.fire_resistance_func(player, duration)
end
function mcl_potions.night_vision_func(player, duration)
player:override_day_night_ratio(0.45)
end

View File

@ -316,7 +316,7 @@ local output_table = {
local enhancement_table = {}
local extension_table = {}
local potions = {"awkward", "mundane", "thick"}
for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility","weakness","water_breathing"}) do
for i, potion in ipairs({"healing","harming","swiftness","leaping","poison","regeneration","invisibility","weakness","water_breathing","night_vision"}) do
table.insert(potions, potion)

View File

@ -152,10 +152,43 @@ minetest.register_craftitem("mcl_potions:harming_2", {
minetest.register_craftitem("mcl_potions:night_vision", {
description = S("Night Vision Potion"),
_doc_items_longdesc = brewhelp,
wield_image = "mcl_potions_night_vision.png",
inventory_image = "mcl_potions_night_vision.png",
wield_image = potion_image("#009999"),
inventory_image = potion_image("#009999"),
groups = { brewitem = 1, food=0},
stack_max = 1,
on_place = function(itemstack, user, pointed_thing)
mcl_potions.night_vision_func(user, 180)
mcl_potions._use_potion(itemstack, user, "#009999")
return itemstack
end,
on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.night_vision_func(user, 180)
mcl_potions._use_potion(itemstack, user, "#009999")
return itemstack
end,
})
minetest.register_craftitem("mcl_potions:night_vision_plus", {
description = S("Night Vision Potion +"),
_doc_items_longdesc = brewhelp,
wield_image = potion_image("#000A0A"),
inventory_image = potion_image("#000A0A"),
groups = { brewitem = 1, food=0},
stack_max = 1,
on_place = function(itemstack, user, pointed_thing)
mcl_potions.night_vision_func(user, 480)
mcl_potions._use_potion(itemstack, user, "#000A0A")
return itemstack
end,
on_secondary_use = function(itemstack, user, pointed_thing)
mcl_potions.night_vision_func(user, 480)
mcl_potions._use_potion(itemstack, user, "#000A0A")
return itemstack
end,
})

View File

@ -196,3 +196,11 @@ register_splash("water_breathing_plus", "Splash Fire Resistance", "#D0A040", {
register_splash("water_breathing_plus", "Splash Fire Resistance +", "#E0B050", {
potion_fun = function(player, redx) mcl_potions.fire_resistance_func(player, 360*redx) end
})
register_splash("night_vision", "Splash Night Vision", "#009999", {
potion_fun = function(player, redx) mcl_potions.night_vision_func(player, 135*redx) end
})
register_splash("night_vision_plus", "Splash Night Vision +", "#000A0A", {
potion_fun = function(player, redx) mcl_potions.night_vision_func(player, 360*redx) end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB