Glitchtest
|
@ -0,0 +1,22 @@
|
||||||
|
## Files related to minetest development cycle
|
||||||
|
/*.patch
|
||||||
|
# GNU Patch reject file
|
||||||
|
*.rej
|
||||||
|
|
||||||
|
## Editors and Development environments
|
||||||
|
*~
|
||||||
|
*.swp
|
||||||
|
*.bak*
|
||||||
|
*.orig
|
||||||
|
# Vim
|
||||||
|
*.vim
|
||||||
|
# Kate
|
||||||
|
.*.kate-swp
|
||||||
|
.swp.*
|
||||||
|
# Eclipse (LDT)
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
.buildpath
|
||||||
|
.metadata
|
||||||
|
# Idea IDE
|
||||||
|
.idea/*
|
|
@ -0,0 +1,22 @@
|
||||||
|
unused_args = false
|
||||||
|
allow_defined_top = true
|
||||||
|
|
||||||
|
read_globals = {
|
||||||
|
"DIR_DELIM",
|
||||||
|
"minetest", "core",
|
||||||
|
"dump",
|
||||||
|
"vector",
|
||||||
|
"VoxelManip", "VoxelArea",
|
||||||
|
"PseudoRandom", "PcgRandom",
|
||||||
|
"ItemStack",
|
||||||
|
"Settings",
|
||||||
|
"unpack",
|
||||||
|
-- Silence errors about custom table methods.
|
||||||
|
table = { fields = { "copy", "indexof" } }
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Overwrites minetest.handle_node_drops
|
||||||
|
files["mods/creative/init.lua"].globals = { "minetest" }
|
||||||
|
|
||||||
|
-- Don't report on legacy definitions of globals.
|
||||||
|
files["mods/default/legacy.lua"].global = false
|
|
@ -0,0 +1,12 @@
|
||||||
|
language: generic
|
||||||
|
sudo: false
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- luarocks
|
||||||
|
before_install:
|
||||||
|
- luarocks install --local luacheck
|
||||||
|
script:
|
||||||
|
- $HOME/.luarocks/bin/luacheck --no-color ./mods
|
||||||
|
notifications:
|
||||||
|
email: false
|
|
@ -0,0 +1,9 @@
|
||||||
|
3D Armor - Visible Player Armor
|
||||||
|
===============================
|
||||||
|
|
||||||
|
License Source Code: Copyright (C) 2013-2017 Stuart Jones - LGPL v2.1
|
||||||
|
|
||||||
|
Armor Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0
|
||||||
|
|
||||||
|
Special credit to Jordach and MirceaKitsune for providing the default 3d character model.
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
Modpack - 3d Armor [0.4.9]
|
||||||
|
==========================
|
||||||
|
|
||||||
|
### Table of Contents
|
||||||
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
|
- [[mod] Visible Player Armor [3d_armor]](#mod-visible-player-armor-3d_armor)
|
||||||
|
- [[mod] Visible Wielded Items [wieldview]](#mod-visible-wielded-items-wieldview)
|
||||||
|
- [[mod] Shields [shields]](#mod-shields-shields)
|
||||||
|
- [[mod] Technic Armor [technic_armor]](#mod-technic-armor-technic_armor)
|
||||||
|
- [[mod] Hazmat Suit [hazmat_suit]](#mod-hazmat-suit-hazmat_suit)
|
||||||
|
- [[mod] 3d Armor Stand [3d_armor_stand]](#mod-3d-armor-stand-3d_armor_stand)
|
||||||
|
|
||||||
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
|
|
||||||
|
|
||||||
|
[mod] Visible Player Armor [3d_armor]
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Minetest Version: 0.4.16
|
||||||
|
|
||||||
|
Game: minetest_game and many derivatives
|
||||||
|
|
||||||
|
Depends: default
|
||||||
|
|
||||||
|
Adds craftable armor that is visible to other players. Each armor item worn contributes to
|
||||||
|
a player's armor group level making them less vulnerable to attack.
|
||||||
|
|
||||||
|
Armor takes damage when a player is hurt, however, many armor items offer a 'stackable'
|
||||||
|
percentage chance of restoring the lost health points. Overall armor level is boosted by 10%
|
||||||
|
when wearing a full matching set (helmet, chestplate, leggings and boots of the same material)
|
||||||
|
|
||||||
|
Fire protection has been added by TenPlus1 and in use when ethereal mod is found and crystal
|
||||||
|
armor has been enabled. each piece of armor offers 1 fire protection, level 1 protects
|
||||||
|
against torches, level 2 against crystal spikes, 3 for fire and 5 protects when in lava.
|
||||||
|
|
||||||
|
Compatible with sfinv, inventory plus or unified inventory by enabling the appropriate
|
||||||
|
inventory module, [3d_armor_sfinv], [3d_armor_ip] and [3d_armor_ui] respectively.
|
||||||
|
Also compatible with [smart_inventory] without the need for additional modules.
|
||||||
|
|
||||||
|
built in support player skins [skins] by Zeg9 and Player Textures [player_textures] by PilzAdam
|
||||||
|
and [simple_skins] by TenPlus1.
|
||||||
|
|
||||||
|
Armor can be configured by adding a file called armor.conf in 3d_armor mod or world directory.
|
||||||
|
see armor.conf.example for all available options.
|
||||||
|
|
||||||
|
[mod] Visible Wielded Items [wieldview]
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
Depends: 3d_armor
|
||||||
|
|
||||||
|
Makes hand wielded items visible to other players.
|
||||||
|
|
||||||
|
[mod] Shields [shields]
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Depends: 3d_armor
|
||||||
|
|
||||||
|
Originally a part of 3d_armor, shields have been re-included as an optional extra.
|
||||||
|
If you do not want shields then simply remove the shields folder from the modpack.
|
||||||
|
|
||||||
|
[mod] Technic Armor [technic_armor]
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
Depends: 3d_armor, technic_worldgen
|
||||||
|
|
||||||
|
Adds tin, silver and technic materials to 3d_armor.
|
||||||
|
Requires technic (technic_worldgen at least) mod.
|
||||||
|
|
||||||
|
[mod] Hazmat Suit [hazmat_suit]
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
Depends: 3d_armor, technic
|
||||||
|
|
||||||
|
Adds hazmat suit to 3d_armor. It protects rather well from fire (if enabled in configuration) and radiation*, and it has built-in oxygen supply.
|
||||||
|
|
||||||
|
Requires technic mod.
|
||||||
|
|
||||||
|
[mod] 3d Armor Stand [3d_armor_stand]
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Depends: 3d_armor
|
||||||
|
|
||||||
|
Adds a chest-like armor stand for armor storage and display.
|
|
@ -0,0 +1,31 @@
|
||||||
|
I fixed multiskin erroring on "default:dirt" texture. Now, it appears that when
|
||||||
|
joining the game as a node class, that when wielding a walkie after
|
||||||
|
changing back to miner results in the compass being shown behind the hearts!
|
||||||
|
[This should be okay, now. I just reorganized the order of hud flags
|
||||||
|
being set, seemed to work.]
|
||||||
|
|
||||||
|
Sometimes switching to/from node class results in bugs. Like getting an item in your
|
||||||
|
hand from prior class. Or the hotbar on the hud showing visual glitches
|
||||||
|
(vertical lines). There's also the matter of multiskin attempting to set
|
||||||
|
player's skin to "default:dirt" and the like.
|
||||||
|
|
||||||
|
Explosions seem to erase backpacks, other stuff. I did function() end on on_blast
|
||||||
|
for backpack, hopefully that helps. Still need to explode the contents.
|
||||||
|
|
||||||
|
I was underground battling with Oerkki and NPCs, when I saw the minimap come on when I hit
|
||||||
|
the button. But, I didn't have a walkie! What? [Got it, forgot to turn it off
|
||||||
|
if wielded ~= walkie... -jas]
|
||||||
|
|
||||||
|
Sometimes the player's HP (built-in statbar, not override (breath is hidden/off)) does not
|
||||||
|
display on the HUD. The reason, I suspect, is because I had a level 99 miner
|
||||||
|
and 1/99 HP shows as zero (out of twenty) on the HUD. I wonder if I can override
|
||||||
|
it easily, I don't want to redo the HP statbar, but I might eventually. [Update:
|
||||||
|
Armor suffers the same issue, if a very low value, shows as `0' on statbar!]
|
||||||
|
|
||||||
|
When the player's `wielditem' (mod), in third person, item is constantly set, models resets.
|
||||||
|
Example: Holding a walkie talkie, which is always setting(?). Or updating something,
|
||||||
|
causing the model to reset (not fully animate, go back to frame 0 repeatedly)...
|
||||||
|
|
||||||
|
The last item on the list of teleports in the bed formspec, if deleted, doesn't
|
||||||
|
update the index. So what happens is that once you delete the last
|
||||||
|
item, it won't work again until you select a new item.
|
|
@ -0,0 +1,682 @@
|
||||||
|
+----------------------------------------------------------------------+
|
||||||
|
| Glitchtest is copyright (c) 2018 James Stevenson |
|
||||||
|
| |
|
||||||
|
| Code: GPL version 3 |
|
||||||
|
| Media: CC BY-SA 4
|
||||||
|
+----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
{one line to give the program's name and a brief idea of what it does.}
|
||||||
|
Copyright (C) {year} {name of author}
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
{project} Copyright (C) {year} {fullname}
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 408 B |
|
@ -0,0 +1,43 @@
|
||||||
|
#3d_armor
|
||||||
|
armor_material_wood = true
|
||||||
|
armor_material_cactus = true
|
||||||
|
armor_material_steel = true
|
||||||
|
armor_material_bronze = true
|
||||||
|
armor_material_diamond = true
|
||||||
|
armor_material_gold = true
|
||||||
|
#armor_init_delay = 1
|
||||||
|
#armor_init_times = 1
|
||||||
|
#armor_bones_delay = 1
|
||||||
|
#armor_update_time = 1
|
||||||
|
#armor_drop = true
|
||||||
|
#armor_destroy = false
|
||||||
|
#armor_level_multiplier = 1
|
||||||
|
armor_heal_multiplier = 0
|
||||||
|
#armor_water_protect = true
|
||||||
|
#armor_fire_protect = false
|
||||||
|
#armor_punch_damage = true
|
||||||
|
#armor_migrate_old_inventory = true
|
||||||
|
|
||||||
|
#bones
|
||||||
|
share_bones_time = 300
|
||||||
|
share_bones_time_early = 60
|
||||||
|
bones_position_message = true
|
||||||
|
|
||||||
|
#give_initial_stuff
|
||||||
|
give_initial_stuff = true
|
||||||
|
initial_stuff = walkie:talkie
|
||||||
|
|
||||||
|
#tnt
|
||||||
|
enable_tnt = true
|
||||||
|
|
||||||
|
#fire
|
||||||
|
enable_fire = true
|
||||||
|
|
||||||
|
#sneak_jeak
|
||||||
|
sneak_jump.food_governor = 0.5
|
||||||
|
sneak_jump.regen_rate = 1
|
||||||
|
sneak_jump.drain_rate = 0.075
|
||||||
|
sneak_jump.fill_rate = 0.5
|
||||||
|
|
||||||
|
#mobs
|
||||||
|
remove_far_mobs = false
|
|
@ -0,0 +1,66 @@
|
||||||
|
# This file contains settings of Minetest Game that can be changed in
|
||||||
|
# minetest.conf.
|
||||||
|
# By default, all the settings are commented and not functional.
|
||||||
|
# Uncomment settings by removing the preceding #.
|
||||||
|
|
||||||
|
# Whether creative mode (fast digging of all blocks, unlimited resources) should
|
||||||
|
# be enabled.
|
||||||
|
#creative_mode = false
|
||||||
|
|
||||||
|
# Sets the behaviour of the inventory items when a player dies.
|
||||||
|
# bones: Store items in a bone node but drop items if inside protected area.
|
||||||
|
# drop: Drop items on the ground.
|
||||||
|
# keep: Player keeps items.
|
||||||
|
#bones_mode = bones
|
||||||
|
|
||||||
|
# The time in seconds after which the bones of a dead player can be looted by
|
||||||
|
# everyone.
|
||||||
|
# 0 to disable.
|
||||||
|
#share_bones_time = 1200
|
||||||
|
|
||||||
|
# How much earlier the bones of a dead player can be looted by
|
||||||
|
# everyone if the player dies in a protected area they don't own.
|
||||||
|
# 0 to disable. By default it is "share_bones_time" divide by four.
|
||||||
|
#share_bones_time_early = 300
|
||||||
|
|
||||||
|
# Inform player of condition and location of new bones.
|
||||||
|
#bones_position_message = false
|
||||||
|
|
||||||
|
# Whether fire should be enabled. If disabled, 'basic_flame' nodes will
|
||||||
|
# disappear.
|
||||||
|
# 'permanent_flame' nodes will remain with either setting.
|
||||||
|
#enable_fire = true
|
||||||
|
|
||||||
|
# Enable flame sound.
|
||||||
|
#flame_sound = true
|
||||||
|
|
||||||
|
# Whether lavacooling should be enabled.
|
||||||
|
#enable_lavacooling = true
|
||||||
|
|
||||||
|
# Whether the stuff in initial_stuff should be given to new players.
|
||||||
|
#give_initial_stuff = false
|
||||||
|
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
|
||||||
|
default:torch 99,default:cobble 99
|
||||||
|
|
||||||
|
# Whether the TNT mod should be enabled.
|
||||||
|
#enable_tnt = <true in singleplayer, false in multiplayer>
|
||||||
|
|
||||||
|
# The radius of a TNT explosion.
|
||||||
|
#tnt_radius = 3
|
||||||
|
|
||||||
|
# Enable the stairs mod ABM that replaces the old 'upside down'
|
||||||
|
# stair and slab nodes in old maps with the new param2 versions.
|
||||||
|
#enable_stairs_replace_abm = false
|
||||||
|
|
||||||
|
# Whether to allow respawning in beds.
|
||||||
|
# Default value is true.
|
||||||
|
#enable_bed_respawn = true
|
||||||
|
|
||||||
|
# Whether players can skip night by sleeping.
|
||||||
|
# Default value is true.
|
||||||
|
#enable_bed_night_skip = true
|
||||||
|
|
||||||
|
# Whether the engine's spawn search, which does not check for a suitable
|
||||||
|
# starting biome, is used.
|
||||||
|
# Default value is false.
|
||||||
|
#engine_spawn = false
|
|
@ -0,0 +1,9 @@
|
||||||
|
[mod] 3d Armor [3d_armor]
|
||||||
|
=========================
|
||||||
|
|
||||||
|
License Source Code: (C) 2012-2017 Stuart Jones - LGPL v2.1
|
||||||
|
|
||||||
|
License Textures: Copyright (C) 2017 davidthecreator - CC-BY-SA 3.0
|
||||||
|
|
||||||
|
https://github.com/daviddoesminetest/3d-armors-new-textures
|
||||||
|
|
|
@ -0,0 +1,191 @@
|
||||||
|
[mod] Visible Player Armor [3d_armor]
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
Depends: default
|
||||||
|
|
||||||
|
Recommends: sfinv, unified_inventory or smart_inventory (use only one to avoid conflicts)
|
||||||
|
|
||||||
|
Supports: player_monoids and armor_monoid
|
||||||
|
|
||||||
|
Adds craftable armor that is visible to other players. Each armor item worn contributes to
|
||||||
|
a player's armor group level making them less vulnerable to weapons.
|
||||||
|
|
||||||
|
Armor takes damage when a player is hurt but also offers a percentage chance of healing.
|
||||||
|
Overall level is boosted by 10% when wearing a full matching set.
|
||||||
|
|
||||||
|
Fire protection added by TenPlus1 when using crystal armor if Ethereal mod active, level 1
|
||||||
|
protects against torches, level 2 for crystal spike, level 3 for fire, level 5 for lava.
|
||||||
|
|
||||||
|
Armor Configuration
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Override the following default settings by adding them to your minetest.conf file.
|
||||||
|
|
||||||
|
-- Set false to disable individual armor materials.
|
||||||
|
armor_material_wood = true
|
||||||
|
armor_material_cactus = true
|
||||||
|
armor_material_steel = true
|
||||||
|
armor_material_bronze = true
|
||||||
|
armor_material_diamond = true
|
||||||
|
armor_material_gold = true
|
||||||
|
armor_material_mithril = true
|
||||||
|
armor_material_crystal = true
|
||||||
|
|
||||||
|
-- Increase this if you get initialization glitches when a player first joins.
|
||||||
|
armor_init_delay = 1
|
||||||
|
|
||||||
|
-- Number of initialization attempts.
|
||||||
|
-- Use in conjunction with armor_init_delay if initialization problems persist.
|
||||||
|
armor_init_times = 1
|
||||||
|
|
||||||
|
-- Increase this if armor is not getting into bones due to server lag.
|
||||||
|
armor_bones_delay = 1
|
||||||
|
|
||||||
|
-- How often player armor items are updated.
|
||||||
|
armor_update_time = 1
|
||||||
|
|
||||||
|
-- Drop armor when a player dies.
|
||||||
|
-- Uses bones mod if present, otherwise items are dropped around the player.
|
||||||
|
armor_drop = true
|
||||||
|
|
||||||
|
-- Pulverise armor when a player dies, overrides armor_drop.
|
||||||
|
armor_destroy = false
|
||||||
|
|
||||||
|
-- You can use this to increase or decrease overall armor effectiveness,
|
||||||
|
-- eg: level_multiplier = 0.5 will reduce armor level by half.
|
||||||
|
armor_level_multiplier = 1
|
||||||
|
|
||||||
|
-- You can use this to increase or decrease overall armor healing,
|
||||||
|
-- eg: armor_heal_multiplier = 0 will disable healing altogether.
|
||||||
|
armor_heal_multiplier = 1
|
||||||
|
|
||||||
|
-- Enable water protection (periodically restores breath when activated)
|
||||||
|
armor_water_protect = true
|
||||||
|
|
||||||
|
-- Enable fire protection (defaults true if using ethereal mod)
|
||||||
|
armor_fire_protect = false
|
||||||
|
|
||||||
|
-- Enable punch damage effects.
|
||||||
|
armor_punch_damage = true
|
||||||
|
|
||||||
|
-- Enable migration of old armor inventories
|
||||||
|
armor_migrate_old_inventory = true
|
||||||
|
|
||||||
|
API
|
||||||
|
---
|
||||||
|
|
||||||
|
Armor Registration:
|
||||||
|
|
||||||
|
armor:register_armor(name, def)
|
||||||
|
|
||||||
|
Wrapper function for `minetest.register_tool`, while registering armor as
|
||||||
|
a tool item is still supported, this may be deprecated in future so new code
|
||||||
|
should use this method.
|
||||||
|
|
||||||
|
Additional fields supported by 3d_armor:
|
||||||
|
|
||||||
|
texture = <filename>
|
||||||
|
preview = <filename>
|
||||||
|
armor_groups = <table>
|
||||||
|
damage_groups = <table>
|
||||||
|
reciprocate_damage = <bool>
|
||||||
|
on_equip = <function>
|
||||||
|
on_unequip = <function>
|
||||||
|
on_destroy = <function>
|
||||||
|
on_damage = <function>
|
||||||
|
on_punched = <function>
|
||||||
|
|
||||||
|
armor:register_armor_group(group, base)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
armor:register_armor_group("radiation", 100)
|
||||||
|
|
||||||
|
armor:register_armor("mod_name:speed_boots", {
|
||||||
|
description = "Speed Boots",
|
||||||
|
inventory_image = "mod_name_speed_boots_inv.png",
|
||||||
|
texture = "mod_name_speed_boots.png",
|
||||||
|
preview = "mod_name_speed_boots_preview.png",
|
||||||
|
groups = {armor_feet=1, armor_use=500, physics_speed=1.2, flammable=1},
|
||||||
|
armor_groups = {fleshy=10, radiation=10},
|
||||||
|
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
|
||||||
|
reciprocate_damage = true,
|
||||||
|
on_destroy = function(player, index, stack)
|
||||||
|
local pos = player:getpos()
|
||||||
|
if pos then
|
||||||
|
minetest.sound_play({
|
||||||
|
name = "mod_name_break_sound",
|
||||||
|
pos = pos,
|
||||||
|
gain = 0.5,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
See armor.lua, technic_armor and shields mods for more examples.
|
||||||
|
|
||||||
|
Default groups:
|
||||||
|
|
||||||
|
Elements: armor_head, armor_torso, armor_legs, armor_feet
|
||||||
|
Attributes: armor_heal, armor_fire, armor_water
|
||||||
|
Physics: physics_jump, physics_speed, physics_gravity
|
||||||
|
Durability: armor_use, flammable
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
Elements may be modified by dependent mods, eg shields adds armor_shield.
|
||||||
|
Attributes and physics values are 'stackable', durability is determined
|
||||||
|
by the level of armor_use, total uses == approx (65535/armor_use), non-fleshy
|
||||||
|
damage groups need to be defined in the tool/weapon used against the player.
|
||||||
|
|
||||||
|
Reciprocal tool damage will be done only by the first armor inventory item
|
||||||
|
with `reciprocate_damage = true`
|
||||||
|
|
||||||
|
Armor Functions:
|
||||||
|
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
|
||||||
|
Primarily an internal function but can be called externally to apply any
|
||||||
|
changes that might not otherwise get handled.
|
||||||
|
|
||||||
|
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
|
||||||
|
|
||||||
|
Used to apply damage to all equipped armor based on the damage groups of
|
||||||
|
each individual item.`hitter`, `time_from_last_punch` and `tool_capabilities`
|
||||||
|
are optional but should be valid if included.
|
||||||
|
|
||||||
|
armor:damage(player, index, stack, use)
|
||||||
|
|
||||||
|
Adds wear to a single armor itemstack, triggers `on_damage` callbacks and
|
||||||
|
updates the necessary inventories. Also handles item destruction callbacks
|
||||||
|
and so should NOT be called from `on_unequip` to avoid an infinite loop.
|
||||||
|
|
||||||
|
Item Callbacks:
|
||||||
|
|
||||||
|
on_equip = func(player, index, stack)
|
||||||
|
on_unequip = func(player, index, stack)
|
||||||
|
on_destroy = func(player, index, stack)
|
||||||
|
on_damage = func(player, index, stack)
|
||||||
|
on_punched = func(player, hitter, time_from_last_punch, tool_capabilities)
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
`on_punched` is called every time a player is punched or takes damage, `hitter`,
|
||||||
|
`time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the
|
||||||
|
case of fall damage, etc. When fire protection is enabled, hitter == "fire"
|
||||||
|
in the event of fire damage. Return `false` to override armor damage effects.
|
||||||
|
When armor is destroyed `stack` will contain a copy of the previous stack.
|
||||||
|
|
||||||
|
Global Callbacks:
|
||||||
|
|
||||||
|
armor:register_on_update(func(player))
|
||||||
|
armor:register_on_equip(func(player, index, stack))
|
||||||
|
armor:register_on_unequip(func(player, index, stack))
|
||||||
|
armor:register_on_destroy(func(player, index, stack))
|
||||||
|
|
||||||
|
Global Callback Example:
|
||||||
|
|
||||||
|
armor:register_on_update(function(player)
|
||||||
|
print(player:get_player_name().." armor updated!")
|
||||||
|
end)
|
||||||
|
|
|
@ -0,0 +1,516 @@
|
||||||
|
local use_multiskin = minetest.global_exists("multiskin")
|
||||||
|
local use_player_monoids = minetest.global_exists("player_monoids")
|
||||||
|
local use_armor_monoid = minetest.global_exists("armor_monoid")
|
||||||
|
local armor_def = setmetatable({}, {
|
||||||
|
__index = function()
|
||||||
|
return setmetatable({
|
||||||
|
groups = setmetatable({}, {
|
||||||
|
__index = function()
|
||||||
|
return 0
|
||||||
|
end})
|
||||||
|
}, {
|
||||||
|
__index = function()
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
local armor_textures = setmetatable({}, {
|
||||||
|
__index = function()
|
||||||
|
return setmetatable({}, {
|
||||||
|
__index = function()
|
||||||
|
return "blank.png"
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
armor = {
|
||||||
|
timer = 0,
|
||||||
|
elements = {"head", "torso", "legs", "feet"},
|
||||||
|
physics = {"jump", "speed", "gravity"},
|
||||||
|
attributes = {"heal", "fire", "water"},
|
||||||
|
formspec = "image[2.5,0;2,4;armor_preview]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
default.get_hotbar_bg(0, 4.7)..
|
||||||
|
"list[current_player;main;0,4.7;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.85;8,3;8]",
|
||||||
|
def = armor_def,
|
||||||
|
textures = armor_textures,
|
||||||
|
default_skin = "character.png",
|
||||||
|
materials = {
|
||||||
|
wood = "group:wood",
|
||||||
|
cactus = "default:cactus",
|
||||||
|
steel = "default:steel_ingot",
|
||||||
|
bronze = "default:bronze_ingot",
|
||||||
|
diamond = "default:diamond",
|
||||||
|
gold = "default:gold_ingot",
|
||||||
|
mithril = "moreores:mithril_ingot",
|
||||||
|
crystal = "ethereal:crystal_ingot",
|
||||||
|
},
|
||||||
|
fire_nodes = {
|
||||||
|
{"default:lava_source", 5, 8},
|
||||||
|
{"default:lava_flowing", 5, 8},
|
||||||
|
{"fire:basic_flame", 3, 4},
|
||||||
|
{"fire:permanent_flame", 3, 4},
|
||||||
|
{"ethereal:crystal_spike", 2, 1},
|
||||||
|
{"ethereal:fire_flower", 2, 1},
|
||||||
|
{"default:torch", 1, 1},
|
||||||
|
{"default:torch_ceiling", 1, 1},
|
||||||
|
{"default:torch_wall", 1, 1},
|
||||||
|
},
|
||||||
|
registered_groups = {["fleshy"]=100},
|
||||||
|
registered_callbacks = {
|
||||||
|
on_update = {},
|
||||||
|
on_equip = {},
|
||||||
|
on_unequip = {},
|
||||||
|
on_damage = {},
|
||||||
|
on_destroy = {},
|
||||||
|
},
|
||||||
|
migrate_old_inventory = true,
|
||||||
|
version = "0.4.9",
|
||||||
|
}
|
||||||
|
|
||||||
|
armor.config = {
|
||||||
|
init_delay = 2,
|
||||||
|
init_times = 10,
|
||||||
|
bones_delay = 1,
|
||||||
|
update_time = 1,
|
||||||
|
drop = minetest.get_modpath("bones") ~= nil,
|
||||||
|
destroy = false,
|
||||||
|
level_multiplier = 1,
|
||||||
|
heal_multiplier = 1,
|
||||||
|
material_wood = true,
|
||||||
|
material_cactus = true,
|
||||||
|
material_steel = true,
|
||||||
|
material_bronze = true,
|
||||||
|
material_diamond = true,
|
||||||
|
material_gold = true,
|
||||||
|
material_mithril = true,
|
||||||
|
material_crystal = true,
|
||||||
|
water_protect = true,
|
||||||
|
fire_protect = minetest.get_modpath("ethereal") ~= nil,
|
||||||
|
punch_damage = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Armor Registration
|
||||||
|
|
||||||
|
armor.register_armor = function(self, name, def)
|
||||||
|
minetest.register_tool(name, def)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.register_armor_group = function(self, group, base)
|
||||||
|
base = base or 100
|
||||||
|
self.registered_groups[group] = base
|
||||||
|
if use_armor_monoid then
|
||||||
|
armor_monoid.register_armor_group(group, base)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Armor callbacks
|
||||||
|
|
||||||
|
armor.register_on_update = function(self, func)
|
||||||
|
if type(func) == "function" then
|
||||||
|
table.insert(self.registered_callbacks.on_update, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.register_on_equip = function(self, func)
|
||||||
|
if type(func) == "function" then
|
||||||
|
table.insert(self.registered_callbacks.on_equip, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.register_on_unequip = function(self, func)
|
||||||
|
if type(func) == "function" then
|
||||||
|
table.insert(self.registered_callbacks.on_unequip, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.register_on_damage = function(self, func)
|
||||||
|
if type(func) == "function" then
|
||||||
|
table.insert(self.registered_callbacks.on_damage, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.register_on_destroy = function(self, func)
|
||||||
|
if type(func) == "function" then
|
||||||
|
table.insert(self.registered_callbacks.on_destroy, func)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.run_callbacks = function(self, callback, player, index, stack)
|
||||||
|
if stack then
|
||||||
|
local def = stack:get_definition() or {}
|
||||||
|
if type(def[callback]) == "function" then
|
||||||
|
def[callback](player, index, stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local callbacks = self.registered_callbacks[callback]
|
||||||
|
if callbacks then
|
||||||
|
for _, func in pairs(callbacks) do
|
||||||
|
func(player, index, stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.update_player_visuals = function(self, player)
|
||||||
|
local name = self:get_valid_player(player, "[update_player_visuals]")
|
||||||
|
if not name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local textures = {
|
||||||
|
"blank.png",
|
||||||
|
"blank.png",
|
||||||
|
self.textures[name].armor,
|
||||||
|
self.textures[name].wielditem,
|
||||||
|
}
|
||||||
|
if use_multiskin then
|
||||||
|
multiskin.textures[name] = textures
|
||||||
|
multiskin.update_player_visuals(player)
|
||||||
|
else
|
||||||
|
textures[1] = armor.default_skin
|
||||||
|
default.player_set_textures(player, textures)
|
||||||
|
end
|
||||||
|
self:run_callbacks("on_update", player)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.set_player_armor = function(self, player)
|
||||||
|
local name, armor_inv = self:get_valid_player(player, "[set_player_armor]")
|
||||||
|
if not name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local state = 0
|
||||||
|
local count = 0
|
||||||
|
local material = {count=1}
|
||||||
|
local preview = "3d_armor_preview.png"
|
||||||
|
local texture = "blank.png"
|
||||||
|
local textures = {}
|
||||||
|
local physics = {}
|
||||||
|
local attributes = {}
|
||||||
|
local levels = {}
|
||||||
|
local groups = {}
|
||||||
|
local change = {}
|
||||||
|
if use_multiskin then
|
||||||
|
preview = multiskin.get_preview(player) or preview
|
||||||
|
end
|
||||||
|
for _, phys in pairs(self.physics) do
|
||||||
|
physics[phys] = 1
|
||||||
|
end
|
||||||
|
for _, attr in pairs(self.attributes) do
|
||||||
|
attributes[attr] = 0
|
||||||
|
end
|
||||||
|
for group, _ in pairs(self.registered_groups) do
|
||||||
|
change[group] = 1
|
||||||
|
levels[group] = 0
|
||||||
|
end
|
||||||
|
local list = armor_inv:get_list("armor")
|
||||||
|
if type(list) ~= "table" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for i, stack in pairs(list) do
|
||||||
|
if stack:get_count() == 1 then
|
||||||
|
local def = stack:get_definition()
|
||||||
|
for _, element in pairs(self.elements) do
|
||||||
|
if def.groups["armor_"..element] then
|
||||||
|
if def.armor_groups then
|
||||||
|
for group, level in pairs(def.armor_groups) do
|
||||||
|
if levels[group] then
|
||||||
|
levels[group] = levels[group] + level
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local level = def.groups["armor_"..element]
|
||||||
|
levels["fleshy"] = levels["fleshy"] + level
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
-- DEPRECATED, use armor_groups instead
|
||||||
|
if def.groups["armor_radiation"] and levels["radiation"] then
|
||||||
|
levels["radiation"] = def.groups["armor_radiation"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local item = stack:get_name()
|
||||||
|
local tex = def.texture or item:gsub("%:", "_")
|
||||||
|
tex = tex:gsub(".png$", "")
|
||||||
|
local prev = def.preview or tex.."_preview"
|
||||||
|
prev = prev:gsub(".png$", "")
|
||||||
|
texture = texture.."^"..tex..".png"
|
||||||
|
preview = preview.."^"..prev..".png"
|
||||||
|
state = state + stack:get_wear()
|
||||||
|
count = count + 1
|
||||||
|
for _, phys in pairs(self.physics) do
|
||||||
|
local value = def.groups["physics_"..phys] or 0
|
||||||
|
physics[phys] = physics[phys] + value
|
||||||
|
end
|
||||||
|
for _, attr in pairs(self.attributes) do
|
||||||
|
local value = def.groups["armor_"..attr] or 0
|
||||||
|
attributes[attr] = attributes[attr] + value
|
||||||
|
end
|
||||||
|
local mat = string.match(item, "%:.+_(.+)$")
|
||||||
|
if material.name then
|
||||||
|
if material.name == mat then
|
||||||
|
material.count = material.count + 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
material.name = mat
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for group, level in pairs(levels) do
|
||||||
|
if level > 0 then
|
||||||
|
level = level * armor.config.level_multiplier
|
||||||
|
if material.name and material.count == #self.elements then
|
||||||
|
level = level * 1.1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local base = self.registered_groups[group]
|
||||||
|
self.def[name].groups[group] = level
|
||||||
|
if level > base then
|
||||||
|
level = base
|
||||||
|
end
|
||||||
|
groups[group] = base - level
|
||||||
|
change[group] = groups[group] / base
|
||||||
|
end
|
||||||
|
for _, attr in pairs(self.attributes) do
|
||||||
|
self.def[name][attr] = attributes[attr]
|
||||||
|
end
|
||||||
|
for _, phys in pairs(self.physics) do
|
||||||
|
self.def[name][phys] = physics[phys]
|
||||||
|
end
|
||||||
|
if use_armor_monoid then
|
||||||
|
armor_monoid.monoid:add_change(player, change, "3d_armor:armor")
|
||||||
|
else
|
||||||
|
player:set_armor_groups(groups)
|
||||||
|
end
|
||||||
|
if use_player_monoids then
|
||||||
|
player_monoids.speed:add_change(player, physics.speed,
|
||||||
|
"3d_armor:physics")
|
||||||
|
player_monoids.jump:add_change(player, physics.jump,
|
||||||
|
"3d_armor:physics")
|
||||||
|
player_monoids.gravity:add_change(player, physics.gravity,
|
||||||
|
"3d_armor:physics")
|
||||||
|
else
|
||||||
|
--player:set_physics_override(physics)
|
||||||
|
end
|
||||||
|
self.textures[name].armor = texture
|
||||||
|
self.textures[name].preview = preview
|
||||||
|
self.def[name].level = self.def[name].groups.fleshy or 0
|
||||||
|
self.def[name].state = state
|
||||||
|
self.def[name].count = count
|
||||||
|
self:update_player_visuals(player)
|
||||||
|
player:get_meta():set_int("3d_armor_wear", (65535 * count - state) / (65535 / 2) * 2)
|
||||||
|
sneak_jump.hud_update(player)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabilities)
|
||||||
|
local name, armor_inv = self:get_valid_player(player, "[punch]")
|
||||||
|
if not name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local state = 0
|
||||||
|
local count = 0
|
||||||
|
local recip = true
|
||||||
|
local default_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1}
|
||||||
|
local list = armor_inv:get_list("armor")
|
||||||
|
for i, stack in pairs(list) do
|
||||||
|
if stack:get_count() == 1 then
|
||||||
|
local name = stack:get_name()
|
||||||
|
local use = minetest.get_item_group(name, "armor_use") or 0
|
||||||
|
local damage = use > 0
|
||||||
|
local def = stack:get_definition() or {}
|
||||||
|
if type(def.on_punched) == "function" then
|
||||||
|
damage = def.on_punched(player, hitter, time_from_last_punch,
|
||||||
|
tool_capabilities) ~= false and damage == true
|
||||||
|
end
|
||||||
|
if damage == true and tool_capabilities then
|
||||||
|
local damage_groups = def.damage_groups or default_groups
|
||||||
|
local level = damage_groups.level or 0
|
||||||
|
local groupcaps = tool_capabilities.groupcaps or {}
|
||||||
|
local uses = 0
|
||||||
|
damage = false
|
||||||
|
for group, caps in pairs(groupcaps) do
|
||||||
|
local maxlevel = caps.maxlevel or 0
|
||||||
|
local diff = maxlevel - level
|
||||||
|
if diff == 0 then
|
||||||
|
diff = 1
|
||||||
|
end
|
||||||
|
if diff > 0 and caps.times then
|
||||||
|
local group_level = damage_groups[group]
|
||||||
|
if group_level then
|
||||||
|
local time = caps.times[group_level]
|
||||||
|
if time then
|
||||||
|
local dt = time_from_last_punch or 0
|
||||||
|
if dt > time / diff then
|
||||||
|
if caps.uses then
|
||||||
|
uses = caps.uses * math.pow(3, diff)
|
||||||
|
end
|
||||||
|
damage = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if damage == true and recip == true and hitter and
|
||||||
|
def.reciprocate_damage == true and uses > 0 then
|
||||||
|
local item = hitter:get_wielded_item()
|
||||||
|
if item and item:get_name() ~= "" then
|
||||||
|
item:add_wear(65535 / uses)
|
||||||
|
hitter:set_wielded_item(item)
|
||||||
|
end
|
||||||
|
-- reciprocate tool damage only once
|
||||||
|
recip = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if damage == true and hitter == "fire" then
|
||||||
|
damage = minetest.get_item_group(name, "flammable") > 0
|
||||||
|
end
|
||||||
|
if damage == true then
|
||||||
|
self:damage(player, i, stack, use)
|
||||||
|
end
|
||||||
|
state = state + stack:get_wear()
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.def[name].state = state
|
||||||
|
self.def[name].count = count
|
||||||
|
player:get_meta():set_int("3d_armor_wear", (65535 * count - state) / (65535 / 2) * 2)
|
||||||
|
sneak_jump.hud_update(player)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.damage = function(self, player, index, stack, use)
|
||||||
|
local old_stack = ItemStack(stack)
|
||||||
|
stack:add_wear(use)
|
||||||
|
self:run_callbacks("on_damage", player, index, stack)
|
||||||
|
self:set_inventory_stack(player, index, stack)
|
||||||
|
if stack:get_count() == 0 then
|
||||||
|
self:run_callbacks("on_unequip", player, index, old_stack)
|
||||||
|
self:run_callbacks("on_destroy", player, index, old_stack)
|
||||||
|
self:set_player_armor(player)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.get_armor_formspec = function(self, name, listring)
|
||||||
|
if armor.def[name].init_time == 0 then
|
||||||
|
return "label[0,0;Armor not initialized!]"
|
||||||
|
end
|
||||||
|
local formspec = armor.formspec..
|
||||||
|
"list[detached:"..name.."_armor;armor;0,0.5;2,3;]"
|
||||||
|
if listring == true then
|
||||||
|
formspec = formspec.."listring[current_player;main]"..
|
||||||
|
"listring[detached:"..name.."_armor;armor]"
|
||||||
|
end
|
||||||
|
formspec = formspec:gsub("armor_preview", armor.textures[name].preview)
|
||||||
|
formspec = formspec:gsub("armor_level", armor.def[name].level)
|
||||||
|
for _, attr in pairs(self.attributes) do
|
||||||
|
formspec = formspec:gsub("armor_attr_"..attr, armor.def[name][attr])
|
||||||
|
end
|
||||||
|
for group, _ in pairs(self.registered_groups) do
|
||||||
|
formspec = formspec:gsub("armor_group_"..group,
|
||||||
|
armor.def[name].groups[group])
|
||||||
|
end
|
||||||
|
return formspec
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.serialize_inventory_list = function(self, list)
|
||||||
|
local list_table = {}
|
||||||
|
for _, stack in ipairs(list) do
|
||||||
|
table.insert(list_table, stack:to_string())
|
||||||
|
end
|
||||||
|
return minetest.serialize(list_table)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.deserialize_inventory_list = function(self, list_string)
|
||||||
|
local list_table = minetest.deserialize(list_string)
|
||||||
|
local list = {}
|
||||||
|
for _, stack in ipairs(list_table or {}) do
|
||||||
|
table.insert(list, ItemStack(stack))
|
||||||
|
end
|
||||||
|
return list
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.load_armor_inventory = function(self, player)
|
||||||
|
local msg = "[load_armor_inventory]"
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then
|
||||||
|
minetest.log("warning", S("3d_armor: Player name is nil @1", msg))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||||
|
if not armor_inv then
|
||||||
|
minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local armor_list_string = player:get_attribute("3d_armor_inventory")
|
||||||
|
if armor_list_string then
|
||||||
|
armor_inv:set_list("armor", self:deserialize_inventory_list(armor_list_string))
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.save_armor_inventory = function(self, player)
|
||||||
|
local msg = "[save_armor_inventory]"
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then
|
||||||
|
minetest.log("warning", S("3d_armor: Player name is nil @1", msg))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||||
|
if not armor_inv then
|
||||||
|
minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
player:set_attribute("3d_armor_inventory", self:serialize_inventory_list(armor_inv:get_list("armor")))
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.update_inventory = function(self, player)
|
||||||
|
-- DEPRECATED: Legacy inventory support
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.set_inventory_stack = function(self, player, i, stack)
|
||||||
|
local msg = "[set_inventory_stack]"
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then
|
||||||
|
minetest.log("warning", "3d_armor: Player name is nil "..msg)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local armor_inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||||
|
if not armor_inv then
|
||||||
|
minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
armor_inv:set_stack("armor", i, stack)
|
||||||
|
self:save_armor_inventory(player)
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.get_valid_player = function(self, player, msg)
|
||||||
|
msg = msg or ""
|
||||||
|
if not player then
|
||||||
|
minetest.log("warning", "3d_armor: Player reference is nil "..msg)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then
|
||||||
|
minetest.log("warning", "3d_armor: Player name is nil "..msg)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||||
|
if not inv then
|
||||||
|
minetest.log("warning", "3d_armor: Player inventory is nil "..msg)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return name, inv
|
||||||
|
end
|
||||||
|
|
||||||
|
armor.drop_armor = function(pos, stack)
|
||||||
|
local node = minetest.get_node_or_nil(pos)
|
||||||
|
if node then
|
||||||
|
local obj = minetest.add_item(pos, stack)
|
||||||
|
if obj then
|
||||||
|
obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,65 @@
|
||||||
|
-- DEPRECATED, will not be supported in future versions
|
||||||
|
|
||||||
|
-- See README.txt for new configuration options.
|
||||||
|
|
||||||
|
-- Armor Configuration (defaults)
|
||||||
|
|
||||||
|
-- You can remove any unwanted armor materials from this table.
|
||||||
|
-- Note that existing armor that is removed will show up as an unknown item.
|
||||||
|
ARMOR_MATERIALS = {
|
||||||
|
wood = "group:wood",
|
||||||
|
cactus = "default:cactus",
|
||||||
|
steel = "default:steel_ingot",
|
||||||
|
bronze = "default:bronze_ingot",
|
||||||
|
diamond = "default:diamond",
|
||||||
|
gold = "default:gold_ingot",
|
||||||
|
mithril = "moreores:mithril_ingot",
|
||||||
|
crystal = "ethereal:crystal_ingot",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Enable fire protection (defaults true if using ethereal mod)
|
||||||
|
ARMOR_FIRE_PROTECT = false
|
||||||
|
|
||||||
|
-- Fire protection nodes, (name, protection level, damage)
|
||||||
|
ARMOR_FIRE_NODES = {
|
||||||
|
{"default:lava_source", 5, 4},
|
||||||
|
{"default:lava_flowing", 5, 4},
|
||||||
|
{"fire:basic_flame", 3, 4},
|
||||||
|
{"fire:permanent_flame", 3, 4},
|
||||||
|
{"ethereal:crystal_spike", 2, 1},
|
||||||
|
{"ethereal:fire_flower", 2, 1},
|
||||||
|
{"default:torch", 1, 1},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Increase this if you get initialization glitches when a player first joins.
|
||||||
|
ARMOR_INIT_DELAY = 1
|
||||||
|
|
||||||
|
-- Number of initialization attempts.
|
||||||
|
-- Use in conjunction with ARMOR_INIT_DELAY if initialization problems persist.
|
||||||
|
ARMOR_INIT_TIMES = 1
|
||||||
|
|
||||||
|
-- Increase this if armor is not getting into bones due to server lag.
|
||||||
|
ARMOR_BONES_DELAY = 1
|
||||||
|
|
||||||
|
-- How often player armor/wield items are updated.
|
||||||
|
ARMOR_UPDATE_TIME = 1
|
||||||
|
|
||||||
|
-- Drop armor when a player dies.
|
||||||
|
-- Uses bones mod if present, otherwise items are dropped around the player.
|
||||||
|
ARMOR_DROP = true
|
||||||
|
|
||||||
|
-- Pulverise armor when a player dies, overrides ARMOR_DROP.
|
||||||
|
ARMOR_DESTROY = false
|
||||||
|
|
||||||
|
-- You can use this to increase or decrease overall armor effectiveness,
|
||||||
|
-- eg: ARMOR_LEVEL_MULTIPLIER = 0.5 will reduce armor level by half.
|
||||||
|
ARMOR_LEVEL_MULTIPLIER = 1
|
||||||
|
|
||||||
|
-- You can use this to increase or decrease overall armor healing,
|
||||||
|
-- eg: ARMOR_HEAL_MULTIPLIER = 0 will disable healing altogether.
|
||||||
|
ARMOR_HEAL_MULTIPLIER = 1
|
||||||
|
|
||||||
|
-- You can use this to increase or decrease overall armor radiation protection,
|
||||||
|
-- eg: ARMOR_RADIATION_MULTIPLIER = 0 will completely disable radiation protection.
|
||||||
|
-- Note: patched technic mod is required
|
||||||
|
ARMOR_RADIATION_MULTIPLIER = 1
|
|
@ -0,0 +1,399 @@
|
||||||
|
local S = function(s) return s end
|
||||||
|
if minetest.global_exists("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
S = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
S = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--[[
|
||||||
|
armor:register_armor("3d_armor:helmet_admin", {
|
||||||
|
description = S("Admin Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_admin.png",
|
||||||
|
armor_groups = {fleshy=100},
|
||||||
|
groups = {armor_head=1, armor_heal=100, armor_use=0, armor_water=1,
|
||||||
|
not_in_creative_inventory=1},
|
||||||
|
on_drop = function(itemstack, dropper, pos)
|
||||||
|
return
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
armor:register_armor("3d_armor:chestplate_admin", {
|
||||||
|
description = S("Admin Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_admin.png",
|
||||||
|
armor_groups = {fleshy=100},
|
||||||
|
groups = {armor_torso=1, armor_heal=100, armor_use=0,
|
||||||
|
not_in_creative_inventory=1},
|
||||||
|
on_drop = function(itemstack, dropper, pos)
|
||||||
|
return
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
armor:register_armor("3d_armor:leggings_admin", {
|
||||||
|
description = S("Admin Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_admin.png",
|
||||||
|
armor_groups = {fleshy=100},
|
||||||
|
groups = {armor_legs=1, armor_heal=100, armor_use=0,
|
||||||
|
not_in_creative_inventory=1},
|
||||||
|
on_drop = function(itemstack, dropper, pos)
|
||||||
|
return
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
armor:register_armor("3d_armor:boots_admin", {
|
||||||
|
description = S("Admin Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_admin.png",
|
||||||
|
armor_groups = {fleshy=100},
|
||||||
|
groups = {armor_feet=1, armor_heal=100, armor_use=0,
|
||||||
|
not_in_creative_inventory=1},
|
||||||
|
on_drop = function(itemstack, dropper, pos)
|
||||||
|
return
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_alias("adminboots", "3d_armor:boots_admin")
|
||||||
|
minetest.register_alias("adminhelmet", "3d_armor:helmet_admin")
|
||||||
|
minetest.register_alias("adminchestplate", "3d_armor:chestplate_admin")
|
||||||
|
minetest.register_alias("adminleggings", "3d_armor:leggings_admin")
|
||||||
|
--]]
|
||||||
|
local armor_on_use = function(itemstack, user, pointed_thing)
|
||||||
|
local name = user:get_player_name()
|
||||||
|
local inv = minetest.get_inventory({type = "detached",
|
||||||
|
name = name .. "_armor"})
|
||||||
|
local list = inv:get_list("armor")
|
||||||
|
local index = 0
|
||||||
|
for i = 1, #list do
|
||||||
|
if list[i]:get_name() == "" then
|
||||||
|
inv:set_stack("armor", i, itemstack)
|
||||||
|
index = i
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if index == 0 then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
armor:save_armor_inventory(user)
|
||||||
|
armor:run_callbacks("on_equip", user, index, itemstack)
|
||||||
|
armor:set_player_armor(user)
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
if armor.materials.wood then
|
||||||
|
armor:register_armor("3d_armor:helmet_wood", {
|
||||||
|
description = S("Wood Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_wood.png",
|
||||||
|
groups = {armor_head=1, armor_heal=0, armor_use=2000, flammable=1},
|
||||||
|
armor_groups = {fleshy=5},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_wood", {
|
||||||
|
description = S("Wood Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_wood.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=0, armor_use=2000, flammable=1},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_wood", {
|
||||||
|
description = S("Wood Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_wood.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=0, armor_use=2000, flammable=1},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_wood", {
|
||||||
|
description = S("Wood Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_wood.png",
|
||||||
|
armor_groups = {fleshy=5},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
|
||||||
|
groups = {armor_feet=1, armor_heal=0, armor_use=2000, flammable=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.cactus then
|
||||||
|
armor:register_armor("3d_armor:helmet_cactus", {
|
||||||
|
description = S("Cactus Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_cactus.png",
|
||||||
|
groups = {armor_head=1, armor_heal=0, armor_use=1000},
|
||||||
|
armor_groups = {fleshy=5},
|
||||||
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_cactus", {
|
||||||
|
description = S("Cactus Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_cactus.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=0, armor_use=1000},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_cactus", {
|
||||||
|
description = S("Cactus Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_cactus.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=0, armor_use=1000},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_cactus", {
|
||||||
|
description = S("Cactus Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_cactus.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=0, armor_use=1000},
|
||||||
|
armor_groups = {fleshy=5},
|
||||||
|
damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.steel then
|
||||||
|
armor:register_armor("3d_armor:helmet_steel", {
|
||||||
|
description = S("Steel Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_steel.png",
|
||||||
|
groups = {armor_head=1, armor_heal=0, armor_use=800,
|
||||||
|
physics_speed=-0.01, physics_gravity=0.01},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_steel", {
|
||||||
|
description = S("Steel Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_steel.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=0, armor_use=800,
|
||||||
|
physics_speed=-0.04, physics_gravity=0.04},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_steel", {
|
||||||
|
description = S("Steel Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_steel.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=0, armor_use=800,
|
||||||
|
physics_speed=-0.03, physics_gravity=0.03},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_steel", {
|
||||||
|
description = S("Steel Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_steel.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=0, armor_use=800,
|
||||||
|
physics_speed=-0.01, physics_gravity=0.01},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.bronze then
|
||||||
|
armor:register_armor("3d_armor:helmet_bronze", {
|
||||||
|
description = S("Bronze Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_bronze.png",
|
||||||
|
groups = {armor_head=1, armor_heal=6, armor_use=400,
|
||||||
|
physics_speed=-0.01, physics_gravity=0.01},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_bronze", {
|
||||||
|
description = S("Bronze Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_bronze.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=6, armor_use=400,
|
||||||
|
physics_speed=-0.04, physics_gravity=0.04},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_bronze", {
|
||||||
|
description = S("Bronze Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_bronze.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=6, armor_use=400,
|
||||||
|
physics_speed=-0.03, physics_gravity=0.03},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_bronze", {
|
||||||
|
description = S("Bronze Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_bronze.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=6, armor_use=400,
|
||||||
|
physics_speed=-0.01, physics_gravity=0.01},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.diamond then
|
||||||
|
armor:register_armor("3d_armor:helmet_diamond", {
|
||||||
|
description = S("Diamond Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_diamond.png",
|
||||||
|
groups = {armor_head=1, armor_heal=12, armor_use=200},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_diamond", {
|
||||||
|
description = S("Diamond Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_diamond.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=12, armor_use=200},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_diamond", {
|
||||||
|
description = S("Diamond Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_diamond.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=12, armor_use=200},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_diamond", {
|
||||||
|
description = S("Diamond Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_diamond.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=12, armor_use=200},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.gold then
|
||||||
|
armor:register_armor("3d_armor:helmet_gold", {
|
||||||
|
description = S("Gold Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_gold.png",
|
||||||
|
groups = {armor_head=1, armor_heal=6, armor_use=300,
|
||||||
|
physics_speed=-0.02, physics_gravity=0.02},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_gold", {
|
||||||
|
description = S("Gold Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_gold.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=6, armor_use=300,
|
||||||
|
physics_speed=-0.05, physics_gravity=0.05},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_gold", {
|
||||||
|
description = S("Gold Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_gold.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=6, armor_use=300,
|
||||||
|
physics_speed=-0.04, physics_gravity=0.04},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_gold", {
|
||||||
|
description = S("Gold Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_gold.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=6, armor_use=300,
|
||||||
|
physics_speed=-0.02, physics_gravity=0.02},
|
||||||
|
armor_groups = {fleshy=10},
|
||||||
|
damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
|
||||||
|
on_use = armor_on_use,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.mithril then
|
||||||
|
armor:register_armor("3d_armor:helmet_mithril", {
|
||||||
|
description = S("Mithril Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_mithril.png",
|
||||||
|
groups = {armor_head=1, armor_heal=12, armor_use=100},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_mithril", {
|
||||||
|
description = S("Mithril Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_mithril.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=12, armor_use=100},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_mithril", {
|
||||||
|
description = S("Mithril Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_mithril.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=12, armor_use=100},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_mithril", {
|
||||||
|
description = S("Mithril Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_mithril.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=12, armor_use=100},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.materials.crystal then
|
||||||
|
armor:register_armor("3d_armor:helmet_crystal", {
|
||||||
|
description = S("Crystal Helmet"),
|
||||||
|
inventory_image = "3d_armor_inv_helmet_crystal.png",
|
||||||
|
groups = {armor_head=1, armor_heal=12, armor_use=100, armor_fire=1},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:chestplate_crystal", {
|
||||||
|
description = S("Crystal Chestplate"),
|
||||||
|
inventory_image = "3d_armor_inv_chestplate_crystal.png",
|
||||||
|
groups = {armor_torso=1, armor_heal=12, armor_use=100, armor_fire=1},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:leggings_crystal", {
|
||||||
|
description = S("Crystal Leggings"),
|
||||||
|
inventory_image = "3d_armor_inv_leggings_crystal.png",
|
||||||
|
groups = {armor_legs=1, armor_heal=12, armor_use=100, armor_fire=1},
|
||||||
|
armor_groups = {fleshy=20},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
armor:register_armor("3d_armor:boots_crystal", {
|
||||||
|
description = S("Crystal Boots"),
|
||||||
|
inventory_image = "3d_armor_inv_boots_crystal.png",
|
||||||
|
groups = {armor_feet=1, armor_heal=12, armor_use=100, physics_speed=1,
|
||||||
|
physics_jump=0.5, armor_fire=1},
|
||||||
|
armor_groups = {fleshy=15},
|
||||||
|
damage_groups = {cracky=2, snappy=1, level=3},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
for k, v in pairs(armor.materials) do
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "3d_armor:helmet_"..k,
|
||||||
|
recipe = {
|
||||||
|
{v, v, v},
|
||||||
|
{v, "", v},
|
||||||
|
{"", "", ""},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "3d_armor:chestplate_"..k,
|
||||||
|
recipe = {
|
||||||
|
{v, "", v},
|
||||||
|
{v, v, v},
|
||||||
|
{v, v, v},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "3d_armor:leggings_"..k,
|
||||||
|
recipe = {
|
||||||
|
{v, v, v},
|
||||||
|
{v, "", v},
|
||||||
|
{v, "", v},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "3d_armor:boots_"..k,
|
||||||
|
recipe = {
|
||||||
|
{v, "", v},
|
||||||
|
{v, "", v},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
|
@ -0,0 +1,79 @@
|
||||||
|
3d_armor -- Crafting Guide
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Helmets:
|
||||||
|
|
||||||
|
+---+---+---+
|
||||||
|
| X | X | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
| | | |
|
||||||
|
+---+---+---+
|
||||||
|
|
||||||
|
[3d_armor:helmet_wood] X = [default:wood]
|
||||||
|
[3d_armor:helmet_cactus] X = [default:cactus]
|
||||||
|
[3d_armor:helmet_steel] X = [default:steel_ingot]
|
||||||
|
[3d_armor:helmet_bronze] X = [default:bronze_ingot]
|
||||||
|
[3d_armor:helmet_diamond] X = [default:diamond]
|
||||||
|
[3d_armor:helmet_gold] X = [default:gold_ingot]
|
||||||
|
[3d_armor:helmet_mithril] X = [moreores:mithril_ingot] *
|
||||||
|
[3d_armor:helmet_crystal] X = [ethereal:crystal_ingot] **
|
||||||
|
|
||||||
|
Chestplates:
|
||||||
|
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | X | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | X | X |
|
||||||
|
+---+---+---+
|
||||||
|
|
||||||
|
[3d_armor:chestplate_wood] X = [default:wood]
|
||||||
|
[3d_armor:chestplate_cactus] X = [default:cactus]
|
||||||
|
[3d_armor:chestplate_steel] X = [default:steel_ingot]
|
||||||
|
[3d_armor:chestplate_bronze] X = [default:bronze_ingot]
|
||||||
|
[3d_armor:chestplate_diamond] X = [default:diamond]
|
||||||
|
[3d_armor:chestplate_gold] X = [default:gold_ingot]
|
||||||
|
[3d_armor:chestplate_mithril] X = [moreores:mithril_ingot] *
|
||||||
|
[3d_armor:chestplate_crystal] X = [ethereal:crystal_ingot] **
|
||||||
|
|
||||||
|
Leggings:
|
||||||
|
|
||||||
|
+---+---+---+
|
||||||
|
| X | X | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
|
||||||
|
[3d_armor:leggings_wood] X = [default:wood]
|
||||||
|
[3d_armor:leggings_cactus] X = [default:cactus]
|
||||||
|
[3d_armor:leggings_steel] X = [default:steel_ingot]
|
||||||
|
[3d_armor:leggings_bronze] X = [default:bronze_ingot]
|
||||||
|
[3d_armor:leggings_diamond] X = [default:diamond]
|
||||||
|
[3d_armor:leggings_gold] X = [default:gold_ingot]
|
||||||
|
[3d_armor:leggings_mithril] X = [moreores:mithril_ingot] *
|
||||||
|
[3d_armor:leggings_crystal] X = [ethereal:crystal_ingot] **
|
||||||
|
|
||||||
|
Boots:
|
||||||
|
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
| X | | X |
|
||||||
|
+---+---+---+
|
||||||
|
|
||||||
|
[3d_armor:boots_wood] X = [default:wood]
|
||||||
|
[3d_armor:boots_cactus] X = [default:cactus]
|
||||||
|
[3d_armor:boots_steel] X = [default:steel_ingot]
|
||||||
|
[3d_armor:boots_bronze] X = [default:bronze_ingot
|
||||||
|
[3d_armor:boots_diamond] X = [default:diamond]
|
||||||
|
[3d_armor:boots_gold] X = [default:gold_ingot]
|
||||||
|
[3d_armor:boots_mithril] X = [moreores:mithril_ingot] *
|
||||||
|
[3d_armor:boots_crystal] X = [ethereal:crystal_ingot] **
|
||||||
|
|
||||||
|
* Requires moreores mod by Calinou - https://forum.minetest.net/viewtopic.php?id=549
|
||||||
|
** Requires ethereal mod by Chinchow & TenPlus1 - https://github.com/tenplus1/ethereal
|
|
@ -0,0 +1,8 @@
|
||||||
|
default
|
||||||
|
player_monoids?
|
||||||
|
armor_monoid?
|
||||||
|
fire?
|
||||||
|
ethereal?
|
||||||
|
bakedclay?
|
||||||
|
intllib?
|
||||||
|
multiskin?
|
|
@ -0,0 +1 @@
|
||||||
|
Adds craftable armor that is visible to other players.
|
|
@ -0,0 +1,383 @@
|
||||||
|
local S = function(s) return s end
|
||||||
|
if minetest.global_exists("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
S = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
S = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local modname = minetest.get_current_modname()
|
||||||
|
local modpath = minetest.get_modpath(modname)
|
||||||
|
local worldpath = minetest.get_worldpath()
|
||||||
|
local last_punch_time = {}
|
||||||
|
local pending_players = {}
|
||||||
|
local timer = 0
|
||||||
|
|
||||||
|
dofile(modpath.."/api.lua")
|
||||||
|
|
||||||
|
-- Legacy Config Support
|
||||||
|
|
||||||
|
local input = io.open(modpath.."/armor.conf", "r")
|
||||||
|
if input then
|
||||||
|
dofile(modpath.."/armor.conf")
|
||||||
|
input:close()
|
||||||
|
input = nil
|
||||||
|
end
|
||||||
|
input = io.open(worldpath.."/armor.conf", "r")
|
||||||
|
if input then
|
||||||
|
dofile(worldpath.."/armor.conf")
|
||||||
|
input:close()
|
||||||
|
input = nil
|
||||||
|
end
|
||||||
|
for name, _ in pairs(armor.config) do
|
||||||
|
local global = "ARMOR_"..name:upper()
|
||||||
|
if minetest.global_exists(global) then
|
||||||
|
armor.config[name] = _G[global]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if minetest.global_exists("ARMOR_MATERIALS") then
|
||||||
|
armor.materials = table.copy(ARMOR_MATERIALS)
|
||||||
|
end
|
||||||
|
if minetest.global_exists("ARMOR_FIRE_NODES") then
|
||||||
|
armor.fire_nodes = table.copy(ARMOR_FIRE_NODES)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Load Configuration
|
||||||
|
|
||||||
|
for name, config in pairs(armor.config) do
|
||||||
|
local setting = minetest.settings:get("armor_"..name)
|
||||||
|
if type(config) == "number" then
|
||||||
|
setting = tonumber(setting)
|
||||||
|
elseif type(config) == "boolean" then
|
||||||
|
setting = minetest.settings:get_bool("armor_"..name)
|
||||||
|
end
|
||||||
|
if setting ~= nil then
|
||||||
|
armor.config[name] = setting
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for material, _ in pairs(armor.materials) do
|
||||||
|
local key = "material_"..material
|
||||||
|
if armor.config[key] == false then
|
||||||
|
armor.materials[material] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Mod Compatibility
|
||||||
|
if minetest.get_modpath("multiskin") then
|
||||||
|
multiskin.model = "3d_armor_character.b3d"
|
||||||
|
end
|
||||||
|
if minetest.get_modpath("technic") then
|
||||||
|
armor.formspec = armor.formspec..
|
||||||
|
"label[5,2.5;"..S("Radiation")..": armor_group_radiation]"
|
||||||
|
armor:register_armor_group("radiation")
|
||||||
|
end
|
||||||
|
if not minetest.get_modpath("moreores") then
|
||||||
|
armor.materials.mithril = nil
|
||||||
|
end
|
||||||
|
if not minetest.get_modpath("ethereal") then
|
||||||
|
armor.materials.crystal = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
dofile(modpath.."/armor.lua")
|
||||||
|
|
||||||
|
-- Armor Initialization
|
||||||
|
|
||||||
|
armor.formspec = armor.formspec..
|
||||||
|
"label[5,1;"..S("Level")..": armor_level]"..
|
||||||
|
"label[5,1.5;"..S("Heal")..": armor_attr_heal]"
|
||||||
|
if armor.config.fire_protect then
|
||||||
|
armor.formspec = armor.formspec.."label[5,2;"..S("Fire")..": armor_fire]"
|
||||||
|
end
|
||||||
|
armor:register_on_destroy(function(player, index, stack)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local def = stack:get_definition()
|
||||||
|
if name and def and def.description then
|
||||||
|
minetest.chat_send_player(name, S("Your").." "..def.description.." "..
|
||||||
|
S("got destroyed").."!")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
local function init_player_armor(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local pos = player:getpos()
|
||||||
|
if not name or not pos then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local armor_inv = minetest.create_detached_inventory(name.."_armor", {
|
||||||
|
on_put = function(inv, listname, index, stack, player)
|
||||||
|
armor:save_armor_inventory(player)
|
||||||
|
armor:run_callbacks("on_equip", player, index, stack)
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
end,
|
||||||
|
on_take = function(inv, listname, index, stack, player)
|
||||||
|
armor:save_armor_inventory(player)
|
||||||
|
armor:run_callbacks("on_unequip", player, index, stack)
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
end,
|
||||||
|
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
armor:save_armor_inventory(player)
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
end,
|
||||||
|
allow_put = function(inv, listname, index, stack, player)
|
||||||
|
local def = stack:get_definition() or {}
|
||||||
|
local allowed = 0
|
||||||
|
for _, element in pairs(armor.elements) do
|
||||||
|
if def.groups["armor_"..element] then
|
||||||
|
allowed = 1
|
||||||
|
for i = 1, 6 do
|
||||||
|
local item = inv:get_stack("armor", i):get_name()
|
||||||
|
if minetest.get_item_group(item, "armor_"..element) > 0 then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return allowed
|
||||||
|
end,
|
||||||
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
|
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
return count
|
||||||
|
end,
|
||||||
|
}, name)
|
||||||
|
armor_inv:set_size("armor", 6)
|
||||||
|
if not armor:load_armor_inventory(player) and armor.migrate_old_inventory then
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
player_inv:set_size("armor", 6)
|
||||||
|
for i=1, 6 do
|
||||||
|
local stack = player_inv:get_stack("armor", i)
|
||||||
|
armor_inv:set_stack("armor", i, stack)
|
||||||
|
end
|
||||||
|
armor:save_armor_inventory(player)
|
||||||
|
player_inv:set_size("armor", 0)
|
||||||
|
end
|
||||||
|
for i=1, 6 do
|
||||||
|
local stack = armor_inv:get_stack("armor", i)
|
||||||
|
armor:run_callbacks("on_equip", player, i, stack)
|
||||||
|
end
|
||||||
|
armor.def[name] = {
|
||||||
|
init_time = minetest.get_gametime(),
|
||||||
|
level = 0,
|
||||||
|
state = 0,
|
||||||
|
count = 0,
|
||||||
|
groups = {},
|
||||||
|
}
|
||||||
|
for _, phys in pairs(armor.physics) do
|
||||||
|
armor.def[name][phys] = 1
|
||||||
|
end
|
||||||
|
for _, attr in pairs(armor.attributes) do
|
||||||
|
armor.def[name][attr] = 0
|
||||||
|
end
|
||||||
|
for group, _ in pairs(armor.registered_groups) do
|
||||||
|
armor.def[name].groups[group] = 0
|
||||||
|
end
|
||||||
|
armor.textures[name] = {
|
||||||
|
armor = "blank.png",
|
||||||
|
wielditem = "blank.png",
|
||||||
|
}
|
||||||
|
minetest.after(0, function(player)
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
end, player)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Armor Player Model
|
||||||
|
|
||||||
|
default.player_register_model("3d_armor_character.b3d", {
|
||||||
|
animation_speed = 30,
|
||||||
|
textures = {
|
||||||
|
armor.default_skin,
|
||||||
|
"blank.png",
|
||||||
|
"blank.png",
|
||||||
|
"blank.png",
|
||||||
|
},
|
||||||
|
animations = {
|
||||||
|
stand = {x=0, y=79},
|
||||||
|
lay = {x=162, y=166},
|
||||||
|
walk = {x=168, y=187},
|
||||||
|
mine = {x=189, y=198},
|
||||||
|
walk_mine = {x=200, y=219},
|
||||||
|
sit = {x=81, y=160},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
default.player_set_model(player, "3d_armor_character.b3d")
|
||||||
|
minetest.after(0, function(player)
|
||||||
|
if init_player_armor(player) == false then
|
||||||
|
pending_players[player] = 0
|
||||||
|
end
|
||||||
|
end, player)
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if name then
|
||||||
|
armor.def[name] = nil
|
||||||
|
armor.textures[name] = nil
|
||||||
|
end
|
||||||
|
pending_players[player] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
if armor.config.drop == true or armor.config.destroy == true then
|
||||||
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
local name, armor_inv = armor:get_valid_player(player, "[on_dieplayer]")
|
||||||
|
if not name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local drop = {}
|
||||||
|
for i=1, armor_inv:get_size("armor") do
|
||||||
|
local stack = armor_inv:get_stack("armor", i)
|
||||||
|
if stack:get_count() > 0 then
|
||||||
|
table.insert(drop, stack)
|
||||||
|
armor:set_inventory_stack(player, i, nil)
|
||||||
|
armor:run_callbacks("on_unequip", player, i, stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
armor:set_player_armor(player)
|
||||||
|
local pos = player:getpos()
|
||||||
|
if pos and armor.config.destroy == false then
|
||||||
|
minetest.after(armor.config.bones_delay, function()
|
||||||
|
local meta = nil
|
||||||
|
local maxp = vector.add(pos, 8)
|
||||||
|
local minp = vector.subtract(pos, 8)
|
||||||
|
local bones = minetest.find_nodes_in_area(minp, maxp, {"bones:bones"})
|
||||||
|
for _, p in pairs(bones) do
|
||||||
|
local m = minetest.get_meta(p)
|
||||||
|
if m:get_string("owner") == name then
|
||||||
|
meta = m
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if meta then
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
for _,stack in ipairs(drop) do
|
||||||
|
if inv:room_for_item("main", stack) then
|
||||||
|
inv:add_item("main", stack)
|
||||||
|
else
|
||||||
|
armor.drop_armor(pos, stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for _,stack in ipairs(drop) do
|
||||||
|
armor.drop_armor(pos, stack)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.config.punch_damage == true then
|
||||||
|
minetest.register_on_punchplayer(function(player, hitter,
|
||||||
|
time_from_last_punch, tool_capabilities)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if name then
|
||||||
|
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
|
||||||
|
last_punch_time[name] = minetest.get_gametime()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_on_player_hpchange(function(player, hp_change)
|
||||||
|
if player and hp_change < 0 then
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if name then
|
||||||
|
local heal = armor.def[name].heal
|
||||||
|
heal = heal * armor.config.heal_multiplier
|
||||||
|
if heal >= math.random(100) then
|
||||||
|
hp_change = 0
|
||||||
|
end
|
||||||
|
-- check if armor damage was handled by fire or on_punchplayer
|
||||||
|
local time = last_punch_time[name] or 0
|
||||||
|
if time == 0 or time + 1 < minetest.get_gametime() then
|
||||||
|
armor:punch(player)
|
||||||
|
end
|
||||||
|
-- Punch, fire, but what about damage from fire?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return hp_change
|
||||||
|
end, true)
|
||||||
|
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
timer = timer + dtime
|
||||||
|
if timer > armor.config.init_delay then
|
||||||
|
for player, count in pairs(pending_players) do
|
||||||
|
local remove = init_player_armor(player) == true
|
||||||
|
pending_players[player] = count + 1
|
||||||
|
if remove == false and count > armor.config.init_times then
|
||||||
|
minetest.log("warning", "3d_armor: Failed to initialize player")
|
||||||
|
remove = true
|
||||||
|
end
|
||||||
|
if remove == true then
|
||||||
|
pending_players[player] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
timer = 0
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Fire Protection and water breating, added by TenPlus1
|
||||||
|
|
||||||
|
if armor.config.fire_protect == true then
|
||||||
|
-- override hot nodes so they do not hurt player anywhere but mod
|
||||||
|
for _, row in pairs(armor.fire_nodes) do
|
||||||
|
if minetest.registered_nodes[row[1]] then
|
||||||
|
minetest.override_item(row[1], {damage_per_second = 0})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--else
|
||||||
|
--print ("[3d_armor] Fire Nodes disabled")
|
||||||
|
end
|
||||||
|
|
||||||
|
if armor.config.water_protect == true or armor.config.fire_protect == true then
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
armor.timer = armor.timer + dtime
|
||||||
|
if armor.timer < armor.config.update_time then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for _,player in pairs(minetest.get_connected_players()) do
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local pos = player:getpos()
|
||||||
|
local hp = player:get_hp()
|
||||||
|
if not name or not pos or not hp then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- water breathing
|
||||||
|
if armor.config.water_protect == true then
|
||||||
|
if armor.def[name].water > 0 and
|
||||||
|
player:get_breath() < 10 then
|
||||||
|
player:set_breath(10)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- fire protection
|
||||||
|
if armor.config.fire_protect == true then
|
||||||
|
local fire_damage = true
|
||||||
|
pos.y = pos.y + 1.4 -- head level
|
||||||
|
local node_head = minetest.get_node(pos).name
|
||||||
|
pos.y = pos.y - 1.2 -- feet level
|
||||||
|
local node_feet = minetest.get_node(pos).name
|
||||||
|
-- is player inside a hot node?
|
||||||
|
for _, row in pairs(armor.fire_nodes) do
|
||||||
|
-- check fire protection, if not enough then get hurt
|
||||||
|
if row[1] == node_head or row[1] == node_feet then
|
||||||
|
if fire_damage == true then
|
||||||
|
armor:punch(player, "fire")
|
||||||
|
last_punch_time[name] = minetest.get_gametime()
|
||||||
|
fire_damage = false
|
||||||
|
end
|
||||||
|
if hp > 0 and armor.def[name].fire < row[2] then
|
||||||
|
hp = hp - row[3] * armor.config.update_time
|
||||||
|
player:set_hp(hp)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
armor.timer = 0
|
||||||
|
end)
|
||||||
|
end
|
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 405 B |
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 361 B |
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 474 B |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 469 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 350 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 407 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 412 B |
After Width: | Height: | Size: 420 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 365 B |