Taikedz update (many changes from his own fork)

master
tenplus1 2023-06-13 11:58:22 +01:00
parent 217650a3bb
commit 95b5dc34de
34 changed files with 1237 additions and 572 deletions

456
LICENSE.txt Normal file
View File

@ -0,0 +1,456 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
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 this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser 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 Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

56
README.md Normal file
View File

@ -0,0 +1,56 @@
# Not So Simple Mobs
(C) 2016 NPX Team and Contributors , GPLv3
NSSM adds a wide variety of very hostile mobs, as well as new weapons, armours and foods.
This mod is a continuation of NPX Team's Not So Simple Mobs. Notes from the original README are available below.
## License
* License for the code: `GPLv3 or later`
* see [LICENSE.txt](LICENSE.txt) and [license_notes.md](license_notes.md) for info on the license update
* Copyright NPX Team and contributors
* License for non-code assets: see `LICENSE_MEDIA.txt`
## Version Dependencies
This mod relies heavily on the features in TenPlus1's [`mobs_redo`](https://notabug.org/tenplus1/mobs_redo), which is developed independently.
This version of NSSM was adjusted to run against commit `487e037cc9` (from 2018-12-20). If you are having problems with mod compatibility, please ensure you are using a version of `mobs_redo` close to that commit.
For some NSSB mobs, there is a dependency on the `3d_armor` API itself. This mod has been adjusted to work with version at tag `version-0.4.12` (June 2018) ; most later versions should work too.
## Settings
This mod provides some extra settings for fine tuning the experience:
* `nssm.classic_rainbow_staff` - Rainbow Staff is a powerful tool instead of a block placer
* `nssm.spiders_litter_web` - Allows spiders to place webs all over
## The original notes from NPX Team ! --¬
We suggest that you play nssm with:
* [`NSSB`](https://github.com/taikedz-mt/nssb) (Not So Simple Buildings, NPX Team's second mod that adds many blocks and Morlendor, the new dimension!)
* `3d_armors` (with which you can use nssm armors):
* `unified_inventory` (useful to discover all the new recipes and to use the armors):
* a throwing mod (a mod that add bows) if compatible with the Tenplus1's `damage_system`
We would like to thank:
* PilzAdam, for his wonderful simple-mobs mod;
* Tenplus1, for his hard work in making `mobs_redo`;
* Echoes91, for Spears: simple but amazing;
* and obviously Celeron-55 and all the people who contributed to Minetest and its community (and Paramat in particular);
* Denise and `Ponzi_Duro` for the revision of the guide;
* `Double_P`, `Ponzi_Duro`, `Andrey01` and `Taikedz` for the beta testing;
The mod makes the game really hard, please read the wiki before playing: <http://wiki.minetest.net/Mods/Not_So_Simple_Mobs> (which will be updated as soon as possible) or the old guide for the 2.4 version.
Here are the trailers of the mod:
* nssm 2.1: <https://www.youtube.com/watch?v=ccLUt58mo0k>
* nssm 3.0: <https://www.youtube.com/watch?v=ZBuAi1sQJxQ>
NPX Team ~

View File

@ -1,27 +0,0 @@
Not So Simple Mobs by NPX team
Starting from version 3.0 the mod depends on mobs_redo api: https://notabug.org/TenPlus1/mobs_redo
We suggest that you play nssm with:
- nssb (Not So Simple Buildings, our second mod that adds many blocks and Morlendor, the new dimension):
- 3d_armors (with which you can use nssm armors):
- unified_inventory (useful to discover all the new recipes and to use the armors):
- a throwing mod (a mod that add bows) if compatible with the Tenplus1's damage_system
We would like to thank:
- PilzAdam, for his wonderful simple-mobs mod;
- Tenplus1, for his hard work in making mobs_redo;
- Echoes91, for Spears: simple but amazing;
- and obviously Celeron-55 and all the people who contributed to Minetest and its community (and Paramat in particular);
- Denise and Ponzi_Duro for the revision of the guide;
- Double_P, Ponzi_Duro, Andrey01 and Taikedz for the beta testing;
- Taikedz for his support and for hosting a server dedicated to nssm (Not So Simple Server: https://forum.minetest.net/viewtopic.php?f=10&t=15435&hilit=nsss);
License for the code: LGPLv3
License for all the models, textures and sound: CC BY-SA 4.0
The mod makes the game really hard, please read the wiki before playing: http://wiki.minetest.net/Mods/Not_So_Simple_Mobs (which will be updated as soon as possible) or the old guide for the 2.4 version.
Here are the trailers of the mod:
- nssm 2.1: https://www.youtube.com/watch?v=ccLUt58mo0k
- nssm 3.0: https://www.youtube.com/watch?v=ZBuAi1sQJxQ

View File

@ -24,7 +24,7 @@ local function duck_explosion(pos)
texture = "duck_egg_fragments.png"
})
core.after(0.4, function()
minetest.after(0.4, function()
for dx = -1, 1 do
@ -182,7 +182,7 @@ mobs:register_arrow("nssm:morarrow", {
})
local function explosion_web(pos)
local function explosion_web(pos, webnode)
pos.y = round(pos.y)
@ -200,11 +200,11 @@ local function explosion_web(pos)
local ontop = minetest.get_node(k).name
if current ~= "air"
and current ~= "nssm:web"
and current ~= webnode
and ontop == "air"
and not minetest.is_protected(p,"")
and not minetest.is_protected(k,"") then
minetest.set_node(k, {name = "nssm:web"})
and not minetest.is_protected(p, "")
and not minetest.is_protected(k, "") then
minetest.set_node(k, {name = webnode})
end
end
end
@ -224,7 +224,7 @@ mobs:register_arrow("nssm:webball", {
local p = player:get_pos()
explosion_web(p)
explosion_web(p, "nssm:web")
end,
hit_mob = function(self, player)
@ -236,41 +236,11 @@ mobs:register_arrow("nssm:webball", {
end,
hit_node = function(self, pos, node)
explosion_web(pos)
explosion_web(pos, "nssm:web")
end
})
function explosion_thickweb(pos)
pos.y = round(pos.y)
if minetest.is_protected(pos, "") then
return
end
for i = pos.x + 0, pos.x + 0, 1 do
for j = pos.y - 2, pos.y, 1 do
for k = pos.z + 0, pos.z + 0, 1 do
local p = {x = i, y = j, z = k}
local k = {x = i, y = j + 1, z = k}
local current = minetest.get_node(p).name
local ontop = minetest.get_node(k).name
if current ~= "air"
and current ~= "nssm:thick_web"
and ontop == "air"
and not minetest.is_protected(p,"")
and not minetest.is_protected(k,"") then
minetest.set_node(k, {name = "nssm:thick_web"})
end
end
end
end
end
-- thick_web arrow
mobs:register_arrow("nssm:thickwebball", {
visual = "sprite",
@ -281,7 +251,7 @@ mobs:register_arrow("nssm:thickwebball", {
-- direct hit
hit_player = function(self, player)
local p = player:get_pos()
explosion_thickweb(p)
explosion_web(p, "nssm:thick_web")
end,
hit_mob = function(self, player)
@ -292,7 +262,7 @@ mobs:register_arrow("nssm:thickwebball", {
end,
hit_node = function(self, pos, node)
explosion_thickweb(pos)
explosion_web(pos, "nssm:thick_web")
end
})

View File

@ -4,3 +4,7 @@ farming?
3d_armor?
fire
tnt
shields?
nssb?
nyancat?
pbj_pup?

View File

@ -1,9 +1,24 @@
local path = minetest.get_modpath("nssm")
-- translation
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("nssm") -- 5.x translation function
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
nssm = {
mymapgenis = tonumber(minetest.settings:get("mymapgenis")) or 7,
multimobs = tonumber(minetest.settings:get("multimobs")) or 1000,
spiders_litter_web = minetest.settings:get_bool("spiders_litter_web", true)
mymapgenis = tonumber(minetest.settings:get("nssm.mymapgenis")) or 7,
multimobs = tonumber(minetest.settings:get("nssm.multimobs")) or 1000,
spiders_litter_web = minetest.settings:get_bool("nssm.spiders_litter_web", true),
classic_rainbow_staff = minetest.settings:get_bool("nssm.classic_rainbow_staff", false),
S = S
}

20
license_notes.md Normal file
View File

@ -0,0 +1,20 @@
# About the license
This fork was made after NPX silently left the community circa 2016-2017.
NPX originally licensed their code under "GPLv3" , then later switched it to "LGPL" without specifying a version.
## Choice of new license
[The Free Software Foundation's license compatibility matrix][1] indicates:
* software licensed under any LGPL version can be redistributed under the GPLv3
* any `LGPLv2.1 or later` or `LGPLv3` can be redistributed under LGPLv3
Since we cannot have formal clarity on what verion of the LGPL was intended by NPX, this software fork is now being licensed under the terms of the GNU General Public License version 3.0.
## Intermediate commits
Intermediate commits of the code since abandonment indicated use of the LGPLv2.1-or-later license; this was inappropriate. Please avoid using copies of the code distributed prior to this new, clean relicensing.
[1]: https://www.gnu.org/licenses/gpl-faq.en.html#AllCompatibility

282
locale/template.txt Normal file
View File

@ -0,0 +1,282 @@
# textdomain: nssm
No stats for @1=
Kill stats for @1:=
See your kill stats, or that of other players=
Ant Queen=
Ant Worker=
Ice Teeth=
Black Duck=
Sky=
@1 Helmet=
@1 Chestplate=
@1 Leggings=
@1 Boots=
Pumpking Head=
Masticone Head=
Duck King Crown=
Masticone Crowned Head=
Snake Scute Chestplate=
@1 Shield=
Bloco=
Crocodile=
Duck=
Masticone=
Morlu=
Sand Bloco=
White Werewolf=
Sandworm=
Werewolf=
Rope=
Sun Sword=
Ant Sword=
Mantis Sword=
Masticone Fang Sword=
Night Sword=
Mantis Battleaxe=
Mantis Axe=
Duck Beak Pickaxe=
Ant Pickaxe=
Mantis Pickaxe=
Stoneater Pickaxe=
Little Ice Tooth Knife=
Manticore Spine Knife=
Felucco Knife=
Ant Shovel=
Duck Beak Shovel=
Ant Billhook=
Tarantula Warhammer=
Light Crab Mace=
Heavy Crab Mace=
@1 Sickle=
Felucco=
Ant=
@1 Bomb=
Duck Evocation=
Bloco Evocation=
Enderduck Evocation=
Flying Duck Evocation=
Swimming Duck Evocation=
Duckking Evocation=
Spiderduck Evocation=
Cobweb Bomb=
Ice Bomb=
Mantis Clay Bomb=
Lava Bomb=
Water Bomb=
Fire Bomb=
Mornar Bomb=
Hole Bomb=
Food Bomb=
Phoenix Fire Bomb=
Explosive Bomb=
Teleport Bomb=
Boom Bomb=
Smoke Bomb=
Thick Web Bomb=
Poison Bomb=
Cobblestone Bomb=
Fire Ring Bomb=
Cage Bomb=
Water Column Bomb=
Crab=
Sky Feather=
Snake Scute=
Eyed Tentacle=
Ant Queen's Abdomen=
Masticone Skull Fragments=
Kraken Tentacle=
Lava Titan Eye=
Digested Sand=
Black Ice Tooth=
Tarantula Fangs=
Crab Claw=
Cursed Pumpkin Seed=
Mantis Claw=
Manticore Fur=
Ant Husk=
Bloco Hide=
Crab Shell Fragment=
Crocodile Hide=
Manticore Spine=
Night Feather=
Sun Feather=
Duck Feather=
Black Duck Feather=
Masticone Fang=
White Wolf Fur=
Stoneater Mandible=
Ant Mandible=
Wolf Fur=
Felucco Fur=
Mantis Husk=
Sand Bloco Hide=
Sandworm Hide=
Sky Iron=
Black Powder=
Soarkly Dark Stone Dust=
Empty Summoning Bomb=
Greedy Soul Fragment=
Lustful Soul Fragment=
Wrathful Soul Fragment=
Proud Soul Fragment=
Slothful Soul Fragment=
Envious Soul Fragment=
Gluttonous Soul Fragment=
Gluttonous Moranga=
Envious Moranga=
Proud Moranga=
Slothful Moranga=
Lustful Moranga=
Wrathful Moranga=
Greedy Moranga=
Werewolf Leg=
Felucco Steak=
Roasted Felucco Steak=
Moonheron Leg=
Chichibio's Moonheron Leg=
Crocodile Tail=
Roasted Crocodile Tail=
Roasted_Werewolf Leg=
Duck Legs=
Roasted Duck Leg=
Ant Leg=
Roasted Ant Leg=
Spider Leg=
Roasted Spider Leg=
Brain=
Roasted Brain=
Tentacle=
Roasted Tentacle=
Worm Meat=
Roasted Worm=
Amphibian Heart=
Roasted Amphibian Heart=
Raw Scrausics Wing=
Spicy Scrausics Wing=
Phoenix Nuggets=
Phoenix Tear=
Frosted Amphibian Heart=
Surimi=
Amphibian Ribs=
Roasted Amphibian Ribs=
Dolidrosaurus Fin=
Roasted Dolidrosaurus Fin=
Larva Meat=
Larva Juice=
Larva Soup=
Mantis Meat=
Roasted Mantis=
Spider Meat=
Roasted Spider=
Silk Gland=
Roasted Silk Gland=
Super Silk Gland=
Roasted Super Silk Gland=
Cobweb String=
Dense Cobweb String=
Duck Beak=
Ice Tooth=
Little Ice Tooth=
Felucco Horn=
Dolidrosaurus=
Duck King=
Enderduck=
You have @1s of boost=
Life Energy=
Energy Globe=
Great Energy Globe=
Awesome Energy Globe=
Light Energy=
Giant Sandworm=
Ice Snake=
Mantis Larva=
Lava Titan=
Ant Dirt=
Dead leaves=
Invisible light source=
Venomous Gas=
Modders Block=
Web=
Thick Web=
Ink=
Mese Meteor=
Mese Dragon's Touch=
Phoenix Fire=
@1 Egg=
Stoneater=
Signosigno=
Duckking=
Spiderduck=
Icesnake=
Larva=
Moonheron=
Xgaloctopus=
Pumpking=
Large Pumpboom=
Small Pumpboom=
Medium Pumpboom=
Morvalar=
Mese Egg=
Morwa Statue=
Ant Soldier=
Black Widow=
Daddy Long Legs=
Echidna=
Flying Duck=
Icelamander=
Kraken=
Mantis Beast=
Mordain=
Morgut=
Morvy=
Night Master=
Tarantula=
Mese Dragon=
Moon Heron=
You do not have enough @1=
Axe of Pride=
energy sphere=
Gratuitousness Battleaxe=
energy globe=
Sword of Eagerness=
Falchion of Eagerness=
life energy=
You cannot go to that protected space!=
Sword of Envy=
Sword of Gluttony=
Death Scythe=
Morde=
Morgre=
Summon me ... when you are ready to fight ...=
Mor Valar=
Morbat I=
Morbat II=
Morbat III=
Morwa=
Mini Octopus=
Octopus=
Phoenix=
Pumpboom (@1)=
small=
medium=
large=
PumpKing=
Rainbow Staff=
Rainbow Tool=
Scrausics=
Signo-Signo=
Snow Biter=
Set spear stats modifier - default 1 (somewhat fast)=
Spear stat modifier set to @1=
@1 Spear=
Serenity=
Manticore=
Mantis=
Spider-duck=
Stone Eater=
Swimming Duck=
Uloboros=
Gret Wave Energy Release=
Destructo Disc=
Winding Energy Bullet=
Demon Air Beseiging Bullet (press Q to activate)=

View File

@ -5,9 +5,7 @@ mobs:register_mob("nssm:ant_queen", {
collisionbox = {-0.6, 0.00, -0.6, 0.6, 1, 0.6},
visual = "mesh",
mesh = "ant_queen.x",
textures = {
{"ant_queen.png"}
},
textures = {{"ant_queen.png"}},
visual_size = {x = 6, y = 6},
makes_footstep_sound = true,
view_range = 30,

View File

@ -5,9 +5,7 @@ mobs:register_mob("nssm:ant_soldier", {
collisionbox = {-0.49, 0.00, -0.49, 0.49, 0.9, 0.49},
visual = "mesh",
mesh = "ant_soldier.x",
textures = {
{"ant_soldier.png"}
},
textures = {{"ant_soldier.png"}},
visual_size = {x = 3, y = 3},
makes_footstep_sound = true,
view_range = 20,

View File

@ -6,9 +6,7 @@ mobs:register_mob("nssm:ant_worker", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.5, 0.4},
visual = "mesh",
mesh = "ant_worker.x",
textures = {
{"ant_worker.png"}
},
textures = {{"ant_worker.png"}},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 20,

View File

@ -5,9 +5,7 @@ mobs:register_mob("nssm:black_widow", {
collisionbox = {-0.4, 0.00, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "black_widow.x",
textures = {
{"black_widow.png"}
},
textures = {{"black_widow.png"}},
visual_size = {x = 2, y = 2},
makes_footstep_sound = true,
view_range = 15,

View File

@ -5,9 +5,7 @@ mobs:register_mob("nssm:bloco", {
collisionbox = {-0.56, -0.2, -0.56, 0.56, 1.2, 0.56},
visual = "mesh",
mesh = "bloco.x",
textures = {
{"bloco.png"}
},
textures = {{"bloco.png"}},
visual_size = {x = 4, y = 4},
makes_footstep_sound = true,
view_range = 8,

View File

@ -16,7 +16,7 @@ mobs:register_mob("nssm:dolidrosaurus", {
makes_footstep_sound = true,
view_range = 30,
fly = true,
fly_in = "default:water_source",
fly_in = {"default:water_source", "default:water_flowing"},
fall_speed = -20,
walk_velocity = 1.5,
run_velocity = 3.3,

View File

@ -4,9 +4,9 @@ mobs:register_mob("nssm:flying_duck", {
hp_min = 10,
collisionbox = {-0.3, -0.2, -0.3, 0.3, 0.2, 0.3},
visual = "mesh",
mesh = "nathan_petrelli.x",
mesh = "flying_duck.x",
textures = {
{"nathan_petrelli.png"}
{"flying_duck.png"}
},
visual_size = {x = 1, y = 1},
view_range = 30,

View File

@ -14,7 +14,7 @@ mobs:register_mob("nssm:kraken", {
inker = false,
view_range = 50,
fly = true,
fly_in = "default:water_source",
fly_in = {"default:water_source", "default:water_flowing"},
fall_speed = -1,
walk_velocity = 3.5,
run_velocity = 4.5,

View File

@ -76,18 +76,25 @@ mobs:register_mob("nssm:masticone", {
texture = "tnt_smoke.png"
})
for i = 1, 2 do
local respawn_count = 3
local pos = {
x = pos.x + math.random(-1, 1),
y = pos.y + 0.5,
z = pos.z + math.random(-1, 1)
}
for i = 1, respawn_count do
local n = minetest.get_node(pos).name
local chance = math.random(1, math.ceil(respawn_count * 1.5))
if n == "air" then
minetest.add_entity(pos, "nssm:masticone")
if chance == 1 then
local pos = {
x = pos.x + math.random(-1, 1),
y = pos.y + 0.5,
z = pos.z + math.random(-1, 1)
}
local n = minetest.get_node(pos).name
if n == "air" then
minetest.add_entity(pos, "nssm:masticone")
end
end
end
end)

View File

@ -28,7 +28,7 @@ mobs:register_mob("nssm:moonheron", {
armor = 70,
floats = 1,
drawtype = "front",
water_damage = 5,
water_damage = .1,
lava_damage = 5,
fire_damage = 5,
group_attack = true,

View File

@ -131,6 +131,7 @@ minetest.register_entity("nssm:mortick", {
armor = 100,
visual = "mesh",
mesh = "mortick.x",
collisionbox = {-0.2, -0.2, -0.2, 0.2, 0.2, 0.2},
visual_size = {x = 3, y = 3},
--lifetime = 10,
damage = 1,
@ -154,7 +155,10 @@ minetest.register_entity("nssm:mortick", {
local name = minetest.get_node(s1).name
if name == "fire:basic_flame"
or name == "fire:permanent_flame" then
or name == "fire:permanent_flame"
or name == "nssm:phoenix_fire"
or name == "default:lava_source"
or name == "default:lava_flowing" then
self.object:remove()
end

View File

@ -189,7 +189,7 @@ mobs:register_mob("nssm:morgut", {
self.curr_attack = self.attack
self.state = ""
local pyaw = self.curr_attack: get_look_yaw()
local pyaw = self.curr_attack: get_look_horizontal() + math.pi / 2
self.dir = pyaw
self.object:set_yaw(pyaw)

View File

@ -107,13 +107,16 @@ mobs:register_mob("nssm:morlu", {
if minetest.get_modpath("3d_armor") then
local pname, player_inv, armor_inv, ppos = armor:get_valid_player(
local pname, player_inv = armor:get_valid_player(
self.attack, "[set_player_armor]")
local pname = self.attack:get_player_name()
local player_inv = minetest.get_inventory({type="player", name = pname})
local player_inv = minetest.get_inventory({
type = "player", name = pname})
local armor_inv = minetest.get_inventory({
type = 'detached', name = pname.."_armor"})
if player_inv:is_empty("armor") then
if armor_inv:is_empty("armor") then
-- punch player if he doesn't own an armor
self.attack:punch(self.object, 1.0, {
@ -127,7 +130,7 @@ mobs:register_mob("nssm:morlu", {
for i = 1, 6 do
local armor_stack = player_inv:get_stack("armor", i)
local armor_stack = armor_inv:get_stack("armor", i)
local armor_item = armor_stack:get_name()
if armor_stack:get_count() > 0 then
@ -142,12 +145,13 @@ mobs:register_mob("nssm:morlu", {
steal_pos = steal_pos - 1
local cpos = string.find(armor_elements[steal_pos].name, ":")
local mod_name = string.sub(
armor_elements[steal_pos].name, 0, cpos - 1)
local nname = string.sub(
armor_elements[steal_pos].name, cpos + 1)
local target_armor = armor_elements[steal_pos].name
local mod_name = string.sub(target_armor, 0, cpos - 1)
local nname = string.sub(target_armor, cpos + 1)
if mod_name == "3d_armor" then
if target_armor:find("admin") then
nname = "greedy_soul_fragment.png"
elseif mod_name == "3d_armor" then
nname = "3d_armor_inv_" .. nname .. ".png"
elseif mod_name == "nssm" then
nname = "inv_" .. nname .. ".png"
@ -180,14 +184,18 @@ mobs:register_mob("nssm:morlu", {
texture = nname
})
if target_armor:find("admin") then
return
end
minetest.after(1, function (self)
if self then
local armor_stack = player_inv:get_stack("armor",
local armor_stack = armor_inv:get_stack("armor",
armor_elements[steal_pos].pos)
armor_stack:take_item()
player_inv:set_stack("armor",
armor_inv:set_stack("armor",
armor_elements[steal_pos].pos, armor_stack)
armor_stack = armor_inv:get_stack("armor",
armor_elements[steal_pos].pos)
@ -221,7 +229,7 @@ mobs:register_mob("nssm:morlu", {
self.object:set_yaw(pyaw)
if self then
set_velocity(self, 4)
self:set_velocity(4)
end
end
end, self)

View File

@ -11,7 +11,7 @@ mobs:register_mob("nssm:octopus", {
visual_size = {x = 4, y = 4},
view_range = 25,
fly = true,
fly_in = "default:water_source",
fly_in = {"default:water_source", "default:water_flowing"},
fall_speed = -20,
walk_velocity = 1.5,
run_velocity = 3,
@ -66,7 +66,7 @@ mobs:register_mob("nssm:xgaloctopus", {
visual_size = {x = 1, y = 1},
view_range = 25,
fly = true,
fly_in = "default:water_source",
fly_in = {"default:water_source", "default:water_flowing"},
fall_speed = -20,
walk_velocity = 1.5,
run_velocity = 3,

View File

@ -31,7 +31,7 @@ mobs:register_mob("nssm:phoenix", {
},
armor = 40,
drawtype = "front",
water_damage = 5,
water_damage = .1,
lava_damage = 0,
fire_damage = 0,
light_damage = 0,

View File

@ -1,156 +1,88 @@
mobs:register_mob("nssm:pumpboom_small", {
type = "monster",
hp_max = 15,
local function register_pumpboom(sizename, params)
mobs:register_mob("nssm:pumpboom_" .. sizename, {
type = "monster",
hp_min = params.hp_min,
hp_max = params.hp_max,
collisionbox = params.collisionbox,
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
textures = {{"pumpboom.png"}},
visual_size = params.visual_size,
explosion_radius = params.boom_radius,
makes_footstep_sound = true,
view_range = params.view_range,
fear_height = 4,
walk_velocity = 2,
run_velocity = 2.5,
sounds = {
explode = "tnt_explode"
},
damage = 1.5,
jump = true,
drops = params.drops,
armor = 100,
drawtype = "front",
water_damage = 2,
lava_damage = 5,
light_damage = 0,
group_attack = true,
attack_animals = true,
knock_back=2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
attack_type = "explode",
animation = {
speed_normal = 25,
speed_run = 25,
stand_start = 1,
stand_end = 30,
walk_start = 81,
walk_end = 97,
run_start = 81,
run_end = 97,
punch_start = 70,
punch_end = 80
}
})
end
register_pumpboom("small",{
hp_min = 14,
collisionbox = {-0.80, -0.3, -0.80, 0.80, 0.80, 0.80},
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
textures = {
{"pumpboom.png"}
},
hp_max = 15,
visual_size = {x = 3, y = 3},
explosion_radius = 4,
makes_footstep_sound = true,
collisionbox = {-0.45, -0.3, -0.45, 0.45, 0.45, 0.45},
boom_radius = 4,
view_range = 20,
fear_height = 4,
walk_velocity = 2,
run_velocity = 2.5,
sounds = {
explode = "tnt_explode"
},
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy", chance = 1, min = 1, max = 2},
{name = "nssm:black_powder", chance = 2, min = 1, max = 2}
},
armor = 100,
drawtype = "front",
water_damage = 2,
lava_damage = 5,
fire_damage = 5,
light_damage = 0,
group_attack = true,
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
attack_type = "explode",
animation = {
speed_normal = 25,
speed_run = 25,
stand_start = 1,
stand_end = 30,
walk_start = 81,
walk_end = 97,
run_start = 81,
run_end = 97,
punch_start = 70,
punch_end = 80
}
})
mobs:register_mob("nssm:pumpboom_medium", {
type = "monster",
hp_max = 18,
register_pumpboom("medium",{
hp_min = 17,
collisionbox = {-0.80, -0.3, -0.80, 0.80, 0.80, 0.80},
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
textures = {
{"pumpboom.png"}
},
hp_max = 18,
visual_size = {x = 5, y = 5},
makes_footstep_sound = true,
collisionbox = {-0.7, -0.3, -0.7, 0.7, 0.7, 0.7},
boom_radius = 6,
view_range = 25,
walk_velocity = 2,
explosion_radius = 6,
run_velocity = 2.5,
sounds = {
explode = "tnt_explode"
},
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy", chance = 1, min = 2, max = 3},
{name = "nssm:black_powder", chance = 2, min = 1, max = 3}
},
armor = 100,
drawtype = "front",
water_damage = 2,
lava_damage = 5,
fire_damage = 5,
light_damage = 0,
group_attack = true,
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
attack_type = "explode",
animation = {
speed_normal = 25,
speed_run = 25,
stand_start = 1,
stand_end = 30,
walk_start = 81,
walk_end = 97,
run_start = 81,
run_end = 97,
punch_start = 70,
punch_end = 80
}
})
mobs:register_mob("nssm:pumpboom_large", {
type = "monster",
hp_max = 20,
register_pumpboom("large",{
hp_min = 19,
collisionbox = {-0.80, -0.3, -0.80, 0.80, 0.80, 0.80},
visual = "mesh",
mesh = "pumpboom.x",
rotate = 270,
explosion_radius = 8,
textures = {
{"pumpboom.png"}
},
hp_max = 20,
visual_size = {x = 8, y = 8},
makes_footstep_sound = true,
collisionbox = {-1.2, -0.3, -1.2, 1.2, 1.2, 1.2},
boom_radius = 8,
view_range = 30,
walk_velocity = 2,
run_velocity = 3,
sounds = {
explode = "tnt_explode"
},
damage = 1.5,
jump = true,
drops = {
{name = "nssm:life_energy", chance = 1, min = 3, max = 4},
{name = "nssm:black_powder", chance = 2, min = 2, max = 4}
},
armor = 100,
drawtype = "front",
water_damage = 2,
lava_damage = 5,
fire_damage = 5,
light_damage = 0,
group_attack = true,
attack_animals = true,
knock_back = 2,
blood_texture = "nssm_blood.png",
stepheight = 1.1,
attack_type = "explode",
animation = {
speed_normal = 25,
speed_run = 25,
stand_start = 1,
stand_end = 30,
walk_start = 81,
walk_end = 97,
run_start = 81,
run_end = 97,
punch_start = 70,
punch_end = 80
}
})

View File

@ -14,7 +14,7 @@ mobs:register_mob("nssm:scrausics", {
walk_velocity = 2,
run_velocity = 3,
fall_speed = 0,
stepheight = 3,
stepheight = 3,
floats=1,
sounds = {
random = "scrausics",

View File

@ -42,7 +42,7 @@ mobs:register_mob("nssm:spiderduck", {
attack_type = "dogshoot",
arrow = "nssm:webball",
reach = 2,
shoot_interval = 2,
shoot_interval = 5,
shoot_offset = 2,
animation = {
speed_normal = 25,

View File

@ -1,4 +1,4 @@
name = nssm
depends = default, mobs, fire, tnt
optional_depends = farming, 3d_armor
optional_depends = farming, 3d_armor, shields, nssb, nyancat, pbj_pup
description = Adds a host of creatures into your world with new weapons too.

View File

@ -147,7 +147,7 @@ if minetest.get_modpath("shields") then
description = v.name .. " Shield",
inventory_image = "inv_shield_" .. k .. ".png",
groups = {
armor_head = math.floor(5 * v.armor),
armor_shield = math.floor(5 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},
@ -182,7 +182,7 @@ for k, v in pairs(stats) do
description = v.name .. " ",
inventory_image ="inv_helmet_" .. k .. ".png",
groups = {
armor_shield = math.floor(5 * v.armor),
armor_head = math.floor(5 * v.armor),
armor_heal = v.heal,
armor_use = v.use
},

View File

@ -1,9 +1,11 @@
local S = nssm.S
-- non-eatable craftitems
local function nssm_craftitem(name, descr)
minetest.register_craftitem("nssm:" .. name, {
description = descr,
description = S(descr),
image = name .. ".png"
})
end
@ -76,10 +78,10 @@ nssm_craftitem("empty_evocation_bomb", "Empty Evocation Bomb")
local function nssm_craftitem_eat(name, descr, gnam)
minetest.register_craftitem("nssm:" .. name, {
description = descr,
image =name .. ".png",
description = S(descr),
image = name .. ".png",
on_use = minetest.item_eat(gnam),
groups = {meat = 1, eatable = 1}
groups = {food_meat = 1, meat = 1, eatable = 1}
})
end
@ -223,19 +225,19 @@ minetest.register_ore({
-- nodes
minetest.register_node("nssm:ant_dirt", {
description = "Ant Dirt",
description = S("Ant Dirt"),
tiles = {"ant_dirt.png"},
groups = {crumbly = 3}
})
minetest.register_node("nssm:dead_leaves", {
description = "Dead leaves",
description = S("Dead leaves"),
tiles = {"dead_leaves.png"},
groups = {snappy = 3, leaves = 1}
})
minetest.register_node("nssm:invisible_light", {
description = "Invisible light source",
description = S("Invisible light source"),
tiles = {"transparent.png"},
paramtype = "light",
drawtype = "airlike",
@ -251,9 +253,9 @@ minetest.register_node("nssm:invisible_light", {
})
minetest.register_node("nssm:venomous_gas", {
description = "Venomous Gas",
description = S("Venomous Gas"),
inventory_image = minetest.inventorycube("venomous_gas.png"),
drawtype = "airlike",
drawtype = "firelike",
tiles = {
{
name = "venomous_gas_animated.png",
@ -278,15 +280,25 @@ minetest.register_node("nssm:venomous_gas", {
groups = {flammable = 2}
})
-- Cleanup that obnoxious gas...!
minetest.register_abm({
nodenames = {"nssm:venomous_gas"},
interval = 5,
chance = 5,
action = function(pos, node)
minetest.remove_node(pos)
end
})
minetest.register_node("nssm:modders_block", {
description = "Modders Block",
description = S("Modders Block"),
tiles = {"modders_block.png"},
is_ground_content = true,
groups = {crumbly = 3, not_in_creative_inventory =1}
})
minetest.register_node("nssm:web", {
description = "Web",
description = S("Web"),
inventory_image = "web.png",
tiles = {"web.png"} ,
drawtype = "plantlike",
@ -295,7 +307,7 @@ minetest.register_node("nssm:web", {
pointable = true,
diggable = true,
buildable_to = false,
drop = "",
drop = "farming:cotton",
drowning = 0,
liquid_renewable = false,
liquidtype = "source",
@ -307,7 +319,7 @@ minetest.register_node("nssm:web", {
})
minetest.register_node("nssm:thick_web", {
description = "Thick Web",
description = S("Thick Web"),
inventory_image = "thick_web.png",
tiles = {"thick_web.png"},
drawtype = "firelike",
@ -316,7 +328,7 @@ minetest.register_node("nssm:thick_web", {
pointable = true,
diggable = true,
buildable_to = false,
drop = "",
drop = "farming:cotton 4",
drowning = 2,
liquid_renewable = false,
liquidtype = "source",
@ -328,7 +340,7 @@ minetest.register_node("nssm:thick_web", {
})
minetest.register_node("nssm:ink", {
description = "Ink",
description = S("Ink"),
inventory_image = minetest.inventorycube("ink.png"),
drawtype = "liquid",
tiles = {
@ -362,7 +374,7 @@ minetest.register_node("nssm:ink", {
})
minetest.register_node("nssm:mese_meteor", {
description = "Mese Meteor",
description = S("Mese Meteor"),
tiles = {"mese_meteor.png"},
paramtype = "light",
drop = "",
@ -370,6 +382,7 @@ minetest.register_node("nssm:mese_meteor", {
})
minetest.register_node("nssm:pumpbomb", {
description = S("Pumpbomb"),
tiles = {
"pumpbomb_top.png", "pumpbomb_bottom.png", "pumpbomb_side.png",
"pumpbomb_side.png", "pumpbomb_side.png", "pumpbomb_front.png"
@ -409,7 +422,7 @@ minetest.register_abm({
})
minetest.register_node("nssm:phoenix_fire", {
description = "Phoenix Fire",
description = S("Phoenix Fire"),
drawtype = "firelike",
tiles = {
{
@ -456,7 +469,7 @@ minetest.register_abm({
-- tools
minetest.register_tool("nssm:sun_sword", {
description = "Sun Sword",
description = S("Sun Sword"),
inventory_image = "sun_sword.png",
tool_capabilities = {
full_punch_interval = 0.6,
@ -480,7 +493,7 @@ minetest.register_tool("nssm:sun_sword", {
})
minetest.register_tool("nssm:masticone_fang_sword", {
description = "Masticone Fang Sword",
description = S("Masticone Fang Sword"),
inventory_image = "masticone_fang_sword.png",
tool_capabilities = {
full_punch_interval = 0.7,
@ -494,7 +507,7 @@ minetest.register_tool("nssm:masticone_fang_sword", {
})
minetest.register_tool("nssm:night_sword", {
description = "Night Sword",
description = S("Night Sword"),
inventory_image = "night_sword.png",
tool_capabilities = {
full_punch_interval = 0.4,
@ -508,7 +521,7 @@ minetest.register_tool("nssm:night_sword", {
})
minetest.register_tool("nssm:crab_light_mace", {
description = "Light Crab Mace",
description = S("Light Crab Mace"),
inventory_image = "crab_light_mace.png",
tool_capabilities = {
full_punch_interval = 2,
@ -521,7 +534,7 @@ minetest.register_tool("nssm:crab_light_mace", {
})
minetest.register_tool("nssm:crab_heavy_mace", {
description = "Heavy Crab Mace",
description = S("Heavy Crab Mace"),
inventory_image = "crab_heavy_mace.png",
tool_capabilities = {
full_punch_interval = 4,
@ -534,7 +547,7 @@ minetest.register_tool("nssm:crab_heavy_mace", {
})
minetest.register_tool("nssm:mantis_battleaxe", {
description = "Mantis Battleaxe",
description = S("Mantis Battleaxe"),
inventory_image = "mantis_battleaxe.png",
tool_capabilities = {
full_punch_interval = 3,
@ -547,7 +560,7 @@ minetest.register_tool("nssm:mantis_battleaxe", {
})
minetest.register_node("nssm:rope", {
description = "Rope",
description = S("Rope"),
paramtype = "light",
walkable = false,
climbable = true,
@ -559,7 +572,7 @@ minetest.register_node("nssm:rope", {
})
minetest.register_tool("nssm:stoneater_pick", {
description = "Stoneater Pickaxe",
description = S("Stoneater Pickaxe"),
inventory_image = "stoneater_pick.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -572,21 +585,21 @@ minetest.register_tool("nssm:stoneater_pick", {
})
minetest.register_tool("nssm:mantis_sword", {
description = "Mantis Sword",
description = S("Mantis Sword"),
inventory_image = "mantis_sword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level = 1,
groupcaps = {
fleshy = {times = {[2]=1.0, [3]=0.4}, uses = 30, maxlevel = 1},
snappy = {times = {[2]=0.80, [3]=0.3}, uses = 40, maxlevel = 1},
snappy = {times = {[2]=1.00, [2]=0.80, [3] = 0.3}, uses = 40, maxlevel = 1},
},
damage_groups = {fleshy = 7}
}
})
minetest.register_tool("nssm:little_ice_tooth_knife", {
description = "Little Ice Tooth Knife",
description = S("Little Ice Tooth Knife"),
inventory_image = "little_ice_tooth_knife.png",
tool_capabilities = {
full_punch_interval = 0.3,
@ -600,7 +613,7 @@ minetest.register_tool("nssm:little_ice_tooth_knife", {
})
minetest.register_tool("nssm:manticore_spine_knife", {
description = "Manticore Spine Knife",
description = S("Manticore Spine Knife"),
inventory_image = "manticore_spine_knife.png",
tool_capabilities = {
full_punch_interval = 0.4,
@ -614,7 +627,7 @@ minetest.register_tool("nssm:manticore_spine_knife", {
})
minetest.register_tool("nssm:felucco_knife", {
description = "Felucco Knife",
description = S("Felucco Knife"),
inventory_image = "felucco_knife.png",
tool_capabilities = {
full_punch_interval = 0.4,
@ -630,14 +643,14 @@ minetest.register_tool("nssm:felucco_knife", {
if minetest.get_modpath("farming") then
farming.register_hoe(":farming:felucco_hoe", {
description = "Felucco Hoe",
description = S("Felucco Hoe"),
inventory_image = "felucco_hoe.png",
max_uses = 290,
material = "nssm:felucco_horn"
})
farming.register_hoe(":farming:ant_hoe", {
description = "Ant Hoe",
description = S("Ant Hoe"),
inventory_image = "ant_hoe.png",
max_uses = 350,
material = "nssm:ant_mandible"
@ -645,7 +658,7 @@ if minetest.get_modpath("farming") then
end
minetest.register_tool("nssm:ant_sword", {
description = "Ant Sword",
description = S("Ant Sword"),
inventory_image = "ant_sword.png",
tool_capabilities = {
full_punch_interval = 0.8,
@ -658,7 +671,7 @@ minetest.register_tool("nssm:ant_sword", {
})
minetest.register_tool("nssm:ant_shovel", {
description = "Ant Shovel",
description = S("Ant Shovel"),
inventory_image = "ant_shovel.png",
wield_image = "ant_shovel.png^[transformR90",
tool_capabilities = {
@ -672,7 +685,7 @@ minetest.register_tool("nssm:ant_shovel", {
})
minetest.register_tool("nssm:duck_beak_shovel", {
description = "Duck Beak Shovel",
description = S("Duck Beak Shovel"),
inventory_image = "duck_beak_shovel.png",
wield_image = "duck_beak_shovel.png^[transformR90",
tool_capabilities = {
@ -686,7 +699,7 @@ minetest.register_tool("nssm:duck_beak_shovel", {
})
minetest.register_tool("nssm:mantis_axe", {
description = "Mantis Axe",
description = S("Mantis Axe"),
inventory_image = "mantis_axe.png",
tool_capabilities = {
full_punch_interval = 0.8,
@ -699,7 +712,7 @@ minetest.register_tool("nssm:mantis_axe", {
})
minetest.register_tool("nssm:ant_billhook", {
description = "Ant Billhook",
description = S("Ant Billhook"),
inventory_image = "ant_billhook.png",
tool_capabilities = {
full_punch_interval = 0.8,
@ -713,7 +726,7 @@ minetest.register_tool("nssm:ant_billhook", {
})
minetest.register_tool("nssm:duck_beak_pick",{
description = "Duck Beak Pickaxe",
description = S("Duck Beak Pickaxe"),
inventory_image = "duck_beak_pick.png",
tool_capabilities = {
full_punch_interval = 0.6,
@ -726,7 +739,7 @@ minetest.register_tool("nssm:duck_beak_pick",{
})
minetest.register_tool("nssm:ant_pick", {
description = "Ant Pickaxe",
description = S("Ant Pickaxe"),
inventory_image = "ant_pick.png",
tool_capabilities = {
full_punch_interval = 1.2,
@ -739,7 +752,7 @@ minetest.register_tool("nssm:ant_pick", {
})
minetest.register_tool("nssm:mantis_pick", {
description = "Mantis Pickaxe",
description = S("Mantis Pickaxe"),
inventory_image = "mantis_pick.png",
tool_capabilities = {
full_punch_interval = 1,
@ -752,7 +765,7 @@ minetest.register_tool("nssm:mantis_pick", {
})
minetest.register_tool("nssm:tarantula_warhammer", {
description = "Tarantula Warhammer",
description = S("Tarantula Warhammer"),
inventory_image = "tarantula_warhammer.png",
wield_scale= {x = 2, y = 2, z = 1.5},
tool_capabilities = {
@ -767,7 +780,7 @@ minetest.register_tool("nssm:tarantula_warhammer", {
})
minetest.register_tool("nssm:axe_of_pride", {
description = "Axe of Pride",
description = S("Axe of Pride"),
inventory_image = "axe_of_pride.png",
wield_scale= {x = 2, y = 2, z = 1.5},
tool_capabilities = {
@ -891,7 +904,7 @@ minetest.register_tool("nssm:axe_of_pride", {
})
minetest.register_tool("nssm:gratuitousness_battleaxe", {
description = "Gratuitousness Battleaxe",
description = S("Gratuitousness Battleaxe"),
inventory_image = "gratuitousness_battleaxe.png",
wield_scale = {x = 2.2, y = 2.2, z = 1.5},
tool_capabilities = {
@ -946,7 +959,7 @@ minetest.register_tool("nssm:gratuitousness_battleaxe", {
})
minetest.register_tool("nssm:sword_of_eagerness", {
description = "Sword of Eagerness",
description = S("Sword of Eagerness"),
inventory_image = "sword_of_eagerness.png",
wield_scale= {x = 2, y = 2, z = 1},
tool_capabilities = {
@ -1056,7 +1069,7 @@ minetest.register_tool("nssm:sword_of_eagerness", {
})
minetest.register_tool("nssm:falchion_of_eagerness", {
description = "Falchion of Eagerness",
description = S("Falchion of Eagerness"),
inventory_image = "falchion_of_eagerness.png",
wield_scale= {x = 2, y = 2, z = 1},
tool_capabilities = {
@ -1159,7 +1172,7 @@ minetest.register_tool("nssm:falchion_of_eagerness", {
})
minetest.register_tool("nssm:sword_of_envy", {
description = "Sword of Envy",
description = S("Sword of Envy"),
inventory_image = "sword_of_envy.png",
wield_scale= {x = 2, y = 2, z = 1},
tool_capabilities = {
@ -1250,7 +1263,7 @@ minetest.register_tool("nssm:sword_of_envy", {
})
minetest.register_tool("nssm:sword_of_gluttony", {
description = "Sword of Gluttony",
description = S("Sword of Gluttony"),
inventory_image = "sword_of_gluttony.png",
wield_scale= {x = 2, y = 2, z = 1},
tool_capabilities = {
@ -1363,7 +1376,7 @@ minetest.register_tool("nssm:sword_of_gluttony", {
})
minetest.register_tool("nssm:death_scythe", {
description = "Death Scythe",
description = S("Death Scythe"),
wield_scale= {x = 3, y = 3, z = 1.3},
inventory_image = "death_scythe.png",
tool_capabilities = {
@ -1901,7 +1914,7 @@ end
local function nssm_register_egg(name, descr)
minetest.register_craftitem("nssm:" .. name, {
description = descr .. " Egg",
description = S(descr .. " Egg"),
image = name.."_egg.png",
on_place = function(itemstack, placer, pointed_thing)
@ -1924,7 +1937,7 @@ end
local function nssm_register_egg2(name, descr) -- mobs you can"t catch
minetest.register_craftitem("nssm:" .. name .. "_egg", {
description = descr .. " Egg",
description = S(descr .. " Egg"),
image = name .. "_egg.png",
on_place = function(itemstack, placer, pointed_thing)
@ -2000,7 +2013,7 @@ nssm_register_egg2("morwa", "Morwa")
--nssm_register_egg("morvalar", "Morvalar")
minetest.register_craftitem("nssm:mese_egg", {
description = "Mese Egg",
description = S("Mese Egg"),
image = "mese_egg.png",
on_place = function(itemstack, placer, pointed_thing)
@ -2040,7 +2053,7 @@ minetest.register_craftitem("nssm:mese_egg", {
-- experimental morwa statue
minetest.register_node("nssm:morwa_statue", {
description = "Morwa Statue",
description = S("Morwa Statue"),
drawtype = "mesh",
mesh = "morwa_statue.b3d",
tiles = {"morwa_statue.png"},

View File

@ -1,65 +1,82 @@
local creative_mode = minetest.settings:get_bool("creative_mode")
local function is_walkable(node_name)
if not minetest.registered_nodes[node_name] then
return true -- non-existent, we should stop the spear !
end
if minetest.registered_nodes[node_name].walkable == true
or minetest.registered_nodes[node_name].walkable == nil then
return true
end
return false
end
-- functions
local function spears_shot(itemstack, player)
local spear = itemstack:get_name() .. '_entity'
local playerpos = player:get_pos()
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y + 1.5,
z = playerpos.z
}, spear)
local dir = player:get_look_dir()
local speed = 16
local gravity = 9.8
if spear == "nssm:spear_of_peace_entity" then
sp = 32
gravity = 9.8
else
sp = 16
speed = 32
gravity = 9.8
end
local dr = .3
obj:set_velocity({x = dir.x * sp, y = dir.y * sp, z = dir.z * sp})
obj:set_acceleration({x = -dir.x * dr, y = -gravity, z = -dir.z * dr})
obj:set_yaw(player:get_look_yaw() + math.pi)
obj:get_luaentity().wear = itemstack:get_wear()
local drag = .3
local playerpos = player:getpos()
local dir = player:get_look_dir()
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y + 1.5,
z = playerpos.z}, spear)
obj:set_velocity({x = dir.x * speed, y = dir.y * speed, z = dir.z * speed})
obj:set_acceleration({x = -dir.x * drag, y = -gravity, z = -dir.z * drag})
obj:set_yaw(player:get_look_horizontal() + math.pi / 2)
minetest.sound_play("spears_sound", {pos = playerpos}, true)
obj:get_luaentity().wear = itemstack:get_wear()
obj:get_luaentity().shooter = player
return true
end
local function spears_set_entity(kind, eq, toughness)
local function spears_set_entity(kind, eq, toughness, breadth)
local spearname = "nssm:spear_" .. kind
local spearentityname = spearname .. "_entity"
local maxwear = 65535
local weardown = maxwear / toughness
breadth = breadth or 1
local SPEAR_ENTITY = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x = 0.15, y = 0.1},
textures = {"nssm:spear_" .. kind},
lastpos={},
textures = {spearname},
lastpos = {},
collisionbox = {0,0,0,0,0,0},
on_punch = function(self, puncher)
-- pick up item
if puncher then
if puncher:is_player() then
local stack = {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
}
local stack = {name=spearname, wear=self.wear}
local inv = puncher:get_inventory()
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
self.object:remove()
end
end
@ -69,91 +86,106 @@ local function spears_set_entity(kind, eq, toughness)
SPEAR_ENTITY.on_step = function(self, dtime)
self.timer=self.timer + dtime
self.timer = self.timer + dtime
local pos = self.object:get_pos()
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if not self.wear then
self.object:remove()
return
end
if self.lastpos.x~=nil then
-- pos exists --> entity has moved at least once
if self.lastpos.x then
if node.name ~= "air"
and not (string.find(node.name, "grass")
and not string.find(node.name, "dirt"))
and not string.find(node.name, "flowers:")
and not string.find(node.name, "farming:") then
if node.name ~= "air" and is_walkable(node.name) then
self.object:remove()
if self.wear + 65535 / toughness < 65535 then
local halfweardown = weardown / 2
if self.wear + halfweardown < maxwear then
minetest.add_item(self.lastpos, {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
name = spearname,
wear = self.wear + halfweardown
})
end
elseif self.timer > 0.2 then
else
local objs = minetest.get_objects_inside_radius({
x = pos.x, y = pos.y, z = pos.z}, 1)
x = pos.x,
y = pos.y,
z = pos.z}, 1.5 * breadth)
local add_at
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity"
if obj:get_luaentity().name ~= spearentityname
and obj:get_luaentity().name ~= "__builtin:item" then
local speed = vector.length(self.object:get_velocity())
local damage = (speed + eq) ^ 1.12 - 20
if not (obj:is_player()
and obj:get_luaentity().shooter:get_player_name()
== obj:get_player_name() ) then
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups={fleshy = damage}
}, nil)
local speed = vector.length(self.object:getvelocity())
local damage = (speed + eq) ^ 1.12 - 20
self.object:remove()
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = damage},
}, nil)
if self.wear + 65535 / toughness < 65535 then
self.object:remove()
minetest.add_item(self.lastpos, {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
})
-- Wear down for each mob hit
if self.wear + weardown < maxwear then
self.wear = self.wear + weardown
add_at = {
pos = self.lastpos,
def = {name = spearname, wear =self.wear}
}
end
end
end
break -- only harm first entity hit
end
end
if add_at then
minetest.add_item(add_at.pos, add_at.def)
end
end
end
self.lastpos={x = pos.x, y = pos.y, z = pos.z}
self.lastpos = {x = pos.x, y = pos.y, z = pos.z}
end
return SPEAR_ENTITY
end
-- Tools
--Tools
local function spears_register_spear(kind, desc, eq, toughness, material)
function spears_register_spear(kind, desc, eq, toughness, material, scale)
scale = scale or 1
minetest.register_tool("nssm:spear_" .. kind, {
description = desc .. " Spear",
wield_image = "spear_" .. kind .. ".png",
inventory_image = "spear_" .. kind .. ".png^[transform4",
wield_scale= {x = 2, y = 1, z = 1},
wield_scale= {x = 2 * scale, y = 1 * scale, z = 1 * scale},
on_drop = function(itemstack, user, pointed_thing)
spears_shot(itemstack, user)
if not minetest.setting_getbool("creative_mode") then
if not creative_mode then
itemstack:take_item()
end
@ -164,7 +196,7 @@ local function spears_register_spear(kind, desc, eq, toughness, material)
minetest.add_item(pointed_thing.above, itemstack)
if not minetest.setting_getbool("creative_mode") then
if not creative_mode then
itemstack:take_item()
end
@ -175,189 +207,48 @@ local function spears_register_spear(kind, desc, eq, toughness, material)
full_punch_interval = 1.3,
max_drop_level = 1,
groupcaps = {
snappy = {times = {[3]=0.2, [2]=0.2, [1]=0.2},
uses = toughness, maxlevel = 1},
snappy = {
times = {[3] = 0.2, [2] = 0.2, [1] = 0.2},
uses = toughness,
maxlevel = 1
}
},
damage_groups = {fleshy = eq}
damage_groups = {fleshy = eq},
}
})
local SPEAR_ENTITY = spears_set_entity(kind, eq, toughness)
local SPEAR_ENTITY = spears_set_entity(kind, eq, toughness, scale)
minetest.register_entity("nssm:spear_" .. kind .. "_entity", SPEAR_ENTITY)
minetest.register_craft({
output = "nssm:spear_" .. kind,
output = 'nssm:spear_' .. kind,
recipe = {
{"group:wood", "group:wood", material}
{'group:wood', 'group:wood', material}
}
})
minetest.register_craft({
output = "nssm:spear_" .. kind,
output = 'nssm:spear_' .. kind,
recipe = {
{material, "group:wood", "group:wood"}
{material, 'group:wood', 'group:wood'}
}
})
end
spears_register_spear("ant", "Ant", 6, 25, "nssm:ant_mandible")
spears_register_spear("mantis", "Mantis", 6, 10, "nssm:mantis_claw")
spears_register_spear("manticore", "Manticore", 8, 8, "nssm:manticore_spine")
spears_register_spear("ice_tooth", "Ice Tooth", 16, 200, "nssm:ice_tooth")
spears_register_spear("little_ice_tooth", "Little Ice Tooth", 7, 10, "nssm:little_ice_tooth")
spears_register_spear("duck_beak", "Duck Beak", 5, 6, "nssm:duck_beak")
spears_register_spear("felucco_horn", "Felucco Horn", 7, 9, "nssm:felucco_horn")
-- Spear of peace
minetest.register_tool("nssm:spear_of_peace", {
description = "Spear of Peace",
wield_image = "spear_of_peace.png",
inventory_image = "spear_of_peace.png^[transform4",
wield_scale= {x = 4, y = 2, z = 2},
spears_register_spear('ant', 'Ant', 6, 50, 'nssm:ant_mandible')
on_drop = function(itemstack, user, pointed_thing)
spears_register_spear('mantis', 'Mantis', 6, 20, 'nssm:mantis_claw')
spears_shot(itemstack, user)
spears_register_spear('manticore', 'Manticore', 8, 16, 'nssm:manticore_spine')
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
spears_register_spear('ice_tooth', 'Ice Tooth', 16, 200, 'nssm:ice_tooth')
return itemstack
end,
spears_register_spear('little_ice_tooth', 'Little Ice Tooth', 7, 20, 'nssm:little_ice_tooth')
on_place = function(itemstack, user, pointed_thing)
spears_register_spear('duck_beak', 'Duck Beak', 5, 12, 'nssm:duck_beak')
minetest.add_item(pointed_thing.above, itemstack)
spears_register_spear('felucco_horn', 'Felucco Horn', 7, 18, 'nssm:felucco_horn')
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level = 1,
groupcaps = {
snappy = {times = {[3]=0.2, [2]=0.2, [1]=0.2}, uses = 500, maxlevel = 1}
},
damage_groups = {fleshy = 18}
}
})
local function spears_set_sentity(kind, eq, toughness)
local SUPERSPEAR_ENTITY = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x = 0.15, y = 0.1},
textures = {"nssm:spear_" .. kind},
lastpos={},
collisionbox = {0,0,0,0,0,0},
on_punch = function(self, puncher)
if puncher then
if puncher:is_player() then
local stack = {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
}
local inv = puncher:get_inventory()
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
self.object:remove()
end
end
end
end
}
SUPERSPEAR_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
if not self.wear then
self.object:remove()
return
end
if self.lastpos.x ~= nil then
if node.name ~= "air"
and not (string.find(node.name, "grass")
and not string.find(node.name, "dirt"))
and not string.find(node.name, "flowers:")
and not string.find(node.name, "farming:") then
self.object:remove()
if self.wear + 65535 / toughness < 65535 then
minetest.add_item(self.lastpos, {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
})
end
elseif self.timer > 0.2 then
local objs = minetest.get_objects_inside_radius({
x = pos.x, y = pos.y, z = pos.z}, 1)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "nssm:spear_" .. kind .. "_entity"
and obj:get_luaentity().name ~= "__builtin:item" then
local speed = vector.length(self.object:get_velocity())
local damage = (speed + eq) ^ 1.12 - 20
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups={fleshy = damage}
}, nil)
self.object:remove()
if self.wear + 65535 / toughness < 65535 then
minetest.add_item(self.lastpos, {
name = "nssm:spear_" .. kind,
wear = self.wear + 65535 / toughness
})
end
end
end
end
end
end
self.lastpos = {x = pos.x, y = pos.y, z = pos.z}
end
return SUPERSPEAR_ENTITY
end
SUPERSPEAR_ENTITY = spears_set_sentity("of_peace", 30, 300)
minetest.register_entity("nssm:spear_of_peace_entity", SUPERSPEAR_ENTITY)
minetest.register_craft({
output = "nssm:spear_of_peace",
recipe = {
{"nssm:wrathful_moranga", "group:wood", "group:wood"}
}
})
spears_register_spear('of_peace', 'Grand Peace', 30, 300, 'nssm:wrathful_moranga', 2)

View File

@ -1,63 +1,105 @@
-- rainbow!
-- The Rainbow Staff is a reward for defeating the final boss
-- Classic implementation produces ranbow blocks in any direction it is pointed at and used
-- This tends to be problematic on servers, so is replaced with a powerful tool instead
-- if classic rainbow staff is not enabled
minetest.register_entity("nssm:rainbow", {
textures = {"transparent.png"},
velocity = 10,
hp_max = 50,
-- How long the rainbow generating entity should remain in existence, Used to be 10,
-- really should not last so long, given that it adds rainbow on every server step...
local max_rainbow_time = 1
on_step = function (self, pos, node, dtime)
if nssm.classic_rainbow_staff
and minetest.registered_nodes["nyancat:nyancat_rainbow"] then
self.timer = self.timer or os.time()
minetest.register_entity("nssm:rainbow", {
textures = {"transparent.png"},
velocity = 10,
hp_max = 50,
local pos = self.object:get_pos()
on_step = function (self, pos, node, dtime)
if minetest.is_protected(pos, "") then
return
end
self.timer = self.timer or os.time()
if os.time() - self.timer > 10 then
minetest.set_node(pos, {name = "nyancat:nyancat"})
self.object:remove()
end
local pos = self.object:get_pos()
if minetest.get_node(pos) then
if minetest.is_protected(pos, "") then
return
end
local n = minetest.get_node(pos).name
if os.time() - self.timer > max_rainbow_time then
minetest.set_node(pos, {name = "nyancat:nyancat"})
self.object:remove()
end
if n ~= "nyancat:nyancat_rainbow" then
if minetest.get_node(pos) then
if n == "air" then
minetest.set_node(pos, {name = "nyancat:nyancat_rainbow"})
else
minetest.chat_send_all("Nome:" .. n)
minetest.set_node(pos, {name = "nyancat:nyancat"})
local n = minetest.get_node(pos).name
self.object:remove()
if n ~= "nyancat:nyancat_rainbow" then
if n == "air" then
minetest.set_node(pos, {name = "nyancat:nyancat_rainbow"})
else
minetest.chat_send_all("Nome:" .. n)
minetest.set_node(pos, {name = "nyancat:nyancat"})
self.object:remove()
end
end
end
end
end
})
})
minetest.register_tool("nssm:rainbow_staff", {
description = "Rainbow Staff",
inventory_image = "rainbow_staff.png",
groups = {not_in_creative_inventory = 1},
minetest.register_tool("nssm:rainbow_staff", {
description = "Rainbow Staff",
inventory_image = "rainbow_staff.png",
groups = {not_in_creative_inventory = 1},
on_use = function(itemstack, placer, pointed_thing)
on_use = function(itemstack, placer, pointed_thing)
local dir = placer:get_look_dir()
local playerpos = placer:get_pos()
local obj = minetest.add_entity({
x = playerpos.x + dir.x,
y = playerpos.y + 2 + dir.y,
z = playerpos.z + dir.z
}, "nssm:rainbow")
local dir = placer:get_look_dir()
local playerpos = placer:get_pos()
local obj = minetest.add_entity({
x = playerpos.x + dir.x,
y = playerpos.y + 2 + dir.y,
z = playerpos.z + dir.z
}, "nssm:rainbow")
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
obj:set_velocity(vec)
obj:set_velocity(vec)
return itemstack
end
})
return itemstack
end
})
else
minetest.register_tool("nssm:rainbow_staff", {
description = "Rainbow Bludgeon",
inventory_image = "rainbow_staff.png",
tool_capabilities = {
full_punch_interval = 0.2,
max_drop_level = 1,
groupcaps = {
snappy = {
times = {[1] = 0.80, [2] = 0.40, [3] = 0.20}, uses = 70, maxlevel = 1
},
crumbly = {
times = {[1] = 0.80, [2] = 0.40, [3] = 0.20}, uses = 70, maxlevel = 1
},
choppy = {
times = {[1] = 0.80, [2] = 0.40, [3] = 0.20}, uses = 70, maxlevel = 1
},
cracky = {
times = {[1] = 0.80, [2] = 0.40, [3] = 0.20}, uses = 70, maxlevel = 1
},
fleshy = {
times = {[1] = 0.80, [2] = 0.60, [3] = 0.20}, uses = 140, maxlevel = 1
}
},
damage_groups = {fleshy = 40},
},
groups = {not_in_creative_inventory = 1}
})
end

View File

@ -1,18 +1,20 @@
# ABOUT SETTINGS
# Mapgen: write here (after "int") 6 (mgv6) or 7 (mgv7 or valleys or fractal or flat)
mymapgenis (Mapgen) int 7
nssm.mymapgenis (Mapgen) int 7
# Mobs-Multiplier: multiplier defining the spawn abundance for the mobs:
# 0 = spawn disabled
# a number between 0 and 1000 = less then default
# 1000 = default
# more than 1000 = suicide is not the fastest way of dying
multimobs (Multimobs) int 1000
nssm.multimobs (Multimobs) int 1000
# Difficult-level:
# Multiplier to raise life and damage of the mobs
mob_difficulty (Mob_difficulty) int 1
nssm.mob_difficulty (Mob_difficulty) int 1
# Spiders
spiders_litter_web (Spiders casually litter web) bool true
nssm.spiders_litter_web (Spiders casually litter web) bool true
nssm.classic_rainbow_staff (Use the classical rainbow staff) bool false

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB