forked from VoxeLibre/VoxeLibre
Compare commits
2 Commits
master
...
add_shader
Author | SHA1 | Date |
---|---|---|
Wbjitscool | 8b99efc559 | |
Wbjitscool | f66ba40090 |
|
@ -802,37 +802,34 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir)
|
|||
end
|
||||
|
||||
-- alert others to the attack
|
||||
local alert_pos = hitter:get_pos()
|
||||
if alert_pos then
|
||||
local objs = minetest.get_objects_inside_radius(alert_pos, self.view_range)
|
||||
local obj = nil
|
||||
local objs = minetest.get_objects_inside_radius(hitter:get_pos(), self.view_range)
|
||||
local obj = nil
|
||||
|
||||
for n = 1, #objs do
|
||||
for n = 1, #objs do
|
||||
|
||||
obj = objs[n]:get_luaentity()
|
||||
obj = objs[n]:get_luaentity()
|
||||
|
||||
if obj then
|
||||
-- only alert members of same mob or friends
|
||||
if obj.group_attack
|
||||
and obj.state ~= "attack"
|
||||
and obj.owner ~= name then
|
||||
if obj.name == self.name then
|
||||
obj:do_attack(hitter)
|
||||
elseif type(obj.group_attack) == "table" then
|
||||
for i=1, #obj.group_attack do
|
||||
if obj.group_attack[i] == self.name then
|
||||
obj._aggro = true
|
||||
obj:do_attack(hitter)
|
||||
break
|
||||
end
|
||||
if obj then
|
||||
-- only alert members of same mob or friends
|
||||
if obj.group_attack
|
||||
and obj.state ~= "attack"
|
||||
and obj.owner ~= name then
|
||||
if obj.name == self.name then
|
||||
obj:do_attack(hitter)
|
||||
elseif type(obj.group_attack) == "table" then
|
||||
for i=1, #obj.group_attack do
|
||||
if obj.group_attack[i] == self.name then
|
||||
obj._aggro = true
|
||||
obj:do_attack(hitter)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- have owned mobs attack player threat
|
||||
if obj.owner == name and obj.owner_loyal then
|
||||
obj:do_attack(self.object)
|
||||
end
|
||||
-- have owned mobs attack player threat
|
||||
if obj.owner == name and obj.owner_loyal then
|
||||
obj:do_attack(self.object)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -394,7 +394,18 @@ end)
|
|||
local function initsky(player)
|
||||
|
||||
if player.set_lighting then
|
||||
player:set_lighting({ shadows = { intensity = tonumber(minetest.settings:get("mcl_default_shadow_intensity") or 0.33) } })
|
||||
player:set_lighting({
|
||||
shadows = { intensity = 0.33 },
|
||||
volumetric_light = { strength = 0.45 },
|
||||
exposure = {
|
||||
luminance_min = -3.5,
|
||||
luminance_max = -2.5,
|
||||
exposure_correction = 0.35,
|
||||
speed_dark_bright = 1500,
|
||||
speed_bright_dark = 700,
|
||||
},
|
||||
saturation = 1.1,
|
||||
})
|
||||
end
|
||||
|
||||
if (mcl_weather.skycolor.active) then
|
||||
|
|
|
@ -456,10 +456,6 @@ mcl_potions.register_effect({
|
|||
object:get_meta():set_int("night_vision", 1)
|
||||
mcl_weather.skycolor.update_sky_color({object})
|
||||
end,
|
||||
on_load = function(object, factor)
|
||||
object:get_meta():set_int("night_vision", 1)
|
||||
mcl_weather.skycolor.update_sky_color({object})
|
||||
end,
|
||||
on_step = function(dtime, object, factor, duration)
|
||||
mcl_weather.skycolor.update_sky_color({object})
|
||||
end,
|
||||
|
@ -1356,7 +1352,7 @@ minetest.register_globalstep(function(dtime)
|
|||
potions_set_hud(object)
|
||||
else
|
||||
local ent = object:get_luaentity()
|
||||
if ent and ent._mcl_potions then
|
||||
if ent then
|
||||
ent._mcl_potions["_EF_"..name] = nil
|
||||
end
|
||||
end
|
||||
|
@ -1371,7 +1367,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
else
|
||||
local ent = object:get_luaentity()
|
||||
if ent and ent._mcl_potions then
|
||||
if ent then
|
||||
ent._mcl_potions["_EF_"..name] = EF[name][object]
|
||||
end
|
||||
end
|
||||
|
@ -1529,11 +1525,6 @@ function mcl_potions._load_player_effects(player)
|
|||
local loaded = minetest.deserialize(meta:get_string("mcl_potions:_EF_"..name))
|
||||
if loaded then
|
||||
EF[name][player] = loaded
|
||||
end
|
||||
if EF[name][player] then -- this is needed because of legacy effects loaded separately
|
||||
if effect.uses_factor and type(EF[name][player].factor) ~= "number" then
|
||||
EF[name][player].factor = effect.level_to_factor(1)
|
||||
end
|
||||
if effect.on_load then
|
||||
effect.on_load(player, EF[name][player].factor)
|
||||
end
|
||||
|
@ -1551,9 +1542,6 @@ function mcl_potions._load_entity_effects(entity)
|
|||
local loaded = entity._mcl_potions["_EF_"..name]
|
||||
if loaded then
|
||||
EF[name][object] = loaded
|
||||
if effect.uses_factor and not loaded.factor then
|
||||
EF[name][object].factor = effect.level_to_factor(1)
|
||||
end
|
||||
if effect.on_load then
|
||||
effect.on_load(object, EF[name][object].factor)
|
||||
end
|
||||
|
@ -1792,14 +1780,9 @@ end
|
|||
local function target_valid(object, name)
|
||||
if not object or object:get_hp() <= 0 then return false end
|
||||
|
||||
-- Don't apply effects to anything other than players and entities that have mcl_potions support
|
||||
-- but are not bosses
|
||||
local entity = object:get_luaentity()
|
||||
if not object:is_player() and (not entity or entity.is_boss or not entity._mcl_potions) then
|
||||
return false
|
||||
end
|
||||
if entity and entity.is_boss then return false end
|
||||
|
||||
-- Check resistances
|
||||
for i=1, #registered_res_predicates do
|
||||
if registered_res_predicates[i](object, name) then return false end
|
||||
end
|
||||
|
|
|
@ -841,22 +841,20 @@ local function replace_legacy_potion(itemstack)
|
|||
end
|
||||
local compat = "mcl_potions:compat_potion"
|
||||
local compat_arrow = "mcl_potions:compat_arrow"
|
||||
local compat_def = {
|
||||
description = S("Unknown Potion") .. "\n" .. minetest.colorize("#ff0", S("Right-click to identify")),
|
||||
minetest.register_craftitem(compat, {
|
||||
description = S("Unknown Potion"),
|
||||
_tt_help = S("Right-click to identify"),
|
||||
image = "mcl_potions_potion_overlay.png^[colorize:#00F:127^mcl_potions_potion_bottle.png^vl_unknown.png",
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
on_secondary_use = replace_legacy_potion,
|
||||
on_place = replace_legacy_potion,
|
||||
}
|
||||
local compat_arrow_def = {
|
||||
description = S("Unknown Tipped Arrow") .. "\n" .. minetest.colorize("#ff0", S("Right-click to identify")),
|
||||
})
|
||||
minetest.register_craftitem(compat_arrow, {
|
||||
description = S("Unknown Tipped Arrow"),
|
||||
_tt_help = S("Right-click to identify"),
|
||||
image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:#FFF:100)^vl_unknown.png",
|
||||
groups = {not_in_creative_inventory = 1},
|
||||
on_secondary_use = replace_legacy_potion,
|
||||
on_place = replace_legacy_potion,
|
||||
}
|
||||
minetest.register_craftitem(compat, compat_def)
|
||||
minetest.register_craftitem(compat_arrow, compat_arrow_def)
|
||||
})
|
||||
|
||||
local old_potions_plus = {
|
||||
"fire_resistance", "water_breathing", "invisibility", "regeneration", "poison",
|
||||
|
@ -868,14 +866,14 @@ local old_potions_2 = {
|
|||
}
|
||||
|
||||
for _, name in pairs(old_potions_2) do
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_2", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_2_splash", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_2_lingering", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_2_arrow", compat_arrow_def)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_2", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_2_splash", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_2_lingering", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_2_arrow", compat_arrow)
|
||||
end
|
||||
for _, name in pairs(old_potions_plus) do
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_plus", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_splash", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_lingering", compat_def)
|
||||
minetest.register_craftitem("mcl_potions:" .. name .. "_plus_arrow", compat_arrow_def)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_plus", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_plus_splash", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_plus_lingering", compat)
|
||||
minetest.register_alias("mcl_potions:" .. name .. "_plus_arrow", compat_arrow)
|
||||
end
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 317 B |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue