summaryrefslogtreecommitdiff
path: root/castle_shields
diff options
context:
space:
mode:
Diffstat (limited to 'castle_shields')
-rw-r--r--castle_shields/LICENSE21
-rw-r--r--castle_shields/README.txt25
-rw-r--r--castle_shields/default_shields.lua18
-rw-r--r--castle_shields/depends.txt3
-rw-r--r--castle_shields/description.txt1
-rw-r--r--castle_shields/init.lua5
-rw-r--r--castle_shields/intllib.lua45
-rw-r--r--castle_shields/locale/template.pot21
-rw-r--r--castle_shields/mod.conf1
-rw-r--r--castle_shields/screenshot.pngbin0 -> 14418 bytes
-rw-r--r--castle_shields/shield_functions.lua39
-rw-r--r--castle_shields/textures/castle_shield_back.pngbin0 -> 620 bytes
-rw-r--r--castle_shields/textures/castle_shield_black.pngbin0 -> 275 bytes
-rw-r--r--castle_shields/textures/castle_shield_blue.pngbin0 -> 379 bytes
-rw-r--r--castle_shields/textures/castle_shield_brown.pngbin0 -> 424 bytes
-rw-r--r--castle_shields/textures/castle_shield_cyan.pngbin0 -> 328 bytes
-rw-r--r--castle_shields/textures/castle_shield_dark_green.pngbin0 -> 371 bytes
-rw-r--r--castle_shields/textures/castle_shield_dark_grey.pngbin0 -> 319 bytes
-rw-r--r--castle_shields/textures/castle_shield_green.pngbin0 -> 388 bytes
-rw-r--r--castle_shields/textures/castle_shield_grey.pngbin0 -> 355 bytes
-rw-r--r--castle_shields/textures/castle_shield_magenta.pngbin0 -> 420 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_chevron.pngbin0 -> 223 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_cross.pngbin0 -> 153 bytes
-rw-r--r--castle_shields/textures/castle_shield_mask_slash.pngbin0 -> 183 bytes
-rw-r--r--castle_shields/textures/castle_shield_orange.pngbin0 -> 441 bytes
-rw-r--r--castle_shields/textures/castle_shield_pink.pngbin0 -> 338 bytes
-rw-r--r--castle_shields/textures/castle_shield_red.pngbin0 -> 426 bytes
-rw-r--r--castle_shields/textures/castle_shield_violet.pngbin0 -> 364 bytes
-rw-r--r--castle_shields/textures/castle_shield_white.pngbin0 -> 339 bytes
-rw-r--r--castle_shields/textures/castle_shield_yellow.pngbin0 -> 398 bytes
-rw-r--r--castle_shields/textures/shield.svg143
31 files changed, 322 insertions, 0 deletions
diff --git a/castle_shields/LICENSE b/castle_shields/LICENSE
new file mode 100644
index 0000000..456d091
--- /dev/null
+++ b/castle_shields/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Minetest Mods Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/castle_shields/README.txt b/castle_shields/README.txt
new file mode 100644
index 0000000..e2b85ce
--- /dev/null
+++ b/castle_shields/README.txt
@@ -0,0 +1,25 @@
+=-=-=-=-=-=-=-=-=-=
+
+Castles Mod
+by: Philipbenr And DanDuncombe
+
+=-=-=-=-=-=-=-=-=-=
+
+Licence: MIT
+
+see: LICENSE
+
+=-=-=-=-=-=-=-=-=-=
+
+This mod adds decorative wall-mounted shields. It comes with three default shields, but it's very easy to mix and match the colours and patterns to generate additional shields for your server; see default_shields.lua for a good place to insert your own, or make use of the castle_shields.register_shield method in your own mods.
+
+The three default shields were defined thusly:
+
+castle_shields.register_shield("shield_1", "Mounted Shield", "red", "blue", "slash")
+castle_shields.register_shield("shield_2", "Mounted Shield", "cyan", "yellow", "chevron")
+castle_shields.register_shield("shield_3", "Mounted Shield", "grey", "green", "cross")
+
+The following colors are permitted:
+ "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
+The following patterns are permitted:
+ "slash", "chevron", "cross" \ No newline at end of file
diff --git a/castle_shields/default_shields.lua b/castle_shields/default_shields.lua
new file mode 100644
index 0000000..f29a8e5
--- /dev/null
+++ b/castle_shields/default_shields.lua
@@ -0,0 +1,18 @@
+minetest.register_alias("castle:shield", "castle_shields:shield_1")
+minetest.register_alias("castle:shield_2", "castle_shields:shield_2")
+minetest.register_alias("castle:shield_3", "castle_shields:shield_3")
+
+-- internationalization boilerplate
+local MP = minetest.get_modpath(minetest.get_current_modname())
+local S, NS = dofile(MP.."/intllib.lua")
+
+--The following colors are permitted:
+-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
+--The following patterns are permitted:
+-- "slash", "chevron", "cross"
+
+-- method parameters are name, desc, background_color, foreground_color, pattern
+
+castle_shields.register_shield("shield_1", S("Mounted Shield"), "red", "blue", "slash")
+castle_shields.register_shield("shield_2", S("Mounted Shield"), "cyan", "yellow", "chevron")
+castle_shields.register_shield("shield_3", S("Mounted Shield"), "grey", "green", "cross") \ No newline at end of file
diff --git a/castle_shields/depends.txt b/castle_shields/depends.txt
new file mode 100644
index 0000000..cc455cf
--- /dev/null
+++ b/castle_shields/depends.txt
@@ -0,0 +1,3 @@
+default
+dye
+intllib? \ No newline at end of file
diff --git a/castle_shields/description.txt b/castle_shields/description.txt
new file mode 100644
index 0000000..8cd8630
--- /dev/null
+++ b/castle_shields/description.txt
@@ -0,0 +1 @@
+Adds decorative wall shields
diff --git a/castle_shields/init.lua b/castle_shields/init.lua
new file mode 100644
index 0000000..05ee2d1
--- /dev/null
+++ b/castle_shields/init.lua
@@ -0,0 +1,5 @@
+castle_shields = {}
+
+local MP = minetest.get_modpath(minetest.get_current_modname())
+dofile(MP.."/shield_functions.lua")
+dofile(MP.."/default_shields.lua")
diff --git a/castle_shields/intllib.lua b/castle_shields/intllib.lua
new file mode 100644
index 0000000..6669d72
--- /dev/null
+++ b/castle_shields/intllib.lua
@@ -0,0 +1,45 @@
+
+-- Fallback functions for when `intllib` is not installed.
+-- Code released under Unlicense <http://unlicense.org>.
+
+-- Get the latest version of this file at:
+-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
+
+local function format(str, ...)
+ local args = { ... }
+ local function repl(escape, open, num, close)
+ if escape == "" then
+ local replacement = tostring(args[tonumber(num)])
+ if open == "" then
+ replacement = replacement..close
+ end
+ return replacement
+ else
+ return "@"..open..num..close
+ end
+ end
+ return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
+end
+
+local gettext, ngettext
+if minetest.get_modpath("intllib") then
+ if intllib.make_gettext_pair then
+ -- New method using gettext.
+ gettext, ngettext = intllib.make_gettext_pair()
+ else
+ -- Old method using text files.
+ gettext = intllib.Getter()
+ end
+end
+
+-- Fill in missing functions.
+
+gettext = gettext or function(msgid, ...)
+ return format(msgid, ...)
+end
+
+ngettext = ngettext or function(msgid, msgid_plural, n, ...)
+ return format(n==1 and msgid or msgid_plural, ...)
+end
+
+return gettext, ngettext
diff --git a/castle_shields/locale/template.pot b/castle_shields/locale/template.pot
new file mode 100644
index 0000000..bfb347c
--- /dev/null
+++ b/castle_shields/locale/template.pot
@@ -0,0 +1,21 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-25 14:47-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.lua:6 init.lua:41 init.lua:75
+msgid "Mounted Shield"
+msgstr ""
diff --git a/castle_shields/mod.conf b/castle_shields/mod.conf
new file mode 100644
index 0000000..5df74cc
--- /dev/null
+++ b/castle_shields/mod.conf
@@ -0,0 +1 @@
+name = castle_shields
diff --git a/castle_shields/screenshot.png b/castle_shields/screenshot.png
new file mode 100644
index 0000000..b2cfd5f
--- /dev/null
+++ b/castle_shields/screenshot.png
Binary files differ
diff --git a/castle_shields/shield_functions.lua b/castle_shields/shield_functions.lua
new file mode 100644
index 0000000..d32938b
--- /dev/null
+++ b/castle_shields/shield_functions.lua
@@ -0,0 +1,39 @@
+castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask)
+
+ local tile_side = "castle_shield_"..background_color..".png"
+ local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..".png^[mask:castle_shield_mask_"..mask..".png)"
+
+ minetest.register_node(minetest.get_current_modname()..":"..name, {
+ description = desc,
+ tiles = {tile_side, tile_side, tile_side, tile_side, "castle_shield_back.png", tile_front},
+ drawtype="nodebox",
+ paramtype2 = "facedir",
+ paramtype = "light",
+ groups={cracky=3},
+ sounds = default.node_sound_metal_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.500000,-0.125000,0.375000,0.500000,0.500000,0.500000},
+ {-0.437500,-0.312500,0.375000,0.425000,0.500000,0.500000},
+ {-0.312500,-0.437500,0.375000,0.312500,0.500000,0.500000},
+ {-0.187500,-0.500000,0.375000,0.187500,0.500000,0.500000},
+ },
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.500000,-0.500000,0.375000,0.500000,0.500000,0.500000},
+ },
+ },
+ })
+
+ minetest.register_craft({
+ output = minetest.get_current_modname()..":"..name,
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"dye:"..background_color, "default:steel_ingot", "dye:"..foreground_color},
+ }
+ })
+end \ No newline at end of file
diff --git a/castle_shields/textures/castle_shield_back.png b/castle_shields/textures/castle_shield_back.png
new file mode 100644
index 0000000..53cca18
--- /dev/null
+++ b/castle_shields/textures/castle_shield_back.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_black.png b/castle_shields/textures/castle_shield_black.png
new file mode 100644
index 0000000..cb39341
--- /dev/null
+++ b/castle_shields/textures/castle_shield_black.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_blue.png b/castle_shields/textures/castle_shield_blue.png
new file mode 100644
index 0000000..7ef3a9e
--- /dev/null
+++ b/castle_shields/textures/castle_shield_blue.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_brown.png b/castle_shields/textures/castle_shield_brown.png
new file mode 100644
index 0000000..b1c274d
--- /dev/null
+++ b/castle_shields/textures/castle_shield_brown.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_cyan.png b/castle_shields/textures/castle_shield_cyan.png
new file mode 100644
index 0000000..4bf2f4d
--- /dev/null
+++ b/castle_shields/textures/castle_shield_cyan.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_dark_green.png b/castle_shields/textures/castle_shield_dark_green.png
new file mode 100644
index 0000000..2f6031e
--- /dev/null
+++ b/castle_shields/textures/castle_shield_dark_green.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_dark_grey.png b/castle_shields/textures/castle_shield_dark_grey.png
new file mode 100644
index 0000000..00ff607
--- /dev/null
+++ b/castle_shields/textures/castle_shield_dark_grey.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_green.png b/castle_shields/textures/castle_shield_green.png
new file mode 100644
index 0000000..7b9a82a
--- /dev/null
+++ b/castle_shields/textures/castle_shield_green.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_grey.png b/castle_shields/textures/castle_shield_grey.png
new file mode 100644
index 0000000..53ba7a3
--- /dev/null
+++ b/castle_shields/textures/castle_shield_grey.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_magenta.png b/castle_shields/textures/castle_shield_magenta.png
new file mode 100644
index 0000000..6b60e17
--- /dev/null
+++ b/castle_shields/textures/castle_shield_magenta.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_chevron.png b/castle_shields/textures/castle_shield_mask_chevron.png
new file mode 100644
index 0000000..59ffa37
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_chevron.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_cross.png b/castle_shields/textures/castle_shield_mask_cross.png
new file mode 100644
index 0000000..a032ef4
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_cross.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_mask_slash.png b/castle_shields/textures/castle_shield_mask_slash.png
new file mode 100644
index 0000000..1bd1174
--- /dev/null
+++ b/castle_shields/textures/castle_shield_mask_slash.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_orange.png b/castle_shields/textures/castle_shield_orange.png
new file mode 100644
index 0000000..11f4a92
--- /dev/null
+++ b/castle_shields/textures/castle_shield_orange.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_pink.png b/castle_shields/textures/castle_shield_pink.png
new file mode 100644
index 0000000..a2b08cc
--- /dev/null
+++ b/castle_shields/textures/castle_shield_pink.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_red.png b/castle_shields/textures/castle_shield_red.png
new file mode 100644
index 0000000..87e8657
--- /dev/null
+++ b/castle_shields/textures/castle_shield_red.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_violet.png b/castle_shields/textures/castle_shield_violet.png
new file mode 100644
index 0000000..2168cb4
--- /dev/null
+++ b/castle_shields/textures/castle_shield_violet.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_white.png b/castle_shields/textures/castle_shield_white.png
new file mode 100644
index 0000000..a124396
--- /dev/null
+++ b/castle_shields/textures/castle_shield_white.png
Binary files differ
diff --git a/castle_shields/textures/castle_shield_yellow.png b/castle_shields/textures/castle_shield_yellow.png
new file mode 100644
index 0000000..033d679
--- /dev/null
+++ b/castle_shields/textures/castle_shield_yellow.png
Binary files differ
diff --git a/castle_shields/textures/shield.svg b/castle_shields/textures/shield.svg
new file mode 100644
index 0000000..78b355e
--- /dev/null
+++ b/castle_shields/textures/shield.svg
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="gradient.svg"
+ inkscape:export-filename="C:\Users\Bryan\Downloads\minetest-0.4.15-win64\mods\castle_shields\textures\rect4138.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4148">
+ <stop
+ style="stop-color:#fcf611;stop-opacity:1"
+ offset="0"
+ id="stop4150" />
+ <stop
+ style="stop-color:#ffc20b;stop-opacity:1"
+ offset="1"
+ id="stop4152" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4148"
+ id="radialGradient4154"
+ cx="8"
+ cy="1043.8622"
+ fx="8"
+ fy="1043.8622"
+ r="3.5"
+ gradientTransform="matrix(3.1428571,-2.4687518e-6,2.4687459e-6,3.1428481,-17.145434,-2236.3381)"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.4"
+ inkscape:cx="12.024399"
+ inkscape:cy="9.317634"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer4"
+ showgrid="true"
+ units="px"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1680"
+ inkscape:window-height="987"
+ inkscape:window-x="2952"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:snap-grids="true"
+ inkscape:snap-to-guides="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4136" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)"
+ style="display:none">
+ <rect
+ style="fill:url(#radialGradient4154);fill-opacity:1;stroke:none;stroke-width:100;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4138"
+ width="16"
+ height="16.000017"
+ x="0"
+ y="1036.3622"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="sash"
+ style="display:none">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 20,-4 -5,21"
+ id="path4163"
+ inkscape:connector-curvature="0"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer3"
+ inkscape:label="chevron"
+ style="display:none">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M -4,-4 8,8 20,-4"
+ id="path4166"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer4"
+ inkscape:label="cross">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 8,-4 8,20"
+ id="path4169"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 20,6 -4,6"
+ id="path4171"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>