My mod changes/patches update
|
@ -1 +1,2 @@
|
|||
buildscripts export-ignore
|
||||
buildscripts export-ignore
|
||||
my_changes export-ignore
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
LIB="$(realpath $(dirname $0))" # Absolute path
|
||||
PROJ="$(dirname $LIB)" # Game dir (..)
|
||||
SRC="$PROJ"/../my_changes/ # My changes dir
|
||||
SRC="$PROJ"/my_changes/ # My changes dir
|
||||
DST="$PROJ"/mods/ # Game mods dir
|
||||
#echo $LIB
|
||||
#echo $PROJ
|
||||
|
@ -38,7 +38,7 @@ MOD_PATCH=( ) #patch names
|
|||
#MOD_PATCHES - all patches defined
|
||||
#MOD_PATCHES - first is path and all patch names are separeted by ":"
|
||||
#MOD_PATCHES=("mobs/water_life:poison.patch" "buildings/doors:doors_update.patch" "player/3d_armor:mob_damage.patch" "player/hbsprint:no_damage.patch" "player/hunger_ng:effects.patch")
|
||||
MOD_PATCHES=("buildings/doors:doors_update.patch" "buildings/doors:doors_update54.patch" "buildings/ts_doors:ts_doors_update54.patch" "player/hbsprint:no_damage.patch" "mobs/mobs_mobkit/water_life:poison.patch" "mobs/mobs_mobkit/water_life:poison_hunger_ng.patch" "buildings/mg_villages:villages.patch" "player/fire_plus:extend_fire.patch" "mobs/mobs_mobs/advanced_npc:adv_npc_log.patch" "mobs/mobs_mobs/advanced_npc:bugtrade184.patch" "mobs/mobs_mobs/mg_villages_npc:bug.patch" "mobs/mobs_mobs/mg_villages_npc:patch_log.patch")
|
||||
MOD_PATCHES=("buildings/doors:doors_update.patch" "buildings/doors:doors_update54.patch" "buildings/ts_doors:ts_doors_update54.patch" "player/hbsprint:no_damage.patch" "mobs/mobs_mobkit/water_life:poison.patch" "mobs/mobs_mobkit/water_life:poison_hunger_ng.patch" "buildings/mg_villages:villages.patch" "player/fire_plus:extend_fire.patch" "mobs/mobs_mobs/advanced_npc:adv_npc_log.patch" "mobs/mobs_mobs/advanced_npc:bugtrade184.patch" "mobs/mobs_mobs/mg_villages_npc:bug.patch" "mobs/mobs_mobs/mg_villages_npc:patch_log.patch" "gui/i3:progressive_creative.patch")
|
||||
#"mobs/mobs_mobs/goblins:goblins_nil.patch"
|
||||
|
||||
#MOD_PATCHES=( )
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
License of my media (textures, sounds, ...)
|
||||
-------------------------------------------
|
||||
https://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
License of my source code
|
||||
-------------------------
|
||||
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
or mod licence
|
|
@ -0,0 +1,28 @@
|
|||
diff --git a/cooling_lava.lua b/cooling_lava.lua
|
||||
index 035c4fd..c57da0a 100644
|
||||
--- a/cooling_lava.lua
|
||||
+++ b/cooling_lava.lua
|
||||
@@ -221,4 +221,21 @@ minetest.register_abm({
|
||||
action = function(...)
|
||||
cool_lava_source(...)
|
||||
end,
|
||||
-})
|
||||
\ No newline at end of file
|
||||
+})
|
||||
+
|
||||
+-- new water types to work with lava cooling
|
||||
+dynamic_liquid.add_to_water_nodes = function(new_source, new_flowing)
|
||||
+ -- Flowing liquid
|
||||
+ table.insert(dynamic_lava_flowing_destroys, new_flowing)
|
||||
+ table.insert(dynamic_lava_source_destroys, new_flowing)
|
||||
+
|
||||
+ table.insert(all_flowing_nodes, new_flowing)
|
||||
+ table.insert(all_source_nodes, new_flowing)
|
||||
+
|
||||
+ --Source liquid
|
||||
+ table.insert(dynamic_lava_source_destroys, new_source)
|
||||
+ table.insert(dynamic_cools_lava_flowing, new_source)
|
||||
+ table.insert(dynamic_cools_lava_source, new_source)
|
||||
+
|
||||
+ table.insert(all_source_nodes, new_source)
|
||||
+end
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/init.lua b/init.lua
|
||||
index d329d0f..7a82145 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -147,7 +147,8 @@ local api_functions = {
|
||||
attributes = hunger_ng.attributes,
|
||||
translator = hunger_ng.configuration.translator,
|
||||
get_data = hunger_ng.functions.get_data,
|
||||
- set_data = hunger_ng.functions.set_data
|
||||
+ set_data = hunger_ng.functions.set_data,
|
||||
+ effects = hunger_ng.effects,
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
-- Exit if damage is not enabled and create dummy functions so mods using the
|
||||
-- API do not crash the server.
|
||||
if not minetest.is_yes(minetest.settings:get('enable_damage')) then
|
||||
local info = 'Hunger NG is disabled because damage is disabled.'
|
||||
|
||||
local call = function (function_name)
|
||||
minetest.log('warning', ('+m tried to use +f but +i'):gsub('%+%a+', {
|
||||
['+m'] = minetest.get_current_modname(),
|
||||
['+f'] = 'hunger_ng.'..function_name..'()',
|
||||
['+i'] = info
|
||||
}))
|
||||
end
|
||||
|
||||
hunger_ng = {
|
||||
add_hunger_data = function () call('add_hunger_data') end,
|
||||
alter_hunger = function () call('alter_hunger') end,
|
||||
configure_hunger = function () call('configure_hunger') end,
|
||||
get_hunger_information = function () call('get_hunger_information') end
|
||||
}
|
||||
|
||||
minetest.log('info', '[hunger_ng] '..info)
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- Paths for later use
|
||||
local modpath = minetest.get_modpath('hunger_ng')..DIR_DELIM
|
||||
local worldpath = minetest.get_worldpath()..DIR_DELIM
|
||||
local configpath = worldpath..'_hunger_ng'..DIR_DELIM..'hunger_ng_settings.conf'
|
||||
|
||||
|
||||
-- World-specific configuration interface for use in the get function
|
||||
local worldconfig = Settings(configpath)
|
||||
|
||||
|
||||
-- Wrapper for getting configuration options
|
||||
--
|
||||
-- The function automatically prefixes the given setting with `hunger_ng_` and
|
||||
-- returns the requested setting from one of the three sources.
|
||||
--
|
||||
-- 1. world-specific `./worlds/worldname/_hunger_ng/hunger_ng.conf` file
|
||||
-- 2. default `minetest.conf` file
|
||||
-- 3. the given default value
|
||||
--
|
||||
-- If 1. is found then it will be returned from there. If 2. is found then it
|
||||
-- will be returned from there and after that it will be returned using 3.
|
||||
--
|
||||
-- @param setting The unprefixed setting name
|
||||
-- @param default The default value if the setting is not found
|
||||
-- @return string The value for the requested setting
|
||||
local get = function (setting, default)
|
||||
local parameter = 'hunger_ng_'..setting
|
||||
local global_setting = minetest.settings:get(parameter)
|
||||
local world_specific_setting = worldconfig:get(parameter)
|
||||
return world_specific_setting or global_setting or default
|
||||
end
|
||||
|
||||
|
||||
-- Global hunger_ng table that will be used to pass around variables and use
|
||||
-- them later in the game.
|
||||
hunger_ng = {
|
||||
functions = {},
|
||||
food_items = {
|
||||
satiating = 0,
|
||||
starving = 0,
|
||||
healing = 0,
|
||||
injuring = 0,
|
||||
},
|
||||
attributes = {
|
||||
hunger_bar_id = 'hunger_ng:hunger_bar_id',
|
||||
hunger_value = 'hunger_ng:hunger_value',
|
||||
eating_timestamp = 'hunger_ng:eating_timestamp',
|
||||
hunger_disabled = 'hunger_ng:hunger_disabled'
|
||||
},
|
||||
configuration = {
|
||||
debug_mode = minetest.is_yes(get('debug_mode', false)),
|
||||
log_prefix = '[hunger_ng] ',
|
||||
translator = minetest.get_translator('hunger_ng')
|
||||
},
|
||||
settings = {
|
||||
hunger_bar = {
|
||||
image = get('hunger_bar_image', 'hunger_ng_builtin_bread_icon.png'),
|
||||
use = minetest.is_yes(get('use_hunger_bar', true))
|
||||
},
|
||||
timers = {
|
||||
heal = tonumber(get('timer_heal', 5)),
|
||||
starve = tonumber(get('timer_starve', 10)),
|
||||
basal_metabolism = tonumber(get('timer_basal_metabolism', 60)),
|
||||
movement = tonumber(get('timer_movement', 0.5))
|
||||
},
|
||||
hunger = {
|
||||
timeout = tonumber(get('hunger_timeout', 0)),
|
||||
persistent = minetest.is_yes(get('hunger_persistent', true)),
|
||||
start_with = tonumber(get('hunger_start_with', 20)),
|
||||
maximum = tonumber(get('hunger_maximum', 20))
|
||||
}
|
||||
},
|
||||
effects = {
|
||||
heal = {
|
||||
above = tonumber(get('heal_above', 16)),
|
||||
amount = tonumber(get('heal_amount', 1))
|
||||
},
|
||||
starve = {
|
||||
below = tonumber(get('starve_below', 1)),
|
||||
amount = tonumber(get('starve_amount', 1)),
|
||||
die = minetest.is_yes(get('starve_die', false))
|
||||
},
|
||||
disabled_attribute = 'hunger_ng:hunger_disabled'
|
||||
},
|
||||
costs = {
|
||||
base = tonumber(get('cost_base', 0.1)),
|
||||
dig = tonumber(get('cost_dig', 0.005)),
|
||||
place = tonumber(get('cost_place', 0.01)),
|
||||
movement = tonumber(get('cost_movement', 0.008))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Load mod parts
|
||||
dofile(modpath..'system'..DIR_DELIM..'hunger_functions.lua')
|
||||
dofile(modpath..'system'..DIR_DELIM..'chat_commands.lua')
|
||||
dofile(modpath..'system'..DIR_DELIM..'timers.lua')
|
||||
dofile(modpath..'system'..DIR_DELIM..'register_on.lua')
|
||||
dofile(modpath..'system'..DIR_DELIM..'add_hunger_data.lua')
|
||||
dofile(modpath..'system'..DIR_DELIM..'interoperability.lua')
|
||||
|
||||
|
||||
-- Log debug mode warning
|
||||
if hunger_ng.configuration.debug_mode then
|
||||
local log_prefix = hunger_ng.configuration.log_prefix
|
||||
minetest.log('warning', log_prefix..'Mod loaded with debug mode enabled!')
|
||||
end
|
||||
|
||||
|
||||
-- Replace the global table used for easy variable access within the mod with
|
||||
-- an API-like global table for other mods to utilize.
|
||||
local api_functions = {
|
||||
add_hunger_data = hunger_ng.functions.add_hunger_data,
|
||||
alter_hunger = hunger_ng.functions.alter_hunger,
|
||||
configure_hunger = hunger_ng.functions.configure_hunger,
|
||||
get_hunger_information = hunger_ng.functions.get_hunger_information,
|
||||
hunger_bar_image = hunger_ng.settings.hunger_bar.image,
|
||||
food_items = hunger_ng.food_items,
|
||||
interoperability = {
|
||||
settings = hunger_ng.settings,
|
||||
attributes = hunger_ng.attributes,
|
||||
translator = hunger_ng.configuration.translator,
|
||||
get_data = hunger_ng.functions.get_data,
|
||||
set_data = hunger_ng.functions.set_data,
|
||||
effects = hunger_ng.effects,
|
||||
}
|
||||
}
|
||||
|
||||
hunger_ng = api_functions
|
|
@ -0,0 +1,88 @@
|
|||
|
||||
water_life.playerhud = {}
|
||||
water_life.playerhud.poison = {}
|
||||
water_life.playerhud.repellant = {}
|
||||
|
||||
|
||||
|
||||
water_life.hud_poison = {
|
||||
|
||||
hud_elem_type = "image",
|
||||
|
||||
position = {x=0.5, y=0.8},
|
||||
-- Left corner position of element
|
||||
|
||||
name = "water_life_poison",
|
||||
|
||||
scale = {x = 0.1, y = 0.1},
|
||||
|
||||
text = "water_life_emptyhud.png",
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
water_life.hud_repellant = {
|
||||
hud_elem_type = "image",
|
||||
|
||||
position = {x=0.55, y=0.8},
|
||||
-- Left corner position of element
|
||||
|
||||
name = "water_life_repellant",
|
||||
|
||||
scale = {x = 0.1, y = 0.1},
|
||||
|
||||
text = "water_life_emptyhud.png",
|
||||
}
|
||||
|
||||
|
||||
function water_life.change_hud(player,selection,switch)
|
||||
local value = ""
|
||||
if not player then return end
|
||||
if not selection then selection = "poison" end
|
||||
if not switch then switch = 1 end
|
||||
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if selection == "poison" then
|
||||
if switch == 1 then value = "water_life_poison.png" else value = "water_life_emptyhud.png" end
|
||||
player:hud_change(water_life.playerhud.poison[name], "text", value)
|
||||
end
|
||||
|
||||
if selection == "repellant" then
|
||||
if switch == 1 then value = "water_life_repellanthud.png" else value = "water_life_emptyhud.png" end
|
||||
player:hud_change(water_life.playerhud.repellant[name], "text", value)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not player then return end
|
||||
|
||||
local meta=player:get_meta()
|
||||
meta:set_int("repellant",0)
|
||||
local name = player:get_player_name()
|
||||
|
||||
water_life.playerhud.poison[name] = player:hud_add(water_life.hud_poison)
|
||||
water_life.playerhud.repellant[name] = player:hud_add(water_life.hud_repellant)
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
minetest.after(5, function(player)
|
||||
water_life.change_hud(player,"poison")
|
||||
end, player)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
if not player then return end
|
||||
if water_life.poison_after_death then return end
|
||||
|
||||
local meta=player:get_meta()
|
||||
meta:set_int("snakepoison",0)
|
||||
water_life.change_hud(player,"poison",0)
|
||||
end)
|
|
@ -0,0 +1,394 @@
|
|||
local timer = 0
|
||||
local landtimer = 0
|
||||
local pi = math.pi
|
||||
local random = water_life.random
|
||||
local landinterval = 60 -- check every 60 seconds for spawnpos on land
|
||||
local waterinterval = 20 -- check every 20 seconds for spawnpos in water
|
||||
|
||||
|
||||
local function getcount(name)
|
||||
if not name then
|
||||
return 0
|
||||
else
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function spawnstep(dtime)
|
||||
|
||||
timer = timer + dtime
|
||||
landtimer = landtimer + dtime
|
||||
|
||||
if timer > waterinterval then
|
||||
|
||||
for _,plyr in ipairs(minetest.get_connected_players()) do
|
||||
|
||||
local toomuch = false
|
||||
|
||||
if plyr and plyr:is_player() and plyr:get_pos().y > -50 and plyr:get_pos().y < 150 then -- each player gets a spawn chance every 10s on average
|
||||
|
||||
local pos = plyr:get_pos()
|
||||
local yaw = plyr:get_look_horizontal()
|
||||
local animal = water_life.count_objects(pos)
|
||||
local meta = plyr:get_meta()
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
poison_value = 1 --defautl poison value
|
||||
local pl_name=plyr:get_player_name() -- player name
|
||||
local hunger_ng_infos = hunger_ng.get_hunger_information(pl_name) -- information from hunger_ng
|
||||
--minetest.log(dump(hunger_ng_infos))
|
||||
local hunger_ng_interoper = hunger_ng.interoperability
|
||||
--minetest.log(dump(hunger_ng_interoper))
|
||||
-- if healing is enabled, then add healing to poison value
|
||||
-- if the same you have the chance to survive if you stay satiated
|
||||
if hunger_ng_infos.effects.healing then
|
||||
poison_value = ((waterinterval/hunger_ng_interoper.settings.timers.heal)*hunger_ng_interoper.effects.heal.amount) + 0.1 --+ poison_value -- if you want decrease healt even with healing
|
||||
end
|
||||
minetest.log("Poison: "..dump(poison_value))
|
||||
|
||||
local score = plyr:get_hp()-poison_value
|
||||
--if score < 0 then score = 0 end
|
||||
minetest.log("Health: "..dump(score))
|
||||
plyr:set_hp(score)
|
||||
end
|
||||
|
||||
if meta:get_int("repellant") > 0 then
|
||||
if math.floor(os.clock()) - meta:get_int("repellant") > water_life.repeltime then
|
||||
water_life.change_hud(plyr,"repellant",0)
|
||||
meta:set_int("repellant",0)
|
||||
end
|
||||
end
|
||||
|
||||
if animal.all > water_life.maxmobs then toomuch = true end
|
||||
|
||||
-- find a pos randomly in look direction of player
|
||||
local radius = (water_life.abr * 12) -- 75% from 16 = 12 nodes
|
||||
radius = random(7,radius) -- not nearer than 7 nodes in front of player
|
||||
local angel = math.rad(random(75)) -- look for random angel 0 - 75 degrees
|
||||
if water_life.leftorright() then yaw = yaw + angel else yaw = yaw - angel end -- add or substract to/from yaw
|
||||
|
||||
local pos2 = mobkit.pos_translate2d(pos,yaw,radius) -- calculate position
|
||||
local depth, stype, surface = water_life.water_depth(pos2,25) -- get surface pos and water depth
|
||||
local bdata = water_life_get_biome_data(pos2) -- get biome data at spawn position
|
||||
local ground = {}
|
||||
local dalam = depth
|
||||
local landpos = nil
|
||||
local geckopos = nil
|
||||
local moskitopos = nil
|
||||
|
||||
-- no need of so many postions on land
|
||||
if landtimer > landinterval then
|
||||
landpos = water_life.find_node_under_air(pos2)
|
||||
geckopos = water_life.find_node_under_air(pos2,5,{"group:tree","group:leaves","default:junglegrass"})
|
||||
moskitopos = water_life.find_node_under_air(pos2,5,{"default:river_water_source","water_life:muddy_river_water_source","group:flora","default:dirt_with_rainforest_litter"})
|
||||
end
|
||||
|
||||
|
||||
if moskitopos and not water_life.dangerous then
|
||||
local mlevel = minetest.get_node_light(moskitopos)
|
||||
local ptime = water_life.get_game_time()
|
||||
local mdata = water_life_get_biome_data(moskitopos)
|
||||
--minetest.chat_send_all("MOSKITO: "..dump(moskitopos).." : "..dump(mdata.temp).." : "..dump(ptime).." : "..dump(mlevel))
|
||||
|
||||
if ((ptime and ptime > 2) or mlevel < 8) and mdata.temp > 16 then --from 3pm to 5am or in shadows all day long
|
||||
|
||||
minetest.set_node(moskitopos, {name = "water_life:moskito"})
|
||||
minetest.get_node_timer(moskitopos):start(random(15,45))
|
||||
local pmeta = minetest.get_meta(moskitopos)
|
||||
pmeta:set_int("mlife",math.floor(os.clock()))
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--some spawn on land, too
|
||||
|
||||
if landpos then
|
||||
local landdata = water_life_get_biome_data(landpos)
|
||||
|
||||
|
||||
if not water_life.dangerous then
|
||||
-- the snake
|
||||
local mobname = 'water_life:snake'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50)
|
||||
if random(100) < faktor then
|
||||
local fits = minetest.is_protected(landpos,mobname)
|
||||
--minetest.chat_send_all(dump(fits))
|
||||
|
||||
if (string.match(landdata.name,"desert") or string.match(landdata.name,"savanna"))
|
||||
and not fits and landdata.temp > 15 then
|
||||
|
||||
local obj=minetest.add_entity(landpos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
--the beaver
|
||||
local mobname = 'water_life:beaver'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 25)
|
||||
if random(100) < faktor then
|
||||
|
||||
if string.match(landdata.name,"coniferous") and landdata.temp > -5 and landdata.temp < 20 then
|
||||
|
||||
local obj=minetest.add_entity(landpos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if geckopos then
|
||||
local landdata = water_life_get_biome_data(geckopos)
|
||||
|
||||
local mobname = 'water_life:gecko'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50)
|
||||
if random(100) < faktor then
|
||||
|
||||
|
||||
if (string.match(landdata.name,"rainforest") or string.match(landdata.name,"savanna"))
|
||||
and landdata.temp > 20 then
|
||||
|
||||
local obj=minetest.add_entity(geckopos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--water spawn
|
||||
|
||||
if depth and depth > 0 then
|
||||
if water_life.radar_debug then
|
||||
water_life.temp_show(surface,9,5)
|
||||
minetest.chat_send_all(">>> Depth ="..dump(depth).." <<< "..dump(stype))
|
||||
minetest.chat_send_all(dump(bdata.name))
|
||||
end
|
||||
pos2 = surface
|
||||
|
||||
end
|
||||
|
||||
local liquidflag = nil
|
||||
|
||||
if stype == "default:water_source" then
|
||||
liquidflag = "sea"
|
||||
|
||||
elseif stype == "default:river_water_source" then
|
||||
liquidflag = "river"
|
||||
|
||||
elseif stype == "water_life:muddy_river_water_source" then
|
||||
liquidflag = "muddy"
|
||||
|
||||
end
|
||||
|
||||
if liquidflag and not toomuch and surface then
|
||||
ground = mobkit.pos_shift(surface,{y=(dalam*-1)})
|
||||
|
||||
|
||||
if not water_life.dangerous then
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
local mobname = 'water_life:croc'
|
||||
local faktor = 100 - getcount(animal[mobname]) * 33
|
||||
if random(100) < faktor then
|
||||
local fits = false
|
||||
if string.match(bdata.name,"rainforest") or string.match(bdata.name,"savanna") then fits = true end
|
||||
|
||||
if depth < 4 and fits then --shark min water depth
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
|
||||
local mobname = 'water_life:snake'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50) +25
|
||||
if random(100) < faktor then
|
||||
local fits = false
|
||||
if string.match(bdata.name,"desert") or string.match(bdata.name,"savanna") then fits = true end
|
||||
|
||||
if depth < 3 and fits then --snake max water depth
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
local mobname = 'water_life:shark'
|
||||
if water_life.shark_spawn_rate >= random(1000) then
|
||||
|
||||
local bcheck = water_life.count_objects(pos2,12)
|
||||
if getcount(animal[mobname]) < water_life.maxsharks and liquidflag == "sea" and not bcheck["water_life:shark_buoy"]
|
||||
and not animal["water_life:croc"] then
|
||||
|
||||
if depth > 4 then --shark min water depth
|
||||
local obj=minetest.add_entity(mobkit.pos_shift(ground,{y=2}),mobname) -- spawn it 2 nodes above sea ground
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local mobname = "water_life:gull"
|
||||
local faktor = 100 - getcount(animal[mobname]) * 20
|
||||
if random(100) < faktor and liquidflag == "sea" then
|
||||
if depth > 4 then
|
||||
local spawn = mobkit.pos_shift(surface,{y=12})
|
||||
--spawn.y = spawn.y + 12
|
||||
local obj=minetest.add_entity(spawn,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:urchin"
|
||||
if water_life.urchin_spawn_rate >= random(1000) then
|
||||
|
||||
local upos1 = mobkit.pos_shift(ground,{x=-5,y=-2,z=-5})
|
||||
local upos2 = mobkit.pos_shift(ground,{x=5,y=2,z=5})
|
||||
local coraltable = minetest.find_nodes_in_area(upos1, upos2, water_life.urchinspawn)
|
||||
--local nearlife = water_life.count_objects(ground,5,"water_life:urchin")
|
||||
if coraltable and #coraltable > 0 and getcount(animal[mobname]) < 15 and liquidflag == "sea" then
|
||||
local coralpos = coraltable[random(#coraltable)]
|
||||
coralpos.y = coralpos.y +1
|
||||
local node = minetest.get_node(coralpos)
|
||||
|
||||
if node.name == "default:water_source" then
|
||||
local obj= water_life.set_urchin(coralpos) --minetest.add_entity(coralpos,mobname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:clams"
|
||||
if water_life.clams_spawn_rate >= random(1000) then
|
||||
local clpos1 = mobkit.pos_shift(ground,{x=-8, y=-2, z=8})
|
||||
local clpos2 = mobkit.pos_shift(ground,{x=8, y=2, z=8})
|
||||
local coraltable = minetest.find_nodes_in_area(clpos1, clpos2, water_life.clams_spawn)
|
||||
----minetest.chat_send_all("seagrass ="..dump(#coraltable))
|
||||
local nearlife = water_life.count_objects(ground,8,"water_life:clams")
|
||||
if coraltable and #coraltable > 0 and getcount(animal[mobname]) < 10 and liquidflag == "sea" then
|
||||
local coralpos = mobkit.pos_shift(coraltable[random(#coraltable)],{y=1})
|
||||
|
||||
local node = minetest.get_node(coralpos)
|
||||
if node.name == "default:water_source" then
|
||||
local obj= water_life.set_urchin(coralpos,"water_life:clams")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:jellyfish"
|
||||
|
||||
|
||||
local faktor = 100 - getcount(animal[mobname]) * 20
|
||||
if random(100) < faktor and liquidflag == "sea" and depth > 2 then
|
||||
local obj=minetest.add_entity(mobkit.pos_shift(ground,{y=2}),mobname)
|
||||
end
|
||||
|
||||
|
||||
mobname = "water_life:coralfish"
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
local cfpos1 = mobkit.pos_shift(ground,{x=-5,y=-2,z=-5})
|
||||
local cfpos2 = mobkit.pos_shift(ground,{x=5,y=2,z=5})
|
||||
local coraltable = minetest.find_nodes_in_area(cfpos1,cfpos2,water_life.urchinspawn)
|
||||
--local nearlife = water_life.count_objects(ground,nil,mobname)
|
||||
faktor = 100 - getcount(animal[mobname]) * 6.66
|
||||
if random(100) < faktor and liquidflag == "sea" and #coraltable > 1 then
|
||||
local cfish = coraltable[random(#coraltable)]
|
||||
cfish.y = cfish.y +1
|
||||
local maxfish = random(3,7)
|
||||
for i = 1,maxfish,1 do
|
||||
local obj=minetest.add_entity(cfish,mobname)
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.base = cfish
|
||||
entity.head = random(65535)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:clownfish"
|
||||
|
||||
faktor = 100 - getcount(animal[mobname]) * 50
|
||||
if random(100) < faktor and liquidflag == "sea" and #coraltable > 1 then
|
||||
local cfish = coraltable[random(#coraltable)]
|
||||
cfish.y = cfish.y +1
|
||||
local obj=minetest.add_entity(cfish,mobname)
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.base = cfish
|
||||
end
|
||||
end
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = 'water_life:fish'
|
||||
--local nearlife = water_life.count_objects(pos2,24,"water_life:piranha")
|
||||
if water_life.fish_spawn_rate >= random(1000) and ((animal.all < (water_life.maxmobs-5)) or getcount(animal[mobname]) < 5) and (liquidflag == "river" or liquidflag == "muddy") then
|
||||
|
||||
local table = minetest.get_biome_data(pos)
|
||||
|
||||
if not water_life.dangerous and table and water_life.piranha_biomes[minetest.get_biome_name(table.biome)] then
|
||||
mobname = "water_life:piranha"
|
||||
end
|
||||
|
||||
if depth > 2 then -- min water depth for piranha and riverfish
|
||||
if mobname == "water_life:fish" then
|
||||
local obj=minetest.add_entity(pos2,mobname) -- ok spawn it already damnit
|
||||
else
|
||||
if getcount(animal[mobname]) < 10 then
|
||||
for i = 1,3,1 do
|
||||
local obj=minetest.add_entity(pos2,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
mobname = 'water_life:whale'
|
||||
if water_life.whale_spawn_rate >= random(1000) and getcount(animal[mobname]) < (water_life.maxwhales) and liquidflag == "sea" then
|
||||
|
||||
|
||||
if depth > 8 then -- min water depth for whales
|
||||
|
||||
local gotwhale = true
|
||||
local whpos = mobkit.pos_shift(surface,{y=-3})
|
||||
for i = 0,3,1 do
|
||||
local whpos2 = mobkit.pos_translate2d(whpos,math.rad(i*90),30)
|
||||
local under = water_life.find_collision(whpos,whpos2, false)
|
||||
----minetest.chat_send_all(dump(under))
|
||||
if under and under < 25 then
|
||||
gotwhale = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if gotwhale then local obj=minetest.add_entity(surface,mobname) end -- ok spawn it already damnit
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
timer = 0
|
||||
if landtimer > landinterval then landtimer = 0 end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
minetest.register_globalstep(spawnstep)
|
|
@ -0,0 +1,77 @@
|
|||
diff --git a/hud.lua b/hud.lua
|
||||
index bff0dd4..4ed006a 100644
|
||||
--- a/hud.lua
|
||||
+++ b/hud.lua
|
||||
@@ -78,4 +78,11 @@ minetest.register_on_joinplayer(function(player)
|
||||
|
||||
end)
|
||||
|
||||
+minetest.register_on_dieplayer(function(player)
|
||||
+ if not player then return end
|
||||
+ if water_life.poison_after_death then return end
|
||||
|
||||
+ local meta=player:get_meta()
|
||||
+ meta:set_int("snakepoison",0)
|
||||
+ water_life.change_hud(player,"poison",0)
|
||||
+end)
|
||||
diff --git a/init.lua b/init.lua
|
||||
index f92c3c3..97833b3 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -31,6 +31,7 @@ water_life.moskitolifetime = tonumber(minetest.settings:get("water_life_moskitol
|
||||
water_life.radar_debug = minetest.settings:get_bool("water_life_radar_debug") or false
|
||||
water_life.muddy_water = minetest.settings:get_bool("water_life_muddy_water") or false
|
||||
water_life.repeltime = math.floor (720 / (tonumber(minetest.settings:get("time_speed")) or 72)*60) -- the repellent lasts half a minetest day
|
||||
+water_life.poison_after_death = minetest.settings:get_bool("water_life_poison_after_death") or false
|
||||
|
||||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
diff --git a/settingtypes.txt b/settingtypes.txt
|
||||
index 24bb049..4eb03f3 100644
|
||||
--- a/settingtypes.txt
|
||||
+++ b/settingtypes.txt
|
||||
@@ -62,3 +62,7 @@ water_life_muddy_water (muddy water in rainforest and savanna biome) bool false
|
||||
#-
|
||||
# turn this value to true to see api function debug
|
||||
water_life_radar_debug (api function debug shown in chat) bool false
|
||||
+
|
||||
+#
|
||||
+# Turn this Value to true, if you want poison to persist after death
|
||||
+water_life_poison_after_death (Poison stays after death) bool false
|
||||
diff --git a/spawn.lua b/spawn.lua
|
||||
index e6cef07..d2653f9 100644
|
||||
--- a/spawn.lua
|
||||
+++ b/spawn.lua
|
||||
@@ -35,8 +35,25 @@ local function spawnstep(dtime)
|
||||
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
- local score = plyr:get_hp()
|
||||
- plyr:set_hp(score-1)
|
||||
+ --local score = plyr:get_hp()
|
||||
+ --plyr:set_hp(score-1)
|
||||
+ poison_value = 1 --defautl poison value
|
||||
+ local pl_name=plyr:get_player_name() -- player name
|
||||
+ local hunger_ng_infos = hunger_ng.get_hunger_information(pl_name) -- information from hunger_ng
|
||||
+ --minetest.log(dump(hunger_ng_infos))
|
||||
+ local hunger_ng_interoper = hunger_ng.interoperability
|
||||
+ --minetest.log(dump(hunger_ng_interoper))
|
||||
+ -- if healing is enabled, then add healing to poison value
|
||||
+ -- if the same you have the chance to survive if you stay satiated
|
||||
+ if hunger_ng_infos.effects.healing then
|
||||
+ poison_value = ((waterinterval/hunger_ng_interoper.settings.timers.heal)*hunger_ng_interoper.effects.heal.amount) + 0.1 --+ poison_value -- if you want decrease healt even with healing
|
||||
+ end
|
||||
+ --minetest.log("Poison: "..dump(poison_value))
|
||||
+
|
||||
+ local score = plyr:get_hp()-poison_value
|
||||
+ --if score < 0 then score = 0 end
|
||||
+ --minetest.log("Health: "..dump(score))
|
||||
+ plyr:set_hp(score)
|
||||
end
|
||||
|
||||
if meta:get_int("repellant") > 0 then
|
||||
@@ -378,4 +395,3 @@ end
|
||||
|
||||
|
||||
minetest.register_globalstep(spawnstep)
|
||||
-
|
|
@ -0,0 +1,40 @@
|
|||
diff --git a/hud.lua b/hud.lua
|
||||
index bff0dd4..9635342 100644
|
||||
--- a/hud.lua
|
||||
+++ b/hud.lua
|
||||
@@ -78,4 +78,11 @@ minetest.register_on_joinplayer(function(player)
|
||||
|
||||
end)
|
||||
|
||||
+minetest.register_on_dieplayer(function(player)
|
||||
+ if not player then return end
|
||||
+ if water_life.poison_after_death then return end
|
||||
|
||||
+ local meta=player:get_meta()
|
||||
+ meta:set_int("snakepoison",0)
|
||||
+ water_life.change_hud(player,"poison",0)
|
||||
+end)
|
||||
diff --git a/init.lua b/init.lua
|
||||
index 0e4fd8a..7c32a0b 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -31,6 +31,7 @@ water_life.moskitolifetime = tonumber(minetest.settings:get("water_life_moskitol
|
||||
water_life.radar_debug = minetest.settings:get_bool("water_life_radar_debug") or false
|
||||
water_life.muddy_water = minetest.settings:get_bool("water_life_muddy_water") or false
|
||||
water_life.repeltime = math.floor (720 / (tonumber(minetest.settings:get("time_speed")) or 72)*60) -- the repellent lasts half a minetest day
|
||||
+water_life.poison_after_death = minetest.settings:get_bool("water_life_poison_after_death") or false
|
||||
|
||||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
diff --git a/settingtypes.txt b/settingtypes.txt
|
||||
index 24bb049..4eb03f3 100644
|
||||
--- a/settingtypes.txt
|
||||
+++ b/settingtypes.txt
|
||||
@@ -62,3 +62,7 @@ water_life_muddy_water (muddy water in rainforest and savanna biome) bool false
|
||||
#-
|
||||
# turn this value to true to see api function debug
|
||||
water_life_radar_debug (api function debug shown in chat) bool false
|
||||
+
|
||||
+#
|
||||
+# Turn this Value to true, if you want poison to persist after death
|
||||
+water_life_poison_after_death (Poison stays after death) bool false
|
|
@ -0,0 +1,72 @@
|
|||
diff --git a/README.txt b/README.txt
|
||||
index 79320a1..a1eec4f 100644
|
||||
--- a/README.txt
|
||||
+++ b/README.txt
|
||||
@@ -173,8 +173,9 @@ Minetest 0.4.15+ required
|
||||
Installation
|
||||
----------------------
|
||||
|
||||
- 1) Unzip the archive into the mods directory of your game.
|
||||
- 2) Rename the doors-master directory to "doors".
|
||||
+ 1) Backup the original "doors" mod to a safe location.
|
||||
+ 2) Unzip the archive into the mods directory of your game.
|
||||
+ 3) Rename the doors-master directory to "doors".
|
||||
|
||||
Source code license
|
||||
----------------------------------------------------------
|
||||
diff --git a/api.lua b/api.lua
|
||||
index d7685bd..1a822da 100644
|
||||
--- a/api.lua
|
||||
+++ b/api.lua
|
||||
@@ -1,5 +1,5 @@
|
||||
--------------------------------------------------------
|
||||
--- Minetest :: Doors Redux Mod v1.1 (doors)
|
||||
+-- Minetest :: Doors Redux Mod (doors)
|
||||
--
|
||||
-- See README.txt for licensing and other information.
|
||||
-- Copyright (c) 2016-2020, Leslie E. Krause
|
||||
@@ -972,3 +972,9 @@ minetest.register_craft( {
|
||||
{ "default:steel_ingot" },
|
||||
}
|
||||
} )
|
||||
+
|
||||
+-- compatibility for Minetest S3 engine
|
||||
+
|
||||
+if not vector.offset_y or not minetest.get_node_above then
|
||||
+ dofile( minetest.get_modpath( "doors" ) .. "/compatibility.lua" )
|
||||
+end
|
||||
diff --git a/init.lua b/init.lua
|
||||
index 647191b..e6ceffd 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -193,7 +193,9 @@ doors.register_door( "doors:door_mansion1", {
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
{ "group:wood", "group:wood", "dye:white" },
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
- }
|
||||
+ },
|
||||
+ is_lockable = true,
|
||||
+ is_closable = true,
|
||||
} )
|
||||
|
||||
doors.register_door( "doors:door_mansion2", {
|
||||
@@ -205,7 +207,9 @@ doors.register_door( "doors:door_mansion2", {
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
{ "group:wood", "group:wood", "dye:black" },
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
- }
|
||||
+ },
|
||||
+ is_lockable = true,
|
||||
+ is_closable = true,
|
||||
} )
|
||||
|
||||
doors.register_door( "doors:door_steel", {
|
||||
@@ -261,7 +265,7 @@ doors.register_door( "doors:door_dungeon2", {
|
||||
} )
|
||||
|
||||
doors.register_door( "doors:door_steelpanel1", {
|
||||
- tiles = {{ name = "doors_door_steelpanel.png", backface_culling = true}},
|
||||
+ tiles = {{ name = "doors_door_steelpanel1.png", backface_culling = true}},
|
||||
description = "Steel Colonial Door",
|
||||
inventory_image = "doors_item_steelpanel1.png",
|
||||
protected = true,
|
|
@ -0,0 +1,281 @@
|
|||
diff --git a/api.lua b/api.lua
|
||||
index 1a822da..9ef1f43 100644
|
||||
--- a/api.lua
|
||||
+++ b/api.lua
|
||||
@@ -1,5 +1,5 @@
|
||||
--------------------------------------------------------
|
||||
--- Minetest :: Doors Redux Mod (doors)
|
||||
+-- Minetest :: Doors Redux Mod v1.1 (doors)
|
||||
--
|
||||
-- See README.txt for licensing and other information.
|
||||
-- Copyright (c) 2016-2020, Leslie E. Krause
|
||||
@@ -23,6 +23,7 @@ doors.ADJUST_LOCKING = 1
|
||||
doors.ADJUST_CLOSING = 2
|
||||
|
||||
minetest.register_node( "doors:hidden", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Hidden Door Segment",
|
||||
drawtype = "nodebox", -- cannot use air-like, since falling nodes would be stuck
|
||||
paramtype = "light",
|
||||
@@ -972,9 +973,3 @@ minetest.register_craft( {
|
||||
{ "default:steel_ingot" },
|
||||
}
|
||||
} )
|
||||
-
|
||||
--- compatibility for Minetest S3 engine
|
||||
-
|
||||
-if not vector.offset_y or not minetest.get_node_above then
|
||||
- dofile( minetest.get_modpath( "doors" ) .. "/compatibility.lua" )
|
||||
-end
|
||||
diff --git a/init.lua b/init.lua
|
||||
index e6ceffd..8533226 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -18,6 +18,7 @@ dofile( minetest.get_modpath( "doors" ) .. "/api.lua" )
|
||||
|
||||
doors.register_door( "doors:door_wood", {
|
||||
tiles = {{ name = "doors_door_wood.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Wooden Door",
|
||||
inventory_image = "doors_item_wood.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -32,6 +33,7 @@ doors.register_door( "doors:door_wood", {
|
||||
doors.register_door( "doors:door_woodpanel1", {
|
||||
-- Colonial Style (6 panel)
|
||||
tiles = {{ name = "doors_door_woodpanel1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Wooden Colonial Door",
|
||||
inventory_image = "doors_item_woodpanel1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -46,6 +48,7 @@ doors.register_door( "doors:door_woodpanel1", {
|
||||
|
||||
doors.register_door( "doors:door_woodglass1", {
|
||||
tiles = {{ name = "doors_door_woodglass1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Wooden Single-Lite Door",
|
||||
inventory_image = "doors_item_woodglass1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -60,6 +63,7 @@ doors.register_door( "doors:door_woodglass1", {
|
||||
|
||||
doors.register_door( "doors:door_woodglass2", {
|
||||
tiles = {{ name = "doors_door_woodglass2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Wooden Double-Lite Door",
|
||||
inventory_image = "doors_item_woodglass2.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -74,6 +78,7 @@ doors.register_door( "doors:door_woodglass2", {
|
||||
|
||||
doors.register_door( "doors:door_japanese", {
|
||||
tiles = {{ name = "doors_door_japanese.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Japanese Door",
|
||||
inventory_image = "doors_item_japanese.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -88,6 +93,7 @@ doors.register_door( "doors:door_japanese", {
|
||||
|
||||
doors.register_door( "doors:door_french", {
|
||||
tiles = {{ name = "doors_door_french.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "French Door",
|
||||
inventory_image = "doors_item_french.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -102,6 +108,7 @@ doors.register_door( "doors:door_french", {
|
||||
|
||||
doors.register_door( "doors:door_cottage1", {
|
||||
tiles = {{ name = "doors_door_cottage1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Cottage Interior Door",
|
||||
inventory_image = "doors_item_cottage1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -116,6 +123,7 @@ doors.register_door( "doors:door_cottage1", {
|
||||
|
||||
doors.register_door( "doors:door_cottage2", {
|
||||
tiles = {{ name = "doors_door_cottage2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Cottage Exterior Door",
|
||||
inventory_image = "doors_item_cottage2.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -130,6 +138,7 @@ doors.register_door( "doors:door_cottage2", {
|
||||
|
||||
doors.register_door( "doors:door_barn1", {
|
||||
tiles = {{ name = "doors_door_barn1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Barn Interior Door",
|
||||
inventory_image = "doors_item_barn1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -144,6 +153,7 @@ doors.register_door( "doors:door_barn1", {
|
||||
|
||||
doors.register_door( "doors:door_barn2", {
|
||||
tiles = {{ name = "doors_door_barn2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Barn Exterior Door",
|
||||
inventory_image = "doors_item_barn2.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -158,6 +168,7 @@ doors.register_door( "doors:door_barn2", {
|
||||
|
||||
doors.register_door( "doors:door_castle1", {
|
||||
tiles = {{ name = "doors_door_castle1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Castle Interior Door",
|
||||
inventory_image = "doors_item_castle1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -172,6 +183,7 @@ doors.register_door( "doors:door_castle1", {
|
||||
|
||||
doors.register_door( "doors:door_castle2", {
|
||||
tiles = {{ name = "doors_door_castle2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Castle Exterior Door",
|
||||
inventory_image = "doors_item_castle2.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -186,6 +198,7 @@ doors.register_door( "doors:door_castle2", {
|
||||
|
||||
doors.register_door( "doors:door_mansion1", {
|
||||
tiles = {{ name = "doors_door_mansion1.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Mansion Interior Door",
|
||||
inventory_image = "doors_item_mansion1.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -193,13 +206,12 @@ doors.register_door( "doors:door_mansion1", {
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
{ "group:wood", "group:wood", "dye:white" },
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
- },
|
||||
- is_lockable = true,
|
||||
- is_closable = true,
|
||||
+ }
|
||||
} )
|
||||
|
||||
doors.register_door( "doors:door_mansion2", {
|
||||
tiles = {{ name = "doors_door_mansion2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Mansion Exterior Door ",
|
||||
inventory_image = "doors_item_mansion2.png",
|
||||
groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 },
|
||||
@@ -207,13 +219,12 @@ doors.register_door( "doors:door_mansion2", {
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
{ "group:wood", "group:wood", "dye:black" },
|
||||
{ "group:wood", "group:wood", "default:steel_rod" },
|
||||
- },
|
||||
- is_lockable = true,
|
||||
- is_closable = true,
|
||||
+ }
|
||||
} )
|
||||
|
||||
doors.register_door( "doors:door_steel", {
|
||||
tiles = {{ name = "doors_door_steel.png", backface_culling = true}},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Steel Door",
|
||||
inventory_image = "doors_item_steel.png",
|
||||
protected = true,
|
||||
@@ -232,6 +243,7 @@ doors.register_door( "doors:door_steel", {
|
||||
|
||||
doors.register_door( "doors:door_dungeon1", {
|
||||
tiles = {{ name = "doors_door_dungeon1.png", backface_culling = true}},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Dungeon Interior Door",
|
||||
inventory_image = "doors_item_dungeon1.png",
|
||||
protected = true,
|
||||
@@ -249,6 +261,7 @@ doors.register_door( "doors:door_dungeon1", {
|
||||
|
||||
doors.register_door( "doors:door_dungeon2", {
|
||||
tiles = {{ name = "doors_door_dungeon2.png", backface_culling = true}},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Dungeon Exterior Door",
|
||||
inventory_image = "doors_item_dungeon2.png",
|
||||
protected = true,
|
||||
@@ -266,6 +279,7 @@ doors.register_door( "doors:door_dungeon2", {
|
||||
|
||||
doors.register_door( "doors:door_steelpanel1", {
|
||||
tiles = {{ name = "doors_door_steelpanel1.png", backface_culling = true}},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Steel Colonial Door",
|
||||
inventory_image = "doors_item_steelpanel1.png",
|
||||
protected = true,
|
||||
@@ -284,6 +298,7 @@ doors.register_door( "doors:door_steelpanel1", {
|
||||
|
||||
doors.register_door( "doors:door_steelglass1", {
|
||||
tiles = {{ name = "doors_door_steelglass1.png", backface_culling = true}},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Steel Single-Lite Door",
|
||||
inventory_image = "doors_item_steelglass1.png",
|
||||
protected = true,
|
||||
@@ -302,6 +317,7 @@ doors.register_door( "doors:door_steelglass1", {
|
||||
|
||||
doors.register_door( "doors:door_steelglass2", {
|
||||
tiles = {{ name = "doors_door_steelglass2.png", backface_culling = true }},
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Steel Double-Lite Door",
|
||||
inventory_image = "doors_item_steelglass2.png",
|
||||
protected = true,
|
||||
@@ -320,6 +336,7 @@ doors.register_door( "doors:door_steelglass2", {
|
||||
|
||||
doors.register_door( "doors:door_glass", {
|
||||
tiles = { "doors_door_glass.png" },
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Glass Door",
|
||||
inventory_image = "doors_item_glass.png",
|
||||
groups = { cracky = 3, oddly_breakable_by_hand = 3 },
|
||||
@@ -338,6 +355,7 @@ doors.register_door( "doors:door_glass", {
|
||||
|
||||
doors.register_door( "doors:door_obsidian_glass", {
|
||||
tiles = { "doors_door_obsidian_glass.png" },
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Obsidian Glass Door",
|
||||
inventory_image = "doors_item_obsidian_glass.png",
|
||||
groups = { cracky = 3 },
|
||||
@@ -359,6 +377,7 @@ doors.register_door( "doors:door_obsidian_glass", {
|
||||
----------------------------
|
||||
|
||||
doors.register_trapdoor( "doors:trapdoor", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Trapdoor",
|
||||
inventory_image = "doors_trapdoor.png",
|
||||
wield_image = "doors_trapdoor.png",
|
||||
@@ -371,6 +390,7 @@ doors.register_trapdoor( "doors:trapdoor", {
|
||||
} )
|
||||
|
||||
doors.register_trapdoor( "doors:trapdoor_steel", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Steel Trapdoor",
|
||||
inventory_image = "doors_trapdoor_steel.png",
|
||||
wield_image = "doors_trapdoor_steel.png",
|
||||
@@ -409,6 +429,7 @@ minetest.register_craft( {
|
||||
-----------------------------
|
||||
|
||||
doors.register_fencegate( "doors:gate_wood", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Wooden Fence Gate",
|
||||
texture = "default_wood.png",
|
||||
material = "default:wood",
|
||||
@@ -416,6 +437,7 @@ doors.register_fencegate( "doors:gate_wood", {
|
||||
} )
|
||||
|
||||
doors.register_fencegate( "doors:gate_junglewood", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Junglewood Fence Gate",
|
||||
texture = "default_junglewood.png",
|
||||
material = "default:junglewood",
|
||||
@@ -423,6 +445,7 @@ doors.register_fencegate( "doors:gate_junglewood", {
|
||||
} )
|
||||
|
||||
doors.register_fencegate( "doors:gate_acacia_wood", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Acacia Fence Gate",
|
||||
texture = "default_acacia_wood.png",
|
||||
material = "default:acacia_wood",
|
||||
@@ -430,6 +453,7 @@ doors.register_fencegate( "doors:gate_acacia_wood", {
|
||||
} )
|
||||
|
||||
doors.register_fencegate( "doors:gate_pine_wood", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Pine Fence Gate",
|
||||
texture = "default_pine_wood.png",
|
||||
material = "default:pine_wood",
|
||||
@@ -437,6 +461,7 @@ doors.register_fencegate( "doors:gate_pine_wood", {
|
||||
} )
|
||||
|
||||
doors.register_fencegate( "doors:gate_aspen_wood", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = "Aspen Fence Gate",
|
||||
texture = "default_aspen_wood.png",
|
||||
material = "default:aspen_wood",
|
|
@ -0,0 +1,52 @@
|
|||
diff --git a/config.lua b/config.lua
|
||||
index be08447..ed89fc5 100644
|
||||
--- a/config.lua
|
||||
+++ b/config.lua
|
||||
@@ -27,7 +27,7 @@ mg_villages.VILLAGE_DETECT_RANGE = 400;
|
||||
mg_villages.REQUIRE_PRIV_FOR_TELEPORT = false;
|
||||
|
||||
-- if set to true, players cannot modify spawned villages without buying the house from the village first
|
||||
-mg_villages.ENABLE_PROTECTION = true;
|
||||
+mg_villages.ENABLE_PROTECTION = false;
|
||||
|
||||
-- the first village - the one the player spawns in - will be of this type
|
||||
mg_villages.FIRST_VILLAGE_TYPE = 'medieval';
|
||||
@@ -35,7 +35,7 @@ mg_villages.FIRST_VILLAGE_TYPE = 'medieval';
|
||||
-- the mapgen will disregard mapchunks where min.y > mg_villages.MAX_HEIGHT_TREATED;
|
||||
-- you can set this value to 64 if you have a slow machine and a mapgen which does not create extreme mountains
|
||||
-- (or if you don't care if extreme mountains may create burried villages occasionally)
|
||||
-mg_villages.MAX_HEIGHT_TREATED = 200;
|
||||
+mg_villages.MAX_HEIGHT_TREATED = 400;
|
||||
|
||||
-- choose the debug level you want
|
||||
mg_villages.DEBUG_LEVEL = mg_villages.DEBUG_LEVEL_NORMAL
|
||||
diff --git a/init.lua b/init.lua
|
||||
index 2463866..b4017db 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -104,7 +104,7 @@ dofile(mg_villages.modpath.."/terrain_blend.lua")
|
||||
-- also takes care of spawning the player
|
||||
dofile(mg_villages.modpath.."/mapgen.lua")
|
||||
|
||||
-dofile(mg_villages.modpath.."/spawn_player.lua")
|
||||
+-- dofile(mg_villages.modpath.."/spawn_player.lua")
|
||||
|
||||
-- reconstruct the connection of the roads inside a village
|
||||
dofile(mg_villages.modpath.."/roads.lua")
|
||||
diff --git a/plotmarker_formspec.lua b/plotmarker_formspec.lua
|
||||
index 0dd65ad..f54f4cf 100644
|
||||
--- a/plotmarker_formspec.lua
|
||||
+++ b/plotmarker_formspec.lua
|
||||
@@ -366,9 +366,9 @@ end
|
||||
|
||||
mg_villages.form_input_handler = function( player, formname, fields)
|
||||
-- mg_villages.print(mg_villages.DEBUG_LEVEL_NORMAL,minetest.serialize(fields));
|
||||
- if( not( mg_villages.ENABLE_PROTECTION )) then
|
||||
- return false;
|
||||
- end
|
||||
+-- if( not( mg_villages.ENABLE_PROTECTION )) then
|
||||
+-- return false;
|
||||
+-- end
|
||||
|
||||
-- teleport to a plot or mob
|
||||
if( fields[ 'teleport_to' ]
|
|
@ -0,0 +1,34 @@
|
|||
diff --git a/config.lua b/config.lua
|
||||
index be08447..ea102e5 100644
|
||||
--- a/config.lua
|
||||
+++ b/config.lua
|
||||
@@ -27,10 +27,10 @@ mg_villages.VILLAGE_DETECT_RANGE = 400;
|
||||
mg_villages.REQUIRE_PRIV_FOR_TELEPORT = false;
|
||||
|
||||
-- if set to true, players cannot modify spawned villages without buying the house from the village first
|
||||
-mg_villages.ENABLE_PROTECTION = true;
|
||||
+mg_villages.ENABLE_PROTECTION = false;
|
||||
|
||||
-- the first village - the one the player spawns in - will be of this type
|
||||
-mg_villages.FIRST_VILLAGE_TYPE = 'medieval';
|
||||
+--mg_villages.FIRST_VILLAGE_TYPE = 'medieval';
|
||||
|
||||
-- the mapgen will disregard mapchunks where min.y > mg_villages.MAX_HEIGHT_TREATED;
|
||||
-- you can set this value to 64 if you have a slow machine and a mapgen which does not create extreme mountains
|
||||
diff --git a/plotmarker_formspec.lua b/plotmarker_formspec.lua
|
||||
index 0dd65ad..002c7c7 100644
|
||||
--- a/plotmarker_formspec.lua
|
||||
+++ b/plotmarker_formspec.lua
|
||||
@@ -366,9 +366,9 @@ end
|
||||
|
||||
mg_villages.form_input_handler = function( player, formname, fields)
|
||||
-- mg_villages.print(mg_villages.DEBUG_LEVEL_NORMAL,minetest.serialize(fields));
|
||||
- if( not( mg_villages.ENABLE_PROTECTION )) then
|
||||
- return false;
|
||||
- end
|
||||
+ -- if( not( mg_villages.ENABLE_PROTECTION )) then
|
||||
+ -- return false;
|
||||
+ -- end
|
||||
|
||||
-- teleport to a plot or mob
|
||||
if( fields[ 'teleport_to' ]
|
|
@ -0,0 +1,68 @@
|
|||
diff --git a/init.lua b/init.lua
|
||||
index 566ff86..2d235fc 100755
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -95,6 +95,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
end
|
||||
|
||||
doors.register("ts_doors:door_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
tiles = { { name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base.png^[noalpha^[makealpha:0,255,0", backface_culling = true } },
|
||||
description = S(description .. " Windowed Door"),
|
||||
inventory_image = "[combine:32x32:0,8=" .. texture .. ":16,8=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_inv.png^[noalpha^[makealpha:0,255,0",
|
||||
@@ -115,6 +116,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
})
|
||||
|
||||
doors.register_trapdoor("ts_doors:trapdoor_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = S("Windowed " .. description .. " Trapdoor"),
|
||||
inventory_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor.png^[noalpha^[makealpha:0,255,0",
|
||||
wield_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor.png^[noalpha^[makealpha:0,255,0",
|
||||
@@ -127,6 +129,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
})
|
||||
|
||||
doors.register_trapdoor("ts_doors:trapdoor_full_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = S("Solid " .. description .. " Trapdoor"),
|
||||
inventory_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_full.png^[noalpha",
|
||||
wield_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_full.png^[noalpha",
|
||||
@@ -141,6 +144,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
door_groups.level = 2
|
||||
|
||||
doors.register("ts_doors:door_locked_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
tiles = { { name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_locked.png^[noalpha^[makealpha:0,255,0", backface_culling = true } },
|
||||
description = S("Windowed Locked " .. description .. " Door"),
|
||||
inventory_image = "[combine:32x32:0,8=" .. texture .. ":16,8=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_locked_inv.png^[noalpha^[makealpha:0,255,0",
|
||||
@@ -154,6 +158,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
})
|
||||
|
||||
doors.register("ts_doors:door_full_locked_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
tiles = { { name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_full_locked.png^[noalpha", backface_culling = true } },
|
||||
description = S("Solid Locked " .. description .. " Door"),
|
||||
inventory_image = "[combine:32x32:0,8=" .. texture .. ":16,8=" .. texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_full_locked_inv.png^[noalpha^[makealpha:0,255,0",
|
||||
@@ -167,6 +172,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
})
|
||||
|
||||
doors.register_trapdoor("ts_doors:trapdoor_locked_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = S("Windowed Locked " .. description .. " Trapdoor"),
|
||||
inventory_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_locked.png^[noalpha^[makealpha:0,255,0",
|
||||
wield_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_locked.png^[noalpha^[makealpha:0,255,0",
|
||||
@@ -180,6 +186,7 @@ function ts_doors.register_door(item, description, texture, sounds, recipe)
|
||||
})
|
||||
|
||||
doors.register_trapdoor("ts_doors:trapdoor_full_locked_" .. item:gsub(":", "_"), {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = S("Solid Locked " .. description .. " Trapdoor"),
|
||||
inventory_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_full_locked.png^[noalpha",
|
||||
wield_image = texture .. "^[transformR90^[colorize:#fff:30^ts_doors_base_trapdoor_full_locked.png^[noalpha",
|
||||
@@ -542,6 +549,7 @@ local function can_dig(pos, player)
|
||||
end
|
||||
|
||||
ts_workshop.register_workshop("ts_doors", "workshop", {
|
||||
+ use_texture_alpha = "clip",
|
||||
description = S("Door Workshop"),
|
||||
tiles = {
|
||||
"default_wood.png",
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/init.lua b/init.lua
|
||||
index 0a953e7..619952d 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -12,7 +12,7 @@ local toolrepair
|
||||
|
||||
local tabs = {}
|
||||
|
||||
-local progressive_mode = core.settings:get_bool "i3_progressive_mode"
|
||||
+local progressive_mode = core.settings:get_bool "i3_progressive_mode" and not(core.is_creative_enabled())
|
||||
local damage_enabled = core.settings:get_bool "enable_damage"
|
||||
|
||||
local __3darmor, __skinsdb, __awards
|
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 315 B |
After Width: | Height: | Size: 311 B |
After Width: | Height: | Size: 333 B |
After Width: | Height: | Size: 333 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 313 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 360 B |
After Width: | Height: | Size: 377 B |
After Width: | Height: | Size: 369 B |
|
@ -0,0 +1,15 @@
|
|||
##Tamagochi Mode (Take care of your pet: fed it...)
|
||||
tamagochi_mode = false
|
||||
|
||||
##Shears
|
||||
shears = mobs:shears
|
||||
|
||||
##Selling
|
||||
selling = false
|
||||
|
||||
##Bloody Mode
|
||||
blood = true
|
||||
|
||||
##Capture Mobs
|
||||
lasso = mobs:lasso
|
||||
rob_mobs = true
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
water_life.poison_after_death = minetest.settings:get_bool("water_life_poison_after_death") or false
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
if not player then return end
|
||||
if water_life.poison_after_death then return end
|
||||
|
||||
local meta=player:get_meta()
|
||||
meta:set_int("snakepoison",0)
|
||||
water_life.change_hud(player,"poison",0)
|
||||
end)
|
|
@ -0,0 +1,900 @@
|
|||
|
||||
local abs = math.abs
|
||||
local pi = math.pi
|
||||
local floor = math.floor
|
||||
local ceil = math.ceil
|
||||
local sqrt = math.sqrt
|
||||
local max = math.max
|
||||
local min = math.min
|
||||
local pow = math.pow
|
||||
local sign = math.sign
|
||||
local time = os.time
|
||||
local rad = math.rad
|
||||
local deg=math.deg
|
||||
local tan = math.tan
|
||||
local cos = math.cos
|
||||
local atan=math.atan
|
||||
|
||||
|
||||
|
||||
local neighbors ={
|
||||
{x=1,z=0},
|
||||
{x=1,z=1},
|
||||
{x=0,z=1},
|
||||
{x=-1,z=1},
|
||||
{x=-1,z=0},
|
||||
{x=-1,z=-1},
|
||||
{x=0,z=-1},
|
||||
{x=1,z=-1}
|
||||
}
|
||||
|
||||
|
||||
-- pseudo random generator, init and call function
|
||||
water_life.randomtable = PcgRandom(math.random(2^23)+1)
|
||||
|
||||
function water_life.random(min,max)
|
||||
if not min and not max then return math.abs(water_life.randomtable:next() / 2^31) end
|
||||
if not max then
|
||||
max = min
|
||||
min = 1
|
||||
end
|
||||
if max and not min then min = 1 end
|
||||
if max < min then return water_life.randomtable:next(max,min) end
|
||||
|
||||
return water_life.randomtable:next(min,max)
|
||||
end
|
||||
|
||||
--
|
||||
local random = water_life.random -- do not delete, this MUST be here!
|
||||
--
|
||||
|
||||
--checks if entity is in a small water pool
|
||||
function water_life.check_for_pool(self,deep,minr,pos)
|
||||
if not self and not pos then return nil end
|
||||
if not deep then deep = 3 end
|
||||
if not minr then minr = 3 end
|
||||
|
||||
local max = 16
|
||||
if not pos then
|
||||
pos = self.object:get_pos()
|
||||
end
|
||||
|
||||
local d,t,s = water_life.water_depth(pos,max)
|
||||
if not d then return nil end
|
||||
local cpos = {}
|
||||
local ispool = 0
|
||||
|
||||
for i = 0,270,90 do
|
||||
cpos = mobkit.pos_translate2d(pos,rad(i),minr)
|
||||
if water_life.find_collision(pos,cpos,false) then ispool = ispool + 1 end
|
||||
end
|
||||
|
||||
if ispool > 2 and d < deep then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- returns ingame time, 1 = morning, 2 = noon, 3 = afternoon, 4 = night
|
||||
function water_life.get_game_time()
|
||||
local time = minetest.get_timeofday()
|
||||
local hour = math.floor(time*24)
|
||||
|
||||
if hour >= 5 and hour < 10 then return 1 end
|
||||
if hour >= 10 and hour < 15 then return 2 end
|
||||
if hour >= 15 and hour < 20 then return 3 end
|
||||
if hour > 20 or hour < 5 then return 4 end
|
||||
end
|
||||
|
||||
|
||||
function water_life_get_biome_data(pos)
|
||||
if not pos then return nil end
|
||||
local table = minetest.get_biome_data(pos)
|
||||
if not table then return nil end
|
||||
local biome = {}
|
||||
biome.id = table.biome
|
||||
biome.name = minetest.get_biome_name(table.biome)
|
||||
biome.temp = math.floor((table.heat-32)*5/9) --turn fahrenheit into celsius
|
||||
biome.humid = math.floor(table.humidity*100)/100
|
||||
return biome
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- returns closest enemy or player, if player is true enemies must be in entity definition: predators = {[name1]=1,[name2]=1,.....}
|
||||
function water_life.get_closest_enemy(self,player)
|
||||
local cobj = nil
|
||||
local dist = water_life.abr*64
|
||||
local pos = self.object:get_pos()
|
||||
local otable = minetest.get_objects_inside_radius(pos, self.view_range)
|
||||
|
||||
if not self.predators and not player then return nil end
|
||||
|
||||
for _,obj in ipairs(otable) do
|
||||
local luaent = obj:get_luaentity()
|
||||
|
||||
if mobkit.is_alive(obj) and not obj:is_player() and luaent and self.predators[luaent.name] then
|
||||
local opos = obj:get_pos()
|
||||
local odist = abs(opos.x-pos.x) + abs(opos.z-pos.z)
|
||||
if odist < dist then
|
||||
dist=odist
|
||||
cobj=obj
|
||||
end
|
||||
elseif mobkit.is_alive(obj) and obj:is_player() and player then
|
||||
local opos = obj:get_pos()
|
||||
local odist = abs(opos.x-pos.x) + abs(opos.z-pos.z)
|
||||
if odist < dist then
|
||||
dist=odist
|
||||
cobj=obj
|
||||
end
|
||||
end
|
||||
end
|
||||
return cobj
|
||||
end
|
||||
|
||||
|
||||
--player knockback from entity
|
||||
function water_life.knockback_player(self,target,force)
|
||||
if not target:is_player() then return end
|
||||
if not self.object then return end
|
||||
if not force then force = 10 end
|
||||
local dir = minetest.yaw_to_dir(self.object:get_yaw())
|
||||
dir = vector.multiply(dir, force)
|
||||
dir = {x=dir.x, y=dir.y+force/2, z= dir.z}
|
||||
target:add_player_velocity(dir)
|
||||
end
|
||||
|
||||
|
||||
--sets an urchin somewhere but not in the center of a node
|
||||
function water_life.set_urchin(pos,name)
|
||||
if not pos then return end
|
||||
if not name then name = "water_life:urchin" end
|
||||
local x = random()/2
|
||||
local z = random()/2
|
||||
if water_life.leftorright() then pos.x = pos.x +x else pos.x=pos.x - x end
|
||||
if water_life.leftorright() then pos.z = pos.z +z else pos.z=pos.z - z end
|
||||
local obj = minetest.add_entity(pos, name)
|
||||
return obj
|
||||
end
|
||||
|
||||
-- add vector cross function for flying behavior if not yet there
|
||||
if vector and not vector.cross then
|
||||
function vector.cross(a, b)
|
||||
return {
|
||||
x = a.y * b.z - a.z * b.y,
|
||||
y = a.z * b.x - a.x * b.z,
|
||||
z = a.x * b.y - a.y * b.x
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- show temp marker
|
||||
function water_life.temp_show(pos,time,pillar)
|
||||
if not pos then return end
|
||||
if not time then time = 5 end
|
||||
local step = 1
|
||||
if not pillar then pillar = 1 end
|
||||
if pillar < 0 then step = -1 end
|
||||
|
||||
for i = 1,pillar,step do
|
||||
|
||||
local obj = minetest.add_entity({x=pos.x, y=pos.y+i, z=pos.z}, "water_life:pos")
|
||||
if obj then
|
||||
minetest.after(time, function(obj) obj:remove() end, obj)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- throws a coin
|
||||
function water_life.leftorright()
|
||||
local rnd = random()
|
||||
if rnd > 0.5 then return true else return false end
|
||||
end
|
||||
|
||||
|
||||
-- distance from self to target
|
||||
function water_life.dist2tgt(self,tgt)
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local tpos = tgt:get_pos()
|
||||
return vector.distance(pos,tpos)
|
||||
end
|
||||
|
||||
|
||||
function water_life.dumbstep(self,height,tpos,speed_factor,idle_duration)
|
||||
if height <= 0.001 then
|
||||
mobkit.lq_turn2pos(self,tpos)
|
||||
water_life.lq_dumbwalk(self,tpos,speed_factor)
|
||||
else
|
||||
mobkit.lq_turn2pos(self,tpos)
|
||||
water_life.lq_dumbjump(self,height)
|
||||
end
|
||||
idle_duration = idle_duration or 6
|
||||
mobkit.lq_idle(self,random(ceil(idle_duration*0.5),idle_duration))
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- drop on death what is definded in the entity table
|
||||
function water_life.handle_drops(self)
|
||||
if not self.drops then return end
|
||||
|
||||
for _,item in ipairs(self.drops) do
|
||||
|
||||
local amount = random (item.min, item.max)
|
||||
local chance = random(1,100)
|
||||
local pos = self.object:get_pos()
|
||||
pos.y = pos.y + self.collisionbox[5] +1
|
||||
|
||||
if chance < (100/item.chance) then
|
||||
local obj = minetest.add_item(pos, item.name.." "..tostring(amount))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function water_life.register_shark_food(name)
|
||||
table.insert(water_life.shark_food,name)
|
||||
end
|
||||
|
||||
function water_life.register_gull_bait(name)
|
||||
if name then water_life.gull_bait[name] = 1 end
|
||||
end
|
||||
|
||||
|
||||
function water_life.feed_shark(self)
|
||||
for i = 1,#water_life.shark_food,1 do
|
||||
if water_life.shark_food[i] ~= "water_life:fish" and water_life.shark_food[i] ~= "water_life:fish_tamed" then
|
||||
local target = mobkit.get_closest_entity(self,water_life.shark_food[i])
|
||||
if target then
|
||||
return target
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function water_life.get_close_drops(self,name)
|
||||
|
||||
|
||||
local objs = minetest.get_objects_inside_radius(self.object:get_pos(), self.view_range)
|
||||
if #objs < 1 then return nil end
|
||||
|
||||
for i = #objs,1,-1 do
|
||||
local entity = objs[i]:get_luaentity()
|
||||
if not entity or not entity.name == "__builtin:item" then table.remove(objs,i) end -- remove any entity different from a drop
|
||||
end
|
||||
|
||||
if #objs < 1 then return nil end
|
||||
if not name then return objs[random(#objs)] end -- no name, return random drop
|
||||
|
||||
for i=#objs,1,-1 do
|
||||
local entity = objs[i]:get_luaentity()
|
||||
if not entity.itemstring then
|
||||
table.remove(objs,i)
|
||||
else
|
||||
if not string.match(entity.itemstring,name) then table.remove(objs,i) end -- remove anything different from name
|
||||
end
|
||||
end
|
||||
|
||||
if #objs < 1 then
|
||||
return nil
|
||||
else
|
||||
return objs[random(#objs)]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function water_life.inwater(obj)
|
||||
if not obj then return nil end
|
||||
local pos = obj:get_pos()
|
||||
local node = minetest.get_node(pos)
|
||||
if not node or node.name == 'ignore' then return nil end
|
||||
if not minetest.registered_nodes[node.name] then return nil end -- handle unknown nodes
|
||||
|
||||
local type = minetest.registered_nodes[node.name]["liquidtype"]
|
||||
if type == "none" then return nil end
|
||||
return true
|
||||
end
|
||||
|
||||
function water_life.aqua_radar_dumb(pos,yaw,range,reverse,shallow) -- same as mobkit's but added shallow water if true
|
||||
range = range or 4
|
||||
|
||||
local function okpos(p)
|
||||
local node = mobkit.nodeatpos(p)
|
||||
if node then
|
||||
if node.drawtype == 'liquid' then
|
||||
local nodeu = mobkit.nodeatpos(mobkit.pos_shift(p,{y=1}))
|
||||
local noded = mobkit.nodeatpos(mobkit.pos_shift(p,{y=-1}))
|
||||
if ((nodeu and nodeu.drawtype == 'liquid') or (noded and noded.drawtype == 'liquid')) or shallow then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
else
|
||||
local h,l = mobkit.get_terrain_height(p)
|
||||
if h then
|
||||
local node2 = mobkit.nodeatpos({x=p.x,y=h+1.99,z=p.z})
|
||||
if node2 and node2.drawtype == 'liquid' then return true, h end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local fpos = mobkit.pos_translate2d(pos,yaw,range)
|
||||
local ok,h = okpos(fpos)
|
||||
if not ok then
|
||||
local ffrom, fto, fstep
|
||||
if reverse then
|
||||
ffrom, fto, fstep = 3,1,-1
|
||||
else
|
||||
ffrom, fto, fstep = 1,3,1
|
||||
end
|
||||
for i=ffrom, fto, fstep do
|
||||
local ok,h = okpos(mobkit.pos_translate2d(pos,yaw+i,range))
|
||||
if ok then return yaw+i,h end
|
||||
ok,h = okpos(mobkit.pos_translate2d(pos,yaw-i,range))
|
||||
if ok then return yaw-i,h end
|
||||
end
|
||||
return yaw+pi,h
|
||||
else
|
||||
return yaw, h
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- counts animals in specified radius or active_block_range, returns a table containing numbers
|
||||
function water_life.count_objects(pos,radius,name)
|
||||
|
||||
if not radius then radius = water_life.abr * 16 end
|
||||
|
||||
local all_objects = minetest.get_objects_inside_radius(pos, radius)
|
||||
local hasil = {}
|
||||
hasil.whales = 0
|
||||
hasil.sharks = 0
|
||||
hasil.fish = 0
|
||||
hasil.name = 0
|
||||
hasil.all = #all_objects or 0
|
||||
|
||||
local _,obj
|
||||
for _,obj in ipairs(all_objects) do
|
||||
local entity = obj:get_luaentity()
|
||||
if name then
|
||||
if entity and entity.name == name then
|
||||
hasil.name = hasil.name +1
|
||||
end
|
||||
end
|
||||
if entity and entity.name == "water_life:whale" then
|
||||
hasil.whales = hasil.whales +1
|
||||
elseif entity and entity.name == "water_life:shark" then
|
||||
hasil.sharks = hasil.sharks +1
|
||||
elseif entity and (entity.name == "water_life:fish" or entity.name == "water_life:fish_tamed") then
|
||||
hasil.fish = hasil.fish +1
|
||||
end
|
||||
|
||||
if entity and entity.name then
|
||||
if not hasil[entity.name] then
|
||||
hasil[entity.name] = 1
|
||||
else
|
||||
hasil[entity.name] = hasil[entity.name] +1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return hasil
|
||||
end
|
||||
|
||||
|
||||
function water_life.get_herd_members(self,radius)
|
||||
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local name = self.name
|
||||
|
||||
if not radius then radius = water_life.abo * 16 end
|
||||
|
||||
local all_objects = minetest.get_objects_inside_radius(pos, radius)
|
||||
if #all_objects < 1 then return nil end
|
||||
|
||||
for i = #all_objects,1,-1 do
|
||||
local entity = all_objects[i]:get_luaentity()
|
||||
|
||||
if entity and entity.name ~= name then
|
||||
table.remove(all_objects,i)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if #all_objects < 1 then
|
||||
return nil
|
||||
else
|
||||
return all_objects
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- returns 2D angle from self to target in radians
|
||||
function water_life.get_yaw_to_object(self,target)
|
||||
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local tpos = target:get_pos()
|
||||
local tyaw = minetest.dir_to_yaw(vector.direction(pos, tpos))
|
||||
return tyaw
|
||||
end
|
||||
|
||||
-- returns 2D angle from self to pos in radians
|
||||
function water_life.get_yaw_to_pos(self,tpos)
|
||||
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local tyaw = minetest.dir_to_yaw(vector.direction(pos, tpos))
|
||||
|
||||
return tyaw
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function water_life.isinliquid(target)
|
||||
if not target then return false end
|
||||
local nodepos = mobkit.get_stand_pos(target)
|
||||
local node1 = mobkit.nodeatpos(nodepos)
|
||||
nodepos.y = nodepos.y -1
|
||||
local node2 = mobkit.nodeatpos(nodepos)
|
||||
if node1 and node1.drawtype=='liquid' or (node2 and node2.drawtype=='liquid' and node1 and node1.drawtype=='airlike') then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- find if there is a node between pos1 and pos2
|
||||
-- water = true means water = obstacle
|
||||
-- returns distance to obstacle in nodes or nil
|
||||
|
||||
function water_life.find_collision(pos1,pos2,water,objects)
|
||||
local ray = minetest.raycast(pos1, pos2, objects, water)
|
||||
for pointed_thing in ray do
|
||||
if pointed_thing.type == "node" then
|
||||
local dist = math.floor(vector.distance(pos1,pointed_thing.under))
|
||||
return dist
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
-- fast radar, less accurate
|
||||
-- yaw-x to the right, yaw + x to the left !
|
||||
-- sonar = true water is no obstacle
|
||||
|
||||
function water_life.radar_fast(self,dist,sonar)
|
||||
local water = not sonar
|
||||
if not dist then dist = self.view_range end
|
||||
local angel = atan(3/dist)
|
||||
local yaw = self.object:get_yaw()
|
||||
local tpos = self.object:get_pos()
|
||||
local tapos = mobkit.pos_translate2d(tpos,(yaw-angel),dist)
|
||||
local tbpos = mobkit.pos_translate2d(tpos,yaw,dist)
|
||||
local tcpos = mobkit.pos_translate2d(tpos,(yaw+angel),dist)
|
||||
local tupos = mobkit.pos_shift(tbpos,{y=2})
|
||||
local tdpos = mobkit.pos_shift(tbpos,{y=-2})
|
||||
local right = water_life.find_collision(tpos,tapos,water)
|
||||
local left = water_life.find_collision(tpos,tcpos,water)
|
||||
local center = water_life.find_collision(tpos,tbpos,water)
|
||||
local up = water_life.find_collision(tpos,tupos,water)
|
||||
local down = water_life.find_collision(tpos,tdpos,water)
|
||||
|
||||
return left,right,center,up,down
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- WIP radar, not ready to use !
|
||||
function water_life.radar_fast_cols(obj,dist,sonar,rev) --sonar = true, water no obstacle :: rev = true array contains possible positions
|
||||
if not dist then dist = 3 end
|
||||
local pos = obj:get_pos()
|
||||
local yaw = 0
|
||||
local box = {}
|
||||
local counter = 1
|
||||
local rarray = {}
|
||||
|
||||
|
||||
if obj:is_player() then
|
||||
yaw = obj:get_look_horizontal()
|
||||
box = obj:get_properties().collisionbox
|
||||
else
|
||||
yaw = obj:get_yaw()
|
||||
if obj:get_luaentity().name == "water_life:whale" then yaw = yaw + rad(180) end
|
||||
box = obj:get_luaentity().collisionbox
|
||||
end
|
||||
|
||||
local vec = minetest.yaw_to_dir(yaw)
|
||||
local crasha = mobkit.get_box_displace_cols(pos,box,vec,dist)
|
||||
|
||||
|
||||
if crasha then
|
||||
for i = #crasha,1,-1 do
|
||||
for j = #crasha[i],1,-1 do
|
||||
local cpos ={x=crasha[i][j].x, y= pos.y, z= crasha[i][j].z}
|
||||
--local cyaw = abs(math.floor(minetest.dir_to_yaw(vector.direction(pos,cpos))*10))
|
||||
local node = minetest.get_node(cpos)
|
||||
if minetest.registered_nodes[node.name] then
|
||||
local kill = false
|
||||
if minetest.registered_nodes[node.name]["drawtype"] == "airlike" then kill = true end
|
||||
if minetest.registered_nodes[node.name]["buildable_to"] then kill = true end
|
||||
if minetest.registered_nodes[node.name]["drawtype"] == "liquid" then kill = sonar end
|
||||
|
||||
if kill then
|
||||
if not rev then
|
||||
table.remove(crasha[i],j)
|
||||
else
|
||||
rarray[counter] = cpos
|
||||
counter = counter +1
|
||||
end
|
||||
else
|
||||
if not rev then
|
||||
rarray[counter] = cpos
|
||||
counter = counter +1
|
||||
else
|
||||
table.remove(crasha[i],j)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
return rarray
|
||||
end
|
||||
|
||||
-- radar function for obstacles lying in front of an entity
|
||||
-- use water = true if water should be an obstacle
|
||||
|
||||
function water_life.radar(pos, yaw, radius, water,fast)
|
||||
|
||||
if not radius or radius < 1 then radius = 16 end
|
||||
local left = 0
|
||||
local right = 0
|
||||
if not water then water = false end
|
||||
for j = 0,3,1 do
|
||||
for i = 0,4,1 do
|
||||
local pos2 = mobkit.pos_translate2d(pos,yaw+(i*pi/16),radius)
|
||||
local pos3 = mobkit.pos_translate2d(pos,yaw-(i*pi/16),radius)
|
||||
--minetest.set_node(pos2,{name="default:stone"})
|
||||
if water_life.find_collision(pos,{x=pos2.x, y=pos2.y + j*2, z=pos2.z}, water) then
|
||||
left = left + 5 - i
|
||||
end
|
||||
if water_life.find_collision(pos,{x=pos3.x, y=pos3.y + j*2, z=pos3.z},water) then
|
||||
right = right + 5 - i
|
||||
end
|
||||
end
|
||||
end
|
||||
local up =0
|
||||
local down = 0
|
||||
if not fast then
|
||||
for j = -4,4,1 do
|
||||
for i = -3,3,1 do
|
||||
local k = i
|
||||
local pos2 = mobkit.pos_translate2d(pos,yaw+(i*pi/16),radius)
|
||||
local collide = water_life.find_collision(pos,{x=pos2.x, y=pos2.y + j, z=pos2.z}, water)
|
||||
if k < 0 then k = k * -1 end
|
||||
if collide and j <= 0 then
|
||||
down = down + math.floor((7+j-k)*collide/radius*2)
|
||||
elseif collide and j >= 0 then
|
||||
up = up + math.floor((7-j-k)*collide/radius*2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local under = water_life.find_collision(pos,{x=pos.x, y=pos.y - radius, z=pos.z}, water)
|
||||
if not under then under = radius end
|
||||
local above = water_life.find_collision(pos,{x=pos.x, y=pos.y + radius, z=pos.z}, water)
|
||||
if not above then above = radius end
|
||||
if water_life.radar_debug then
|
||||
-- minetest.chat_send_all(dump(water_life.radar_debug).." left = "..left.." right = "..right.." up = "..up.." down = "..down.." under = "..under.." above = "..above)
|
||||
end
|
||||
return left, right, up, down, under, above
|
||||
end
|
||||
|
||||
|
||||
--find a spawn position under air
|
||||
function water_life.find_node_under_air(pos,radius,name)
|
||||
if not pos then return nil end
|
||||
if not radius then radius = 3 end
|
||||
if not name then name={"group:crumbly","group:stone","group:tree"} end
|
||||
|
||||
local pos1 = {x=pos.x-radius, y=pos.y-radius, z=pos.z-radius} --mobkit.pos_shift(pos,{x=radius*-1,y=radius*-1,z=radius*-1})
|
||||
local pos2 = {x=pos.x+radius, y=pos.y+radius, z=pos.z+radius} --mobkit.pos_shift(pos,{x=radius,y=radius,z=radius})
|
||||
local spawner = minetest.find_nodes_in_area_under_air(pos1, pos2, name)
|
||||
if not spawner or #spawner < 1 then
|
||||
return nil
|
||||
else
|
||||
local rpos = spawner[random(#spawner)]
|
||||
rpos = mobkit.pos_shift(rpos,{y=1})
|
||||
return rpos
|
||||
end
|
||||
end
|
||||
|
||||
-- function to find liquid surface and depth at that position
|
||||
function water_life.water_depth(pos,max)
|
||||
|
||||
|
||||
local surface = {}
|
||||
local depth = 0
|
||||
local type = ""
|
||||
if not max then max = 10 end
|
||||
if not pos then return nil end
|
||||
local tempos = {}
|
||||
local node = minetest.get_node(pos)
|
||||
if not node or node.name == 'ignore' then return nil end
|
||||
if not minetest.registered_nodes[node.name] then return nil end -- handle unknown nodes
|
||||
|
||||
local type = minetest.registered_nodes[node.name]["liquidtype"]
|
||||
local found = false
|
||||
--minetest.chat_send_all(">>>"..dump(node.name).." <<<")
|
||||
if type == "none" then -- start in none liquid try to find surface
|
||||
|
||||
local under = water_life.find_collision(pos,{x=pos.x, y=pos.y - max, z=pos.z}, true)
|
||||
--minetest.chat_send_all(dump(under).." "..dump(node.name))
|
||||
if under then
|
||||
local check = {x=pos.x, y=pos.y - under-1, z=pos.z}
|
||||
local cname = minetest.get_node(check).name
|
||||
if not minetest.registered_nodes[cname] then return nil end -- handle unknown nodes
|
||||
if minetest.registered_nodes[cname]["liquidtype"] == "source" then
|
||||
surface = check
|
||||
found = true
|
||||
end
|
||||
end
|
||||
if not found then
|
||||
return nil
|
||||
end
|
||||
|
||||
else -- start in liquid find way up first
|
||||
|
||||
local lastpos = pos
|
||||
for i = 1,max,1 do
|
||||
tempos = {x=pos.x, y=pos.y+i, z= pos.z}
|
||||
node = minetest.get_node(tempos)
|
||||
if not minetest.registered_nodes[node.name] then return nil end -- handle unknown nodes
|
||||
local ctype = minetest.registered_nodes[node.name]["liquidtype"]
|
||||
|
||||
if ctype == "none" then
|
||||
surface = lastpos
|
||||
found = true
|
||||
break
|
||||
end
|
||||
lastpos = tempos
|
||||
end
|
||||
if not found then surface = lastpos end
|
||||
end
|
||||
|
||||
pos = surface
|
||||
type = minetest.get_node(pos).name or ""
|
||||
local under = water_life.find_collision(pos,{x=pos.x, y=pos.y - max, z=pos.z}, false)
|
||||
depth = under or max
|
||||
|
||||
return depth, type, surface
|
||||
end
|
||||
|
||||
|
||||
-- amphibious version of mobkit
|
||||
function water_life.get_next_waypoint_fast(self,tpos,nogopos)
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local dir=vector.direction(pos,tpos)
|
||||
local neighbor = mobkit.dir2neighbor(dir)
|
||||
local height, pos2, liquidflag = mobkit.is_neighbor_node_reachable(self,neighbor)
|
||||
local heightr = nil
|
||||
local heightl = nil
|
||||
local liq = nil
|
||||
|
||||
if height then
|
||||
local fast = false
|
||||
heightl = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-1))
|
||||
if heightl and abs(heightl-height)<0.001 then
|
||||
heightr = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,1))
|
||||
if heightr and abs(heightr-height)<0.001 then
|
||||
fast = true
|
||||
dir.y = 0
|
||||
local dirn = vector.normalize(dir)
|
||||
local npos = mobkit.get_node_pos(mobkit.pos_shift(pos,neighbors[neighbor]))
|
||||
local factor = abs(dirn.x) > abs(dirn.z) and abs(npos.x-pos.x) or abs(npos.z-pos.z)
|
||||
pos2=mobkit.pos_shift(pos,{x=dirn.x*factor,z=dirn.z*factor})
|
||||
end
|
||||
end
|
||||
return height, pos2, fast
|
||||
else
|
||||
|
||||
for i=1,4 do
|
||||
-- scan left
|
||||
height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i))
|
||||
if height then return height,pos2 end
|
||||
-- scan right
|
||||
height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,i))
|
||||
if height then return height,pos2 end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- amphibious version of mobkit
|
||||
function water_life.goto_next_waypoint(self,tpos)
|
||||
local height, pos2 = water_life.get_next_waypoint_fast(self,tpos)
|
||||
|
||||
if not height then return false end
|
||||
|
||||
if height <= 0.01 then
|
||||
local yaw = self.object:get_yaw()
|
||||
local tyaw = minetest.dir_to_yaw(vector.direction(self.object:get_pos(),pos2))
|
||||
if abs(tyaw-yaw) > 1 then
|
||||
mobkit.lq_turn2pos(self,pos2)
|
||||
end
|
||||
mobkit.lq_dumbwalk(self,pos2)
|
||||
else
|
||||
mobkit.lq_turn2pos(self,pos2)
|
||||
mobkit.lq_dumbjump(self,height)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
|
||||
function water_life.get_next_waypoint(self,tpos)
|
||||
local pos = mobkit.get_stand_pos(self)
|
||||
local dir=vector.direction(pos,tpos)
|
||||
local neighbor = mobkit.dir2neighbor(dir)
|
||||
local function update_pos_history(self,pos)
|
||||
table.insert(self.pos_history,1,pos)
|
||||
if #self.pos_history > 2 then table.remove(self.pos_history,#self.pos_history) end
|
||||
end
|
||||
local nogopos = self.pos_history[2]
|
||||
|
||||
local height, pos2, liquidflag = mobkit.is_neighbor_node_reachable(self,neighbor)
|
||||
--minetest.chat_send_all('pos2 ' .. minetest.serialize(pos2))
|
||||
--minetest.chat_send_all('nogopos ' .. minetest.serialize(nogopos))
|
||||
if height and not (nogopos and mobkit.isnear2d(pos2,nogopos,0.1)) then
|
||||
|
||||
local heightl = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-1))
|
||||
if heightl and abs(heightl-height)<0.001 then
|
||||
local heightr = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,1))
|
||||
if heightr and abs(heightr-height)<0.001 then
|
||||
dir.y = 0
|
||||
local dirn = vector.normalize(dir)
|
||||
local npos = mobkit.get_node_pos(mobkit.pos_shift(pos,neighbors[neighbor]))
|
||||
local factor = abs(dirn.x) > abs(dirn.z) and abs(npos.x-pos.x) or abs(npos.z-pos.z)
|
||||
pos2=mobkit.pos_shift(pos,{x=dirn.x*factor,z=dirn.z*factor})
|
||||
end
|
||||
end
|
||||
update_pos_history(self,pos2)
|
||||
return height, pos2
|
||||
else
|
||||
|
||||
for i=1,3 do
|
||||
-- scan left
|
||||
local height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i*self.path_dir))
|
||||
if height and not liq
|
||||
and not (nogopos and mobkit.isnear2d(pos2,nogopos,0.1)) then
|
||||
update_pos_history(self,pos2)
|
||||
return height,pos2
|
||||
end
|
||||
-- scan right
|
||||
height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,i*self.path_dir))
|
||||
if height and not liq
|
||||
and not (nogopos and mobkit.isnear2d(pos2,nogopos,0.1)) then
|
||||
update_pos_history(self,pos2)
|
||||
return height,pos2
|
||||
end
|
||||
end
|
||||
--scan rear
|
||||
height, pos2, liquidflag = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,4))
|
||||
if height and not liquidflag
|
||||
and not (nogopos and mobkit.isnear2d(pos2,nogopos,0.1)) then
|
||||
update_pos_history(self,pos2)
|
||||
return height,pos2
|
||||
end
|
||||
end
|
||||
-- stuck condition here
|
||||
table.remove(self.pos_history,2)
|
||||
self.path_dir = self.path_dir*-1 -- subtle change in pathfinding
|
||||
end
|
||||
|
||||
|
||||
-- blood effects
|
||||
function water_life.spilltheblood(object,size)
|
||||
if not water_life.bloody then return end
|
||||
if not size then size = 1 end
|
||||
local particlespawner_id = minetest.add_particlespawner({
|
||||
amount = 50,
|
||||
time = 1,
|
||||
minpos = vector.new(-0.3, size/2, -0.3),
|
||||
maxpos = vector.new( 0.3, size, 0.3),
|
||||
minvel = {x = -1, y = 0, z = -1},
|
||||
maxvel = {x = 1, y = 1, z = 1},
|
||||
minacc = {x = 0, y = 2, z = 0},
|
||||
maxacc = {x = 0, y = 3, z = 0},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
texture = "water_life_bloodeffect1.png",
|
||||
collisiondetection = true,
|
||||
collision_removal = true,
|
||||
object_collision = true,
|
||||
attached = object,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Entity definitions
|
||||
|
||||
-- entity for showing positions in debug
|
||||
minetest.register_entity("water_life:pos", {
|
||||
initial_properties = {
|
||||
visual = "cube",
|
||||
collide_with_objects = false,
|
||||
visual_size = {x=1.1, y=1.1},
|
||||
textures = {"water_life_pos.png", "water_life_pos.png",
|
||||
"water_life_pos.png", "water_life_pos.png",
|
||||
"water_life_pos.png", "water_life_pos.png"},
|
||||
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
||||
physical = false,
|
||||
}
|
||||
})
|
||||
|
||||
if water_life.radar_debug then
|
||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||
if not player or hp_change >= 0 then return hp_change end
|
||||
local name = player:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
if not privs.god then return hp_change end
|
||||
return 0
|
||||
end, true)
|
||||
|
||||
minetest.register_privilege("god", {description ="unvulnerable"})
|
||||
end
|
||||
|
||||
|
||||
--check here for antiserum group of eaten food
|
||||
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
if not user or not user:is_player() then return end
|
||||
if not itemstack then return end
|
||||
local name = user:get_player_name()
|
||||
local antiserum = itemstack:get_definition().groups.antiserum
|
||||
if antiserum then
|
||||
local meta = user:get_meta()
|
||||
local score = user:get_hp()
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
||||
water_life.change_hud(user,"poison",0)
|
||||
end
|
||||
|
||||
return
|
||||
end)
|
||||
|
||||
|
||||
--new players are immune to snakepoison
|
||||
minetest.register_on_newplayer(function(player)
|
||||
if not player or not player:is_player() then return end
|
||||
local meta = player:get_meta()
|
||||
local join = os.time()
|
||||
meta:set_int("jointime",join)
|
||||
end)
|
||||
|
||||
-- but not forever
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not player or not player:is_player() then return end
|
||||
local meta = player:get_meta()
|
||||
meta:set_int("bitten",0)
|
||||
meta:set_int("repellant",0)
|
||||
end)
|
|
@ -0,0 +1,558 @@
|
|||
local random = water_life.random
|
||||
|
||||
|
||||
|
||||
if not water_life.petz and not water_life.mobsredo then
|
||||
-- lasso
|
||||
|
||||
minetest.register_tool("water_life:lasso", {
|
||||
description = ("Lasso (right-click animal to capture it)"),
|
||||
inventory_image = "water_life_lasso.png",
|
||||
groups = {flammable = 2}
|
||||
})
|
||||
|
||||
if minetest.get_modpath("farming") then
|
||||
minetest.register_craft({
|
||||
output = "water_life:lasso",
|
||||
recipe = {
|
||||
{"farming:string", "", "farming:string"},
|
||||
{"", "default:diamond", ""},
|
||||
{"farming:string", "", "farming:string"}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- only one kind of meat if mobs_redo is present
|
||||
if not water_life.mobsredo then
|
||||
|
||||
-- raw meat
|
||||
minetest.register_craftitem("water_life:meat_raw", {
|
||||
description = ("Raw Meat"),
|
||||
inventory_image = "water_life_meat_raw.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = {food_meat_raw = 1, flammable = 2}
|
||||
})
|
||||
|
||||
-- cooked meat
|
||||
minetest.register_craftitem("water_life:meat", {
|
||||
description = ("Meat"),
|
||||
inventory_image = "water_life_meat.png",
|
||||
on_use = minetest.item_eat(8),
|
||||
groups = {food_meat = 1, flammable = 2}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "water_life:meat",
|
||||
recipe = "water_life:meat_raw",
|
||||
cooktime = 5
|
||||
})
|
||||
|
||||
minetest.register_alias("mobs:meat_raw","water_life:meat_raw")
|
||||
minetest.register_alias("mobs:meat","water_life:meat")
|
||||
|
||||
else
|
||||
minetest.register_alias("water_life:meat_raw","mobs:meat_raw")
|
||||
minetest.register_alias("water_life:meat","mobs:meat")
|
||||
|
||||
end
|
||||
|
||||
-- revive corals if a living one is around
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:coral_skeleton","water_life:artificial_skeleton"},
|
||||
neighbors = {"default:water_source"},
|
||||
interval = 30, --30
|
||||
chance = 5, --10
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local table = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y-2, z=pos.z-2}, {x=pos.x+2, y=pos.y+2, z=pos.z+2}, water_life.urchinspawn)
|
||||
local nname = "default:coral_skeleton"
|
||||
if table and #table > 0 then nname = minetest.get_node(table[water_life.random(#table)]).name end
|
||||
minetest.set_node(pos, {name = nname})
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("water_life:artificial_skeleton", {
|
||||
description = "artificial coral skeleton",
|
||||
tiles = {"default_coral_skeleton.png"},
|
||||
groups = {cracky = 3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "water_life:artificial_skeleton 4",
|
||||
type = "shapeless",
|
||||
recipe = {"default:silver_sandstone","default:silver_sandstone","default:silver_sandstone","default:coral_skeleton"}
|
||||
})
|
||||
|
||||
|
||||
-- moskito repellant
|
||||
if water_life.farming and farming.mod == "redo" then
|
||||
minetest.register_craft({
|
||||
output = "water_life:repellant",
|
||||
recipe = {
|
||||
{"", "farming:mint_leaf", "farming:bottle_ethanol"},
|
||||
{"farming:garlic", "farming:chili_pepper", "farming:onion"},
|
||||
{"", "farming:mortar_pestle", ""}},
|
||||
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = "water_life:repellant",
|
||||
recipe = {
|
||||
{"", "farming:cotton", ""},
|
||||
{"flowers:tulip_black", "flowers:mushroom_red", "flowers:geranium"},
|
||||
{"", "vessels:glass_bottle", ""}}
|
||||
})
|
||||
end
|
||||
|
||||
if not water_life.apionly then
|
||||
|
||||
minetest.register_craftitem("water_life:riverfish", {
|
||||
description = ("Riverfish"),
|
||||
inventory_image = "water_life_riverfish_item.png",
|
||||
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos)
|
||||
if number.all > water_life.maxmobs or number.fish > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:fish_tamed")
|
||||
obj = obj:get_luaentity()
|
||||
itemstack:take_item()
|
||||
obj.owner = name
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:piranha", {
|
||||
description = ("Piranha"),
|
||||
inventory_image = "water_life_piranha_item.png",
|
||||
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(5),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,nil,"water_life:piranha")
|
||||
if number.all > water_life.maxmobs or number.name > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:piranha_tamed")
|
||||
obj = obj:get_luaentity()
|
||||
itemstack:take_item()
|
||||
--obj.owner = name
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:coralfish", {
|
||||
description = ("Coralfish"),
|
||||
inventory_image = "water_life_coralfish_item.png",
|
||||
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,nil,"water_life:coralfish_tamed")
|
||||
if number.all > water_life.maxmobs or number.name > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:coralfish_tamed")
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.base = nil
|
||||
entity.owner = name
|
||||
entity.head = random(65535)
|
||||
end
|
||||
itemstack:take_item()
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:clownfish", {
|
||||
description = ("Clownfish"),
|
||||
inventory_image = "water_life_clownfish_item.png",
|
||||
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,nil,"water_life:clownfish_tamed")
|
||||
if number.all > water_life.maxmobs or number.name > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:clownfish_tamed")
|
||||
obj = obj:get_luaentity()
|
||||
itemstack:take_item()
|
||||
obj.owner = name
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:urchin_item", {
|
||||
description = ("Sea urchin"),
|
||||
inventory_image = "water_life_urchin_item.png",
|
||||
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,10,"water_life:urchin")
|
||||
if number.all > water_life.maxmobs or number.name > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = water_life.set_urchin(pos)
|
||||
obj = obj:get_luaentity()
|
||||
itemstack:take_item()
|
||||
--obj.owner = name
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_craftitem("water_life:jellyfish_item", {
|
||||
description = ("Jellyfish"),
|
||||
inventory_image = "water_life_jellyfish_item.png",
|
||||
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,10,"water_life:jellyfish")
|
||||
if number.all > water_life.maxmobs or number.name > 10 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:jellyfish")
|
||||
|
||||
if obj then itemstack:take_item() end
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_craftitem("water_life:snake_item", {
|
||||
description = ("Rattlesnake"),
|
||||
inventory_image = "water_life_snake_item.png",
|
||||
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
|
||||
stack_max = 10,
|
||||
liquids_pointable = false,
|
||||
range = 10,
|
||||
on_use = minetest.item_eat(5),
|
||||
groups = {food_meat = 1, flammable = 2},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if placer and not placer:is_player() then return itemstack end
|
||||
if not pointed_thing then return itemstack end
|
||||
if not pointed_thing.type == "node" then return itemstack end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local number = water_life.count_objects(pos,water_life.abr * 16,"water_life:snake")
|
||||
if number.all > water_life.maxmobs or number.name > 5 then return itemstack end
|
||||
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos,name) then return itemstack end
|
||||
|
||||
local obj = minetest.add_entity(pos, "water_life:snake")
|
||||
|
||||
if obj then itemstack:take_item() end
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:antiserum", {
|
||||
description = ("Antiserum, cures snake bites"),
|
||||
inventory_image = "water_life_antiserum.png",
|
||||
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
|
||||
liquids_pointable = false,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
if not user or not user:is_player() then return itemstack end
|
||||
|
||||
local name = user:get_player_name()
|
||||
local meta = user:get_meta()
|
||||
local score = user:get_hp()
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
||||
user:set_hp(score+10)
|
||||
itemstack:take_item()
|
||||
water_life.change_hud(user,"poison",0)
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
groups = {vessel = 1},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craftitem("water_life:repellant", {
|
||||
description = ("No moskitos for half a day"),
|
||||
inventory_image = "water_life_repell.png",
|
||||
wield_scale = {x = 0.4, y = 0.4, z = 0.4},
|
||||
liquids_pointable = false,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
if not user or not user:is_player() then return itemstack end
|
||||
|
||||
local name = user:get_player_name()
|
||||
local meta = user:get_meta()
|
||||
|
||||
meta:set_int("repellant",math.floor(os.time()))
|
||||
itemstack:take_item()
|
||||
|
||||
water_life.change_hud(user,"repellant")
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
groups = {vessel = 1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "water_life:antiserum",
|
||||
recipe = {"water_life:snake_item","water_life:snake_item","water_life:snake_item"},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("water_life:beaver_fur", {
|
||||
description = ("Beaver fur"),
|
||||
inventory_image = "water_life_beaverfur.png",
|
||||
groups = {flammable = 2, fur = 1}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
--muddy water
|
||||
|
||||
if water_life.muddy_water then
|
||||
|
||||
minetest.register_node("water_life:muddy_river_water_source", {
|
||||
description = "Muddy river water source",
|
||||
drawtype = "liquid",
|
||||
waving = 3,
|
||||
tiles = {
|
||||
{
|
||||
name="water_life_muddy_river_water_flowing.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
special_tiles = {
|
||||
{
|
||||
name="water_life_muddy_river_water_flowing.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
alpha = 224,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "water_life:muddy_river_water_flowing",
|
||||
liquid_alternative_source = "water_life:muddy_river_water_source",
|
||||
liquid_viscosity = 1,
|
||||
liquid_renewable = true,
|
||||
liquid_range = 3,
|
||||
post_effect_color = {a = 232, r = 92, g = 80, b = 48},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("water_life:muddy_river_water_flowing", {
|
||||
description = "Flowing muddy river water",
|
||||
drawtype = "flowingliquid",
|
||||
waving = 3,
|
||||
tiles = {"water_life_muddy_river_water_source.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
image="water_life_muddy_river_water_flowing.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
{
|
||||
image="water_life_muddy_river_water_flowing.png",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 224,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "flowing",
|
||||
liquid_alternative_flowing = "water_life:muddy_river_water_flowing",
|
||||
liquid_alternative_source = "water_life:muddy_river_water_source",
|
||||
liquid_viscosity = 1,
|
||||
liquid_renewable = true,
|
||||
liquid_range = 3,
|
||||
post_effect_color = {a = 232, r = 92, g = 80, b = 48},
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1,
|
||||
not_in_creative_inventory = 1},
|
||||
})
|
||||
|
||||
if minetest.get_modpath("bucket") then
|
||||
bucket.register_liquid(
|
||||
"water_life:muddy_river_water_source",
|
||||
"water_life:muddy_river_water_flowing",
|
||||
"water_life:bucket_muddy_river_water",
|
||||
"water_life_bucket_muddy_water.png",
|
||||
"Muddy Water Bucket",
|
||||
{water_bucket = 1}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- make corals to dye
|
||||
if minetest.get_modpath("dye") then
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:green",
|
||||
recipe = {"default:coral_green"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:cyan",
|
||||
recipe = {"default:coral_cyan"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:pink",
|
||||
recipe = {"default:coral_pink"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:magenta",
|
||||
recipe = {"water_life:coralmagenta"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "dye:blue",
|
||||
recipe = {"water_life:coralskyblue"},
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("unified_inventory") then
|
||||
minetest.register_craft({
|
||||
output = "water_life:croc_bag",
|
||||
recipe = {
|
||||
{"farming:string", "water_life:crocleather", "farming:string"},
|
||||
{"water_life:crocleather", "water_life:crocleather", "water_life:crocleather"},
|
||||
{"farming:string", "water_life:crocleather", "farming:string"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("water_life:croc_bag", {
|
||||
description = ("CrocBag"),
|
||||
inventory_image = "water_life_crocbag.png",
|
||||
groups = {bagslots=24},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craftitem("water_life:crocleather", {
|
||||
description = ("Crockleather"),
|
||||
inventory_image = "water_life_crocleather.png",
|
||||
wield_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
liquids_pointable = false,
|
||||
groups = {leather = 1, flammable = 2},
|
||||
})
|
|
@ -0,0 +1,82 @@
|
|||
|
||||
water_life.playerhud = {}
|
||||
water_life.playerhud.poison = {}
|
||||
water_life.playerhud.repellant = {}
|
||||
|
||||
|
||||
|
||||
water_life.hud_poison = {
|
||||
|
||||
hud_elem_type = "image",
|
||||
|
||||
position = {x=0.5, y=0.8},
|
||||
-- Left corner position of element
|
||||
|
||||
name = "water_life_poison",
|
||||
|
||||
scale = {x = 0.1, y = 0.1},
|
||||
|
||||
text = "water_life_emptyhud.png",
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
water_life.hud_repellant = {
|
||||
hud_elem_type = "image",
|
||||
|
||||
position = {x=0.55, y=0.8},
|
||||
-- Left corner position of element
|
||||
|
||||
name = "water_life_repellant",
|
||||
|
||||
scale = {x = 0.1, y = 0.1},
|
||||
|
||||
text = "water_life_emptyhud.png",
|
||||
}
|
||||
|
||||
|
||||
function water_life.change_hud(player,selection,switch)
|
||||
local value = ""
|
||||
if not player then return end
|
||||
if not selection then selection = "poison" end
|
||||
if not switch then switch = 1 end
|
||||
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if selection == "poison" then
|
||||
if switch == 1 then value = "water_life_poison.png" else value = "water_life_emptyhud.png" end
|
||||
player:hud_change(water_life.playerhud.poison[name], "text", value)
|
||||
end
|
||||
|
||||
if selection == "repellant" then
|
||||
if switch == 1 then value = "water_life_repellanthud.png" else value = "water_life_emptyhud.png" end
|
||||
player:hud_change(water_life.playerhud.repellant[name], "text", value)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not player then return end
|
||||
|
||||
local meta=player:get_meta()
|
||||
meta:set_int("repellant",0)
|
||||
local name = player:get_player_name()
|
||||
|
||||
water_life.playerhud.poison[name] = player:hud_add(water_life.hud_poison)
|
||||
water_life.playerhud.repellant[name] = player:hud_add(water_life.hud_repellant)
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
hunger_ng.set_effect(player:get_player_name(), "heal", "disabled")
|
||||
minetest.after(5, function(player)
|
||||
water_life.change_hud(player,"poison")
|
||||
end, player)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
-----------------------------------------------------------
|
||||
|
||||
water_life = {}
|
||||
water_life.version = "210207"
|
||||
water_life.version = "020201"
|
||||
water_life.shark_food = {}
|
||||
water_life.repellant = {}
|
||||
water_life.gull_bait = {}
|
||||
|
@ -43,9 +43,7 @@ water_life.bloody = minetest.settings:get_bool("water_life_bloody") or true
|
|||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
|
||||
|
||||
dofile(path.."/api.lua") -- load water_life api
|
||||
dofile(path.."/compat.lua")
|
||||
dofile(path.."/paths.lua") -- load pathfinding
|
||||
if water_life.muddy_water then dofile(path.."/mapgen.lua") end -- load muddy_water
|
||||
dofile(path.."/crafts.lua") -- load crafts
|
|
@ -0,0 +1,81 @@
|
|||
|
||||
#
|
||||
# Turn this Value to true, if you want poison to persist after death
|
||||
water_life_poison_after_death (Poison stays after death) bool false
|
||||
|
||||
# all settings for client menu or in minetest.conf on servers
|
||||
|
||||
# -
|
||||
# I am a baby, please turn off the dangerous wild animals
|
||||
water_life_dangerous (turn off agressive animals) bool false
|
||||
|
||||
# -
|
||||
# Sound volume adjustment
|
||||
# 0.9 means 90% of original sound volume
|
||||
# 1.1 means 110% of original sound volume
|
||||
# every step of 0.1 adds/reduces 10%
|
||||
water_life_soundadjust (volume adjustment) float 1.0
|
||||
|
||||
# -
|
||||
# controls spawn chance of whales 10 promille = 1 %
|
||||
water_life_whale_spawn_rate (Whales spawn chance in promille) int 100
|
||||
|
||||
# -
|
||||
# controls spawn chance of sharks 10 promille = 1 %
|
||||
water_life_shark_spawn_rate (Shark spawn chance in promille) int 100
|
||||
|
||||
# -
|
||||
# controls spawn chance of Riverfish 10 promille = 1 %
|
||||
water_life_fish_spawn_rate (Riverfish spawn chance in promille) int 1000
|
||||
|
||||
# -
|
||||
# controls spawn chance of sea urchins 10 promille = 1 %
|
||||
water_life_urchin_spawn_rate (Sea urchin spawn chance in promille) int 300
|
||||
|
||||
#-
|
||||
# controls spawn chance of clams 10 promille = 1 %
|
||||
water_life_clams_spawn_rate (Clams spawn chance in promille) int 500
|
||||
|
||||
# -
|
||||
# total max number of whales spawning in aktive area
|
||||
water_life_maxwhales (Max possible whales in aktive area) int 1
|
||||
|
||||
# -
|
||||
# total max number of sharks spawning in aktive area
|
||||
water_life_maxsharks (Max possible sharks in aktive area) int 5
|
||||
|
||||
# -
|
||||
# max lifetime of a moskito (default 120 = 2 minutes)
|
||||
water_life_moskitolifetime (Max lifetime of a moskito in seconds) int 120
|
||||
|
||||
|
||||
# -
|
||||
# total max number of animals in an aktive area
|
||||
# other mods might not care about this setting
|
||||
water_life_maxmobs (Max possible animals in aktive area) int 60
|
||||
|
||||
# -
|
||||
# turn this to true if you only need the api but do
|
||||
# not want to have the animals
|
||||
water_life_apionly (no animals please, I just need the api) bool false
|
||||
|
||||
# -
|
||||
#replace riverwater with muddywater
|
||||
#in rainforest and savanna biome
|
||||
water_life_muddy_water (muddy water in rainforest and savanna biome) bool false
|
||||
|
||||
#-
|
||||
# turn this value to true to see api function debug
|
||||
water_life_radar_debug (api function debug shown in chat) bool false
|
||||
|
||||
#-
|
||||
#number in days where new players are not affected by rattlesnake poison
|
||||
water_life_newplayerbonus (days for newplayer immune to rattlesnake) int 5
|
||||
|
||||
#-
|
||||
#I really hate insects, kill 'em all
|
||||
water_life_hate_insects (no spawning of insects if true) bool false
|
||||
|
||||
#-
|
||||
#Let me see all that blood - blood effect on
|
||||
water_life_bloody (blood effect on) bool true
|
|
@ -0,0 +1,442 @@
|
|||
local timer = 0
|
||||
local landtimer = 0
|
||||
local dttot=0
|
||||
local dtavg=0
|
||||
local dtnum=0
|
||||
local dtmax=0
|
||||
local dttimer = 10
|
||||
local pi = math.pi
|
||||
local random = water_life.random
|
||||
local landinterval = 120 -- check every 60 seconds for spawnpos on land
|
||||
local waterinterval = 40 -- check every 20 seconds for spawnpos in water
|
||||
|
||||
|
||||
local function getcount(name)
|
||||
if not name then
|
||||
return 0
|
||||
else
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function spawnstep(dtime)
|
||||
|
||||
-- dtime measurement by Termos
|
||||
if dtnum < 10001 then
|
||||
dttot=dttot+dtime
|
||||
dtnum=dtnum+1
|
||||
dtmax = dtime>dtmax and dtime or dtmax
|
||||
|
||||
if dttot>dttimer then
|
||||
dttimer=dttimer+10
|
||||
water_life.avg_dtime = dttot/dtnum
|
||||
water_life.max_dtime = dtmax
|
||||
dtmax=0
|
||||
end
|
||||
else -- reset after 10000 steps
|
||||
dtnum = 0
|
||||
dtavg = 0
|
||||
dttot = 0
|
||||
dtmax = 0
|
||||
dttimer = 10
|
||||
end
|
||||
-- end dtime measurement
|
||||
|
||||
timer = timer + dtime
|
||||
landtimer = landtimer + dtime
|
||||
|
||||
if timer > waterinterval then
|
||||
|
||||
|
||||
for _,plyr in ipairs(minetest.get_connected_players()) do
|
||||
|
||||
local toomuch = false
|
||||
|
||||
if plyr and plyr:is_player() then
|
||||
local meta = plyr:get_meta()
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
local score = plyr:get_hp()
|
||||
hunger_ng.set_effect(plyr:get_player_name(), "heal", "disabled")
|
||||
plyr:set_hp(score-1)
|
||||
end
|
||||
|
||||
if meta:get_int("repellant") > 0 then
|
||||
if math.floor(os.time()) - meta:get_int("repellant") > water_life.repeltime then
|
||||
water_life.change_hud(plyr,"repellant",0)
|
||||
meta:set_int("repellant",0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if plyr and plyr:is_player() and plyr:get_pos().y > -50 and plyr:get_pos().y < 150 and not water_life.apionly then -- each player gets a spawn chance every 10s on average
|
||||
|
||||
local pos = plyr:get_pos()
|
||||
local yaw = plyr:get_look_horizontal()
|
||||
local animal = water_life.count_objects(pos)
|
||||
local meta = plyr:get_meta()
|
||||
|
||||
if animal.all > water_life.maxmobs then toomuch = true end
|
||||
|
||||
-- find a pos randomly in look direction of player
|
||||
local radius = (water_life.abr * 12) -- 75% from 16 = 12 nodes
|
||||
radius = random(7,radius) -- not nearer than 7 nodes in front of player
|
||||
local angel = math.rad(random(75)) -- look for random angel 0 - 75 degrees
|
||||
if water_life.leftorright() then yaw = yaw + angel else yaw = yaw - angel end -- add or substract to/from yaw
|
||||
|
||||
local pos2 = mobkit.pos_translate2d(pos,yaw,radius) -- calculate position
|
||||
local depth, stype, surface = water_life.water_depth(pos2,25) -- get surface pos and water depth
|
||||
local bdata = water_life_get_biome_data(pos2) -- get biome data at spawn position
|
||||
local ground = {}
|
||||
local dalam = depth
|
||||
local landpos = nil
|
||||
local geckopos = nil
|
||||
local moskitopos = nil
|
||||
local mobname = ""
|
||||
|
||||
-- no need of so many postions on land
|
||||
if landtimer > landinterval then
|
||||
landpos = water_life.find_node_under_air(pos2)
|
||||
geckopos = water_life.find_node_under_air(pos2,5,{"group:tree","group:leaves","default:junglegrass"})
|
||||
if not water_life.ihateinsects then
|
||||
moskitopos = water_life.find_node_under_air(pos2,5,{"group:water","group:flora","group:crumbly"})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if moskitopos and not water_life.dangerous and moskitopos.y > -10 and moskitopos.y < 100 then
|
||||
local mlevel = minetest.get_node_light(moskitopos)
|
||||
local ptime = water_life.get_game_time()
|
||||
local mdata = water_life_get_biome_data(moskitopos)
|
||||
--minetest.chat_send_all("MOSKITO: "..dump(moskitopos).." : "..dump(mdata.temp).." : "..dump(ptime).." : "..dump(mlevel))
|
||||
--minetest.chat_send_all(">>> Bzzzz ... SPAWN")
|
||||
if ((ptime and ptime > 2) or mlevel < 8) and mdata.temp > 20 then --from 3pm to 5am or in shadows all day long
|
||||
|
||||
minetest.set_node(moskitopos, {name = "water_life:moskito"})
|
||||
minetest.get_node_timer(moskitopos):start(random(15,45))
|
||||
local pmeta = minetest.get_meta(moskitopos)
|
||||
pmeta:set_int("mlife",math.floor(os.time()))
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--some spawn on land, too
|
||||
|
||||
if landpos then
|
||||
local landdata = water_life_get_biome_data(landpos)
|
||||
|
||||
|
||||
if not water_life.dangerous then
|
||||
-- the snake
|
||||
mobname = 'water_life:snake'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50)
|
||||
if random(100) < faktor then
|
||||
local fits = minetest.is_protected(landpos,mobname)
|
||||
--minetest.chat_send_all(dump(fits))
|
||||
|
||||
if (string.match(landdata.name,"desert") or string.match(landdata.name,"savanna"))
|
||||
and not fits and landdata.temp > 15 then
|
||||
|
||||
local obj=minetest.add_entity(landpos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
--the beaver
|
||||
mobname = 'water_life:beaver'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 25)
|
||||
if random(100) < faktor then
|
||||
|
||||
if string.match(landdata.name,"coniferous") and landdata.temp > -5 and landdata.temp < 20 then
|
||||
|
||||
local obj=minetest.add_entity(landpos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if geckopos then
|
||||
local landdata = water_life_get_biome_data(geckopos)
|
||||
|
||||
mobname = 'water_life:gecko'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50)
|
||||
if random(100) < faktor then
|
||||
|
||||
|
||||
if (string.match(landdata.name,"rainforest") or string.match(landdata.name,"savanna"))
|
||||
and landdata.temp > 20 then
|
||||
|
||||
local obj=minetest.add_entity(geckopos,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--water spawn
|
||||
|
||||
if depth and depth > 0 then
|
||||
if water_life.radar_debug then
|
||||
water_life.temp_show(surface,9,5)
|
||||
minetest.chat_send_all(">>> Depth ="..dump(depth).." <<< "..dump(stype))
|
||||
minetest.chat_send_all(dump(bdata.name))
|
||||
end
|
||||
pos2 = surface
|
||||
|
||||
end
|
||||
|
||||
local liquidflag = nil
|
||||
|
||||
if stype == "default:water_source" then
|
||||
liquidflag = "sea"
|
||||
|
||||
elseif stype == "default:river_water_source" then
|
||||
liquidflag = "river"
|
||||
|
||||
elseif stype == "water_life:muddy_river_water_source" then
|
||||
liquidflag = "muddy"
|
||||
|
||||
elseif water_life.swampz and stype == "swaz:water_source" then
|
||||
liquidflag = "swamp"
|
||||
|
||||
end
|
||||
|
||||
if liquidflag and not toomuch and surface then
|
||||
ground = mobkit.pos_shift(surface,{y=(dalam*-1)})
|
||||
local pool = water_life.check_for_pool(nil,4,8,surface)
|
||||
|
||||
if water_life.radar_debug then
|
||||
minetest.chat_send_all(">> A pool: "..dump(pool).." <<")
|
||||
end
|
||||
|
||||
if not water_life.dangerous then
|
||||
|
||||
|
||||
if water_life.swampz then
|
||||
|
||||
mobname = 'water_life:alligator'
|
||||
local faktor = 100 - getcount(animal[mobname]) * 20
|
||||
if random(100) < faktor then
|
||||
local fits = false
|
||||
if string.match(bdata.name,"swampz") and liquidflag == "swamp" then fits = true end
|
||||
|
||||
if depth < 4 and fits then --gator min water depth
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = 'water_life:croc'
|
||||
local faktor = 100 - getcount(animal[mobname]) * 33
|
||||
if random(100) < faktor then
|
||||
local fits = false
|
||||
if string.match(bdata.name,"rainforest") or string.match(bdata.name,"savanna") then fits = true end
|
||||
|
||||
if depth < 4 and fits and pool == false then --croc min water depth and no pools - do not check for nil
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
|
||||
mobname = 'water_life:snake'
|
||||
local faktor = (100 - getcount(animal[mobname]) * 50) +25
|
||||
if random(100) < faktor then
|
||||
local fits = false
|
||||
if string.match(bdata.name,"desert") or string.match(bdata.name,"savanna") then fits = true end
|
||||
|
||||
if depth < 3 and fits then --snake max water depth
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
mobname = 'water_life:shark'
|
||||
if water_life.shark_spawn_rate >= random(1000) then
|
||||
|
||||
local bcheck = water_life.count_objects(pos2,12)
|
||||
if getcount(animal[mobname]) < water_life.maxsharks and liquidflag == "sea" and not bcheck["water_life:shark_buoy"]
|
||||
and not animal["water_life:croc"] then
|
||||
|
||||
if depth > 4 and pool == false then --shark min water depth
|
||||
local obj=minetest.add_entity(mobkit.pos_shift(ground,{y=2}),mobname) -- spawn it 2 nodes above sea ground
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
mobname = "water_life:gull"
|
||||
local faktor = 100 - getcount(animal[mobname]) * 20
|
||||
if random(100) < faktor and (liquidflag == "sea" or liquidflag == "river") then
|
||||
if depth > 2 and not water_life.check_for_pool(nil,2,10,surface)then
|
||||
--local spawn = mobkit.pos_shift(surface,{y=-1})
|
||||
--spawn.y = spawn.y + 12
|
||||
local obj=minetest.add_entity(surface,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:urchin"
|
||||
if water_life.urchin_spawn_rate >= random(1000) then
|
||||
|
||||
local upos1 = mobkit.pos_shift(ground,{x=-5,y=-2,z=-5})
|
||||
local upos2 = mobkit.pos_shift(ground,{x=5,y=2,z=5})
|
||||
local coraltable = minetest.find_nodes_in_area(upos1, upos2, water_life.urchinspawn)
|
||||
--local nearlife = water_life.count_objects(ground,5,"water_life:urchin")
|
||||
if coraltable and #coraltable > 0 and getcount(animal[mobname]) < 15 and liquidflag == "sea" then
|
||||
local coralpos = coraltable[random(#coraltable)]
|
||||
coralpos.y = coralpos.y +1
|
||||
local node = minetest.get_node(coralpos)
|
||||
|
||||
if node.name == "default:water_source" then
|
||||
local obj= water_life.set_urchin(coralpos) --minetest.add_entity(coralpos,mobname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:clams"
|
||||
if water_life.clams_spawn_rate >= random(1000) then
|
||||
local clpos1 = mobkit.pos_shift(ground,{x=-8, y=-2, z=8})
|
||||
local clpos2 = mobkit.pos_shift(ground,{x=8, y=2, z=8})
|
||||
local coraltable = minetest.find_nodes_in_area(clpos1, clpos2, water_life.clams_spawn)
|
||||
----minetest.chat_send_all("seagrass ="..dump(#coraltable))
|
||||
local nearlife = water_life.count_objects(ground,8,"water_life:clams")
|
||||
if coraltable and #coraltable > 0 and getcount(animal[mobname]) < 10 and liquidflag == "sea" then
|
||||
local coralpos = mobkit.pos_shift(coraltable[random(#coraltable)],{y=1})
|
||||
|
||||
local node = minetest.get_node(coralpos)
|
||||
if node.name == "default:water_source" then
|
||||
local obj= water_life.set_urchin(coralpos,"water_life:clams")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:jellyfish"
|
||||
|
||||
|
||||
local faktor = 100 - getcount(animal[mobname]) * 20
|
||||
if random(100) < faktor and liquidflag == "sea" and depth > 2 then
|
||||
local obj=minetest.add_entity(mobkit.pos_shift(ground,{y=2}),mobname)
|
||||
end
|
||||
|
||||
|
||||
mobname = "water_life:coralfish"
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
local cfpos1 = mobkit.pos_shift(ground,{x=-5,y=-2,z=-5})
|
||||
local cfpos2 = mobkit.pos_shift(ground,{x=5,y=2,z=5})
|
||||
local coraltable = minetest.find_nodes_in_area(cfpos1,cfpos2,water_life.urchinspawn)
|
||||
--local nearlife = water_life.count_objects(ground,nil,mobname)
|
||||
faktor = 100 - getcount(animal[mobname]) * 6.66
|
||||
if random(100) < faktor and liquidflag == "sea" and #coraltable > 1 then
|
||||
local cfish = coraltable[random(#coraltable)]
|
||||
cfish.y = cfish.y +1
|
||||
local maxfish = random(3,7)
|
||||
for i = 1,maxfish,1 do
|
||||
local obj=minetest.add_entity(cfish,mobname)
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.base = cfish
|
||||
entity.head = random(65535)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = "water_life:clownfish"
|
||||
|
||||
faktor = 100 - getcount(animal[mobname]) * 50
|
||||
if random(100) < faktor and liquidflag == "sea" and #coraltable > 1 then
|
||||
local cfish = coraltable[random(#coraltable)]
|
||||
cfish.y = cfish.y +1
|
||||
local obj=minetest.add_entity(cfish,mobname)
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.base = cfish
|
||||
end
|
||||
end
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
mobname = 'water_life:fish'
|
||||
--local nearlife = water_life.count_objects(pos2,24,"water_life:piranha")
|
||||
if water_life.fish_spawn_rate >= random(1000) and ((animal.all < (water_life.maxmobs-5)) or getcount(animal[mobname]) < 5) and (liquidflag == "river" or liquidflag == "muddy") then
|
||||
|
||||
local table = minetest.get_biome_data(pos)
|
||||
|
||||
if not water_life.dangerous and table and water_life.piranha_biomes[minetest.get_biome_name(table.biome)] then
|
||||
mobname = "water_life:piranha"
|
||||
end
|
||||
|
||||
if depth > 2 then -- min water depth for piranha and riverfish
|
||||
if mobname == "water_life:fish" then
|
||||
local obj=minetest.add_entity(pos2,mobname) -- ok spawn it already damnit
|
||||
else
|
||||
if getcount(animal[mobname]) < 10 then
|
||||
for i = 1,3,1 do
|
||||
local obj=minetest.add_entity(pos2,mobname) -- ok spawn it already damnit
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--minetest.chat_send_all(dump(minetest.pos_to_string(surface)).." "..dump(minetest.pos_to_string(ground)))
|
||||
|
||||
mobname = 'water_life:whale'
|
||||
if water_life.whale_spawn_rate >= random(1000) and getcount(animal[mobname]) < (water_life.maxwhales) and liquidflag == "sea" then
|
||||
|
||||
|
||||
if depth > 8 then -- min water depth for whales
|
||||
|
||||
local gotwhale = true
|
||||
local whpos = mobkit.pos_shift(surface,{y=-3})
|
||||
for i = 0,3,1 do
|
||||
local whpos2 = mobkit.pos_translate2d(whpos,math.rad(i*90),30)
|
||||
local under = water_life.find_collision(whpos,whpos2, false)
|
||||
----minetest.chat_send_all(dump(under))
|
||||
if under and under < 25 then
|
||||
gotwhale = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if gotwhale then local obj=minetest.add_entity(surface,mobname) end -- ok spawn it already damnit
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
timer = 0
|
||||
if landtimer > landinterval then landtimer = 0 end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
minetest.register_globalstep(spawnstep)
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
diff --git a/apa_patch.lua b/apa_patch.lua
|
||||
new file mode 100644
|
||||
index 0000000..d14688d
|
||||
--- /dev/null
|
||||
+++ b/apa_patch.lua
|
||||
@@ -0,0 +1,11 @@
|
||||
+
|
||||
+water_life.poison_after_death = minetest.settings:get_bool("water_life_poison_after_death") or false
|
||||
+
|
||||
+minetest.register_on_dieplayer(function(player)
|
||||
+ if not player then return end
|
||||
+ if water_life.poison_after_death then return end
|
||||
+
|
||||
+ local meta=player:get_meta()
|
||||
+ meta:set_int("snakepoison",0)
|
||||
+ water_life.change_hud(player,"poison",0)
|
||||
+end)
|
||||
\ No newline at end of file
|
||||
diff --git a/init.lua b/init.lua
|
||||
index 22c16c9..8b5a455 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -187,3 +187,5 @@ if minetest.get_modpath("farming") then
|
||||
end
|
||||
|
||||
|
||||
+-- Patch for a planet alive
|
||||
+dofile(path.."/apa_patch.lua")
|
||||
diff --git a/settingtypes.txt b/settingtypes.txt
|
||||
index 3864685..a28a034 100644
|
||||
--- a/settingtypes.txt
|
||||
+++ b/settingtypes.txt
|
||||
@@ -1,3 +1,8 @@
|
||||
+
|
||||
+#
|
||||
+# Turn this Value to true, if you want poison to persist after death
|
||||
+water_life_poison_after_death (Poison stays after death) bool false
|
||||
+
|
||||
# all settings for client menu or in minetest.conf on servers
|
||||
|
||||
# -
|
|
@ -0,0 +1,62 @@
|
|||
diff --git a/api.lua b/api.lua
|
||||
index c390549..78e30f0 100644
|
||||
--- a/api.lua
|
||||
+++ b/api.lua
|
||||
@@ -875,7 +875,7 @@ minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack,
|
||||
local meta = user:get_meta()
|
||||
local score = user:get_hp()
|
||||
|
||||
- if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) end
|
||||
+ if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
||||
water_life.change_hud(user,"poison",0)
|
||||
end
|
||||
|
||||
diff --git a/behaviors.lua b/behaviors.lua
|
||||
index 654fc5f..61935b6 100644
|
||||
--- a/behaviors.lua
|
||||
+++ b/behaviors.lua
|
||||
@@ -297,6 +297,7 @@ function water_life.lq_jumpattack(self,height,target,extra)
|
||||
local name = target:get_player_name()
|
||||
local join = meta:get_int("jointime")
|
||||
if not join or (os.time() - join) > water_life.newplayerbonus * 86400 then
|
||||
+ hunger_ng.set_effect(target:get_player_name(), "heal", "disabled")
|
||||
meta:set_int("snakepoison",1)
|
||||
water_life.change_hud(target,"poison")
|
||||
else
|
||||
diff --git a/crafts.lua b/crafts.lua
|
||||
index 84703e4..5e5bf71 100644
|
||||
--- a/crafts.lua
|
||||
+++ b/crafts.lua
|
||||
@@ -340,7 +340,7 @@ if not water_life.apionly then
|
||||
local meta = user:get_meta()
|
||||
local score = user:get_hp()
|
||||
|
||||
- if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) end
|
||||
+ if meta:get_int("snakepoison") > 0 then meta:set_int("snakepoison",0) hunger_ng.set_effect(user:get_player_name(), "heal", "enabled") end
|
||||
user:set_hp(score+10)
|
||||
itemstack:take_item()
|
||||
water_life.change_hud(user,"poison",0)
|
||||
diff --git a/hud.lua b/hud.lua
|
||||
index bff0dd4..1b205ba 100644
|
||||
--- a/hud.lua
|
||||
+++ b/hud.lua
|
||||
@@ -71,6 +71,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
water_life.playerhud.repellant[name] = player:hud_add(water_life.hud_repellant)
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
+ hunger_ng.set_effect(player:get_player_name(), "heal", "disabled")
|
||||
minetest.after(5, function(player)
|
||||
water_life.change_hud(player,"poison")
|
||||
end, player)
|
||||
diff --git a/spawn.lua b/spawn.lua
|
||||
index 00b5afc..bb46d6e 100644
|
||||
--- a/spawn.lua
|
||||
+++ b/spawn.lua
|
||||
@@ -58,6 +58,7 @@ local function spawnstep(dtime)
|
||||
|
||||
if meta:get_int("snakepoison") > 0 then
|
||||
local score = plyr:get_hp()
|
||||
+ hunger_ng.set_effect(plyr:get_player_name(), "heal", "disabled")
|
||||
plyr:set_hp(score-1)
|
||||
end
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
diff --git a/backup/npc.lua.bkp.before.process.lua b/backup/npc.lua.bkp.before.process.lua
|
||||
index 6134e46..89db0d5 100644
|
||||
--- a/backup/npc.lua.bkp.before.process.lua
|
||||
+++ b/backup/npc.lua.bkp.before.process.lua
|
||||
@@ -72,7 +72,7 @@ npc.texture_check = {
|
||||
-- Logging
|
||||
function npc.log(level, message)
|
||||
if npc.log_level[level] then
|
||||
- minetest.log("[advanced_npc] "..level..": "..message)
|
||||
+ minetest.log("info","[advanced_npc] "..level..": "..message)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1995,7 +1995,7 @@ function npc.schedule_check(self)
|
||||
-- Speed is default wandering speed. Target pos is node_pos
|
||||
-- Calculate dir if dir is random
|
||||
local dir = npc.commands.get_direction(start_pos, node_pos)
|
||||
- minetest.log("actions: "..dump(actions[node.name][i]))
|
||||
+ minetest.log("info","actions: "..dump(actions[node.name][i]))
|
||||
if actions[node.name][i].args.dir == "random" then
|
||||
dir = math.random(0,7)
|
||||
elseif type(actions[node.name][i].args.dir) == "number" then
|
||||
@@ -2086,7 +2086,7 @@ end
|
||||
-- and other functions that are assigned to the Lua entity definition
|
||||
-- This function is executed each time the NPC is loaded
|
||||
function npc.after_activate(self)
|
||||
- minetest.log("Self: "..dump(self))
|
||||
+ minetest.log("info","Self: "..dump(self))
|
||||
if not self.actions then
|
||||
npc.log("WARNING", "Found NPC on bad initialization state: no 'self.actions' object.\nReinitializing...")
|
||||
npc.initialize(self, self.object:getpos(), true)
|
||||
diff --git a/dialogue.lua b/dialogue.lua
|
||||
index f6968be..783dad2 100644
|
||||
--- a/dialogue.lua
|
||||
+++ b/dialogue.lua
|
||||
@@ -448,7 +448,7 @@ function npc.dialogue.start_dialogue(self, player, show_married_dialogue)
|
||||
dialogue = self.dialogues.normal[math.random(1, #self.dialogues.normal)]
|
||||
elseif chance >= 90 then
|
||||
-- Check if gift items hints are enabled
|
||||
- minetest.log("Self gift data enable: "..dump(self.gift_data.enable_gift_items_hints))
|
||||
+ minetest.log("info","Self gift data enable: "..dump(self.gift_data.enable_gift_items_hints))
|
||||
if self.gift_data.enable_gift_items_hints then
|
||||
-- Choose a random dialogue line from the favorite/disliked item hints
|
||||
dialogue = self.dialogues.hints[math.random(1, 4)]
|
||||
diff --git a/executable/actions.lua b/executable/actions.lua
|
||||
index cbb18aa..56db8a0 100644
|
||||
--- a/executable/actions.lua
|
||||
+++ b/executable/actions.lua
|
||||
@@ -1217,7 +1217,7 @@ function npc.commands.use_sittable(self, args)
|
||||
end
|
||||
-- Stand
|
||||
npc.enqueue_command(self, npc.commands.cmd.STAND, {pos=pos_out_of_sittable, dir=dir})
|
||||
- minetest.log("Setting sittable at "..minetest.pos_to_string(pos).." as not used")
|
||||
+ minetest.log("info","Setting sittable at "..minetest.pos_to_string(pos).." as not used")
|
||||
if enable_usage_marking then
|
||||
-- Set place as unused
|
||||
npc.locations.mark_place_used(pos, npc.locations.USE_STATE.NOT_USED)
|
||||
@@ -1264,7 +1264,7 @@ end
|
||||
-- going to be considered walkable for the algorithm to find a
|
||||
-- path.
|
||||
npc.commands.register_script("advanced_npc:walk_to_pos", function(self, args)
|
||||
- minetest.log("Received arguments: "..dump(args))
|
||||
+ minetest.log("info","Received arguments: "..dump(args))
|
||||
-- Get arguments for this task
|
||||
local use_access_node = true
|
||||
if args.use_access_node ~= nil then
|
||||
@@ -1332,7 +1332,7 @@ npc.commands.register_script("advanced_npc:walk_to_pos", function(self, args)
|
||||
if use_access_node == true then
|
||||
dir = npc.commands.get_direction(end_pos, node_pos)
|
||||
end
|
||||
- minetest.log("Dir: "..dump(dir))
|
||||
+ minetest.log("info","Dir: "..dump(dir))
|
||||
-- Change dir if using access_node
|
||||
npc.enqueue_command(self, npc.commands.cmd.STAND, {dir = dir})
|
||||
break
|
||||
@@ -1488,7 +1488,7 @@ npc.commands.register_script("advanced_npc:idle", function (self, args)
|
||||
else
|
||||
-- Set interval
|
||||
npc.commands.execute(self, npc.commands.cmd.SET_INTERVAL, {interval=obj_search_interval})
|
||||
- minetest.log("No obj found")
|
||||
+ minetest.log("info","No obj found")
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -1546,7 +1546,7 @@ npc.commands.register_script_function("advanced_npc:follow", "follow_player", fu
|
||||
local player_name = args.player_name
|
||||
local objs = minetest.get_objects_inside_radius(self.object:getpos(), args.radius)
|
||||
-- Check if objects were found
|
||||
- minetest.log("Objects found: "..dump(objs))
|
||||
+ minetest.log("info","Objects found: "..dump(objs))
|
||||
if #objs > 0 then
|
||||
for _,obj in pairs(objs) do
|
||||
if obj then
|
||||
diff --git a/executable/helper.lua b/executable/helper.lua
|
||||
index 438c980..3d2414c 100644
|
||||
--- a/executable/helper.lua
|
||||
+++ b/executable/helper.lua
|
||||
@@ -216,19 +216,19 @@ function npc.programs.helper.get_pos_argument(self, pos, use_access_node)
|
||||
local use_access_node = pos.use_access_node or false
|
||||
local try_alternative_if_used = pos.try_alternative_if_used or false
|
||||
local places = npc.locations.get_by_type(self, pos.place_type)
|
||||
- minetest.log("Place type: "..dump(pos.place_type))
|
||||
- minetest.log("Places: "..dump(places))
|
||||
+ minetest.log("info","Place type: "..dump(pos.place_type))
|
||||
+ minetest.log("info","Places: "..dump(places))
|
||||
-- Check index is valid on the places map
|
||||
if #places >= index then
|
||||
local place = places[index]
|
||||
-- Check if place is used, and if it is, find alternative if required
|
||||
if try_alternative_if_used == true then
|
||||
- minetest.log("Self places map: "..dump(self.places_map))
|
||||
- minetest.log("Place category: "..dump(pos.place_category))
|
||||
- minetest.log("Place type: "..dump(pos.place_type))
|
||||
- minetest.log("Original Place: "..dump(place))
|
||||
+ minetest.log("info","Self places map: "..dump(self.places_map))
|
||||
+ minetest.log("info","Place category: "..dump(pos.place_category))
|
||||
+ minetest.log("info","Place type: "..dump(pos.place_type))
|
||||
+ minetest.log("info","Original Place: "..dump(place))
|
||||
place = npc.locations.find_unused_place(self, pos.place_category, pos.place_type, place)
|
||||
- minetest.log("New place: "..dump(place))
|
||||
+ minetest.log("info","New place: "..dump(place))
|
||||
|
||||
if next(place) ~= nil then
|
||||
--minetest.log("Mark as used? "..dump(pos.mark_target_as_used))
|
||||
diff --git a/executable/instructions/builtin_instructions.lua b/executable/instructions/builtin_instructions.lua
|
||||
index b53b359..67ada14 100644
|
||||
--- a/executable/instructions/builtin_instructions.lua
|
||||
+++ b/executable/instructions/builtin_instructions.lua
|
||||
@@ -180,7 +180,7 @@ npc.programs.instr.register("advanced_npc:dig", function(self, args)
|
||||
npc.add_item_to_inventory(self, drop_itemname, 1)
|
||||
end
|
||||
-- Dig node
|
||||
- minetest.log("Setting air at pos: "..minetest.pos_to_string(pos))
|
||||
+ minetest.log("info","Setting air at pos: "..minetest.pos_to_string(pos))
|
||||
minetest.set_node(pos, {name="air"})
|
||||
end
|
||||
end
|
||||
diff --git a/executable/locations.lua b/executable/locations.lua
|
||||
index 9605a14..6553b06 100644
|
||||
--- a/executable/locations.lua
|
||||
+++ b/executable/locations.lua
|
||||
@@ -548,7 +548,7 @@ end
|
||||
-- furnaces, storage (e.g. chests) and openable (e.g. doors).
|
||||
-- Returns a table with these classifications
|
||||
function npc.locations.scan_area_for_usable_nodes(pos1, pos2)
|
||||
- minetest.log("Bed Nodes: "..dump(npc.locations.nodes.bed))
|
||||
+ minetest.log("info","Bed Nodes: "..dump(npc.locations.nodes.bed))
|
||||
local result = {
|
||||
bed_type = {},
|
||||
sittable_type = {},
|
||||
diff --git a/executable/programs/builtin/follow.lua b/executable/programs/builtin/follow.lua
|
||||
index ac52b1c..66d5e4e 100644
|
||||
--- a/executable/programs/builtin/follow.lua
|
||||
+++ b/executable/programs/builtin/follow.lua
|
||||
@@ -55,7 +55,7 @@ npc.programs.instr.register("advanced_npc:follow:follow_player", function(self,
|
||||
local player_name = args.player_name
|
||||
local objs = minetest.get_objects_inside_radius(self.object:getpos(), args.radius)
|
||||
-- Check if objects were found
|
||||
- minetest.log("Objects found: "..dump(objs))
|
||||
+ minetest.log("info","Objects found: "..dump(objs))
|
||||
if #objs > 0 then
|
||||
for _,obj in pairs(objs) do
|
||||
if obj then
|
||||
diff --git a/executable/programs/builtin/idle.lua b/executable/programs/builtin/idle.lua
|
||||
index d7891d5..b7b6ddd 100644
|
||||
--- a/executable/programs/builtin/idle.lua
|
||||
+++ b/executable/programs/builtin/idle.lua
|
||||
@@ -160,7 +160,7 @@ npc.programs.register("advanced_npc:idle", function(self, args)
|
||||
-- Set interval
|
||||
npc.programs.instr.execute(self, "advanced_npc:wait", {time=5})
|
||||
--npc.programs.instr.execute(self, npc.programs.instr.default.SET_PROCESS_INTERVAL, {interval=obj_search_interval})
|
||||
- minetest.log("No obj found")
|
||||
+ minetest.log("info","No obj found")
|
||||
end
|
||||
end
|
||||
end)
|
||||
diff --git a/executable/programs/builtin/use_sittable.lua b/executable/programs/builtin/use_sittable.lua
|
||||
index 2ec7260..30565c1 100644
|
||||
--- a/executable/programs/builtin/use_sittable.lua
|
||||
+++ b/executable/programs/builtin/use_sittable.lua
|
||||
@@ -17,7 +17,7 @@ npc.programs.register("advanced_npc:use_sittable", function(self, args)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
if action == npc.programs.const.node_ops.sittable.SIT then
|
||||
- minetest.log("Sitting...")
|
||||
+ minetest.log("info","Sitting...")
|
||||
-- Calculate position depending on bench
|
||||
-- Error here due to ignore. Need to come up with better solution
|
||||
if node.name == "ignore" then
|
||||
@@ -54,7 +54,7 @@ npc.programs.register("advanced_npc:use_sittable", function(self, args)
|
||||
end
|
||||
-- Stand
|
||||
npc.programs.instr.execute(self, npc.programs.instr.default.STAND, {pos=pos_out_of_sittable, dir=dir})
|
||||
- minetest.log("Setting sittable at "..minetest.pos_to_string(pos).." as not used")
|
||||
+ minetest.log("info","Setting sittable at "..minetest.pos_to_string(pos).." as not used")
|
||||
if enable_usage_marking then
|
||||
-- Set place as unused
|
||||
npc.locations.mark_place_used(pos, npc.locations.USE_STATE.NOT_USED)
|
||||
diff --git a/executable/programs/builtin/wander.lua b/executable/programs/builtin/wander.lua
|
||||
index 866be02..b9aa741 100644
|
||||
--- a/executable/programs/builtin/wander.lua
|
||||
+++ b/executable/programs/builtin/wander.lua
|
||||
@@ -48,7 +48,7 @@ npc.programs.register("advanced_npc:wander", function(self, args)
|
||||
})
|
||||
npc.exec.proc.enqueue(self, npc.programs.instr.default.STAND, {})
|
||||
else
|
||||
- minetest.log("Walking randomly")
|
||||
+ minetest.log("info","Walking randomly")
|
||||
-- Walk in a random direction
|
||||
local npc_pos = self.object:getpos()
|
||||
npc.exec.proc.enqueue(self, npc.programs.instr.default.WALK_STEP, {
|
||||
diff --git a/npc.lua b/npc.lua
|
||||
index 88d7442..a1b16ae 100755
|
||||
--- a/npc.lua
|
||||
+++ b/npc.lua
|
||||
@@ -65,7 +65,7 @@ npc.texture_check = {
|
||||
-- Logging
|
||||
function npc.log(level, message)
|
||||
if npc.log_level[level] then
|
||||
- minetest.log("[advanced_npc] "..level..": "..message)
|
||||
+ minetest.log("info","[advanced_npc] "..level..": "..message)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1102,7 +1102,7 @@ function npc.exec.interrupt(self, new_program, new_arguments, interrupt_options)
|
||||
_exec.priority_enqueue(self,
|
||||
{[1] = {program_name=new_program, arguments=new_arguments, interrupt_options=interrupt_options}})
|
||||
--minetest.log("Pause")
|
||||
- minetest.log("Interrupted process: "..dump(self.execution.process_queue[1]))
|
||||
+ minetest.log("info","Interrupted process: "..dump(self.execution.process_queue[1]))
|
||||
-- Check process - if the instruction queue is empty, do not store
|
||||
-- Pause current process
|
||||
_exec.pause_process(self)
|
||||
@@ -1205,7 +1205,7 @@ end
|
||||
function _exec.restore_process(self)
|
||||
local current_process = self.execution.process_queue[1]
|
||||
if current_process then
|
||||
- minetest.log("Restoring process: "..dump(current_process.program_name))
|
||||
+ minetest.log("info","Restoring process: "..dump(current_process.program_name))
|
||||
-- Change process state
|
||||
current_process.state = npc.exec.proc.state.RUNNING
|
||||
-- Check if any instruction was interrupted
|
||||
@@ -1215,7 +1215,7 @@ function _exec.restore_process(self)
|
||||
-- Restore position
|
||||
--self.object:setpos(current_process.current_instruction.pos)
|
||||
-- Execute instruction
|
||||
- minetest.log("Re-executing instruction: "..dump(current_process.current_instruction.entry.name))
|
||||
+ minetest.log("info","Re-executing instruction: "..dump(current_process.current_instruction.entry.name))
|
||||
_exec.proc.execute(self, current_process.current_instruction.entry)
|
||||
end
|
||||
end
|
||||
diff --git a/occupations/occupations.lua b/occupations/occupations.lua
|
||||
index 092f451..4108634 100644
|
||||
--- a/occupations/occupations.lua
|
||||
+++ b/occupations/occupations.lua
|
||||
@@ -387,7 +387,7 @@ function npc.occupations.initialize_occupation_values(self, occupation_name)
|
||||
self.selected_texture = "default_"..self.gender..".png"
|
||||
end
|
||||
end
|
||||
- minetest.log("Result: "..dump(self.selected_texture))
|
||||
+ minetest.log("info","Result: "..dump(self.selected_texture))
|
||||
|
||||
-- Set texture and base texture
|
||||
self.textures = {self.selected_texture}
|
||||
@@ -464,7 +464,7 @@ function npc.occupations.initialize_occupation_values(self, occupation_name)
|
||||
end
|
||||
|
||||
-- Initialize properties
|
||||
- minetest.log("def.properties: "..dump(def.properties))
|
||||
+ minetest.log("info","def.properties: "..dump(def.properties))
|
||||
if def.properties then
|
||||
-- Initialize trader status
|
||||
if def.properties.initial_trader_status then
|
||||
diff --git a/spawner.lua b/spawner.lua
|
||||
index 9c06f3f..3d47a3d 100644
|
||||
--- a/spawner.lua
|
||||
+++ b/spawner.lua
|
||||
@@ -299,8 +299,8 @@ function npc.spawner.determine_npc_occupation(building_type, workplace_nodes, np
|
||||
end
|
||||
else
|
||||
-- Try to match building type with the occupation local building types
|
||||
- minetest.log("Building type: "..dump(building_type))
|
||||
- minetest.log("Occupation local building types: "..dump(local_building_types))
|
||||
+ minetest.log("info","Building type: "..dump(building_type))
|
||||
+ minetest.log("info","Occupation local building types: "..dump(local_building_types))
|
||||
for i = 1, #occupation_names do
|
||||
for j = 1, #local_building_types do
|
||||
if building_type == local_building_types[j] then
|
||||
@@ -311,7 +311,7 @@ function npc.spawner.determine_npc_occupation(building_type, workplace_nodes, np
|
||||
end
|
||||
end
|
||||
end
|
||||
- minetest.log("Local building match after: "..dump(result))
|
||||
+ minetest.log("info","Local building match after: "..dump(result))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -323,9 +323,9 @@ function npc.spawner.determine_npc_occupation(building_type, workplace_nodes, np
|
||||
-- - If count is less than three (only two NPCs), default_basic occupation.
|
||||
-- - If count is greater than two, assign any eligible occupation with 50% chance
|
||||
-- - If not NPC is working, choose an occupation that is not default_basic
|
||||
- minetest.log("Current building occupations: "..dump(current_building_npc_occupations))
|
||||
- minetest.log("Result #: "..dump(#result))
|
||||
- minetest.log("Result: "..dump(result))
|
||||
+ minetest.log("info","Current building occupations: "..dump(current_building_npc_occupations))
|
||||
+ minetest.log("info","Result #: "..dump(#result))
|
||||
+ minetest.log("info","Result: "..dump(result))
|
||||
if next(current_building_npc_occupations) ~= nil then
|
||||
for i = 1, #current_building_npc_occupations do
|
||||
if current_building_npc_occupations[i] ~= npc.occupations.basic_name then
|
||||
@@ -839,7 +839,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
-- Scan for usable nodes
|
||||
local area_info = npc.spawner.scan_area_for_spawn(start_pos, end_pos, player:get_player_name(), pos)
|
||||
- minetest.log("Area info: "..dump(area_info))
|
||||
+ minetest.log("info","Area info: "..dump(area_info))
|
||||
-- Assign occupation
|
||||
local occupation_data = npc.spawner.determine_npc_occupation(
|
||||
fields.building_type or area_info.building_type,
|
||||
@@ -1094,8 +1094,8 @@ if minetest.get_modpath("mg_villages") ~= nil then
|
||||
-- TODO: Change formspec to a more detailed one.
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
- minetest.log("NPCs: "..dump(minetest.deserialize(meta:get_string("npcs"))))
|
||||
- minetest.log("Node data: "..dump(minetest.deserialize(meta:get_string("node_data"))))
|
||||
+ minetest.log("info","NPCs: "..dump(minetest.deserialize(meta:get_string("npcs"))))
|
||||
+ minetest.log("info","Node data: "..dump(minetest.deserialize(meta:get_string("node_data"))))
|
||||
return mg_villages.plotmarker_formspec( pos, nil, {}, clicker )
|
||||
end,
|
||||
|
||||
@@ -1201,7 +1201,7 @@ minetest.register_chatcommand("restore_area", {
|
||||
privs = {server = true},
|
||||
func = function(name, param)
|
||||
local args = npc.utils.split(param, " ")
|
||||
- minetest.log("Params: "..dump(args))
|
||||
+ minetest.log("info","Params: "..dump(args))
|
||||
if #args < 2 then
|
||||
minetest.chat_send_player("Please specify horizontal and vertical radius.")
|
||||
return
|
||||
diff --git a/trade/trade.lua b/trade/trade.lua
|
||||
index de535fc..56b814f 100644
|
||||
--- a/trade/trade.lua
|
||||
+++ b/trade/trade.lua
|
||||
@@ -451,8 +451,8 @@ function npc.trade.get_dedicated_trade_offers(self)
|
||||
-- If it is, create a sell offer, else create a buy offer if possible.
|
||||
-- Also, avoid creating sell offers immediately if the item was just bought
|
||||
local item = npc.inventory_contains(self, item_name)
|
||||
- minetest.log("Searched item: "..dump(item_name))
|
||||
- minetest.log("Found: "..dump(item))
|
||||
+ minetest.log("info","Searched item: "..dump(item_name))
|
||||
+ minetest.log("info","Found: "..dump(item))
|
||||
if item ~= nil and trade_info.last_offer_type ~= npc.trade.OFFER_BUY then
|
||||
-- Check if item can be sold
|
||||
if trade_info.item_sold_count == nil
|
|
@ -0,0 +1,22 @@
|
|||
diff --git a/trade/trade.lua b/trade/trade.lua
|
||||
index 56b814f..6526b9b 100644
|
||||
--- a/trade/trade.lua
|
||||
+++ b/trade/trade.lua
|
||||
@@ -173,7 +173,8 @@ function npc.trade.show_trade_offer_formspec(self, player, offer_type)
|
||||
prompt_string = " wants to sell to you"
|
||||
buy_sell_string = "Buy"
|
||||
end
|
||||
-
|
||||
+
|
||||
+ if trade_offer.item ~= nil then
|
||||
local formspec = "size[8,4]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
@@ -192,6 +193,7 @@ function npc.trade.show_trade_offer_formspec(self, player, offer_type)
|
||||
}
|
||||
-- Show formspec to player
|
||||
minetest.show_formspec(player:get_player_name(), "advanced_npc:trade_offer", formspec)
|
||||
+ end
|
||||
end
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
diff --git a/behaviors.lua b/behaviors.lua
|
||||
index baac807..453807d 100644
|
||||
--- a/behaviors.lua
|
||||
+++ b/behaviors.lua
|
||||
@@ -669,7 +669,21 @@ function goblins.tunneling(self, type)
|
||||
end
|
||||
|
||||
function goblins.danger_dig(self,freq,depth)
|
||||
- local pos = vector.round(self.object:get_pos())
|
||||
+ local self_pos = self.object:get_pos()
|
||||
+ if self_pos ~= nil then
|
||||
+ local vx = self_pos.x
|
||||
+ local vy = self_pos.y
|
||||
+ local vz = self_pos.z
|
||||
+ local pos = {x = math.floor(vx + 0.5),
|
||||
+ y = math.floor(vy + 0.5),
|
||||
+ z = math.floor(vz + 0.5)
|
||||
+ }
|
||||
+ --minetest.log("self_pos: "..dump(self_pos))
|
||||
+ else
|
||||
+ --minetest.log("self_pos: "..dump(self_pos))
|
||||
+ end
|
||||
+
|
||||
+ --local pos = vector.round(self.object:get_pos())
|
||||
if pos then
|
||||
local lol = minetest.get_node_light(pos) or 0
|
||||
local freq = freq or 0.1
|
||||
@@ -814,5 +828,3 @@ function goblins.goblin_dog_behaviors(self)
|
||||
--]]
|
||||
end
|
||||
end
|
||||
-
|
||||
-
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/data/dialogues_data.lua b/data/dialogues_data.lua
|
||||
index 8d1dae4..26dd4cb 100644
|
||||
--- a/data/dialogues_data.lua
|
||||
+++ b/data/dialogues_data.lua
|
||||
@@ -63,18 +63,18 @@ npc.dialogue.register_dialogue({
|
||||
text = "Yes, how can I help?",
|
||||
action_type = "dialogue",
|
||||
action = {
|
||||
- text = "Could you please give me 3 "..npc.trade.prices.currency.tier3.name.."?",
|
||||
+ text = "Could you please give me 3 "..npc.trade.prices.get_currency_name(npc.trade.prices.currency.tier3).."?",
|
||||
responses = {
|
||||
[1] = {
|
||||
text = "Yes, ok, here",
|
||||
action_type = "function",
|
||||
action = function(self, player)
|
||||
-- Take item
|
||||
- if npc.commands.execute(self, npc.commands.cmd.TAKE_ITEM, {
|
||||
+ if npc.programs.instr.execute(self, npc.programs.instr.default.TAKE_ITEM, {
|
||||
player=player:get_player_name(),
|
||||
pos=nil,
|
||||
inv_list="main",
|
||||
- item_name=npc.trade.prices.currency.tier3.string,
|
||||
+ item_name=npc.trade.prices.get_currency_itemstring("tier3"),
|
||||
count=3
|
||||
}) then
|
||||
-- Send message
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/data/occupations/default_farmer.lua b/data/occupations/default_farmer.lua
|
||||
index 673019b..b5452cd 100644
|
||||
--- a/data/occupations/default_farmer.lua
|
||||
+++ b/data/occupations/default_farmer.lua
|
||||
@@ -33,7 +33,7 @@ npc.programs.register("mg_villages_npc:farmer:walk_to_field", function(self, arg
|
||||
-- Get plotmarker
|
||||
local plotmarker_pos = npc.locations.get_by_type(self, npc.locations.data.other.home_plotmarker)
|
||||
-- There should always be just one plotmarker
|
||||
- minetest.log("Got: "..dump(plotmarker_pos))
|
||||
+ minetest.log("info","Got: "..dump(plotmarker_pos))
|
||||
plotmarker_pos = plotmarker_pos[1].pos
|
||||
-- Search building area for gates
|
||||
local meta = minetest.get_meta(plotmarker_pos)
|
|
@ -0,0 +1,82 @@
|
|||
diff --git a/api.lua b/api.lua
|
||||
index 013dae3..cce2937 100644
|
||||
--- a/api.lua
|
||||
+++ b/api.lua
|
||||
@@ -68,8 +68,27 @@ function fire_plus.burn_player(player, burns, damage, not_initial)
|
||||
maxexptime = 1,
|
||||
minsize = 3,
|
||||
maxsize = 3,
|
||||
- texture = "fire_basic_flame.png",
|
||||
+ texture = "smoke_puff.png",
|
||||
collisiondetection = true,
|
||||
+ glow = 0,
|
||||
+ attached = player,
|
||||
+ }),
|
||||
+ particlespawner_id2 = minetest.add_particlespawner({
|
||||
+ amount = 5,
|
||||
+ time = 0,
|
||||
+ minpos = vector.new(0, 0.5, -0.3),
|
||||
+ maxpos = vector.new( 0, 0.5, 0.3),
|
||||
+ minvel = {x = 0, y = 0, z = 0},
|
||||
+ maxvel = {x = 0, y = 0, z = 0},
|
||||
+ minacc = {x = 0, y = 0, z = 0},
|
||||
+ maxacc = {x = 0, y = 0, z = 0},
|
||||
+ minexptime = 0.5,
|
||||
+ maxexptime = 1,
|
||||
+ minsize = 10,
|
||||
+ maxsize = 10,
|
||||
+ texture = "fire_basic_flame_animated.png",
|
||||
+ animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 1,},
|
||||
+ collisiondetection = false,
|
||||
glow = minetest.LIGHT_MAX,
|
||||
attached = player,
|
||||
})
|
||||
@@ -120,6 +139,7 @@ function fire_plus.extinguish_player(player)
|
||||
end
|
||||
|
||||
minetest.delete_particlespawner(fire_plus.burning[name].particlespawner_id)
|
||||
-
|
||||
+ minetest.delete_particlespawner(fire_plus.burning[name].particlespawner_id2)
|
||||
+
|
||||
fire_plus.burning[name] = nil
|
||||
end
|
||||
diff --git a/init.lua b/init.lua
|
||||
index f89a241..43cc4f7 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -24,6 +24,8 @@ fire_plus = {
|
||||
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/api.lua")
|
||||
|
||||
local time = 0
|
||||
+local img_num = 1
|
||||
+local img_num_max = 8
|
||||
minetest.register_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
|
||||
@@ -40,6 +42,26 @@ minetest.register_globalstep(function(dtime)
|
||||
|
||||
if fire_plus.burning[name] then
|
||||
|
||||
+ -- change HUD to next image to simulate animation
|
||||
+ --local img_name = "fire_basic_flame_"..img_num..".png"
|
||||
+ img_name = "fire_basic_flame_animated.png".."^[verticalframe:"..img_num_max..":"..img_num
|
||||
+ --minetest.log(dump(img_name))
|
||||
+ player:hud_remove(fire_plus.burning[name].hud_id)
|
||||
+ fire_plus.burning[name].hud_id = player:hud_add({
|
||||
+ hud_elem_type = "image",
|
||||
+ position = {x = 0.5, y = 0.95},
|
||||
+ offset = {x = 0, y = 0},
|
||||
+ text = img_name,
|
||||
+ alignment = -1,
|
||||
+ scale = {x = 100, y = 32},
|
||||
+ number = 0xFFFFFF,
|
||||
+ })
|
||||
+ if img_num >= img_num_max then
|
||||
+ img_num = 1
|
||||
+ else
|
||||
+ img_num = img_num + 1
|
||||
+ end
|
||||
+
|
||||
local nodename = minetest.get_node(player:get_pos()).name
|
||||
local nodename_head = minetest.get_node(vector.add(player:get_pos(),
|
||||
vector.new(0, 1, 0))).name
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/init.lua b/init.lua
|
||||
index 3e5ff0d..18f5150 100644
|
||||
--- a/init.lua
|
||||
+++ b/init.lua
|
||||
@@ -230,7 +230,7 @@ local function sprint_step(player, dtime)
|
||||
local hunger = 30
|
||||
if starve == "hbhunger" then
|
||||
hunger = tonumber(hbhunger.hunger[name])
|
||||
- elseif starve == "hunger_ng" then
|
||||
+ elseif starve == "hunger_ng" and minetest.is_yes(minetest.settings:get('enable_damage')) then
|
||||
hunger = hunger_ng.get_hunger_information(name).hunger.exact
|
||||
end
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
horrible spring sdzen
|
||||
sdzen
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
rize
|
||||
rexyGYM
|
||||
CC BY-NC-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
alejandra
|
||||
rexyGYM
|
||||
CC BY 4.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Aurora (child of light)
|
||||
WD/Ubisoft
|
||||
CC BY-NC-SA 4.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Xenia
|
||||
HeyGirlHey
|
||||
CC BY 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
stef325
|
||||
stef325
|
||||
CC 0 (1.0)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Cloé
|
||||
Sporax
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Julia
|
||||
nelly
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Morgane
|
||||
loupicate
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Elf
|
||||
loupicate
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Angel
|
||||
nelly
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Summer
|
||||
lizzie
|
||||
CC BY-NC-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Female angel
|
||||
loupicate
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Elf
|
||||
loupicate
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Blonde Girl
|
||||
Rin
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
bikini
|
||||
anonme
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
White Music Girl
|
||||
ElMehdiBen
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
MLP-Fluttershy
|
||||
julito
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Flower Girl
|
||||
julito
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Rin-chan 1
|
||||
Rin
|
||||
CC BY-NC-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Tahlia
|
||||
loupicate
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
MC cute girls polar bear
|
||||
SAM7777
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
lisa
|
||||
hansuke123
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Blue Wolf-Girl
|
||||
AuroreTheWolf
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Pretresse
|
||||
AuroreTheWolf
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
bear63681
|
||||
SAM7777
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
CreativeFox
|
||||
SAM7777
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
FluffyGirl
|
||||
SAM7777
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Nenha
|
||||
SAM7777
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Abril
|
||||
julito
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Custom Skin 1
|
||||
Rin0002
|
||||
CC BY 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Black Flower Crown
|
||||
Rin0002
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Name this pls 2
|
||||
Rin0002
|
||||
CC BY 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Ladyvioletkitty
|
||||
lordphoenixmh
|
||||
CC BY 4.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Lilly
|
||||
Karelys26
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Nani
|
||||
Karelys26
|
||||
CC BY-NC-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Karita
|
||||
Karelys26
|
||||
CC BY-NC-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Athena
|
||||
skindex
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Lotte
|
||||
skindex
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Yuzuki_Airi
|
||||
planetmc
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Raina
|
||||
XrystalFox
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Marisa
|
||||
ZUN
|
||||
CC 0 (1.0)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
KittyKat_2
|
||||
skindex
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
KittyKat
|
||||
skindex
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Mammu
|
||||
hansuke123
|
||||
CC BY-SA 3.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Yuzuki_Airi
|
||||
skindex
|
||||
CC BY-SA 3.0
|
||||
|