From 9f0d7ba1f5a06d7e3afec636b84626250f4c2799 Mon Sep 17 00:00:00 2001 From: cale Date: Wed, 10 Feb 2016 12:46:16 +0100 Subject: [PATCH] added armor mod (WIP) --- mods/armor/LICENSE.txt | 16 ++++++++++++++ mods/armor/init.lua | 3 +++ mods/armor/textures/armor_copper_boots.png | Bin 0 -> 215 bytes .../textures/armor_copper_chestplate.png | Bin 0 -> 243 bytes mods/armor/textures/armor_copper_leggings.png | Bin 0 -> 319 bytes mods/armor/textures/armor_diamond_boots.png | Bin 0 -> 266 bytes .../textures/armor_diamond_chestplate.png | Bin 0 -> 294 bytes .../armor/textures/armor_diamond_leggings.png | Bin 0 -> 367 bytes mods/armor/textures/armor_iron_boots.png | Bin 0 -> 215 bytes mods/armor/textures/armor_iron_chestplate.png | Bin 0 -> 235 bytes mods/armor/textures/armor_iron_leggings.png | Bin 0 -> 293 bytes mods/places/init.lua | 4 ++++ mods/story/api.lua | 20 ++++++++++++++++++ mods/story/parts/base.part | 6 ++++-- 14 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 mods/armor/LICENSE.txt create mode 100644 mods/armor/init.lua create mode 100644 mods/armor/textures/armor_copper_boots.png create mode 100644 mods/armor/textures/armor_copper_chestplate.png create mode 100644 mods/armor/textures/armor_copper_leggings.png create mode 100644 mods/armor/textures/armor_diamond_boots.png create mode 100644 mods/armor/textures/armor_diamond_chestplate.png create mode 100644 mods/armor/textures/armor_diamond_leggings.png create mode 100644 mods/armor/textures/armor_iron_boots.png create mode 100644 mods/armor/textures/armor_iron_chestplate.png create mode 100644 mods/armor/textures/armor_iron_leggings.png diff --git a/mods/armor/LICENSE.txt b/mods/armor/LICENSE.txt new file mode 100644 index 0000000..6f6a256 --- /dev/null +++ b/mods/armor/LICENSE.txt @@ -0,0 +1,16 @@ +License for Code +---------------- + +Copyright (C) 2016 cd2 (cdqwertz) + +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) diff --git a/mods/armor/init.lua b/mods/armor/init.lua new file mode 100644 index 0000000..c4ec8ad --- /dev/null +++ b/mods/armor/init.lua @@ -0,0 +1,3 @@ +armor = {} +function armor.register_armor(name, def) +end diff --git a/mods/armor/textures/armor_copper_boots.png b/mods/armor/textures/armor_copper_boots.png new file mode 100644 index 0000000000000000000000000000000000000000..2f973cd5bc18b8f40804061117c2ddba4d1b753f GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoC(zMQ1)cc74DiEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8c$jr;B5V#p&b(3D(641`KWzkAJ?E{h#>e`}y-m88<_Xm9&qj zo^M+7;`VX(irm9$=UrBcYnU~#-i-gjpjf$ykwME$;#pMj5|FzXJYD@<);T3K0RVN* BL9hS- literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_copper_chestplate.png b/mods/armor/textures/armor_copper_chestplate.png new file mode 100644 index 0000000000000000000000000000000000000000..aaf73ea2f7756ff1fb97cec9f552932278b89f66 GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoCp#FR;|s(?b0C9V-A&iT2ysd*&~&PAz-C8;S2 z<(VZJ3hti10pX2&;y^{wo-U3d7N?UFBtA7vY;0_NcysOA|0gf%EPZzN1k>Z1|6iu4 zoV~x_COrWJ7G2>k5HI-TX)I90dnT;Mz=7?2Uhd!i^9-`>RU)<`)rnUamSnUvmY+Yz cv+)cIgPg34?&QFt7N9i@p00i_>zopr0E{V7eEwc6x=<11Hv2m#DR*Id%8G=Se)KE$&u@jfq-kg)0!3!%j;^pKcBAxbTWgdtDnm{ Hr-UW|-M(|w literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_diamond_boots.png b/mods/armor/textures/armor_diamond_boots.png new file mode 100644 index 0000000000000000000000000000000000000000..72b630e31f66701eb65dda54e146c2b2afd80982 GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoCRhJFiS=iW&l(dhi zo^M%`@xI=zZF~OxM_Y11tgrgY~euVrIv>$fnux4XQ*5eOXT-`dE)kXx>$474v4Xgh{`WiQto#_>%!USqRhi|*u#Jxx99 hq>|lwKBk}F!kFV~Q2KhaRtL~!44$rjF6*2UngDnsYbF2y literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_diamond_leggings.png b/mods/armor/textures/armor_diamond_leggings.png new file mode 100644 index 0000000000000000000000000000000000000000..f8600666cc6d2de4e3df40bd11b359f3ebd82a2f GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoA{`#h%K4nQHv64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF5>o-U3d7N^%vcH}x_AmAE5yX$s96|??=9pYyg-^A{1c)-|I z{vvEkkc-RlT^A>*trYvRUMTG!|L6ZKbuKIcBCHO^Q$nVxI!t+P*%=%0o?mCu4dpkN zdR`{Vi@Yw;Kdw9_C@xt3rm%pZ%aXnM@B95WSAS>8$yghisu`92Y8M+v-}D-z)vH#$ zD9vH(-Qd01@1jJr;j?6=joH(Jv@%j&Fy^`w`c`yKCtVnq*^iTF6W+=$6< z4!4v@)>yYMwqyUyCql6wkNlGHX}A@oBE9+a&b5C<{b%3u+`3=VcoWcz44$rjF6*2U FngD*biRJ(R literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_iron_boots.png b/mods/armor/textures/armor_iron_boots.png new file mode 100644 index 0000000000000000000000000000000000000000..eb901dcf6761868529fddc04c4cf42f06a021aff GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoC(kXvEmGoX-UiEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8c$jr;B5V#p&b(3D(641`KWzj~^ZF{-5}!`ujUW7B)5`CG8`s z=bP5Nczb($Mebp>^DZmJHOv}VZ^r*%P^{d<$RM*#;zEM&pPfLX7(8A5T-G@yGywpI C8A12} literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_iron_chestplate.png b/mods/armor/textures/armor_iron_chestplate.png new file mode 100644 index 0000000000000000000000000000000000000000..09700a3f686535b1bd46f75c517516976ec3542f GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoB8yX36r{Xikf64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aiF4LPZ!4!i_^&o5}z6-Ha0ds{PXkk|C1MUGBQq_V0yf#{{K9c zvj$&%rc^P$V{&wKWOG_~Q0-iYUctXVKmY&W;o#$QyXd@8+>O_v%S~cO`TKhUr+pZH Xo{*8@d@X4UG@ilJ)z4*}Q$iB};~P&b literal 0 HcmV?d00001 diff --git a/mods/armor/textures/armor_iron_leggings.png b/mods/armor/textures/armor_iron_leggings.png new file mode 100644 index 0000000000000000000000000000000000000000..b99ba6256416c18cab47d3924ca80d7e5a5c2b9f GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPN6BoCNfk>y#S)h<)iEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8afqr;B5V#p$h+ck>=m5O9&#S*e<}h|y{}r<8+I+|5qrH_g@? zN`*J>zi6QIL5NLZDa(fQd{5^v`t%517xU6Q&6OkF!J)Ltr66#@s?%I|Ry^3d|4!xY zZKh3^g^T6BYx2M2P!w>QVg7OY#Jzjon${S9_DiZ>ZxFO#mHd-+*S}OuocF-AG28BV g!9<3vwSQRIWqxT%h}edn0XmGq)78&qol`;+0JmIZHUIzs literal 0 HcmV?d00001 diff --git a/mods/places/init.lua b/mods/places/init.lua index d3d6858..957234a 100644 --- a/mods/places/init.lua +++ b/mods/places/init.lua @@ -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({ diff --git a/mods/story/api.lua b/mods/story/api.lua index 2ce9e6f..4667627 100644 --- a/mods/story/api.lua +++ b/mods/story/api.lua @@ -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, diff --git a/mods/story/parts/base.part b/mods/story/parts/base.part index a3fa34f..d47b3d1 100644 --- a/mods/story/parts/base.part +++ b/mods/story/parts/base.part @@ -1,7 +1,9 @@ $dialog test -$pos +$place home $create $wait $dialog test -$place testplace +$place homeB $create +$wait +$spawn pets:pig homePig