Alpha Version

master
ExeVirus 2020-12-27 17:37:12 -05:00
parent ae2b14150d
commit 44edc28f9c
31 changed files with 149352 additions and 150670 deletions

36
api.lua
View File

@ -1,4 +1,12 @@
-- API
function adv_core.check_pouch(name)
local pouch = minetest.deserialize(adv_core.mod_storage:get_string(tostring(name) .. "pouch"))
if pouch == nil then
return false
else
return true
end
end
function adv_core.load_pouch(name)
local pouch = minetest.deserialize(adv_core.mod_storage:get_string(tostring(name) .. "pouch"))
@ -43,11 +51,15 @@ end
function adv_core.player_can_afford(name, fire, water, earth, air)
--load player pouch
local player_pouch = adv_core.load_pouch(name)
fire = tonumber(fire) or 0
water = tonumber(water) or 0
earth = tonumber(earth) or 0
air = tonumber(air) or 0
local fire_ok = player_pouch.fire >= fire
local water_ok = player_pouch.water >= water
local earth_ok = player_pouch.earth >= earth
local water_ok = player_pouch.air >= air
local fire_ok = (player_pouch.fire >= fire)
local water_ok = (player_pouch.water >= water)
local earth_ok = (player_pouch.earth >= earth)
local air_ok = (player_pouch.air >= air)
if fire_ok and water_ok and earth_ok and air_ok then
return true
@ -58,7 +70,15 @@ end
-- (reward player with elements, pay with elements, register nodes to purchase for shop)
function adv_core.reward_player(name, fire, water, earth, air, notify)
if name == nil then
return false
end
local player_pouch = adv_core.load_pouch(name)
fire = fire or 0
water = water or 0
earth = earth or 0
air = air or 0
notify = notify or true
player_pouch.fire = player_pouch.fire + fire
player_pouch.water = player_pouch.water + water
@ -67,11 +87,11 @@ function adv_core.reward_player(name, fire, water, earth, air, notify)
if notify then
--notify player:
minetest.chat_send_player(player_name,
minetest.chat_send_player(minetest.get_color_escape_sequence("green") .. name,
"You've been rewarded elemental essence!"
)
minetest.chat_send_player(player_name,
minetest.chat_send_player(name,
minetest.get_color_escape_sequence("red") .. "Fire: " .. player_pouch.fire ..
minetest.get_color_escape_sequence("blue") .. " Water: " .. player_pouch.water ..
minetest.get_color_escape_sequence("green") .. " Earth: " .. player_pouch.earth ..
@ -93,11 +113,11 @@ function adv_core.take_from_player(name, fire, water, earth, air, notify)
if notify then
--notify player:
minetest.chat_send_player(player_name,
minetest.chat_send_player(name,
"Elemental essence taken!"
)
minetest.chat_send_player(player_name,
minetest.chat_send_player(name,
minetest.get_color_escape_sequence("red") .. "Fire: " .. player_pouch.fire ..
minetest.get_color_escape_sequence("blue") .. " Water: " .. player_pouch.water ..
minetest.get_color_escape_sequence("green") .. " Earth: " .. player_pouch.earth ..

View File

@ -1,5 +1,29 @@
-- CHAT COMMANDS
local red = minetest.get_color_escape_sequence("red")
if adv_core.setting("enable_chat_commands",true) then
-- for give command
local function give(player_name, item)
local itemstack = ItemStack(item)
if itemstack:is_empty() then
return false
elseif (not itemstack:is_known()) or (itemstack:get_name() == "unknown") then
return false -- "Cannot give an unknown item"
-- Forbid giving 'ignore' due to unwanted side effects
elseif itemstack:get_name() == "ignore" then
return false -- "Giving 'ignore' is not allowed"
end
local playerref = minetest.get_player_by_name(player_name)
--Give to Player
local leftover = playerref:get_inventory():add_item("main", itemstack)
if not leftover:is_empty() then
return false
end
return true
end
if adv_core.setting("enable_adventure_shop_chat",true) then
minetest.register_chatcommand("shop", {
@ -25,6 +49,15 @@ if adv_core.setting("enable_chat_commands",true) then
privs = {interact = true},
func = function(name)
if adv_core.player_can_afford(name, 5, 5, 5, 5) then
if give(name, "adventure_core:shop") then
adv_core.take_from_player(name, 5, 5, 5, 5, false)
else
minetest.chat_send_player(name, red .."Adventure_Core: No room in inventory!")
end
else
minetest.chat_send_player(name, red .. "Sorry, need more elemental essence!")
end
return true
end,
})
@ -43,17 +76,6 @@ if adv_core.setting("enable_chat_commands",true) then
end,
})
--Priv only API commands
--Set player pouch contents
--spawn elements
--
end
minetest.register_chatcommand("guidebook", {
params = "<name> <privilege>",
@ -66,4 +88,110 @@ end
return true
end,
})
--register admin priv
minetest.register_privilege("adv_core_admin", { description = "Adventure_Core Admin Commands", give_to_singleplayer = false, give_to_admin = true, }
)
--Priv only API commands
--Get player pouch contents
minetest.register_chatcommand("get_pouch", {
params = "<player_to_check>",
description = "Check the element pouch of any player on the server",
privs = {interact = true, adv_core_admin = true},
func = function (name, player_to_check)
if adv_core.check_pouch(player_to_check) then
minetest.show_formspec(name, "adventure_core:pouch", adv_core.pouch_formspec(player_to_check))
else
minetest.chat_send_player(name, red .. "That player doesn't exist yet")
end
return true
end,
})
--Set Player Pouch
minetest.register_chatcommand("set_pouch", {
params = "<player_to_set> <fire> <water> <earth> <air>",
description = "Check the element pouch of any player on the server",
privs = {interact = true, adv_core_admin = true},
func = function (name, params)
local pouch
local player_to_set, fire, water, earth, air = params:match(
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
if adv_core.check_pouch(player_to_set) then
pouch = adv_core.load_pouch(player_to_set)
else
minetest.chat_send_player(name, red .. "Command entered incorrectly")
return true
end
pouch.fire = tonumber(fire) or pouch.fire
pouch.water = tonumber(water) or pouch.water
pouch.earth = tonumber(earth) or pouch.earth
pouch.air = tonumber(air) or pouch.air
adv_core.mod_storage:set_string(player_to_set .. "pouch", minetest.serialize(pouch))
return true
end,
})
--Reward Player
minetest.register_chatcommand("adv_reward", {
params = "<player_to_reward> <fire> <water> <earth> <air>",
description = "Check the element pouch of any player on the server",
privs = {interact = true, adv_core_admin = true},
func = function (name, params)
local player_to_reward, fire, water, earth, air = params:match(
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
if adv_core.check_pouch(player_to_reward) then
if adv_core.reward_player(player_to_reward, tonumber(fire), tonumber(water), tonumber(earth), tonumber(air), true) == false then
minetest.chat_send_player(name, minetest.get_color_escape_sequence("red") .. "Invalid name entered")
end
else
minetest.chat_send_player(name, red .. "That player doesn't exist yet")
end
return true
end,
})
--spawn Element
minetest.register_chatcommand("spawn_element", {
params = "<element_type> <x> <y> <z>",
description = "Spawn element (fire, water, earth, air) at position specified",
privs = {interact = true, adv_core_admin = true},
func = function (name, params)
local element_type, x, y, z = params:match(
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
x = tonumber(x) or 0
y = tonumber(y) or 0
z = tonumber(z) or 0
if element_type == "fire" then
adv_core.spawn_element(element_type, {x=x,y=y,z=z})
elseif element_type == "water" then
adv_core.spawn_element(element_type, {x=x,y=y,z=z})
elseif element_type == "water" then
adv_core.spawn_element(element_type, {x=x,y=y,z=z})
elseif element_type == "water" then
adv_core.spawn_element(element_type, {x=x,y=y,z=z})
else
minetest.chat_send_player(name,"'" .. element_type "' is not a valid element")
end
return true
end,
})
end

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,7 @@ local red = minetest.get_color_escape_sequence("red")
local blue = minetest.get_color_escape_sequence("blue")
local green = minetest.get_color_escape_sequence("green")
local yellow = minetest.get_color_escape_sequence("yellow")
local black = minetest.get_color_escape_sequence("#111111")
local black = minetest.get_color_escape_sequence("#111111")
-- Guidebook formspec (with or without default)
function adv_core.guide_formspec(name)
@ -111,16 +111,16 @@ function adv_core.store_formspec(name, page, search, selected)
"bgcolor[#866f4c;both;#00000080]",
"box[0.2,0.2;15.6,11.6;#dec29cFF]",
--pouch
"box[0.3,2.4;0.6,6.6;#564222FF]",
"image[0.4,2.6;0.4,0.4;pouch.png]",
"image[0.35,3.2;0.5,0.5;fire.png]",
"image[0.35,4.6;0.5,0.5;water.png]",
"image[0.35,6.0;0.5,0.5;earth.png]",
"image[0.35,7.4;0.5,0.5;air.png]",
"hypertext[0.45,3.9;1.5,1;;<global halign=left size=16 font=regular color=#F00> ", pouch.fire, "]",
"hypertext[0.45,5.3;1.5,1;;<global halign=left size=16 font=regular color=#00F> ", pouch.water, "]",
"hypertext[0.45,6.8;1.5,1;;<global halign=left size=16 font=regular color=#0F0> ", pouch.earth, "]",
"hypertext[0.45,8.1;1.5,1;;<global halign=left size=16 font=regular color=#FF0> ", pouch.air, "]",
"box[0.3,2.4;0.7,6.6;#564222FF]",
"image[0.42,2.6;0.4,0.4;pouch.png]",
"image[0.38,3.2;0.5,0.5;fire.png]",
"image[0.38,4.6;0.5,0.5;water.png]",
"image[0.38,6.0;0.5,0.5;earth.png]",
"image[0.38,7.4;0.5,0.5;air.png]",
"hypertext[0.38,3.9;1.5,1;;<global halign=left size=16 font=regular color=#F00> ", pouch.fire, "]",
"hypertext[0.38,5.3;1.5,1;;<global halign=left size=16 font=regular color=#00F> ", pouch.water, "]",
"hypertext[0.38,6.8;1.5,1;;<global halign=left size=16 font=regular color=#0F0> ", pouch.earth, "]",
"hypertext[0.38,8.1;1.5,1;;<global halign=left size=16 font=regular color=#FF0> ", pouch.air, "]",
--Search Bar
"field[9.0,10;5,0.6;search;;",search,"]",
"field_close_on_enter[search;false]",
@ -219,11 +219,14 @@ function adv_core.store_formspec(name, page, search, selected)
--Selected Item Display
if selected ~= nil and selected ~= "" then
--show item
formspec[#formspec+1] = "item_image_button[2,2;4,4;"
formspec[#formspec+1] = "hypertext[1.5,1.8;5,1;;<global halign=center size=18 color=#000>"
formspec[#formspec+1] = minetest.registered_nodes[selected].description or selected
formspec[#formspec+1] = "]"
formspec[#formspec+1] = "item_image_button[2,2.8;4,4;"
formspec[#formspec+1] = selected
formspec[#formspec+1] = ";;]"
--Show Costs
formspec[#formspec+1] = "hypertext[2,6;7,1;;<global halign=left size=16 font=regular color=#000> Fire: "
formspec[#formspec+1] = "hypertext[1.5,6.8;7,1;;<global halign=left size=16 font=regular color=#000> Fire: "
formspec[#formspec+1] = objectTable[selected].fire
formspec[#formspec+1] = " Water: "
formspec[#formspec+1] = objectTable[selected].water
@ -234,10 +237,10 @@ function adv_core.store_formspec(name, page, search, selected)
formspec[#formspec+1] = "]"
--Show "Create" button
if adv_core.player_can_afford_object(name, selected) then
formspec[#formspec+1] = "button[3,7;2,1.5;create;Create]"
formspec[#formspec+1] = "button[3,7.8;2,1.5;create;Create]"
else
formspec[#formspec+1] = "button[2,7;4,1.5;;Can't Afford]"
formspec[#formspec+1] = "box[2,7;4,1.5;#8008]"
formspec[#formspec+1] = "button[2,7.8;4,1.5;;Can't Afford]"
formspec[#formspec+1] = "box[2,7.8;4,1.5;#8008]"
end
end
@ -278,7 +281,7 @@ local function give(player_name, item)
adv_core.take_from_player(player_name, object.fire, object.water, object.earth, object.air, false)
--play successful sound
minetest.sound_play("adv_core_success", { to_player = player_name, gain = 1.0 })
minetest.sound_play("adv_core_success", { to_player = player_name, gain = 0.3 })
return true
end

View File

@ -6,31 +6,30 @@
-- Aventure Core Mod by ExeVirus
-- Font used in title: Graceful
--
-- See https://github.com/ExeVirus/adventure_core/wiki for more information
adv_core={} --contains all functions and global variables
adv_core.mod_storage = minetest.get_mod_storage()
-- Settings
-- Settings 98% DONE
dofile(minetest.get_modpath("adventure_core").."/settings.lua")
-- Register the element entities
-- Register the element entities DONE
dofile(minetest.get_modpath("adventure_core").."/elements.lua")
-- API for this and other mods
-- (reward player with elements, pay with elements, register nodes to purchase for shop, etc.)
-- API for this and other mods DONE
-- (reward player with elements, pay with elements, **register nodes to purchase in shop**, etc.)
dofile(minetest.get_modpath("adventure_core").."/api.lua")
-- Formspecs (guide,store,pouch)
-- Formspecs (guide,store,pouch) DONE
dofile(minetest.get_modpath("adventure_core").."/formspecs.lua")
-- Register the Built-in Nodes
-- Register the Built-in Nodes DONE
dofile(minetest.get_modpath("adventure_core").."/register.lua")
-- Spawning, including player spawning items
-- Spawning, including player spawning items 85% DONE
dofile(minetest.get_modpath("adventure_core").."/spawning.lua")
-- Chat Commands
-- Chat Commands DONE
dofile(minetest.get_modpath("adventure_core").."/chat_commands.lua")

BIN
mod.conf

Binary file not shown.

1892
models/axe_stump.obj Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

565
models/campfire.obj Normal file
View File

@ -0,0 +1,565 @@
# Blender v2.82 (sub 7) OBJ File: ''
# www.blender.org
mtllib campfire.mtl
g logs_Logs_Logs_campfire_logs
v -0.656667 -0.500000 -0.366511
v -0.366511 -0.330980 -0.656667
v -0.366511 -0.500000 -0.656667
v -0.656667 -0.330980 -0.366511
v 0.366511 -0.330980 0.656667
v 0.656667 -0.500000 0.366511
v 0.656667 -0.330980 0.366512
v 0.366511 -0.500000 0.656667
v 0.629127 -0.218300 0.178412
v 0.629127 -0.500000 -0.178412
v 0.629127 -0.218300 -0.178411
v 0.629127 -0.500000 0.178412
v -0.629127 -0.500000 0.178412
v -0.629127 -0.218300 -0.178411
v -0.629127 -0.500000 -0.178412
v -0.629127 -0.218300 0.178412
v 0.178412 -0.218300 0.629127
v -0.178412 -0.500000 0.629127
v 0.178412 -0.500000 0.629127
v -0.178412 -0.218300 0.629127
v -0.178412 -0.218300 -0.629127
v 0.178412 -0.500000 -0.629127
v -0.178412 -0.500000 -0.629127
v 0.178412 -0.218300 -0.629127
v 0.656667 -0.330980 -0.366511
v 0.366511 -0.500000 -0.656667
v 0.366511 -0.330980 -0.656667
v 0.656667 -0.500000 -0.366511
v -0.366511 -0.500000 0.656667
v -0.656667 -0.330980 0.366512
v -0.656667 -0.500000 0.366511
v -0.366511 -0.330980 0.656667
v -0.178412 -0.359568 -0.468562
v -0.178412 -0.500000 -0.468563
v -0.468563 -0.359568 -0.178411
v -0.468563 -0.500000 -0.178412
v 0.468563 -0.359569 0.178412
v 0.468563 -0.500000 0.178412
v 0.178412 -0.500000 -0.468563
v 0.178412 -0.359568 -0.468562
v 0.178412 -0.359569 0.468567
v 0.178412 -0.500000 0.468563
v -0.178412 -0.299025 -0.178411
v -0.178412 -0.381614 -0.178411
v -0.178412 -0.299026 0.178412
v 0.000000 -0.330980 0.000000
v 0.178412 -0.299026 0.178412
v -0.468563 -0.359569 0.178412
v -0.178412 -0.359569 0.468567
v -0.178412 -0.381614 0.178412
v 0.468563 -0.359568 -0.178411
v 0.178412 -0.381614 -0.178411
v 0.178412 -0.381614 0.178412
v -0.178412 -0.500000 0.468563
v 0.178412 -0.299025 -0.178411
v -0.468563 -0.500000 0.178412
v 0.468563 -0.500000 -0.178412
vt 0.002002 0.943443
vt 0.221221 0.890891
vt 0.221221 0.943443
vt 0.832332 0.446446
vt 0.779780 0.665666
vt 0.832332 0.665666
vt 0.668669 0.998999
vt 0.776777 0.946446
vt 0.776777 0.998999
vt 0.943443 0.002002
vt 0.890891 0.221221
vt 0.943443 0.221221
vt 0.446446 0.665666
vt 0.665666 0.557558
vt 0.665666 0.665666
vt 0.443443 0.446446
vt 0.335335 0.665666
vt 0.443443 0.665666
vt 0.446446 0.554555
vt 0.665666 0.446446
vt 0.665666 0.554555
vt 0.332332 0.668669
vt 0.224224 0.887888
vt 0.332332 0.887888
vt 0.221221 0.779780
vt 0.002002 0.887888
vt 0.221221 0.887888
vt 0.001001 0.886887
vt 0.220220 0.778779
vt 0.001001 0.778779
vt 0.331331 0.667668
vt 0.223223 0.886887
vt 0.223223 0.667668
vt 0.445445 0.553554
vt 0.664665 0.445445
vt 0.445445 0.445445
vt 0.668669 0.887888
vt 0.887888 0.835335
vt 0.887888 0.887888
vt 0.334334 0.664665
vt 0.442442 0.445445
vt 0.334334 0.445445
vt 0.886887 0.834334
vt 0.667668 0.886887
vt 0.667668 0.834334
vt 0.889890 0.220220
vt 0.942442 0.001001
vt 0.889890 0.001001
vt 0.998999 0.113113
vt 0.946446 0.221221
vt 0.998999 0.221221
vt 0.002002 0.998999
vt 0.110110 0.946446
vt 0.110110 0.998999
vt 0.776777 0.890891
vt 0.668669 0.943443
vt 0.776777 0.943443
vt 0.946446 0.776777
vt 0.998999 0.668669
vt 0.998999 0.776777
vt 0.667668 0.997998
vt 0.775776 0.945445
vt 0.667668 0.945445
vt 0.997998 0.667668
vt 0.945445 0.775776
vt 0.945445 0.667668
vt 0.335335 0.998999
vt 0.443443 0.946446
vt 0.443443 0.998999
vt 0.943443 0.668669
vt 0.890891 0.776777
vt 0.943443 0.776777
vt 0.775776 0.889890
vt 0.667668 0.942442
vt 0.667668 0.889890
vt 0.945445 0.220220
vt 0.997998 0.112112
vt 0.945445 0.112112
vt 0.998999 0.779780
vt 0.946446 0.887888
vt 0.998999 0.887888
vt 0.221221 0.946446
vt 0.113113 0.998999
vt 0.221221 0.998999
vt 0.443443 0.887888
vt 0.335335 0.887888
vt 0.443443 0.779780
vt 0.887888 0.946446
vt 0.887888 0.971221
vt 0.779780 0.971221
vt 0.998999 0.224224
vt 0.998999 0.332332
vt 0.890891 0.332332
vt 0.554555 0.890891
vt 0.446446 0.998999
vt 0.554555 0.998999
vt 0.224224 0.443443
vt 0.443443 0.224224
vt 0.443443 0.443443
vt 0.002002 0.665666
vt 0.221221 0.446446
vt 0.221221 0.665666
vt 0.998999 0.335335
vt 0.890891 0.443443
vt 0.998999 0.443443
vt 0.445445 0.556557
vt 0.664665 0.556557
vt 0.445445 0.664665
vt 0.557558 0.776777
vt 0.776777 0.668669
vt 0.776777 0.776777
vt 0.779780 0.776777
vt 0.887888 0.668669
vt 0.887888 0.776777
vt 0.779780 0.443443
vt 0.887888 0.224224
vt 0.887888 0.443443
vt 0.668669 0.665666
vt 0.776777 0.446446
vt 0.776777 0.665666
vt 0.667668 0.664665
vt 0.775776 0.445445
vt 0.667668 0.445445
vt 0.887888 0.221221
vt 0.887888 0.002002
vt 0.779780 0.221221
vt 0.889890 0.442442
vt 0.997998 0.334334
vt 0.889890 0.334334
vt 0.779780 0.943443
vt 0.887888 0.890891
vt 0.887888 0.943443
vt 0.890891 0.887888
vt 0.943443 0.779780
vt 0.943443 0.887888
vt 0.665666 0.887888
vt 0.557558 0.887888
vt 0.665666 0.779780
vt 0.887888 0.974224
vt 0.887888 0.998999
vt 0.779780 0.998999
vt 0.943443 0.890891
vt 0.890891 0.943443
vt 0.943443 0.943443
vt 0.554555 0.779780
vt 0.554555 0.887888
vt 0.446446 0.887888
vt 0.998999 0.446446
vt 0.998999 0.554555
vt 0.890891 0.554555
vt 0.971221 0.890891
vt 0.946446 0.998999
vt 0.971221 0.998999
vt 0.943443 0.998999
vt 0.943443 0.946446
vt 0.890891 0.998999
vt 0.998999 0.557558
vt 0.998999 0.665666
vt 0.890891 0.665666
vt 0.665666 0.998999
vt 0.557558 0.998999
vt 0.665666 0.890891
vt 0.109109 0.945445
vt 0.001001 0.997998
vt 0.001001 0.945445
vt 0.445445 0.889890
vt 0.445445 0.997998
vt 0.553554 0.889890
vt 0.970220 0.889890
vt 0.945445 0.997998
vt 0.945445 0.889890
vt 0.664665 0.889890
vt 0.556557 0.889890
vt 0.556557 0.997998
vt 0.997998 0.556557
vt 0.889890 0.556557
vt 0.889890 0.664665
vt 0.942442 0.945445
vt 0.889890 0.997998
vt 0.889890 0.945445
vt 0.332332 0.946446
vt 0.224224 0.998999
vt 0.332332 0.998999
vt 0.946446 0.110110
vt 0.998999 0.002002
vt 0.998999 0.110110
vt 0.778779 0.942442
vt 0.886887 0.889890
vt 0.778779 0.889890
vt 0.889890 0.886887
vt 0.942442 0.778779
vt 0.889890 0.778779
vt 0.997998 0.445445
vt 0.889890 0.445445
vt 0.889890 0.553554
vt 0.778779 0.997998
vt 0.886887 0.973223
vt 0.778779 0.973223
vt 0.889890 0.331331
vt 0.889890 0.223223
vt 0.997998 0.223223
vt 0.221221 0.002002
vt 0.002002 0.221221
vt 0.221221 0.221221
vt 0.221221 0.224224
vt 0.002002 0.443443
vt 0.221221 0.443443
vt 0.778779 0.220220
vt 0.886887 0.001001
vt 0.778779 0.001001
vt 0.001001 0.442442
vt 0.220220 0.223223
vt 0.001001 0.223223
vt 0.556557 0.775776
vt 0.775776 0.667668
vt 0.556557 0.667668
vt 0.778779 0.442442
vt 0.778779 0.223223
vt 0.886887 0.223223
vt 0.886887 0.667668
vt 0.778779 0.775776
vt 0.778779 0.667668
vt 0.778779 0.970220
vt 0.886887 0.945445
vt 0.778779 0.945445
vt 0.664665 0.778779
vt 0.556557 0.778779
vt 0.556557 0.886887
vt 0.553554 0.778779
vt 0.445445 0.778779
vt 0.445445 0.886887
vt 0.942442 0.889890
vt 0.889890 0.942442
vt 0.889890 0.889890
vt 0.778779 0.664665
vt 0.831331 0.445445
vt 0.778779 0.445445
vt 0.334334 0.886887
vt 0.442442 0.778779
vt 0.334334 0.778779
vt 0.112112 0.945445
vt 0.220220 0.945445
vt 0.112112 0.997998
vt 0.997998 0.778779
vt 0.945445 0.886887
vt 0.945445 0.778779
vt 0.220220 0.001001
vt 0.001001 0.220220
vt 0.001001 0.001001
vt 0.220220 0.445445
vt 0.001001 0.664665
vt 0.001001 0.445445
vt 0.223223 0.997998
vt 0.331331 0.945445
vt 0.223223 0.945445
vt 0.997998 0.001001
vt 0.945445 0.109109
vt 0.945445 0.001001
vt 0.002002 0.776777
vt 0.221221 0.668669
vt 0.221221 0.776777
vt 0.665666 0.443443
vt 0.665666 0.224224
vt 0.446446 0.443443
vt 0.446446 0.221221
vt 0.665666 0.221221
vt 0.665666 0.002002
vt 0.224224 0.665666
vt 0.332332 0.446446
vt 0.332332 0.665666
vt 0.335335 0.776777
vt 0.554555 0.668669
vt 0.554555 0.776777
vt 0.668669 0.221221
vt 0.776777 0.002002
vt 0.776777 0.221221
vt 0.776777 0.443443
vt 0.668669 0.443443
vt 0.776777 0.224224
vt 0.887888 0.446446
vt 0.835335 0.665666
vt 0.887888 0.665666
vt 0.443443 0.943443
vt 0.224224 0.943443
vt 0.443443 0.890891
vt 0.442442 0.223223
vt 0.223223 0.442442
vt 0.223223 0.223223
vt 0.442442 0.889890
vt 0.223223 0.942442
vt 0.223223 0.889890
vt 0.667668 0.442442
vt 0.775776 0.223223
vt 0.667668 0.223223
vt 0.887888 0.779780
vt 0.668669 0.832332
vt 0.887888 0.832332
vt 0.001001 0.942442
vt 0.220220 0.889890
vt 0.001001 0.889890
vt 0.775776 0.001001
vt 0.667668 0.220220
vt 0.667668 0.001001
vt 0.334334 0.667668
vt 0.553554 0.667668
vt 0.334334 0.775776
vt 0.445445 0.220220
vt 0.664665 0.001001
vt 0.445445 0.001001
vt 0.331331 0.445445
vt 0.223223 0.664665
vt 0.223223 0.445445
vt 0.445445 0.223223
vt 0.445445 0.442442
vt 0.664665 0.223223
vt 0.667668 0.831331
vt 0.886887 0.778779
vt 0.667668 0.778779
vt 0.886887 0.445445
vt 0.834334 0.664665
vt 0.834334 0.445445
vt 0.220220 0.667668
vt 0.001001 0.775776
vt 0.001001 0.667668
vt 0.443443 0.002002
vt 0.224224 0.221221
vt 0.443443 0.221221
vt 0.223223 0.220220
vt 0.442442 0.001001
vt 0.223223 0.001001
vt 0.889890 0.775776
vt 0.942442 0.667668
vt 0.889890 0.667668
vt 0.442442 0.945445
vt 0.334334 0.997998
vt 0.334334 0.945445
vn -0.7071 0.0000 -0.7071
vn 0.7071 -0.0000 0.7071
vn 1.0000 -0.0000 0.0000
vn -1.0000 -0.0000 0.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 0.0000 -1.0000
vn 0.7071 0.0000 -0.7071
vn -0.7071 -0.0000 0.7071
vn 0.0888 0.9921 -0.0888
vn 0.0000 1.0000 0.0000
vn 0.0888 0.9921 0.0888
vn -0.0888 0.9921 -0.0888
vn 0.0000 0.9843 -0.1763
vn 0.0756 0.9943 -0.0756
vn 0.0755 0.9943 -0.0755
vn 0.0756 0.9943 0.0756
vn 0.0756 0.9943 0.0755
vn 0.0755 0.9943 0.0756
vn -0.0756 0.9943 0.0756
vn -0.0755 0.9943 0.0756
vn -0.0756 0.9943 0.0755
vn -0.0888 0.9921 0.0888
vn 0.1763 0.9843 0.0000
vn -0.1763 0.9843 0.0000
vn -0.0755 0.9943 -0.0756
vn -0.0756 0.9943 -0.0756
vn -0.0756 0.9943 -0.0755
vn 0.0000 0.9843 0.1763
vn -0.0000 -1.0000 -0.0000
vn -0.8000 -0.6000 -0.0000
vn 0.8042 0.5170 -0.2930
usemtl wood
s 1
f 1/1/1 2/2/1 3/3/1
f 2/4/1 1/5/1 4/6/1
f 5/7/2 6/8/2 7/9/2
f 6/10/2 5/11/2 8/12/2
f 9/13/3 10/14/3 11/15/3
f 10/16/3 9/17/3 12/18/3
f 13/19/4 14/20/4 15/21/4
f 14/22/4 13/23/4 16/24/4
f 17/25/5 18/26/5 19/27/5
f 18/28/5 17/29/5 20/30/5
f 21/31/6 22/32/6 23/33/6
f 22/34/6 21/35/6 24/36/6
f 25/37/7 26/38/7 27/39/7
f 26/40/7 25/41/7 28/42/7
f 29/43/8 30/44/8 31/45/8
f 30/46/8 29/47/8 32/48/8
f 33/49/7 3/50/7 2/51/7
f 3/52/7 33/53/7 34/54/7
f 35/55/8 1/56/8 36/57/8
f 1/58/8 35/59/8 4/60/8
f 37/61/7 6/62/7 38/63/7
f 6/64/7 37/65/7 7/66/7
f 39/67/1 27/68/1 26/69/1
f 27/70/1 39/71/1 40/72/1
f 8/73/8 41/74/8 42/75/8
f 41/76/8 8/77/8 5/78/8
f 14/79/6 36/80/6 15/81/6
f 36/82/6 14/83/6 35/84/6
f 35/85/6 14/86/6 43/87/6
f 43/88/6 44/89/6 35/90/6
f 45/91/9 46/92/10 43/93/11
f 45/94/9 47/95/12 46/96/10
f 45/97/13 17/98/13 47/99/13
f 17/100/13 45/101/13 20/102/13
f 48/103/14 49/104/14 50/105/15
f 49/106/14 48/107/14 32/108/14
f 32/109/14 48/110/14 30/111/14
f 2/112/16 44/113/16 33/114/17
f 44/115/16 2/116/16 35/117/18
f 35/118/18 2/119/16 4/120/16
f 27/121/19 51/122/20 25/123/19
f 51/124/20 27/125/19 52/126/19
f 52/127/19 27/128/19 40/129/21
f 9/130/5 38/131/5 12/132/5
f 38/133/5 9/134/5 37/135/5
f 37/136/5 9/137/5 47/138/5
f 47/139/5 53/140/5 37/141/5
f 18/142/4 49/143/4 54/144/4
f 20/145/4 49/146/4 18/147/4
f 45/148/4 49/149/4 20/150/4
f 49/151/4 45/152/4 50/153/4
f 39/154/3 22/155/3 40/156/3
f 24/157/3 40/158/3 22/159/3
f 40/160/3 24/161/3 55/162/3
f 40/163/3 55/164/3 52/165/3
f 46/166/10 47/167/12 55/168/22
f 45/169/5 48/170/5 50/171/5
f 16/172/5 48/173/5 45/174/5
f 13/175/5 48/176/5 16/177/5
f 48/178/5 13/179/5 56/180/5
f 30/181/1 56/182/1 31/183/1
f 56/184/1 30/185/1 48/186/1
f 34/187/4 21/188/4 23/189/4
f 21/190/4 34/191/4 33/192/4
f 21/193/4 33/194/4 43/195/4
f 43/196/4 33/197/4 44/198/4
f 43/199/11 46/200/10 55/201/22
f 14/202/23 45/203/23 43/204/23
f 45/205/23 14/206/23 16/207/23
f 55/208/24 9/209/24 11/210/24
f 9/211/24 55/212/24 47/213/24
f 37/214/25 5/215/26 7/216/26
f 5/217/26 37/218/25 53/219/26
f 5/220/26 53/221/26 41/222/27
f 55/223/6 51/224/6 52/225/6
f 11/226/6 51/227/6 55/228/6
f 10/229/6 51/230/6 11/231/6
f 51/232/6 10/233/6 57/234/6
f 17/235/3 53/236/3 47/237/3
f 53/238/3 17/239/3 41/240/3
f 41/241/3 17/242/3 42/243/3
f 42/244/3 17/245/3 19/246/3
f 21/247/28 55/248/28 24/249/28
f 55/250/28 21/251/28 43/252/28
f 25/253/2 57/254/2 28/255/2
f 57/256/2 25/257/2 51/258/2
f 8/259/29 38/260/29 6/261/29
f 38/262/29 8/263/29 57/264/29
f 26/265/29 57/266/29 8/267/29
f 57/268/29 26/269/29 28/270/29
f 26/271/29 8/272/29 42/273/29
f 26/274/29 42/275/29 39/276/29
f 42/277/29 18/278/29 39/279/29
f 18/280/29 42/281/29 19/282/29
f 39/283/29 18/284/29 22/285/29
f 22/286/29 18/287/29 23/288/29
f 23/289/29 18/290/29 54/291/30
f 23/292/29 54/293/30 34/294/31
f 10/295/29 38/296/29 57/297/29
f 38/298/29 10/299/29 12/300/29
f 29/301/29 34/302/31 54/303/30
f 34/304/31 29/305/29 3/306/29
f 3/307/29 29/308/29 56/309/29
f 56/310/29 29/311/29 31/312/29
f 36/313/29 3/314/29 56/315/29
f 13/316/29 36/317/29 56/318/29
f 36/319/29 13/320/29 15/321/29
f 3/322/29 36/323/29 1/324/29
f 43/325/10 47/326/10 55/327/10
f 47/328/10 43/329/10 45/330/10
f 32/331/2 54/332/2 49/333/2
f 54/334/2 32/335/2 29/336/2
g fire_Fire_Fire_Plane
v -0.532626 -0.319257 0.000000
v 0.532626 -0.319257 0.000000
v 0.532626 0.455467 0.000000
v -0.532626 0.455467 0.000000
v 0.000000 -0.319258 0.464837
v 0.000000 -0.319257 -0.464837
v 0.000000 0.455467 -0.464837
v 0.000000 0.455467 0.464837
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vn 0.0000 -0.0000 1.0000
vn 1.0000 0.0000 0.0000
usemtl wood
s off
f 58/337/32 59/338/32 60/339/32 61/340/32
f 62/341/33 63/342/33 64/343/33 65/344/33

File diff suppressed because it is too large Load Diff

2457
models/rune.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,186 @@
-- REGISTER
for node in pairs(minetest.registered_nodes) do
adv_core.register_object(node, 0, 0, 1, 1)
end
--Register Adventure_Shop
minetest.register_node("adventure_core:shop", {
description = "Aventure Shop",
drawtype = "node",
sunlight_propagates = false,
paramtype2 = "facedir",
tiles = {"shop_tb.png", "shop_tb.png", "shop_side.png", "shop_side.png", "shop_side.png", "shop.png"},
groups = {oddly_breakable_by_hand=2},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local name = player:get_player_name()
minetest.show_formspec(name, "adventure_core:store", adv_core.store_formspec(name, 1, "", ""))
end,
})
--Register craft recipe, if desired.
local craftable_shop = adv_core.setting("enable_adventure_shop", true)
local default_present = true
if(minetest.get_modpath("default")) == nil then
default_present = false
end
if craftable_shop and default_present then
minetest.register_craft({
output = "adventure_core:shop",
recipe = {
{"default:wood", "default:sign_wall_wood", "default:wood"},
{"default:wood", "default:chest", "default:wood"},
{"default:wood", "default:wood", "default:wood"},
}
})
end
--Register Guidebook and Pouch
minetest.register_craftitem("adventure_core:pouch", {
description = "Aventure Pouch",
inventory_image = "pouch.png",
on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name()
minetest.show_formspec(name, "adventure_core:pouch", adv_core.pouch_formspec(name))
end,
})
minetest.register_craftitem("adventure_core:guidebook", {
description = "Aventure Guide",
inventory_image = "guidebook.png",
on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name()
minetest.show_formspec(name, "adventure_core:guidebook", adv_core.guide_formspec(name))
end,
})
--Register Builtins, if enabled
if adv_core.setting("enable_builtin_nodes", true) then
local bridgeboxes = {{-1.5,-0.45,-0.5,1.5,-0.36,0.5},{-1.5,-0.5,-0.5,1.5,0.5,-0.45},{-1.5,-0.5,0.5,1.5,0.5,0.45}}
-- ---Register the round rock
-- minetest.register_node("rocks:".. name .."_round", {
-- description = "Round " .. name .. " Rock",
-- drawtype = "mesh",
-- mesh = "round.obj",
-- sunlight_propagates = true,
-- paramtype2 = "facedir",
-- collision_box = {
-- type = "fixed", --Complicated Collision Boxes:
-- fixed = {
-- {-0.18, -0.41, -0.8, 0.62, 0.39, -0.6},
-- {-0.6, -0.5, -0.6, 0.35, 0.5, 0.7},
-- {0.02, -0.21, -0.6, 0.77, 1.09, 0.7},
-- {-0.36, -0.35, 0.70, 0.49, 0.75, 1.02},
-- {-0.38, 0.5, -0.55, 0.02, 0.85, 0.85},
-- }
-- },
-- selection_box = {
-- type = "fixed",
-- fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
-- },
minetest.register_node("adventure_core:bridge", {
description = "Bridge",
drawtype = "mesh",
mesh = "bridge.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = bridgeboxes,
},
selection_box = {
type = "fixed",
fixed = bridgeboxes
},
tiles = {"bridge.jpg"},
groups = {cracky=2},
})
-- tiles = {image},
-- groups = { cracky=2 },
minetest.register_node("adventure_core:bonzai", {
description = "Bonzai",
drawtype = "mesh",
mesh = "bonzai.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = {-0.4,-0.4,-0.4,0.4,0.4,0.4},
},
selection_box = {
type = "fixed",
fixed = {-0.4,-0.4,-0.4,0.4,0.4,0.4},
},
tiles = {"leaf.png", "wood.jpg"},
inventory_image = "bonzai_inv.png",
groups = {cracky=2},
})
minetest.register_node("adventure_core:rune", {
description = "Rune",
drawtype = "mesh",
mesh = "rune.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = {{0.895, -0.455, -0.785, -0.865, -0.015, 0.645},{0.235, -0.015, -0.235, -0.205, 1.195, 0.095},},
},
selection_box = {
type = "fixed",
fixed = {{0.895, -0.455, -0.785, -0.865, -0.015, 0.645},{0.235, -0.015, -0.235, -0.205, 1.195, 0.095},},
},
tiles = {"rune.png"},
groups = {cracky=2},
})
minetest.register_node("adventure_core:campfire", {
description = "Campfire",
drawtype = "mesh",
mesh = "campfire.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
light_source = 11,
collision_box = {
type = "fixed",
fixed = {{0.66, -0.5, -0.66, -0.62, -0.26, 0.62},},
},
selection_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5,0.5,0.2,0.5},
},
tiles = {
"wood.jpg",
{name="fire_animated.png", animation={type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.7,},}
},
inventory_image = "campfire_inv.png",
-- Full loop length},
groups = {cracky=2},
})
minetest.register_node("adventure_core:flag", {
description = "Flag",
drawtype = "mesh",
mesh = "flag.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = {{0.125, -0.475, -0.075, -0.025, 0.325, 0.025},{0.075, -0.475, -0.125, -0.025, -0.425, -0.075},{0.075, 0.325, -0.025, -0.025, 0.575, 0.025},},
},
selection_box = {
type = "fixed",
fixed = {-0.035, -0.475, -0.05, 0.075, 0.5, 0.035},
},
tiles = {"blue.png","grey.png"},
inventory_image = "flag_inv.png",
groups = {cracky=2},
})
minetest.register_node("adventure_core:axe_stump", {
description = "Axe Stump",
drawtype = "mesh",
mesh = "axe_stump.obj",
sunlight_propagates = true,
paramtype2 = "facedir",
collision_box = {
type = "fixed",
fixed = {{0.525, -0.475, -0.225, -0.075, -0.025, 0.275},{0.475, -0.475, -0.475, -0.275, -0.125, -0.225},{0.475, -0.475, 0.275, -0.275, 0.025, 0.525},{0.425, -0.025, -0.125, -0.325, 0.075, 0.275},{0.425, 0.075, -0.175, 0.025, 0.375, 0.175},{0.375, 0.075, 0.175, 0.025, 0.325, 0.325},{0.325, -0.125, -0.375, -0.275, 0.025, -0.225},{0.325, 0.025, -0.275, -0.125, 0.375, -0.175},{0.275, 0.025, 0.325, -0.275, 0.375, 0.475},{0.275, 0.325, -0.025, -0.375, 0.375, 0.325},{0.175, 0.025, -0.375, -0.175, 0.275, -0.275},{0.175, 0.375, -0.175, -0.275, 0.425, 0.225},{0.075, -0.175, -0.225, -0.425, 0.025, -0.125},{0.025, 0.125, -0.125, -0.425, 0.325, 0.325},{-0.075, -0.475, -0.225, -0.525, -0.075, 0.275},{-0.075, -0.075, -0.125, -0.475, -0.025, 0.275},{-0.125, 0.075, -0.275, -0.325, 0.575, -0.175},{-0.125, 0.575, -0.225, -0.325, 0.775, -0.025},{-0.275, -0.475, -0.475, -0.425, -0.225, -0.225},{-0.275, -0.475, 0.275, -0.475, -0.175, 0.475},},
},
selection_box = {
type = "fixed",
fixed = {-0.4,-0.5,-0.4,0.4,0.42,0.4},
},
tiles = {"axe_stump.png"},
groups = {oddly_breakable_by_hand=2},
})
--Register all 6:
adv_core.register_object("adventure_core:bridge", 0, 0, 2, 1)
adv_core.register_object("adventure_core:rune", 1, 1, 1, 0)
adv_core.register_object("adventure_core:bonzai", 1, 2, 1, 0)
adv_core.register_object("adventure_core:campfire", 2, 0, 1, 0)
adv_core.register_object("adventure_core:flag", 0, 0, 1, 1)
adv_core.register_object("adventure_core:axe_stump", 0, 2, 2, 0)
end
-- })
-- minetest.register_craft({
-- output = "rocks:".. name .."_round 1",
-- recipe = {
-- {"", recipe_cobble, ""},
-- {recipe_cobble, recipe_stone, recipe_cobble},
-- {"", recipe_cobble, ""},
-- },
-- })

View File

@ -8,7 +8,7 @@ function adv_core.setting(setting, default)
return read
end
elseif type(default) == "string" then
return minetest.settings:get("adventure_core."..setting) or default
return tostring(minetest.settings:get("adventure_core."..setting)) or default
elseif type(default) == "number" then
return tonumber(minetest.settings:get("adventure_core."..setting) or default)
elseif type(default) == "table" then

View File

@ -7,7 +7,7 @@ adventure_core.spawn_location (Spawn Location) v3f (0.0, 0.0, 0.0)
adventure_core.enable_adventure_shop (Craftable Adventure Shop) bool true
#Enable or disable the chat command for generating adventure_shop
adventure_core.enable_adventure_shop_chat_build (Chat Command Build Adventure Shop) bool true
adventure_core.enable_adventure_shop_chat_build (Chat Command Build the Adventure Shop) bool true
#Enable or disable the chat command to browse shop directly
adventure_core.enable_adventure_shop_chat (Chat Command View Adventure Shop) bool false

View File

@ -9,20 +9,19 @@
-- --------------------------------
--Returns true on success, false on failure
local time_between = adv_core.setting("base_time_between_spawns", 80)
local spread = adv_core.setting("spawn_time_spread", 15)
local time_between = adv_core.setting("base_time_between_spawns", 80) * 1000000
local spread = adv_core.setting("spawn_time_spread", 15) * 1000000
local base_dist = adv_core.setting("base_distance", 500)
local spawn_adjust = adv_core.setting("spawn_adjustment_time", 180)
local dist_adjust = adv_core.setting("distance_adjustment_time", 2)
local min_time = adv_core.setting("minimum_spawn_time", 30)
local spawn_adjust = adv_core.setting("spawn_adjustment_time", 180) * 1000000
local dist_adjust = adv_core.setting("distance_adjustment_time", 2) * 1000000
local min_time = adv_core.setting("minimum_spawn_time", 30) * 1000000
local spawn_point = adv_core.setting("spawn_location",{x=0,y=0,z=0})
local biome_spawns = adv_core.setting("enable_spawn_biome", true)
local spawn_dist = adv_core.setting("distance_from_player", 12)
local default_en = (minetest.get_modpath("default")) ~= nil
local air_id = minetest.get_content_id("air")
local ignore_id = minetest.get_content_id("ignore")
--local init_time = (time_between + spawn_adjust) * 1000000
local init_time = 1000000
local init_time = (time_between + spawn_adjust)
--Used to randomly spawn element near a player
local function spawn_element(player, with_biomes)
@ -62,7 +61,6 @@ local function spawn_element(player, with_biomes)
position.y = math.floor(position.y + math.random(0 , 10))
if (minetest.get_node(position).name == "air") then
minetest.chat_send_all("starting: ".. minetest.serialize(position))
--find lowest node that's not air
local vm = minetest.get_voxel_manip()
local position2 = position
@ -80,7 +78,6 @@ local function spawn_element(player, with_biomes)
position.y = y+3
if with_biomes then
biome_spawn(minetest.get_biome_data(position), position)
minetest.chat_send_all("ending: " .. minetest.serialize(position))
else
random_spawn(position)
end
@ -91,7 +88,6 @@ local function spawn_element(player, with_biomes)
position.y = position.y - 7
if with_biomes then
biome_spawn(minetest.get_biome_data(position), position)
minetest.chat_send_all("ending: " .. minetest.serialize(position))
else
random_spawn(position)
end
@ -115,10 +111,8 @@ minetest.register_globalstep(function(dtime)
player_old_time = new_time
end
local player_countdown = tonumber(adv_core.mod_storage:get_string(name .. "countdown")) or init_time
minetest.chat_send_all("old_time: " .. player_old_time .. "countdown: " .. player_countdown)
if player_old_time + player_countdown < new_time then
minetest.chat_send_all("attempting spawn")
local spawned = nil
if biome_spawns and default_en then
spawned = spawn_element(player, true)
@ -126,7 +120,6 @@ minetest.register_globalstep(function(dtime)
spawned = spawn_element(player, false)
end
if spawned then
minetest.chat_send_all("spawn_successful")
local countdown = time_between + math.random(-spread,spread)
local dist = vector.distance(player:get_pos(), spawn_point)
if dist > base_dist then
@ -134,10 +127,10 @@ minetest.register_globalstep(function(dtime)
else
countdown = countdown + spawn_adjust
end
adv_core.mod_storage:set_string(name .. "countdown", 3000000)--math.max(countdown, min_time) * 1000000)
adv_core.mod_storage:set_string(name .. "countdown", math.max(min_time, countdown)) --math.max(countdown, min_time) * 1000000)
else
minetest.chat_send_all("spawn_unsuccessful")
adv_core.mod_storage:set_string(name .. "countdown", 1000000) -- try again in 1 seconds...
adv_core.mod_storage:set_string(name .. "countdown", 2000000) -- try again in 2 seconds...
end
adv_core.mod_storage:set_string(name .. "old_time", new_time)
end
@ -145,22 +138,47 @@ minetest.register_globalstep(function(dtime)
end
end)
-- --Do players respawn/spawn with a guidebook and pouch?
-- if adv_core.setting("enable_starting_items", true) then
-- minetest.register_on_newplayer(function(playerRef)
-- local inv = player:get_inventory()
-- local main = inv:get_list("main")
-- --for loop through main stacks
-- --check if empty
-- --add guidebook
-- --break
-- --for loop though main stacks
-- --check if empty
-- --add pouch
-- --break
-- end
-- )
-- end
minetest.register_on_joinplayer(function(ObjectRef, last_login)
local name = ObjectRef:get_player_name()
if name == nil then
return
end
adv_core.mod_storage:set_string(name .. "countdown", init_time)
adv_core.mod_storage:set_string(name .. "old_time", minetest.get_us_time())
end
)
--Do players start with a guidebook and pouch?
if adv_core.setting("enable_starting_items", true) then
-- for give command
local function give(player_name, item)
local itemstack = ItemStack(item)
if itemstack:is_empty() then
return false
elseif (not itemstack:is_known()) or (itemstack:get_name() == "unknown") then
return false -- "Cannot give an unknown item"
-- Forbid giving 'ignore' due to unwanted side effects
elseif itemstack:get_name() == "ignore" then
return false -- "Giving 'ignore' is not allowed"
end
local playerref = minetest.get_player_by_name(player_name)
--Give to Player
local leftover = playerref:get_inventory():add_item("main", itemstack)
if not leftover:is_empty() then
return false
end
return true
end
minetest.register_on_newplayer(
function(player)
give(player:get_player_name(), "adventure_core:guidebook")
give(player:get_player_name(), "adventure_core:pouch")
end
)
end

BIN
textures/axe_stump.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

BIN
textures/blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

BIN
textures/bonzai_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
textures/bridge.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
textures/campfire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
textures/fire_animated.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
textures/flag_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
textures/grey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

BIN
textures/guidebook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
textures/leaf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
textures/rune.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

BIN
textures/shop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
textures/shop_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
textures/shop_tb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB