added armor mod (WIP)

This commit is contained in:
cale 2016-02-10 12:46:16 +01:00
parent 9e79bcd977
commit 9f0d7ba1f5
14 changed files with 47 additions and 2 deletions

16
mods/armor/LICENSE.txt Normal file
View File

@ -0,0 +1,16 @@
License for Code
----------------
Copyright (C) 2016 cd2 (cdqwertz) <cdqwertz@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License for Media
-----------------
CC-BY-SA 3.0 UNPORTED. Created by cd2 (cdqwertz)

3
mods/armor/init.lua Normal file
View File

@ -0,0 +1,3 @@
armor = {}
function armor.register_armor(name, def)
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

View File

@ -1,6 +1,7 @@
places = {}
places.pos = {}
places.places_file = minetest.get_worldpath() .. "/places"
places.show_places = false
function places.register_place(name, pos)
places.pos[name] = pos
end
@ -53,6 +54,9 @@ minetest.register_chatcommand("setplace", {
})
minetest.register_on_joinplayer(function(player)
if not places.show_places then
return
end
if places.pos then
for k, v in pairs(places.pos) do
player:hud_add({

View File

@ -181,6 +181,11 @@ function story.generator.run(part, player, line_pos)
if cmd[1] == "$wait" then
return {cmd="$wait", param=i, wait=true}
end
if cmd[1] == "$spawn" and cmd[2] and cmd[3] then
if places.pos[cmd[3]] then
minetest.add_entity(places.pos[cmd[3]], cmd[2])
end
end
end
end
i = i +1
@ -207,6 +212,21 @@ minetest.register_on_newplayer(function(player)
story.generator.gen_next_step(player)
end)
minetest.register_chatcommand("restart_story", {
params = "",
description = "restarts your story",
privs = {},
func = function(name, text)
local player = minetest.get_player_by_name(name)
if player and player:is_player() then
story.generator.new_player(player)
story.generator.gen_next_step(player)
return true, ""
end
return true, "Error"
end,
})
-- human
minetest.register_entity("story:human", {
hp_max = 50,

View File

@ -1,7 +1,9 @@
$dialog test
$pos
$place home
$create
$wait
$dialog test
$place testplace
$place homeB
$create
$wait
$spawn pets:pig homePig