Initial commit

This commit is contained in:
MCLx86 2021-12-21 18:09:12 -05:00
commit 5fb9897a36
431 changed files with 7241 additions and 0 deletions

28
CHANGELOG.TXT Normal file
View File

@ -0,0 +1,28 @@
====================
====================
==ADSURV CHANGELOG==
====================
====================
-------------------------------
Adsurv 0.5.2137 (March 7, 2021)
-------------------------------
- Added some new crafting recipes.
- Added planks.
- Changed the texture for dirt.
--------------------------
Adsurv 0.5 (March 4, 2021)
--------------------------
- Added blocks from every type of metal currently in the game.
- Added lumps.
- Added axes and knives from steel, stone, and refined stone.
- Completely changed textures of obsidian, cobble, apple tree log, leaves, and more.
-----------------------------
Adsurv 0.4 (February 2, 2019)
-----------------------------
- Changed selected slot hotbar texture.
- Made a few minor changes to the textures

106
LICENSE.TXT Normal file
View File

@ -0,0 +1,106 @@
Source code license: MIT License (see below)
-------------------
Copyright 2019-2021 MCL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Textures and sounds license: Creative Commons Attribution 4.0 International
---------------------------
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
License grant.
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
reproduce and Share the Licensed Material, in whole or in part; and
produce, reproduce, and Share Adapted Material.
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
Term. The term of this Public License is specified in Section 6(a).
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
Downstream recipients.
Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
Other rights.
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
Patent and trademark rights are not licensed under this Public License.
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
Attribution.
If You Share the Licensed Material (including in modified form), You must:
retain the following if it is supplied by the Licensor with the Licensed Material:
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
a copyright notice;
a notice that refers to this Public License;
a notice that refers to the disclaimer of warranties;
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.

19
README.TXT Normal file
View File

@ -0,0 +1,19 @@
FortTest - Version 0.1-dev
TODO:
Death detection
Add all guns
Loot chest generation
Game start
Building
--------
LICENSES
--------
Liccense of code: X11 License (see LICENSE.TXT)
Licecnse of textures, sounds, and schematics: CC BY 4.0 International (see LICENSE.TXT)

1
game.conf Normal file
View File

@ -0,0 +1 @@
name = Coconut Collection (a.k.a. Coconut Hut)

BIN
menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

60
mods/coconut/init.lua Normal file
View File

@ -0,0 +1,60 @@
coconut = {}
minetest.register_node("coconut:nut", {
tiles =
{
"main_cobble.png",
"main_cobble.png",
"main_cobble.png",
"main_cobble.png",
"main_cobble.png",
"main_cobble.png"
},
drawtype = "nodebox",
paramtype = "light",
node_box =
{
type = "fixed",
fixed =
{
{-0.25, -0.5, -0.25, 0.25, 0, 0.25},
}
}
})
function coconut.init()
local players = minetest.get_connected_players()
for i=1, #players do
coconut.add_huds(players[i])
minetest.chat_send_all(players[i])
end
end
function coconut.add_hud(player)
local meta = player:get_meta()
local digs_text = "You: " .. meta:get_int("score:digs")
local places_text = "Ami: " .. meta:get_int("score:places")
player:hud_add({
hud_elem_type = "text",
position = {x = 1, y = 0.5},
offset = {x = -120, y = -25},
text = "Stats",
alignment = 0,
scale = { x = 100, y = 30},
number = 0xFFFFFF,
})
player:hud_add({
hud_elem_type = "text",
position = {x = 1, y = 0.5},
offset = {x = -180, y = 0},
text = digs_text,
alignment = -1,
scale = { x = 50, y = 10},
number = 0xFFFFFF,
})
end

View File

@ -0,0 +1,113 @@
SOURCE CODE LICENSE: MIT License (see below)
Copyright 2018-2021 MCL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
TEXTURES AND SOUNDS LICENSE: Creative Commons Attribution 4.0 International Public License (see below)
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
License grant.
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
reproduce and Share the Licensed Material, in whole or in part; and
produce, reproduce, and Share Adapted Material.
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
Term. The term of this Public License is specified in Section 6(a).
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
Downstream recipients.
Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
Other rights.
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
Patent and trademark rights are not licensed under this Public License.
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
Attribution.
If You Share the Licensed Material (including in modified form), You must:
retain the following if it is supplied by the Licensor with the Licensed Material:
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
a copyright notice;
a notice that refers to this Public License;
a notice that refers to the disclaimer of warranties;
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.

View File

@ -0,0 +1,384 @@
--[[
Copyright 2018-2021 MCL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
minetest.register_node("industrial_decor:planks",{
description = "Planks",
drawtype = "signlike",
tiles = {"industrial_decor_planks.png"},
inventory_image = "industrial_decor_planks.png",
wield_image = "industrial_decor_planks.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {choppy = 2},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:planks_destroyed",{
description = "Destroyed Planks",
drawtype = "signlike",
tiles = {"industrial_decor_planks_destroyed.png"},
inventory_image = "industrial_decor_planks_destroyed.png",
wield_image = "industrial_decor_planks_destroyed.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = true,
groups = {choppy = 3},
selection_box = {
type = "wallmounted",
},
})
--Lamps
minetest.register_node("industrial_decor:lamp",{
description = "Industrial Lamp",
drawtype = "plantlike",
tiles = {"industrial_decor_lamp.png"},
inventory_image = "industrial_decor_lamp.png",
wield_image = "industrial_decor_lamp.png",
light_source = 14,
light_propagates = true,
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
on_punch = function(pos, node, player, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"})
end
})
--Damaged
minetest.register_node("industrial_decor:lamp_damaged",{
description = "Damaged Industrial Lamp",
drawtype = "plantlike",
tiles = {"industrial_decor_lamp_damaged.png"},
inventory_image = "industrial_decor_lamp_damaged.png",
wield_image = "industrial_decor_lamp_damaged.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
is_ground_content = false,
walkable = false,
groups = {cracky = 2},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
on_rightclick = function(pos, node, player, pointed_thing)
if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_bulb"})
elseif player:get_wielded_item():get_name() == "tapes:ducttape_black" then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_tape"})
end
end
})
--Light Bulb Only
minetest.register_node("industrial_decor:lamp_bulb",{
description = "Damaged Industrial Lamp with Light Bulb",
drawtype = "plantlike",
tiles = {
{
name = "industrial_decor_lamp_bulb.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
inventory_image = "industrial_decor_lamp_bulb_single.png",
wield_image = "industrial_decor_lamp_bulb_single.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
is_ground_content = false,
walkable = false,
groups = {cracky = 2},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
on_rightclick = function(pos, node, player, pointed_thing)
if player:get_wielded_item():get_name() == "tapes:ducttape_black" then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"})
end
end
})
--Taped
minetest.register_node("industrial_decor:lamp_tape",{
description = "Industrial Lamp with Duct Tape",
drawtype = "plantlike",
tiles = {"industrial_decor_lamp_tape.png"},
inventory_image = "industrial_decor_lamp_tape.png",
wield_image = "industrial_decor_lamp_bulb_tape.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
is_ground_content = false,
walkable = false,
groups = {cracky = 2},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
on_rightclick = function(pos, node, player, pointed_thing)
if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"})
end
end
})
--Fixed
minetest.register_node("industrial_decor:lamp_fixed",{
description = "Fixed Industrial Lamp",
drawtype = "plantlike",
tiles = {"industrial_decor_lamp_fixed.png"},
inventory_image = "industrial_decor_lamp_fixed.png",
wield_image = "industrial_decor_lamp_fixed.png",
light_source = 10,
light_propagates = true,
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
on_punch = function(pos, node, player, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"})
end
})
--End of Lamps
minetest.register_node("industrial_decor:wires_hanging",{
description = "Hanging Wires",
drawtype = "plantlike",
tiles = {"industrial_decor_wires_hanging.png"},
inventory_image = "industrial_decor_wires_hanging.png",
wield_image = "industrial_decor_wires_hanging.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
is_ground_content = false,
walkable = false,
groups = {snappy = 3},
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
})
minetest.register_node("industrial_decor:sheet_tin",{
description = "Industrial Tin Sheet",
tiles = {"industrial_decor_sheet_tin.png"},
groups = {cracky = 1},
})
minetest.register_node("industrial_decor:shelf_empty",{
paramtype = "light",
description = "Empty Metal Shelf",
tiles = {"industrial_decor_sheet_tin.png",
"industrial_decor_sheet_tin.png",
"industrial_decor_sheet_tin.png",
"industrial_decor_sheet_tin.png",
"industrial_decor_shelf_empty.png",},
groups = {choppy = 2},
})
minetest.register_node("industrial_decor:crate_upsidedown",{
drawtype = "allfaces_optional",
paramtype = "light",
description = "Food Crate",
tiles = {"industrial_decor_crate_upsidedown.png"},
groups = {choppy = 3},
})
minetest.register_node("industrial_decor:hvdevice_pol",{
description = "Polish High Voltage Device",
drawtype = "signlike",
tiles = {"industrial_decor_hvdevice_polish.png"},
inventory_image = "industrial_decor_hvdevice_polish.png",
wield_image = "industrial_decor_hvdevice_polish.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:hvdevice_usa",{
description = "American High Voltage Device",
drawtype = "signlike",
tiles = {"industrial_decor_hvdevice_american.png"},
inventory_image = "industrial_decor_hvdevice_american.png",
wield_image = "industrial_decor_hvdevice_american.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
--Hazard signs
minetest.register_node("industrial_decor:hazardsign_generic",{
description = "Generic Caution Hazard Sign",
drawtype = "signlike",
tiles = {"industrial_decor_hazardsign_generic.png"},
inventory_image = "industrial_decor_hazardsign_generic.png",
wield_image = "industrial_decor_hazardsign_generic.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:hazardsign_poison",{
description = "Poison Hazard Sign",
drawtype = "signlike",
tiles = {"industrial_decor_hazardsign_poison.png"},
inventory_image = "industrial_decor_hazardsign_poison.png",
wield_image = "industrial_decor_hazardsign_poison.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:hazardsign_laser",{
description = "Laser Hazard Sign",
drawtype = "signlike",
tiles = {"industrial_decor_hazardsign_laser.png"},
inventory_image = "industrial_decor_hazardsign_laser.png",
wield_image = "industrial_decor_hazardsign_laser.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:hazardsign_radiation_ion",{
description = "Ionizing Radiation Hazard Sign",
drawtype = "signlike",
tiles = {"industrial_decor_hazardsign_ionradiation.png"},
inventory_image = "industrial_decor_hazardsignion_ionradiation.png",
wield_image = "industrial_decor_hazardsign_ionradiation.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})
minetest.register_node("industrial_decor:hazardsign_radiation_nonion",{
description = "Non-Ionizing Radiation Hazard Sign",
drawtype = "signlike",
tiles = {"industrial_decor_hazardsign_nonionradiation.png"},
inventory_image = "industrial_decor_hazardsign_nonionradiation.png",
wield_image = "industrial_decor_hazardsign_nonionradiation.png",
light_propagates = true,
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
groups = {cracky = 1},
selection_box = {
type = "wallmounted",
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

76
mods/main/craftitems.lua Normal file
View File

@ -0,0 +1,76 @@
---------------
---------------
--Craft Items--
---------------
---------------
--Stick
minetest.register_craftitem("main:stick", {
description = "Stick",
inventory_image = "main_stick.png",
})
--Twig
minetest.register_craftitem("main:twig", {
description = "Twig",
inventory_image = "main_twig.png",
})
----------
--Minerals
----------
--Salt Crystals
minetest.register_craftitem("main:salt_crystals", {
description = "Salt Crystals",
inventory_image = "main_salt_crystals.png",
})
--Sulfur Lump
minetest.register_craftitem("main:lump_sulfur", {
description = "Sulfur Lump",
inventory_image = "main_lump_sulfur.png",
})
--Coal
minetest.register_craftitem("main:coal", {
description = "Coal",
inventory_image = "main_lump_coal.png",
})
--Iron Lump
minetest.register_craftitem("main:lump_iron", {
description = "Iron Lump",
inventory_image = "main_lump_iron.png",
})
--Copper Lump
minetest.register_craftitem("main:lump_copper", {
description = "Copper Lump",
inventory_image = "main_lump_copper.png",
})
--Raw Diamond
minetest.register_craftitem("main:diamond_raw", {
description = "Raw Diamond",
inventory_image = "main_dirt.png", -- Dummy/placeholder texture, will be changed in the future
--inventory_image = "main_diamond_raw.png",
})
--Polished Diamond
minetest.register_craftitem("main:diamond_polished", {
description = "Polished Diamond",
inventory_image = "main_dirt.png", -- Dummy/placeholder, will be changed in the future
--inventory_image = "main_diamond_polished.png",
})
---------
--Edibles
---------
--Strawberry
minetest.register_craftitem("main:berry_straw", {
description = "Strawberry",
tiles = {"main_berry_straw.png"},
on_use = minetest.item_eat(1),
})

11
mods/main/init.lua Normal file
View File

@ -0,0 +1,11 @@
local modpath = minetest.get_modpath("main")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/craftitems.lua")
dofile(modpath.."/mapgen.lua")
dofile(modpath.."/tools.lua")
minetest.register_on_joinplayer(function(player)
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
end)

7
mods/main/license.txt Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019-2021 MCL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

43
mods/main/mapgen.lua Normal file
View File

@ -0,0 +1,43 @@
minetest.register_alias("mapgen_stone", "main:stone")
minetest.register_alias("mapgen_dirt", "main:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "main:grass")
minetest.register_alias("mapgen_sand", "main:sand")
minetest.register_alias("mapgen_water_source", "main:water_source")
--Beach
minetest.register_biome(
{
name = "Beach",
node_top = "main:sand",
node_filler = "main:sand",
depth_top = 1,
depth_filler = 3,
y_min = -20,
y_max = 32000,
heat_point = 70,
humidity_point = 55,
})
--Small Rock
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"main:dirt_with_grass", "main:dirt", "main:sand", "main:dirt_with_swamp_grass"},
rotation = "random",
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Grasslands", "Swamp", "Desert", "Wasteland"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("main")
.. "/schematics/main_rock_cobble_small.mts",
y_min = -32000,
y_max = 32000,
})

193
mods/main/nodes.lua Normal file
View File

@ -0,0 +1,193 @@
--Naturally generating nodes
minetest.register_node("main:stone", {
description = "Stone",
tiles = {"main_stone.png"},
groups = {cracky = 3, stone = 1},
drop = 'main:cobble',
legacy_mineral = true,
})
minetest.register_node("main:cobble", {
description = "Cobble",
tiles = {"main_cobble.png"},
groups = {cracky = 2, stone = 1},
drop = 'main:cobble',
legacy_mineral = true,
})
minetest.register_node("main:dirt", {
description = "Dirt",
tiles = {"main_dirt.png"},
groups = {crumbly = 3, soil = 1},
})
minetest.register_node("main:grass", {
description = "Grass",
tiles = {"main_grass.png", "main_dirt.png",
{name = "main_dirt.png^main_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = 'main:dirt',
})
minetest.register_node("main:sand", {
description = "Sand",
tiles = {"main_sand.png"},
groups = {crumbly = 3, sand = 1},
})
--Player made nodes
minetest.register_node("main:light", {
description = "Lamp",
tiles = {"main_indsutrial_decor_lamp.png"},
light_source = 14,
groups = {choppy = 3, oddly_breakable_by_hand = 3},
})
--Steel Block
minetest.register_node("main:block_steel", {
description = "Steel Block",
tiles = {"main_block_iron.png"},
groups = {cracky = 3},
drop = 'main:block_iron',
})
--Gold Block
minetest.register_node("main:block_gold", {
description = "Gold Block",
tiles = {"main_block_gold.png"},
groups = {cracky = 3},
drop = 'main:block_gold',
})
--Planks
minetest.register_node("main:planks_oak", {
description = "Planks",
tiles = {"main_planks_oak.png"},
groups = {choppy = 3},
})
--
-- Plants and Other Living Organisms
--
--Oak Log
minetest.register_node("main:log", {
description = "Log",
tiles = {"main_log.png"},
groups = {choppy = 2, logs = 1},
})
--Oak Leaves
minetest.register_node("main:leaves", {
drawtype = "plantlike",
paramtype = "light",
light_propagates = true,
sunlight_propagates = true,
walkable = false,
climbable = true,
is_ground_content = false,
description = "Leaves",
tiles = {"main_leaves.png"},
groups = {snappy = 3},
})
--
-- Liquids
--
--Fresh water
minetest.register_node("main:water_source", {
description = "Fresh Water Source",
drawtype = "liquid",
paramtype = "light",
tiles = {
{
name = "main_water_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
alpha = 180,
post_effect_color = {a = 50, r = 0, g = 50, b = 200},
--Behavior
walkable = false,
pointable = false,
buildable_to = true,
diggable = false,
is_ground_content = false,
--Properties
liquid_range = 14,
liquid_viscosity = 0.1,
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "main:water_flowing",
liquid_alternative_source = "main:water_source",
groups = {liquid = 3, water = 1},
})
minetest.register_node("main:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
paramtype = "light",
tiles = {
{
name = "main_water_flowing_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
special_tiles = {
{
name = "main_water_flowing_animated.png",
animation = {type = "vertical_frames", aspect_w = 16,
aspect_h = 16, length = 2.0},
backface_culling = true,
},
{
name = "main_water_flowing_animated.png",
animation = {type = "vertical_frames", aspect_w = 16,
aspect_h = 16, length = 2.0},
backface_culling = false,
}
},
alpha = 180,
post_effect_color = {a = 50, r = 0, g = 50, b = 200},
--Behavior
walkable = false,
pointable = false,
buildable_to = true,
diggable = false,
is_ground_content = false,
--Properties
liquid_range = 14,
liquid_viscosity = 0.1,
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "main:water_flowing",
liquid_alternative_source = "main:water_source",
groups = {liquid = 3, water = 1},
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
mods/main/textures/hand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

74
mods/main/tools.lua Normal file
View File

@ -0,0 +1,74 @@
minetest.register_item(":",
{
type = "none",
wield_image = "hand.png",
wield_scale = {x=1,y=1,z=3.5},
tool_capabilities =
{
max_drop_level = 0,
full_punch_interval = 0.4,
groupcaps =
{
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0},
snappy = {times={[3]=1.00}, uses=0, maxlevel=1},
crumbly = {times={[2]=4.50, [3]=1.80}, uses=0, maxlevel=1},
},
damage_groups = {fleshy = 3, snappy = 2},
}
})
minetest.register_item("main:pickaxe_steel",
{
type = "none",
wield_image = "main_pickaxe_steel.png",
inventory_image = "main_pickaxe_steel.png",
tool_capabilities =
{
max_drop_level = 1,
full_punch_interval = 0.8,
groupcaps =
{
cracky = {times={[1]=1.80, [2]=1.00,[3]=0.50}, uses=0, maxlevel=1},
crumbly = {times={[2]=2.50, [3]=0.80}, uses=0, maxlevel=1},
},
damage_groups = {fleshy = 5, cracky = 8},
}
})
minetest.register_item("main:pickaxe_stone",
{
type = "none",
wield_image = "main_pickaxe_stone.png",
tool_capabilities =
{
max_drop_level = 1,
full_punch_interval = 0.8,
groupcaps =
{
cracky = {times={[1]=3.80, [2]=2.00,[3]=1.50}, uses=0, maxlevel=1},
crumbly = {times={[2]=3.50, [3]=1.80}, uses=0, maxlevel=1},
},
damage_groups = {fleshy = 4, cracky = 5},
}
})
minetest.register_item("main:ax_steel",
{
type = "none",
wield_image = "main_pickaxe_stone.png",
tool_capabilities =
{
max_drop_level = 1,
full_punch_interval = 0.4,
groupcaps =
{
choppy = {times={[1]=3.80, [2]=2.00,[3]=1.50}, uses=0, maxlevel=1},
crumbly = {times={[2]=3.50, [3]=1.80}, uses=0, maxlevel=1},
},
damage_groups = {fleshy = 4, cracky = 8},
}
})

View File

@ -0,0 +1,75 @@
minetest.register_tool("rangedweapons:aa12_r", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.4},
description = "",
rw_next_reload = "rangedweapons:aa12_rr",
load_sound = "rangedweapons_rifle_clip_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_aa12_rld.png",
})
minetest.register_tool("rangedweapons:aa12_rr", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.4},
description = "",
rw_next_reload = "rangedweapons:aa12_rrr",
load_sound = "rangedweapons_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_aa12.png",
})
minetest.register_tool("rangedweapons:aa12_rrr", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.4},
description = "",
rw_next_reload = "rangedweapons:aa12",
load_sound = "rangedweapons_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_aa12.png",
})
-------------------------------------------
minetest.register_tool("rangedweapons:aa12", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.4},
description = "" ..core.colorize("#35cdff","AA-12\n") ..core.colorize("#FFFFFF", "Ranged damage: 1\n") ..core.colorize("#FFFFFF", "projectiles: 5\n") ..core.colorize("#FFFFFF", "Gun gravity: 4\n") ..core.colorize("#FFFFFF", "accuracy: 40%\n") ..core.colorize("#FFFFFF", "knockback: 5\n") ..core.colorize("#FFFFFF", "Reload delay: 1.5\n") ..core.colorize("#FFFFFF", "Clip size: 20\n") ..core.colorize("#FFFFFF", "Critical chance: 5%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.0x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shell\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.2 (full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: shotgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
range = 0,
inventory_image = "rangedweapons_aa12.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=1,knockback=5},
gun_crit = 5,
gun_critEffc = 2.0,
suitable_ammo = {{"rangedweapons:shell",20}},
gun_skill = {"shotgun_skill",40},
gun_magazine = "rangedweapons:drum_mag",
gun_icon = "rangedweapons_aa12_icon.png",
gun_unloaded = "rangedweapons:aa12_r",
gun_velocity = 25,
gun_accuracy = 40,
gun_cooldown = 0.2,
gun_reload = 1.5/4,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 750,
gun_smokeSize = 8,
gun_door_breaking = 1,
gun_projectiles = 5,
gun_gravity = 4,
gun_unload_sound = "rangedweapons_rifle_clip_out",
gun_sound = "rangedweapons_shotgun_shot",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,76 @@
minetest.register_tool("rangedweapons:ak47_r", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:ak47_rr",
load_sound = "rangedweapons_rifle_clip_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_ak47_rld.png",
})
minetest.register_tool("rangedweapons:ak47_rr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:ak47_rrr",
load_sound = "rangedweapons_rifle_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_ak47.png",
})
minetest.register_tool("rangedweapons:ak47_rrr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:ak47",
load_sound = "rangedweapons_rifle_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_ak47.png",
})
minetest.register_tool("rangedweapons:ak47", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "" ..core.colorize("#35cdff","AK-47\n") ..core.colorize("#FFFFFF", "Gun damage: 7\n") ..core.colorize("#FFFFFF", "accuracy: 77%\n") ..core.colorize("#FFFFFF", "Gun knockback: 5\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 12%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.9x\n") ..core.colorize("#FFFFFF", "Reload delay: 1.4\n") ..core.colorize("#FFFFFF", "Clip size: 30\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.10(full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: assault rifle\n") ..core.colorize("#FFFFFF", "Block penetration: 5%\n")
..core.colorize("#FFFFFF", "Enemy penetration: 15%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 40"),
range = 0,
inventory_image = "rangedweapons_ak47.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=7,knockback=5},
gun_crit = 12,
gun_critEffc = 2.9,
suitable_ammo = {{"rangedweapons:762mm",30}},
gun_skill = {"arifle_skill",50},
gun_magazine = "rangedweapons:assaultrifle_mag",
gun_icon = "rangedweapons_ak47_icon.png",
gun_unloaded = "rangedweapons:ak47_r",
gun_velocity = 40,
gun_accuracy = 77,
gun_cooldown = 0.1,
gun_reload = 1.4/4,
gun_projectiles = 1,
has_shell = 1,
gun_gravity = 0,
gun_durability = 1200,
gun_smokeSize = 5,
gun_mob_penetration = 15,
gun_node_penetration = 5,
gun_unload_sound = "rangedweapons_rifle_clip_out",
gun_sound = "rangedweapons_ak",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
inventory_image = "rangedweapons_ak47.png",
})

778
mods/rangedweapons/ammo.lua Normal file
View File

@ -0,0 +1,778 @@
forbidden_ents = {
"",
}
minetest.register_alias("rangedweapons:726mm", "rangedweapons:762mm")
bullet_particles = bullet_particles or "rangedweapons_bullet_fly.png"
minetest.register_craftitem("rangedweapons:shot_bullet_visual", {
wield_scale = {x=1.0,y=1.0,z=1.0},
inventory_image = "rangedweapons_bulletshot.png",
})
local rangedweapons_shot_bullet = {
timer = 0,
initial_properties = {
physical = true,
hp_max = 420,
glow = 100,
visual = "wielditem",
visual_size = {x=0.75, y=0.75},
textures = {"rangedweapons:shot_bullet_visual"},
lastpos = {},
collide_with_objects = false,
collisionbox = {-0.0025, -0.0025, -0.0025, 0.0025, 0.0025, 0.0025},
},
}
rangedweapons_shot_bullet.on_step = function(self, dtime, moveresult)
----------------------------------------
---------------------------------------
if self.owner == nil then
self.object:remove()
end
local sparks = self.sparks or 0
local ignite = self.ignite or 0
local size = self.size or 0.0025
local SBP = self.bullet_particles
if SBP ~= nil then
for i=1,math.random(SBP.amount[1],SBP.amount[2]) do
minetest.add_particle({
pos = {x=self.object:get_pos().x+(math.random(-SBP.pos_randomness,SBP.pos_randomness)/100),y=self.object:get_pos().y+(math.random(-SBP.pos_randomness,SBP.pos_randomness)/100),z=self.object:get_pos().z+(math.random(-SBP.pos_randomness,SBP.pos_randomness)/100)},
velocity = {x=math.random(-SBP.velocity.x,SBP.velocity.x), y=math.random(-SBP.velocity.y,SBP.velocity.y), z=math.random(-SBP.velocity.z,SBP.velocity.z)},
acceleration = {x=math.random(-SBP.acceleration.x,SBP.acceleration.x), y=math.random(-SBP.acceleration.y,SBP.acceleration.y)-SBP.gravity, z=math.random(-SBP.acceleration.z,SBP.acceleration.z)},
expirationtime = SBP.lifetime,
size = math.random(SBP.minsize,SBP.maxsize)/10,
collisiondetection = SBP.collisiondetection,
vertical = false,
texture = SBP.texture,
animation = {type="vertical_frames", aspect_w=8, aspect_h=8, length = SBP.lifetime+0.1,},
glow = SBP.glow,
})
end end
self.timer = self.timer + dtime
if self.timer > 0.06 then
self.object:set_properties({collide_with_objects = true})
self.object:set_properties({collisionbox = {-size, -size, -size, size, size, size}})
end
if self.timer > 10 then
self.object:remove()
end
if moveresult.collides == true then
if moveresult.collisions[1] ~= nil then
local mobPen = self.mobPen or 0
local nodePen = self.nodePen or 0
local door_break = self.door_break or 0
local glass_break = self.glass_break or 0
if moveresult.collisions[1].type == "node" then
minetest.check_for_falling(moveresult.collisions[1].node_pos)
if minetest.registered_nodes[minetest.get_node(moveresult.collisions[1].node_pos).name] and
minetest.registered_nodes[minetest.get_node(moveresult.collisions[1].node_pos).name].tiles and
minetest.registered_nodes[minetest.get_node(moveresult.collisions[1].node_pos).name].tiles[1]
then
local hit_texture = minetest.registered_nodes[minetest.get_node(moveresult.collisions[1].node_pos).name].tiles[1]
if hit_texture.name ~= nil then
hit_texture = hit_texture.name
end
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=0, y=0, z=0},
acceleration = {x=0, y=0, z=0},
expirationtime = 30,
size = math.random(10,20)/10,
collisiondetection = false,
vertical = false,
texture = "rangedweapons_bullethole.png",
glow = 0,
})
for i=1,math.random(4,8) do
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=math.random(-3.0,3.0), y=math.random(2.0,5.0), z=math.random(-3.0,3.0)},
acceleration = {x=math.random(-3.0,3.0), y=math.random(-10.0,-15.0), z=math.random(-3.0,3.0)},
expirationtime = 0.5,
size = math.random(10,20)/10,
collisiondetection = true,
vertical = false,
texture = ""..hit_texture.."^[resize:4x4".."",
glow = 0,
})
end
end
minetest.sound_play("default_dig_cracky", {self.object:get_pos(), gain = 1.0})
if ignite > 0 then
if minetest.get_node(moveresult.collisions[1].node_pos).name == "rangedweapons:barrel" then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "air"})
tnt.boom(moveresult.collisions[1].node_pos, {radius = 3})
end
if minetest.get_node(moveresult.collisions[1].node_pos).name == "tnt:tnt" then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "tnt:tnt_burning"})
minetest.sound_play("tnt_ignite", {moveresult.collisions[1].node_pos}, true)
minetest.get_node_timer(moveresult.collisions[1].node_pos):start(3)
minetest.check_for_falling(moveresult.collisions[1].node_pos)
end
end
if rweapons_door_breaking == "true" and door_break > 0 then
if string.find(minetest.get_node(moveresult.collisions[1].node_pos).name,"door_wood") then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "air"})
minetest.add_item(moveresult.collisions[1].node_pos, "default:wood 5")
minetest.sound_play("rangedweapons_woodbreak",{moveresult.collisions[1].node_pos})
end end
if rweapons_glass_breaking == "true" and glass_break > 0 then
local nodeName = minetest.get_node(moveresult.collisions[1].node_pos).name
if nodeName == "default:glass" then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "rangedweapons:broken_glass"})
minetest.sound_play("glass_break",{moveresult.collisions[1].node_pos})
end
if nodeName == "xpanes:pane" or
nodeName == "xpanes:pane_flat" then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "air"})
minetest.add_item(moveresult.collisions[1].node_pos, "rangedweapons:glass_shards")
minetest.sound_play("glass_break",{moveresult.collisions[1].node_pos})
end
if string.find(nodeName,"door_glass") then
minetest.swap_node(moveresult.collisions[1].node_pos, {name = "air"})
minetest.add_item(moveresult.collisions[1].node_pos, "vessels:glass_fragments 5")
minetest.sound_play("glass_break",{moveresult.collisions[1].node_pos})
end
end
if minetest.get_item_group(minetest.get_node(moveresult.collisions[1].node_pos).name, "level") > 1 then
self.object:set_velocity(moveresult.collisions[1].old_velocity)
if sparks > 0 then
make_sparks(self.object:get_pos())
end
local objVel = moveresult.collisions[1].old_velocity
local objRot = self.object:get_rotation()
if objRot and objVel then
if moveresult.collisions[1].axis == "x" then
self.object:set_rotation({x=0,y=objRot.y,z=objRot.z+3})
self.object:set_velocity({x=objVel.x*-1,y=objVel.y,z=objVel.z})
end
if moveresult.collisions[1].axis == "z" then
self.object:set_rotation({x=0,y=objRot.y,z=objRot.z+3})
self.object:set_velocity({x=objVel.x,y=objVel.y,z=objVel.z*-1})
end
if moveresult.collisions[1].axis == "y" then
self.object:set_rotation({x=0,y=objRot.y+3,z=objRot.z+3})
self.object:set_velocity({x=objVel.x,y=objVel.y*-1,z=objVel.z})
end end
else
if math.random(1,100) <= nodePen then
for i=1,10 do
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=1.5, y=1.5, z=1.5} ,
acceleration = {x=math.random(-3.0,3.0), y=math.random(-4.0,4.0), z=math.random(-3.0,3.0)},
expirationtime = 1.25,
size = math.random(3,6),
collisiondetection = false,
vertical = false,
texture = "tnt_smoke.png",
glow = 2,
})
end
minetest.sound_play("default_dig_cracky", {self.object:get_pos(), gain = 1.0})
self.object:set_properties({collisionbox = {0,0,0,0,0,0}})
--minetest.chat_send_all("hit")
self.object:set_velocity(moveresult.collisions[1].old_velocity)
else
if minetest.get_item_group(minetest.get_node(moveresult.collisions[1].node_pos).name, "leaves") > 0 then
minetest.sound_play("default_dig_snappy", {self.object:get_pos(), gain = 1.5})
for i = 1,math.random(3,6) do
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=math.random(-2,2), y=math.random(3,6), z=math.random(-2,2)},
acceleration = {x=math.random(-2,2), y=math.random(-3,-6), z=math.random(-2,2)},
expirationtime = math.random(2,4),
size = math.random(6,9),
collisiondetection = true,
collision_removal = false,
vertical = false,
texture = "rangedweapons_leaf.png",
animation = {type="vertical_frames", aspect_w=8, aspect_h=8, length = 0.8,},
glow = 15,
})
end
self.object:set_properties({collisionbox = {0,0,0,0,0,0}})
self.object:set_velocity(moveresult.collisions[1].old_velocity)
else
if self.OnCollision ~= nil then
self.OnCollision(self.owner,self,moveresult.collisions[1])
end
self.object:remove()
end
end
end
end
if moveresult.collisions[1].type == "object" then
local actualDamage = self.damage or {fleshy=1}
local damage = {}
local crit = self.crit or 0
local critEffc = self.critEffc or 1
local owner = minetest.get_player_by_name(self.owner)
local hit_texture = "rangedweapons_hit.png"
local dps = self.dps or 0
local skill = self.skill_value or 1
for _, dmg in pairs(actualDamage) do
damage[_] = actualDamage[_]
end
if moveresult.collisions[1].object:is_player() then
for _, player_dmg in pairs(damage) do
damage[_] = damage[_] * rweapons_player_dmg_multiplier
end
if self.object:get_pos().y - moveresult.collisions[1].object:get_pos().y > 1.5 then
for _, hs_dmg in pairs(damage) do
damage[_] = damage[_] * rweapons_headshot_dmg_multiplier
end
end
knockback = damage.knockback or 0
projectile_kb(moveresult.collisions[1].object,self.object,knockback)
else
for _, mob_dmg in pairs(damage) do
damage[_] = damage[_] * rweapons_mob_dmg_multiplier
end
end
for _, bonus_dmg in pairs(damage) do
damage[_] = (damage[_]*skill) + (self.dps*self.timer)
end
--minetest.chat_send_all(critEffc)
if math.random(1,100) <= crit+((skill*10)-10) then
for _, critDmg in pairs(damage) do
damage[_] = damage[_] * critEffc
end
entpos = self.object:get_pos()
minetest.add_particle ({
pos = entpos, velocity = 0, acceleration = {x=0, y=5, z=0},
expirationtime = 0.75, size = 12, collisiondetection = false,
vertical = false, texture = "rangedweapons_crit.png", glow = 30,})
hit_texture = "rangedweapons_crithit.png"
end
moveresult.collisions[1].object:punch(owner, 1.0, {
full_punch_interval = 1.0,
damage_groups = damage,}, nil)
owner:hud_change(hit, "text", hit_texture)
for i=1,math.random(math.ceil(rweapons_bloodyness*0.66),math.ceil(rweapons_bloodyness*1.5)) do
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=math.random(-15.0,15.0)/10, y=math.random(2.0,5.0), z=math.random(-15.0,15.0)/10},
acceleration = {x=math.random(-3.0,3.0), y=math.random(-10.0,-15.0), z=math.random(-3.0,3.0)},
expirationtime = 0.75,
size = math.random(10,20)/10,
collisiondetection = true,
vertical = false,
texture = "rangedweapons_blood.png",
animation = {type="vertical_frames", aspect_w=8, aspect_h=8, length = 0.8,},
glow = 0,
})
end
if math.random(1,100) <= mobPen then
for i=1,10 do
minetest.add_particle({
pos = self.object:get_pos(),
velocity = {x=1.5, y=1.5, z=1.5} ,
acceleration = {x=math.random(-3.0,3.0), y=math.random(-4.0,4.0), z=math.random(-3.0,3.0)},
expirationtime = 1.25,
size = math.random(3,6),
collisiondetection = false,
vertical = false,
texture = "tnt_smoke.png",
glow = 2,
})
end
minetest.sound_play("default_dig_cracky", {self.object:get_pos(), gain = 1.0})
self.object:set_properties({collisionbox = {0,0,0,0,0,0}})
self.object:set_velocity(moveresult.collisions[1].old_velocity)
else
if self.OnCollision ~= nil then
self.OnCollision(self.owner,self,moveresult.collisions[1])
end
self.object:remove()
end
end
else
self.object:remove()
end
end
end
minetest.register_entity("rangedweapons:shot_bullet", rangedweapons_shot_bullet)
---
--- actual mags
---
---
--- visual drop mags
---
minetest.register_craftitem("rangedweapons:drum_mag", {
wield_scale = {x=1.0,y=1.0,z=1.5},
inventory_image = "rangedweapons_drum_mag.png",
})
minetest.register_craftitem("rangedweapons:handgun_mag_black", {
wield_scale = {x=0.6,y=0.6,z=0.8},
inventory_image = "rangedweapons_magazine_handgun.png",
})
local rangedweapons_mag = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x=0.3, y=0.3},
textures = {"rangedweapons:handgun_mag_black"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_mag.on_step = function(self, dtime, pos)
self.timer = self.timer + dtime
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
if self.lastpos.y ~= nil then
if minetest.registered_nodes[node.name] ~= nil then
if minetest.registered_nodes[node.name].walkable then
local vel = self.object:get_velocity()
local acc = self.object:get_acceleration()
self.object:set_velocity({x=0, y=0, z=0})
self.object:set_acceleration({x=0, y=0, z=0})
end end
end
if self.timer > 2.0 then
self.object:remove()
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:mag", rangedweapons_mag)
minetest.register_craftitem("rangedweapons:handgun_mag_white", {
wield_scale = {x=0.6,y=0.6,z=0.8},
inventory_image = "rangedweapons_handgun_mag_white.png",
})
minetest.register_craftitem("rangedweapons:machinepistol_mag", {
wield_scale = {x=0.6,y=0.6,z=0.8},
inventory_image = "rangedweapons_machinepistol_mag.png",
})
minetest.register_craftitem("rangedweapons:assaultrifle_mag", {
wield_scale = {x=0.6,y=0.6,z=0.8},
inventory_image = "rangedweapons_assaultrifle_mag.png",
})
minetest.register_craftitem("rangedweapons:rifle_mag", {
wield_scale = {x=0.6,y=0.6,z=0.8},
inventory_image = "rangedweapons_rifle_mag.png",
})
minetest.register_craftitem("rangedweapons:9mm", {
stack_max= 500,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff","9x19mm Parabellum\n")..core.colorize("#FFFFFF", "Bullet damage: 1 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.25 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 1% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 25 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 1 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_9mm.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=1,knockback=1},
ammo_critEffc = 0.25,
ammo_crit = 1,
ammo_velocity = 25,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
}
})
minetest.register_craftitem("rangedweapons:45acp", {
stack_max= 450,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff",".45ACP catridge\n")..core.colorize("#FFFFFF", "Bullet damage: 2 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.50 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 2% \n")
..core.colorize("#FFFFFF", "Bullet velocity: 20 \n")
..core.colorize("#FFFFFF", "Bullet knockback: 2 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_45acp.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=2,knockback=1},
ammo_critEffc = 0.50,
ammo_crit = 1,
ammo_velocity = 20,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:10mm", {
stack_max= 400,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff","10mm Auto\n")..core.colorize("#FFFFFF", "Bullet damage: 2 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency:0.30 \n") ..core.colorize("#FFFFFF", "Bullet velocity: 25 \n")
..core.colorize("#FFFFFF", "Bullet knockback: 1 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 1% \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_10mm.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=2,knockback=1},
ammo_critEffc = 0.3,
ammo_crit = 1,
ammo_velocity = 25,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shell_whitedrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
}
})
minetest.register_craftitem("rangedweapons:357", {
stack_max= 150,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff",".357 magnum round\n")..core.colorize("#FFFFFF", "Bullet damage: 4 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.6 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 3% \n") ..core.colorize("#FFFFFF", "Bullet knockback: 5 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 5%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 45 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_357.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=4,knockback=5},
ammo_critEffc = 0.6,
ammo_crit = 3,
ammo_velocity = 45,
ammo_glass_breaking = 1,
ammo_mob_penetration = 5,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
}
})
minetest.register_craftitem("rangedweapons:50ae", {
stack_max= 100,
wield_scale = {x=0.6,y=0.6,z=1.5},
description = "" ..core.colorize("#35cdff",".50AE catridge\n")..core.colorize("#FFFFFF", "Bullet damage: 8 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.9 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 6% \n") ..core.colorize("#FFFFFF", "Bullet knockback: 10 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 15%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 55 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_50ae.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=8,knockback=10},
ammo_critEffc = 0.9,
ammo_crit = 6,
ammo_velocity = 55,
ammo_glass_breaking = 1,
ammo_mob_penetration = 15,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
}
})
minetest.register_craftitem("rangedweapons:44", {
stack_max= 150,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff",".44 magnum round\n")..core.colorize("#FFFFFF", "Bullet damage: 4 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.7 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 4% \n") ..core.colorize("#FFFFFF", "Bullet knockback: 6 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 6%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 50 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_44.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=4,knockback=6},
ammo_critEffc = 0.7,
ammo_crit = 4,
ammo_velocity = 50,
ammo_glass_breaking = 1,
ammo_mob_penetration = 6,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
}
})
minetest.register_craftitem("rangedweapons:762mm", {
stack_max= 250,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff","7.62mm round\n")..core.colorize("#FFFFFF", "Bullet damage: 4 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.5 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 2% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 40 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 4 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 5%\n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_762mm.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=4,knockback=4},
ammo_critEffc = 0.5,
ammo_crit = 2,
ammo_velocity = 40,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_mob_penetration = 5,
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:556mm", {
stack_max= 300,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff","5.56mm round\n")..core.colorize("#FFFFFF", "Bullet damage: 3 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.4 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 2% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 35 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 3 \n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_556mm.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=3,knockback=3},
ammo_critEffc = 0.4,
ammo_crit = 2,
ammo_velocity = 35,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_projectile_size = 0.0025,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:shell", {
stack_max= 50,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff","12 Gauge shell\n")..core.colorize("#FFFFFF", "Bullet damage: 2 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.15 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 1% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 20 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 4 \n") ..core.colorize("#FFFFFF", "Bullet gravity: 5 \n") ..core.colorize("#FFFFFF", "Bullet projectile multiplier: 1.5x\n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_shell.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=2,knockback=4},
ammo_projectile_multiplier = 1.5,
ammo_critEffc = 0.15,
ammo_crit = 1,
ammo_velocity = 20,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "sprite",
ammo_texture = "rangedweapons_buckball.png",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shell_shotgundrop",
ammo_gravity = 5,
ammo_projectile_size = 0.00175,
ammo_projectile_glow = 0,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:308winchester", {
stack_max= 75,
wield_scale = {x=0.4,y=0.4,z=1.2},
description = "" ..core.colorize("#35cdff",".308 winchester round\n")..core.colorize("#FFFFFF", "Bullet damage: 8 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.75 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 4% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 60 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 10 \n") ..core.colorize("#FFFFFF", "Damage gain over 1 sec of flight time: 40 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 20%\n") ..core.colorize("#FFFFFF", "Bullet node Penetration: 10%\n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_308winchester.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=8,knockback=10},
ammo_critEffc = 0.75,
ammo_crit = 2,
ammo_velocity = 60,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_mob_penetration = 20,
ammo_node_penetration = 10,
ammo_projectile_size = 0.0025,
ammo_dps = 40,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:408cheytac", {
stack_max= 40,
wield_scale = {x=0.65,y=0.65,z=1.5},
description = "" ..core.colorize("#35cdff",".408 chey tac\n")..core.colorize("#FFFFFF", "Bullet damage: 10 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 0.8 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 5% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 70 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 15 \n") ..core.colorize("#FFFFFF", "Damage gain over 1 sec of flight time: 80 \n") ..core.colorize("#FFFFFF", "Bullet enemy Penetration: 45%\n") ..core.colorize("#FFFFFF", "Bullet node Penetration: 20%\n") ..core.colorize("#FFFFFF", "Ammunition for some guns"),
inventory_image = "rangedweapons_408cheytac.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=10,knockback=15},
ammo_critEffc = 0.8,
ammo_crit = 5,
ammo_velocity = 70,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "wielditem",
ammo_texture = "rangedweapons:shot_bullet_visual",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shelldrop",
ammo_mob_penetration = 45,
ammo_node_penetration = 20,
ammo_projectile_size = 0.0025,
ammo_dps = 80,
has_sparks = 1,
ignites_explosives = 1,
},
})
minetest.register_craftitem("rangedweapons:40mm", {
stack_max= 25,
wield_scale = {x=0.8,y=0.8,z=2.4},
description = "" ..core.colorize("#35cdff",".40mm grenade\n")..core.colorize("#FFFFFF", "Bullet damage: 10 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 1.0 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 1% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 15 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 10 \n") ..core.colorize("#FFFFFF", "Bullet gravity: 5 \n") ..core.colorize("#FFFFFF", "explodes on impact with a radius of 2\n") ..core.colorize("#FFFFFF", "Ammunition for grenade launchers"),
inventory_image = "rangedweapons_40mm.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=10,knockback=15},
ammo_critEffc = 1.0,
ammo_crit = 1,
ammo_velocity = 15,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "sprite",
ammo_texture = "rangedweapons_rocket_fly.png",
shell_entity = "rangedweapons:empty_shell",
shell_visual = "wielditem",
shell_texture = "rangedweapons:shell_grenadedrop",
ammo_projectile_size = 0.15,
has_sparks = 1,
ammo_gravity = 5,
ignites_explosives = 1,
OnCollision = function(player,bullet,target)
tnt.boom(bullet.object:get_pos(), {radius = 2})
end,
ammo_particles = {
velocity = {x=1,y=1,z=1},
acceleration = {x=1,y=1,z=1},
collisiondetection = true,
lifetime = 1,
texture = "tnt_smoke.png",
minsize = 50,
maxsize = 75,
pos_randomness = 50,
glow = 20,
gravity = 10,
amount = {1,1}
},
},
})
minetest.register_craftitem("rangedweapons:rocket", {
stack_max= 15,
wield_scale = {x=1.2,y=1.2,z=2.4},
description = "" ..core.colorize("#35cdff","rocket\n")..core.colorize("#FFFFFF", "Bullet damage: 15 \n") ..core.colorize("#FFFFFF", "Bullet crit efficiency: 1.0 \n") ..core.colorize("#FFFFFF", "Bullet crit chance: 1% \n") ..core.colorize("#FFFFFF", "Bullet velocity: 20 \n") ..core.colorize("#FFFFFF", "Bullet knockback: 20 \n") ..core.colorize("#FFFFFF", "Bullet gravity: 5 \n") ..core.colorize("#FFFFFF", "explodes on impact with a radius of 3\n") ..core.colorize("#FFFFFF", "Ammunition for rocket launchers"),
inventory_image = "rangedweapons_rocket.png",
RW_ammo_capabilities = {
ammo_damage = {fleshy=15,knockback=20},
ammo_critEffc = 1.0,
ammo_crit = 1,
ammo_velocity = 20,
ammo_glass_breaking = 1,
ammo_entity = "rangedweapons:shot_bullet",
ammo_visual = "sprite",
ammo_texture = "rangedweapons_rocket_fly.png",
ammo_projectile_size = 0.15,
has_sparks = 1,
ignites_explosives = 1,
OnCollision = function(player,bullet,target)
tnt.boom(bullet.object:get_pos() , {radius = 3})
end,
ammo_particles = {
velocity = {x=1,y=1,z=1},
acceleration = {x=1,y=1,z=1},
collisiondetection = true,
lifetime = 1,
texture = "tnt_smoke.png",
minsize = 50,
maxsize = 75,
pos_randomness = 50,
glow = 20,
gravity = 10,
amount = {1,1}
},
},
})

102
mods/rangedweapons/awp.lua Normal file
View File

@ -0,0 +1,102 @@
minetest.register_tool("rangedweapons:awp_uld", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.1},
range = 0,
description = "" ..core.colorize("#35cdff","A.W.P. \n") ..core.colorize("#FFFFFF", "Ranged damage:18 + 35/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 15\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round/308.Winchester rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 12x\n") ..core.colorize("#be0d00", "Right-click to eject empty bullet shell\n") ..core.colorize("#FFFFFF", "Clip size: 10/10\n") ..core.colorize("#FFFFFF", "Enemy penetration:30%\n") ..core.colorize("#FFFFFF", "Block penetration:10%\n") ..core.colorize("#FFFFFF", "Gun type: Rifle\n") ..core.colorize("#FFFFFF", "Bullet velocity: 75"),
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_awp.png",
weapon_zoom = 7.5,
on_use = function(user)
minetest.sound_play("rangedweapons_empty", {user})
end,
on_secondary_use = function(itemstack, user, pointed_thing)
eject_shell(itemstack,user,"rangedweapons:awp_rld",1.0,"rangedweapons_rifle_reload_a","rangedweapons:empty_shell")
return itemstack
end,
})
minetest.register_tool("rangedweapons:awp_r", {
rw_next_reload = "rangedweapons:awp_rr",
load_sound = "rangedweapons_rifle_clip_in",
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_awp_noclip.png",
})
minetest.register_tool("rangedweapons:awp_rr", {
rw_next_reload = "rangedweapons:awp_rrr",
load_sound = "rangedweapons_rifle_reload_a",
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_awp.png",
})
minetest.register_tool("rangedweapons:awp_rrr", {
rw_next_reload = "rangedweapons:awp",
load_sound = "rangedweapons_rifle_reload_b",
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_awp_rld.png",
})
minetest.register_tool("rangedweapons:awp_rld", {
stack_max= 1,
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
loaded_gun = "rangedweapons:awp",
loaded_sound = "rangedweapons_rifle_reload_b",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_awp_rld.png",
})
minetest.register_tool("rangedweapons:awp", {
description = "" ..core.colorize("#35cdff","A.W.P. \n") ..core.colorize("#FFFFFF", "Ranged damage:18 + 35/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 15\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round/308.Winchester rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 12x\n") ..core.colorize("#27a600", "The gun is loaded!\n") ..core.colorize("#FFFFFF", "Clip size: 10/10\n") ..core.colorize("#FFFFFF", "Enemy penetration:30%\n") ..core.colorize("#FFFFFF", "Block penetration:10%\n") ..core.colorize("#FFFFFF", "Gun type: Rifle\n") ..core.colorize("#FFFFFF", "Bullet velocity: 75"),
range = 0,
weapon_zoom = 7.5,
wield_scale = {x=1.9,y=1.9,z=1.1},
inventory_image = "rangedweapons_awp.png",
RW_gun_capabilities = {
gun_damage = {fleshy=18,knockback=15},
gun_crit = 30,
gun_critEffc = 3.0,
suitable_ammo = {{"rangedweapons:762mm",10},{"rangedweapons:308winchester",10}},
gun_skill = {"rifle_skill",20},
gun_magazine = "rangedweapons:rifle_mag",
gun_icon = "rangedweapons_awp_icon.png",
gun_unloaded = "rangedweapons:awp_r",
gun_cooling = "rangedweapons:awp_uld",
gun_velocity = 75,
gun_accuracy = 100,
gun_cooldown = 1.0,
gun_reload = 2.0/4,
gun_projectiles = 1,
has_shell = 0,
gun_durability = 700,
gun_smokeSize = 8,
gun_dps = 35,
gun_mob_penetration = 30,
gun_node_penetration = 10,
gun_unload_sound = "rangedweapons_rifle_clip_out",
gun_sound = "rangedweapons_rifle_b",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,63 @@
minetest.register_tool("rangedweapons:benelli_rld", {
stack_max= 1,
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
loaded_gun = "rangedweapons:benelli",
loaded_sound = "rangedweapons_shotgun_reload_b",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_benelli_rld.png",
})
minetest.register_tool("rangedweapons:benelli", {
description = "" ..core.colorize("#35cdff","benelli m3\n") ..core.colorize("#FFFFFF", "Ranged damage: 2\n") ..core.colorize("#FFFFFF", "projectiles: 5\n") ..core.colorize("#FFFFFF", "Gun gravity: 4\n") ..core.colorize("#FFFFFF", "Accuracy: 48%\n")..core.colorize("#FFFFFF", "knockback: 6\n") ..core.colorize("#FFFFFF", "Critical chance: 6%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.0x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shells\n") ..core.colorize("#FFFFFF", "Pump delay: 0.6\n")..core.colorize("#FFFFFF", "Clip size: 7\n") ..core.colorize("#27a600", "Gun is ready to fire!\n") ..core.colorize("#fff21c", "Right-click to load in a bullet!\n") ..core.colorize("#FFFFFF", "Gun type: shotgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 26"),
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
inventory_image = "rangedweapons_benelli.png",
RW_gun_capabilities = {
gun_damage = {fleshy=2,knockback=6},
gun_crit = 6,
gun_critEffc = 2.0,
suitable_ammo = {{"rangedweapons:shell",7}},
gun_skill = {"shotgun_skill",20},
gun_icon = "rangedweapons_benelli_icon.png",
gun_unloaded = "rangedweapons:benelli_rld",
gun_cooling = "rangedweapons:benelli_uld",
gun_velocity = 25,
gun_accuracy = 48,
gun_cooldown = 0.6,
gun_gravity = 4,
gun_reload = 0.25,
gun_projectiles = 5,
has_shell = 0,
gun_durability = 325,
gun_smokeSize = 14,
gun_door_breaking = 1,
gun_sound = "rangedweapons_shotgun_shot",
gun_unload_sound = "rangedweapons_shell_insert",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_single_load_gun(itemstack, user, "")
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})
minetest.register_tool("rangedweapons:benelli_uld", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.1},
range = 0,
description = "" ..core.colorize("#35cdff","benelli m3\n") ..core.colorize("#FFFFFF", "Ranged damage: 2\n") ..core.colorize("#FFFFFF", "projectiles: 5\n") ..core.colorize("#FFFFFF", "Gun gravity: 4\n") ..core.colorize("#FFFFFF", "Accuracy: 48%\n")..core.colorize("#FFFFFF", "knockback: 6\n") ..core.colorize("#FFFFFF", "Critical chance: 6%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.0x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shells\n") ..core.colorize("#FFFFFF", "Pump delay: 0.6\n")..core.colorize("#FFFFFF", "Clip size: 7\n") ..core.colorize("#be0d00", "Right-click, to eject the empty shell!\n") ..core.colorize("#fff21c", "Right-click to load in a bullet!\n") ..core.colorize("#FFFFFF", "Gun type: shotgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
inventory_image = "rangedweapons_benelli.png",
groups = {not_in_creative_inventory = 1},
on_use = function(user)
minetest.sound_play("rangedweapons_empty", {user})
end,
on_secondary_use = function(itemstack, user, pointed_thing)
eject_shell(itemstack,user,"rangedweapons:benelli_rld",0.6,"rangedweapons_shotgun_reload_a","rangedweapons:empty_shell")
return itemstack
end,
})

View File

@ -0,0 +1,58 @@
minetest.register_tool("rangedweapons:beretta_rld", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
range = 0,
loaded_gun = "rangedweapons:beretta",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_beretta_rld.png",
})
minetest.register_tool("rangedweapons:beretta_r", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
rw_next_reload = "rangedweapons:beretta",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_beretta_rld.png",
})
minetest.register_tool("rangedweapons:beretta", {
description = "" ..core.colorize("#35cdff","Beretta M9\n") ..core.colorize("#FFFFFF", "Gun damage: 4\n")..core.colorize("#FFFFFF", "Accuracy: 94%\n") ..core.colorize("#FFFFFF", "gun knockback: 4\n") ..core.colorize("#FFFFFF", "Gun crit chance: 13%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Reload delay: 0.5\n")..core.colorize("#FFFFFF", "Clip size: 15\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm Parabellum\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.4\n") ..core.colorize("#FFFFFF", "Gun type: Handgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
wield_scale = {x=1.1,y=1.1,z=1.05},
range = 0,
inventory_image = "rangedweapons_beretta.png",
RW_gun_capabilities = {
gun_damage = {fleshy=4,knockback=4},
gun_crit = 15,
gun_critEffc = 2.1,
suitable_ammo = {{"rangedweapons:9mm",15}},
gun_skill = {"handgun_skill",43},
gun_magazine = "rangedweapons:handgun_mag_black",
gun_icon = "rangedweapons_beretta_icon.png",
gun_unloaded = "rangedweapons:beretta_r",
gun_cooling = "rangedweapons:beretta_rld",
gun_velocity = 25,
gun_accuracy = 94,
gun_cooldown = 0.4,
gun_reload = 0.5,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 1150,
gun_smokeSize = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_beretta",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,15 @@
function projectile_kb(victim,projectile,kbamount)
if victim:get_pos() and projectile:get_pos() then
rw_proj_kb_pos_x = victim:get_pos().x - projectile:get_pos().x
rw_proj_kb_pos_y = victim:get_pos().y - projectile:get_pos().y
rw_proj_kb_pos_z = victim:get_pos().z - projectile:get_pos().z
else
rw_proj_kb_pos_x = 1
rw_proj_kb_pos_y = 1
rw_proj_kb_pos_z = 1
end
victim:add_player_velocity({x=kbamount*(rw_proj_kb_pos_x*2),y= kbamount*(math.abs(rw_proj_kb_pos_y)/2), z=kbamount*(rw_proj_kb_pos_z*2)})
end

View File

@ -0,0 +1,102 @@
minetest.register_globalstep(function(dtime, player)
for _, player in pairs(minetest.get_connected_players()) do
local w_item = player:get_wielded_item()
local controls = player:get_player_control()
if w_item:get_definition().weapon_zoom ~= nil then
if controls.zoom then
player:hud_change(scope_hud, "text", "rangedweapons_scopehud.png")
else
player:hud_change(scope_hud, "text", "rangedweapons_empty_icon.png")
end
local wpn_zoom = w_item:get_definition().weapon_zoom
if player:get_properties().zoom_fov ~= wpn_zoom then
player:set_properties({zoom_fov = wpn_zoom})
end
end
if w_item:get_definition().weapon_zoom == nil then
player:hud_change(scope_hud, "text", "rangedweapons_empty_icon.png")
if player:get_inventory():contains_item(
"main", "binoculars:binoculars") then
new_zoom_fov = 10
if player:get_properties().zoom_fov ~= new_zoom_fov then
player:set_properties({zoom_fov = new_zoom_fov})
end
else
new_zoom_fov = 0
if player:get_properties().zoom_fov ~= new_zoom_fov then
player:set_properties({zoom_fov = new_zoom_fov})
end
end
end
local u_meta = player:get_meta()
local cool_down = u_meta:get_float("rw_cooldown") or 0
if u_meta:get_float("rw_cooldown") > 0 then
u_meta:set_float("rw_cooldown", cool_down - dtime)
end
local itemstack = player:get_wielded_item()
if controls.LMB then
if player:get_wielded_item():get_definition().RW_gun_capabilities then
if
player:get_wielded_item():get_definition().RW_gun_capabilities.automatic_gun and player:get_wielded_item():get_definition().RW_gun_capabilities.automatic_gun > 0 then
rangedweapons_shoot_gun(itemstack, player)
player:set_wielded_item(itemstack)
end end
if player:get_wielded_item():get_definition().RW_powergun_capabilities then
if player:get_wielded_item():get_definition().RW_powergun_capabilities.automatic_gun and player:get_wielded_item():get_definition().RW_powergun_capabilities.automatic_gun > 0 then
rangedweapons_shoot_powergun(itemstack, player)
player:set_wielded_item(itemstack)
end end
end
--minetest.chat_send_all(u_meta:get_float("rw_cooldown"))
if u_meta:get_float("rw_cooldown") <= 0 then
if player:get_wielded_item():get_definition().loaded_gun ~= nil then
local itemstack = player:get_wielded_item()
if player:get_wielded_item():get_definition().loaded_sound ~= nil then
minetest.sound_play(itemstack:get_definition().loaded_sound, {player})
end
itemstack:set_name(player:get_wielded_item():get_definition().loaded_gun)
player:set_wielded_item(itemstack)
end
if player:get_wielded_item():get_definition().rw_next_reload ~= nil then
local itemstack = player:get_wielded_item()
if itemstack:get_definition().load_sound ~= nil then
minetest.sound_play(itemstack:get_definition().load_sound, {player})
end
gunMeta = itemstack:get_meta()
u_meta:set_float("rw_cooldown",gunMeta:get_float("RW_reload_delay"))
itemstack:set_name(player:get_wielded_item():get_definition().rw_next_reload)
player:set_wielded_item(itemstack)
end
end
end end)

View File

@ -0,0 +1,121 @@
minetest.register_tool("rangedweapons:deagle_rld", {
stack_max= 1,
wield_scale = {x=1.25,y=1.25,z=1.5},
description = "",
range = 0,
loaded_gun = "rangedweapons:deagle",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_deagle_rld.png",
})
minetest.register_tool("rangedweapons:deagle_r", {
stack_max= 1,
wield_scale = {x=1.25,y=1.25,z=1.5},
description = "",
range = 0,
rw_next_reload = "rangedweapons:deagle",
load_sound = "rangedweapons_handgun_mag_in",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_deagle_rld.png",
})
minetest.register_tool("rangedweapons:deagle", {
description = "" ..core.colorize("#35cdff","Desert Eagle\n")..core.colorize("#FFFFFF", "Ranged damage: 11\n") ..core.colorize("#FFFFFF", "Accuracy: 85%\n") ..core.colorize("#FFFFFF", "knockback: 6\n") ..core.colorize("#FFFFFF", "Critical chance: 20%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 3x\n")..core.colorize("#FFFFFF", "Reload delay: 0.6\n")..core.colorize("#FFFFFF", "Clip size: 9/8/7\n") ..core.colorize("#FFFFFF", "Ammunition: .357 Magnum rounds/.44 magnum rounds/.50AE catridges\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.7\n") ..core.colorize("#FFFFFF", "Gun type: Magnum\n") ..core.colorize("#FFFFFF", "Block penetration: 5%\n")
..core.colorize("#FFFFFF", "penetration: 15%\n")..core.colorize("#FFFFFF", "Bullet velocity: 50"),
wield_scale = {x=1.25,y=1.25,z=1.5},
range = 0,
inventory_image = "rangedweapons_deagle.png",
RW_gun_capabilities = {
gun_damage = {fleshy=11,knockback=6},
gun_crit = 20,
gun_critEffc = 2.2,
suitable_ammo = {{"rangedweapons:357",9},{"rangedweapons:44",8},{"rangedweapons:50ae",7}},
gun_skill = {"revolver_skill",40},
gun_magazine = "rangedweapons:handgun_mag_white",
gun_icon = "rangedweapons_deagle_icon.png",
gun_unloaded = "rangedweapons:deagle_r",
gun_cooling = "rangedweapons:deagle_rld",
gun_velocity = 50,
gun_accuracy = 85,
gun_cooldown = 0.7,
gun_reload = 0.6/1,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 900,
gun_smokeSize = 7,
gun_mob_penetration = 15,
gun_node_penetration = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_deagle",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})
minetest.register_tool("rangedweapons:golden_deagle_rld", {
stack_max= 1,
wield_scale = {x=1.25,y=1.25,z=1.5},
description = "",
range = 0,
loaded_gun = "rangedweapons:golden_deagle",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_golden_deagle_rld.png",
})
minetest.register_tool("rangedweapons:golden_deagle_r", {
stack_max= 1,
wield_scale = {x=1.25,y=1.25,z=1.5},
description = "",
range = 0,
rw_next_reload = "rangedweapons:golden_deagle",
load_sound = "rangedweapons_handgun_mag_in",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_golden_deagle_rld.png",
})
minetest.register_tool("rangedweapons:golden_deagle", {
description = "" ..core.colorize("#35cdff","Golden Desert Eagle\n")..core.colorize("#FFFFFF", "Ranged damage: 14\n") ..core.colorize("#FFFFFF", "Accuracy: 90%\n") ..core.colorize("#FFFFFF", "knockback: 6\n") ..core.colorize("#FFFFFF", "Critical chance: 23%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 3x\n")..core.colorize("#FFFFFF", "Reload delay: 0.6\n")..core.colorize("#FFFFFF", "Clip size: 9/8/7\n") ..core.colorize("#FFFFFF", "Ammunition: .357 Magnum rounds/.44 magnum rounds/.50AE catridges\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.75\n") ..core.colorize("#FFFFFF", "Gun type: Magnum\n") ..core.colorize("#FFFFFF", "Block penetration: 5%\n")
..core.colorize("#FFFFFF", "penetration: 15%\n")..core.colorize("#FFFFFF", "Bullet velocity: 50"),
wield_scale = {x=1.25,y=1.25,z=1.5},
range = 0,
inventory_image = "rangedweapons_golden_deagle.png",
RW_gun_capabilities = {
gun_damage = {fleshy=14,knockback=6},
gun_crit = 23,
gun_critEffc = 2.2,
suitable_ammo = {{"rangedweapons:357",9},{"rangedweapons:44",8},{"rangedweapons:50ae",7}},
gun_skill = {"revolver_skill",38},
gun_magazine = "rangedweapons:handgun_mag_white",
gun_icon = "rangedweapons_golden_deagle_icon.png",
gun_unloaded = "rangedweapons:golden_deagle_r",
gun_cooling = "rangedweapons:golden_deagle_rld",
gun_velocity = 50,
gun_accuracy = 90,
gun_cooldown = 0.75,
gun_reload = 0.6/1,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 1000,
gun_smokeSize = 7,
gun_mob_penetration = 15,
gun_node_penetration = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_deagle",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,3 @@

View File

@ -0,0 +1,203 @@
--[[local he_boom = {
name = "rangedweapons:he_explosion",
--description = "DuN mInD mEh...",
radius = 2,
tiles = {
side = "rangedweapons_invisible.png",
top = "rangedweapons_invisible.png",
bottom = "rangedweapons_invisible.png",
burning = "rangedweapons_invisible.png"
},
}
tnt.register_tnt(he_boom)
local rocket_boom = {
name = "rangedweapons:rocket_explosion",
--description = "DuN mInD mEh...",
radius = 3,
tiles = {
side = "rangedweapons_invisible.png",
top = "rangedweapons_invisible.png",
bottom = "rangedweapons_invisible.png",
burning = "rangedweapons_invisible.png"
},
}
tnt.register_tnt(rocket_boom)
]]
local rangedweapons_rocket = {
physical = false,
timer = 0,
visual = "sprite",
visual_size = {x=0.0, y=0.0},
textures = {"rangedweapons_invisible.png"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_rocket.on_step = function(self, dtime, pos)
self.timer = self.timer + dtime
local tiem = 0.002
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if self.timer >= 0.002 then
minetest.add_particle({
pos = pos,
velocity = 0,
acceleration = {x=0, y=0, z=0},
expirationtime = 0.04,
size = 7,
collisiondetection = false,
vertical = false,
texture = "rangedweapons_rocket_fly.png",
glow = 15,
})
minetest.add_particle({
pos = pos,
velocity = 0,
acceleration = {x=0, y=6, z=0},
expirationtime = 0.4,
size = 4,
collisiondetection = false,
vertical = false,
texture = "tnt_smoke.png",
glow = 5,
})
tiem = tiem + 0.002
end
if self.timer >= 0.375 then
local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 1.5)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "rangedweapons:rocket" and obj:get_luaentity().name ~= "__builtin:item" then
--tnt.boom(pos, rocket_boom)
self.object:remove()
end
end
end
end
if self.lastpos.x ~= nil then
if minetest.registered_nodes[node.name].walkable then
--tnt.boom(pos, rocket_boom)
self.object:remove()
end
if self.timer >= 7.5 then
--tnt.boom(pos, rocket_boom)
self.object:remove()
end
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:rocket", rangedweapons_rocket)
local rangedweapons_he_grenade = {
physical = false,
timer = 0,
visual = "sprite",
visual_size = {x=0.0, y=0.0},
textures = {"rangedweapons_invisible.png"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_he_grenade.on_step = function(self, dtime, pos)
self.timer = self.timer + dtime
local tiem = 0.002
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if self.timer >= 0.002 then
minetest.add_particle({
pos = pos,
velocity = 0,
acceleration = {x=0, y=0, z=0},
expirationtime = 0.04,
size = 7,
collisiondetection = false,
vertical = false,
texture = "rangedweapons_rocket_fly.png",
glow = 15,
})
minetest.add_particle({
pos = pos,
velocity = 0,
acceleration = {x=0, y=16, z=0},
expirationtime = 0.4,
size = 4,
collisiondetection = false,
vertical = false,
texture = "tnt_smoke.png",
glow = 5,
})
tiem = tiem + 0.002
end
if self.timer >= 0.4 then
local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 1.5)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "rangedweapons:he_grenade" and obj:get_luaentity().name ~= "__builtin:item" then
--tnt.boom(pos, rocket_boom)
self.object:remove()
end
end
end
end
if self.lastpos.x ~= nil then
if minetest.registered_nodes[node.name].walkable then
--tnt.boom(pos, he_boom)
self.object:remove()
end
if self.timer >= 7.5 then
--tnt.boom(pos, he_boom)
self.object:remove()
end
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:he_grenade", rangedweapons_he_grenade)
local barrel_boom = {
name = "rangedweapons:explosion",
--description = "DuN mInD mEh...",
radius = 3,
tiles = {
side = "rangedweapons_invisible.png",
top = "rangedweapons_invisible.png",
bottom = "rangedweapons_invisible.png",
burning = "rangedweapons_invisible.png"
},
}
--tnt.register_tnt(barrel_boom)
minetest.register_node("rangedweapons:barrel", {
description = "" ..core.colorize("#35cdff","Explosive barrel\n")..core.colorize("#FFFFFF", "It will explode if shot by gun"),
tiles = {
"rangedweapons_barrel_top.png",
"rangedweapons_barrel_top.png",
"rangedweapons_barrel_side.png",
"rangedweapons_barrel_side.png",
"rangedweapons_barrel_side.png",
"rangedweapons_barrel_side.png"
},
drawtype = "nodebox",
paramtype = "light",
groups = {choppy = 3, oddly_breakable_by_hand = 3},
on_blast = function(pos)
--tnt.boom(pos, {radius = 3})
end,
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.5, 0.1875, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.1875, 0.5, 0.5, 0.1875}, -- NodeBox2
{-0.4375, -0.5, -0.3125, 0.4375, 0.5, 0.3125}, -- NodeBox3
{-0.3125, -0.5, -0.4375, 0.3125, 0.5, 0.4375}, -- NodeBox4
{-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox5
}
}
})

View File

@ -0,0 +1,148 @@
minetest.register_tool("rangedweapons:forcegun", {
description = "" ..core.colorize("#35cdff","Force gun\n") ..core.colorize("#FFFFFF", "Completelly harmless... by itself...\n")..core.colorize("#FFFFFF", "It's projectile will push either the entity it hits directly, or everyone near the node it collides with far away.\n") ..core.colorize("#FFFFFF", "Perfect for rocket-jumping or YEETing enemies away.\n")..core.colorize("#FFFFFF", "Power usage: 40\n")..core.colorize("#FFFFFF", "Gun type:Power Special-gun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 60"),
range = 0,
wield_scale = {x=2.0,y=2.0,z=1.75},
inventory_image = "rangedweapons_forcegun.png",
on_use = function(itemstack, user, pointed_thing)
local pos = user:get_pos()
local dir = user:get_look_dir()
local yaw = user:get_look_yaw()
local inv = user:get_inventory()
if inv:contains_item("main", "rangedweapons:power_particle 40") then
if pos and dir then
inv:remove_item("main", "rangedweapons:power_particle 25")
pos.y = pos.y + 1.5
local obj = minetest.add_entity(pos, "rangedweapons:forceblast")
if obj then
minetest.sound_play("rangedweapons_rocket", {object=obj})
obj:set_velocity({x=dir.x * 60, y=dir.y * 60, z=dir.z * 60})
obj:setyaw(yaw + math.pi)
proj_dir = dir
local ent = obj:get_luaentity()
if ent then
ent.player = ent.player or user
end
end
end
end
end,
})
local rangedweapons_forceblast = {
timer = 0,
initial_properties = {
physical = true,
hp_max = 420,
glow = 30,
visual = "sprite",
visual_size = {x=0.4, y=0.4,},
textures = {"rangedweapons_force_bullet.png"},
lastpos = {},
collide_with_objects = false,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
},
}
rangedweapons_forceblast.on_step = function(self, dtime, moveresult)
self.timer = self.timer + dtime
local pos = self.object:get_pos()
proj_dir = proj_dir or ({x=0,y=0,z=0})
if self.timer > 10 then
self.object:remove()
end
if self.timer > 0.05 then
self.object:set_properties({collide_with_objects = true})
end
if moveresult.collides == true then
if moveresult.collisions[1] ~= nil then
if moveresult.collisions[1].type == "object" then
if moveresult.collisions[1].object:is_player() then
moveresult.collisions[1].object:add_player_velocity({x=proj_dir.x * 20, y=5+ (proj_dir.y * 20), z=proj_dir.z * 20})
else
moveresult.collisions[1].object:add_velocity({x=proj_dir.x * 20, y=5+ (proj_dir.y * 20), z=proj_dir.z * 20})
end
minetest.add_particle({
pos = ({x = pos.x, y = pos.y, z = pos.z}),
velocity ={x=0,y=0,z=0},
acceleration ={x=0,y=0,z=0},
expirationtime = 0.20,
size = 16,
collisiondetection = true,
collision_removal = false,
vertical = false,
texture = "rangedweapons_force_blast.png",
glow = 20,
animation = {type="vertical_frames", aspect_w=64, aspect_h=64, length = 0.20,},
})
self.object:remove()
end
if moveresult.collisions[1].type == "node" then
local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 7)
for k, obj in pairs(objs) do
if obj:get_pos() then
posd_x = pos.x - obj:get_pos().x
posd_y = pos.y - obj:get_pos().y
posd_z = pos.z - obj:get_pos().z
else
posd_x = 1
posd_y = 1
posd_z = 1
end
if posd_y < 0 and posd_y > -1 then posd_y = -1 end
if posd_y > 0 and posd_y < 1 then posd_y = 1 end
if posd_y > 0 then posd_y=posd_y*3 end
posd_y = (posd_y + 0.5) * (((math.abs(posd_x)+0.5)+(math.abs(posd_z)+0.5))/2)
if posd_y > -1.0 and posd_y < 0 then posd_y = -1.0 end
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "rangedweapons:forceblast" then
obj:add_velocity({x=10*(-posd_x), y=30*(-1/posd_y), z=10*(-posd_z)})
self.object:remove()
end
else
obj:add_player_velocity({x=30*((-posd_x)/(1+math.abs(posd_x))), y=25*(-1/posd_y), z=30*((-posd_z)/(1+math.abs(posd_z)))})
self.object:remove()
end
end
minetest.add_particle({
pos = ({x = pos.x, y = pos.y, z = pos.z}),
velocity ={x=0,y=0,z=0},
acceleration ={x=0,y=0,z=0},
expirationtime = 0.20,
size = 128,
collisiondetection = true,
collision_removal = false,
vertical = false,
texture = "rangedweapons_force_blast.png",
glow = 20,
animation = {type="vertical_frames", aspect_w=64, aspect_h=64, length = 0.20,},
})
self.object:remove()
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
end
end
minetest.register_entity("rangedweapons:forceblast", rangedweapons_forceblast)

View File

@ -0,0 +1,74 @@
minetest.register_tool("rangedweapons:g36_r", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:g36_rr",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_g36_rld.png",
})
minetest.register_tool("rangedweapons:g36_rr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:g36_rrr",
load_sound = "rangedweapons_rifle_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_g36.png",
})
minetest.register_tool("rangedweapons:g36_rrr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:g36",
load_sound = "rangedweapons_rifle_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_g36.png",
})
minetest.register_tool("rangedweapons:g36", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "" ..core.colorize("#35cdff","g36\n") ..core.colorize("#FFFFFF", "Gun damage: 7\n") ..core.colorize("#FFFFFF", "accuracy: 80%\n") ..core.colorize("#FFFFFF", "Gun knockback: 5\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 12%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.9x\n") ..core.colorize("#FFFFFF", "Reload delay: 1.2\n") ..core.colorize("#FFFFFF", "Clip size: 30\n") ..core.colorize("#FFFFFF", "Ammunition: 5.56mm rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.08(full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: assault rifle\n") ..core.colorize("#FFFFFF", "Block penetration: 6%\n")
..core.colorize("#FFFFFF", "Enemy penetration: 17%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 40"),
range = 0,
inventory_image = "rangedweapons_g36.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=7,knockback=5},
gun_crit = 12,
gun_critEffc = 2.9,
suitable_ammo = {{"rangedweapons:556mm",30}},
gun_skill = {"arifle_skill",55},
gun_magazine = "rangedweapons:assaultrifle_mag",
gun_icon = "rangedweapons_g36_icon.png",
gun_unloaded = "rangedweapons:g36_r",
gun_velocity = 40,
gun_accuracy = 80,
gun_cooldown = 0.08,
gun_reload = 1.2/4,
gun_projectiles = 1,
has_shell = 1,
gun_gravity = 0,
gun_durability = 1500,
gun_smokeSize = 5,
gun_mob_penetration = 17,
gun_node_penetration = 6,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_smg",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
inventory_image = "rangedweapons_g36.png",
})

View File

@ -0,0 +1,39 @@
minetest.register_node("rangedweapons:generator", {
description = "" ..core.colorize("#35cdff","Power particle generator\n")..core.colorize("#FFFFFF", "generates 1 power particle every 3 seconds (can hold up to 200). Punch to harvest them"),
tiles = {
"rangedweapons_generator_top.png",
"rangedweapons_generator_bottom.png",
"rangedweapons_generator_side.png",
"rangedweapons_generator_side.png",
"rangedweapons_generator_side.png",
"rangedweapons_generator_side.png"
},
paramtype = "light",
light_source = 9,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
on_timer = function(pos, elapsed)
minetest.get_node_timer(pos):start(3)
local nodemeta = minetest.get_meta(pos)
if nodemeta:get_int("power_generated") < 200 then
nodemeta:set_int("power_generated",nodemeta:get_int("power_generated")+1)
nodemeta:set_string("infotext", "currently generated power:"..nodemeta:get_int("power_generated"))
end
end,
on_punch = function(pos, node, puncher)
local nodemeta = minetest.get_meta(pos)
local inv = puncher:get_inventory()
inv:add_item("main", "rangedweapons:power_particle "..nodemeta:get_int("power_generated"))
nodemeta:set_int("power_generated",0)
nodemeta:set_string("infotext", "currently generated power:"..nodemeta:get_int("power_generated"))
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(3)
end,
sounds = default.node_sound_wood_defaults(),
})

View File

@ -0,0 +1,31 @@
minetest.register_craftitem("rangedweapons:glass_shards", {
description = "" ..core.colorize("#35cdff","Glass shards\n")..core.colorize("#FFFFFF", "3 of those, can be crafted into a file of glass fragments"),
inventory_image = "rangedweapons_glass_shards.png",
})
minetest.register_craft({
output = "vessels:glass_fragments",
recipe = {
{"rangedweapons:glass_shards", "rangedweapons:glass_shards", "rangedweapons:glass_shards"},
}
})
minetest.register_node("rangedweapons:broken_glass", {
description = "Broken glass",
drawtype = "glasslike",
tiles = {
"rangedweapons_broken_glass.png"
},
paramtype = "light",
walkable = false,
is_ground_content = false,
liquidtype = "source",
liquid_alternative_flowing = "rangedweapons:broken_glass",
liquid_alternative_source = "rangedweapons:broken_glass",
liquid_viscosity = 7,
alpha = 160,
liquid_range= 0,
liquid_renewable = false,
damage_per_second = 2,
groups = {oddly_breakable_by_hand = 3},
})

View File

@ -0,0 +1,84 @@
minetest.register_tool("rangedweapons:glock17_rld", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
loaded_gun = "rangedweapons:glock17",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_glock17_rld.png",
})
minetest.register_tool("rangedweapons:glock17_r", {
stack_max= 1,
wield_scale = {x=1.2,y=1.2,z=1.2},
description = "",
rw_next_reload = "rangedweapons:glock17_rr",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_glock17.png",
})
minetest.register_tool("rangedweapons:glock17_rr", {
stack_max= 1,
wield_scale = {x=1.2,y=1.2,z=1.2},
description = "",
rw_next_reload = "rangedweapons:glock17_rrr",
load_sound = "rangedweapons_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_glock17.png",
})
minetest.register_tool("rangedweapons:glock17_rrr", {
stack_max= 1,
wield_scale = {x=1.2,y=1.2,z=1.2},
description = "",
rw_next_reload = "rangedweapons:glock17",
load_sound = "rangedweapons_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_glock17_rld.png",
})
minetest.register_tool("rangedweapons:glock17", {
description = "" ..core.colorize("#35cdff","Glock 17\n") ..core.colorize("#FFFFFF", "Gun damage: 5\n") ..core.colorize("#FFFFFF", "Accuracy: 96%\n") ..core.colorize("#FFFFFF", "Gun knockback: 4\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 15%\n") ..core.colorize("#FFFFFF", "Gun Critical efficiency: 2.2x\n") ..core.colorize("#FFFFFF", "Reload delay: 0.9\n")..core.colorize("#FFFFFF", "Clip size: 17/17/17\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm Parabellum/10mm Auto/.45acp\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.35\n") ..core.colorize("#FFFFFF", "Gun type: Handgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 30"),
wield_scale = {x=1.2,y=1.2,z=1.2},
range = 0,
inventory_image = "rangedweapons_glock17.png",
RW_gun_capabilities = {
gun_damage = {fleshy=5,knockback=4},
gun_crit = 15,
gun_critEffc = 2.2,
suitable_ammo = {{"rangedweapons:9mm",17},{"rangedweapons:10mm",17},{"rangedweapons:45acp",17}},
gun_skill = {"handgun_skill",45},
gun_magazine = "rangedweapons:handgun_mag_black",
gun_icon = "rangedweapons_glock17_icon.png",
gun_unloaded = "rangedweapons:glock17_r",
gun_cooling = "rangedweapons:glock17_rld",
gun_velocity = 30,
gun_accuracy = 96,
gun_cooldown = 0.35,
gun_reload = 0.9/4,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 1400,
gun_smokeSize = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_glock",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,149 @@
minetest.register_craftitem("rangedweapons:pin", {
wield_scale = {x=2.5,y=2.5,z=1.0},
inventory_image = "rangedweapons_pin.png",
})
local rangedweapons_grenade_pin = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x=0.15, y=0.15},
textures = {"rangedweapons:pin"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_grenade_pin.on_step = function(self, dtime, pos)
self.timer = self.timer + dtime
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
if self.lastpos.x ~= nil then
if minetest.registered_nodes[node.name].walkable then
self.object:remove()
minetest.sound_play("rangedweapons_bulletdrop", {pos = self.lastpos, gain = 0.8})
end
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:grenade_pin", rangedweapons_grenade_pin)
local grenade_boom = {
name = "rangedweapons:grenade_explosion",
--description = "DuN mInD mEh...",
radius = 3,
tiles = {
side = "rangedweapons_invisible.png",
top = "rangedweapons_invisible.png",
bottom = "rangedweapons_invisible.png",
burning = "rangedweapons_invisible.png"
},
}
local gtimer = 0
minetest.register_craftitem("rangedweapons:hand_grenade", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "" ..core.colorize("#35cdff","Hand grenade\n") ..core.colorize("#FFFFFF", "Explosion radius: 3\n")..core.colorize("#FFFFFF", "Throw force: 12\n") ..core.colorize("#FFFFFF", "Grenade gravitational pull: 6\n") ..core.colorize("#ffc000", "Right-click to unpin, Left click to throw after unpinning\n") ..core.colorize("#ffc000", "Thrown or not, it will explode after 3 secons from unpinning, be careful!"),
range = 0,
inventory_image = "rangedweapons_hand_grenade.png",
on_secondary_use = function(itemstack, user, pointed_thing)
if minetest.find_node_near(user:get_pos(), 10,"rangedweapons:antigun_block")
then
minetest.chat_send_player(user:get_player_name(), "" ..core.colorize("#ff0000","Grenades are prohibited in this area!"))
return itemstack
end
gtimer = 0
minetest.sound_play("rangedweapons_reload_a", {user})
itemstack = "rangedweapons:hand_grenade_nopin"
local pos = user:get_pos()
pos.y = pos.y + 1.5
local pinEnt = minetest.add_entity(pos, "rangedweapons:grenade_pin")
if pinEnt then
local dir = user:get_look_dir()
local yaw = user:get_look_yaw()
local svertical = user:get_look_vertical()
pinEnt:setvelocity({x=dir.x * -10, y=dir.y * -10, z=dir.z * -10})
pinEnt:setacceleration({x=dir.x * -5, y= -10, z=dir.z * -5})
pinEnt:set_rotation({x=0,y=yaw + math.pi,z=-svertical})
end
return itemstack end,
})
minetest.register_craftitem("rangedweapons:hand_grenade_nopin", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "***HURRY UP AND THROW IT!!!***",
range = 0,
inventory_image = "rangedweapons_hand_grenade_nopin.png",
groups = {not_in_creative_inventory = 1},
on_use = function(itemstack, user, pointed_thing)
local pos = user:get_pos()
local dir = user:get_look_dir()
local yaw = user:get_look_yaw()
if pos and dir and yaw then
pos.y = pos.y + 1.6
local obj = minetest.add_entity(pos, "rangedweapons:grenade")
if obj then
obj:set_velocity({x=dir.x * 12, y=dir.y * 12, z=dir.z * 12})
obj:set_acceleration({x=0, y=-6, z=0})
obj:set_yaw(yaw + math.pi)
btimer = gtimer
local ent = obj:get_luaentity()
if ent then
ent.player = ent.player or user
itemstack = ""
end
end
end
return itemstack
end,
})
tnt.register_tnt(grenade_boom)
minetest.register_globalstep(function(dtime, player, pos)
gtimer = gtimer + dtime;
if gtimer >= 3.0 then
for _, player in pairs(minetest.get_connected_players()) do
local pos = player:get_pos()
if player:get_wielded_item():get_name() == "rangedweapons:hand_grenade_nopin" then
player:set_wielded_item("")
gtimer = 0
tnt.boom(pos, grenade_boom)
end end end end)
local rangedweapons_grenade = {
physical = true,
btimer = 0,
timer = 0,
hp_max = 420,
visual = "sprite",
visual_size = {x=0.5, y=0.5},
textures = {"rangedweapons_hand_grenade_nopin.png"},
lastpos= {},
collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
}
rangedweapons_grenade.on_step = function(self, dtime, pos)
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
local btimer = btimer or 0
self.timer = self.timer + dtime
if self.timer > (3.0 - btimer) then
tnt.boom(pos, grenade_boom)
self.object:remove()
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:grenade", rangedweapons_grenade)

975
mods/rangedweapons/init.lua Normal file
View File

@ -0,0 +1,975 @@
local modpath = minetest.get_modpath(minetest.get_current_modname())
if minetest.global_exists("armor") and armor.attributes then
table.insert(armor.attributes, "bullet_res")
end
if minetest.global_exists("armor") and armor.attributes then
table.insert(armor.attributes, "ammo_save")
end
if minetest.global_exists("armor") and armor.attributes then
table.insert(armor.attributes, "ranged_dmg")
end
minetest.register_node("rangedweapons:antigun_block", {
description = "" ..core.colorize("#35cdff","Anti-gun block\n")..core.colorize("#FFFFFF", "Prevents people from using guns, in 10 node radius to each side from this block"),
tiles = {"rangedweapons_antigun_block.png"},
groups = {choppy = 3, oddly_breakable_by_hand = 3},
})
----
---- gun_funcs
----
make_sparks = function(pos)
minetest.sound_play("rengedweapons_ricochet", {pos, gain = 0.75})
for i=1,9 do
minetest.add_particle({
pos = pos,
velocity = {x=math.random(-6.0,6.0), y=math.random(-10.0,15.0), z=math.random(-6.0,6.0)},
acceleration = {x=math.random(-9.0,9.0), y=math.random(-15.0,-3.0), z=math.random(-9.0,9.0)},
expirationtime = 1.0,
size = math.random(1,2),
collisiondetection = true,
vertical = false,
texture = "rangedweapons_spark.png",
glow = 25,
})
end
end
rangedweapons_gain_skill = function(player,skill,chance)
if math.random(1, chance) == 1 then
local p_meta = player:get_meta()
local skill_num = p_meta:get_int(skill)
if skill_num < rweapons_max_gun_efficiency then
p_meta:set_int(skill, skill_num + 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#25c200","You've improved your skill with this type of gun!"))
end
end
end
rangedweapons_reload_gun = function(itemstack, player)
GunCaps = itemstack:get_definition().RW_gun_capabilities
if GunCaps ~= nil then
gun_unload_sound = GunCaps.gun_unload_sound or ""
end
minetest.sound_play(gun_unload_sound, {player})
local gun_reload = 0.25
if GunCaps ~= nil then
gun_reload = GunCaps.gun_reload or 0.25
end
local playerMeta = player:get_meta()
local gunMeta = itemstack:get_meta()
gunMeta:set_float("RW_reload_delay",gun_reload)
playerMeta:set_float("rw_cooldown",gun_reload)
local player_has_ammo = 0
local clipSize = 0
local reload_ammo = ""
if GunCaps.suitable_ammo ~= nil then
local inv = player:get_inventory()
for i = 1,inv:get_size("main") do
for _, ammo in pairs(GunCaps.suitable_ammo) do
if inv:get_stack("main",i):get_name() == ammo[1] then
reload_ammo = inv:get_stack("main",i)
clipSize = ammo[2]
player_has_ammo = 1
break
end end
if player_has_ammo == 1 then
break
end
end end
if player_has_ammo == 1 then
local gun_icon = "rangedweapons_emergency_gun_icon.png"
if GunCaps.gun_icon ~= nil then
gun_icon = GunCaps.gun_icon
end
local ammo_icon = "rangedweapons_emergency_ammo_icon.png"
if reload_ammo:get_definition().inventory_image ~= nil then
ammo_icon = reload_ammo:get_definition().inventory_image
end
player:hud_change(gunimg, "text", gun_icon)
player:hud_change(ammoimg, "text", ammo_icon)
local gunMeta = itemstack:get_meta()
local ammoCount = gunMeta:get_int("RW_bullets")
local ammoName = gunMeta:get_string("RW_ammo_name")
local inv = player:get_inventory()
inv:add_item("main",ammoName.." "..ammoCount)
if inv:contains_item("main",reload_ammo:get_name().." "..clipSize) then
inv:remove_item("main",reload_ammo:get_name().." "..clipSize)
gunMeta:set_int("RW_bullets",clipSize)
else
gunMeta:set_int("RW_bullets",reload_ammo:get_count())
inv:remove_item("main",reload_ammo:get_name().." "..reload_ammo:get_count())
end
gunMeta:set_string("RW_ammo_name",reload_ammo:get_name())
player:hud_change(gunammo, "text", gunMeta:get_int("RW_bullets"))
if GunCaps.gun_magazine ~= nil then
local pos = player:get_pos()
local dir = player:get_look_dir()
local yaw = player:get_look_yaw()
if pos and dir and yaw then
pos.y = pos.y + 1.4
local obj = minetest.add_entity(pos,"rangedweapons:mag")
if obj then
obj:set_properties({textures = {GunCaps.gun_magazine}})
obj:set_velocity({x=dir.x*2, y=dir.y*2, z=dir.z*2})
obj:set_acceleration({x=0, y=-5, z=0})
obj:set_rotation({x=0,y=yaw+math.pi,z=0})
end end end
if GunCaps.gun_unloaded ~= nil then
itemstack:set_name(GunCaps.gun_unloaded)
end
end
end
rangedweapons_single_load_gun = function(itemstack, player)
GunCaps = itemstack:get_definition().RW_gun_capabilities
if GunCaps ~= nil then
gun_unload_sound = GunCaps.gun_unload_sound or ""
end
minetest.sound_play(gun_unload_sound, {player})
local gun_reload = 0.25
if GunCaps ~= nil then
gun_reload = GunCaps.gun_reload or 0.25
end
local playerMeta = player:get_meta()
local gunMeta = itemstack:get_meta()
gunMeta:set_float("RW_reload_delay",gun_reload)
playerMeta:set_float("rw_cooldown",gun_reload)
local player_has_ammo = 0
local clipSize = 0
local reload_ammo = ""
if GunCaps.suitable_ammo ~= nil then
local inv = player:get_inventory()
for i = 1,inv:get_size("main") do
for _, ammo in pairs(GunCaps.suitable_ammo) do
if inv:get_stack("main",i):get_name() == ammo[1] then
reload_ammo = inv:get_stack("main",i)
clipSize = ammo[2]
player_has_ammo = 1
break
end end
if player_has_ammo == 1 then
break
end
end end
if player_has_ammo == 1 then
local gun_icon = "rangedweapons_emergency_gun_icon.png"
if GunCaps.gun_icon ~= nil then
gun_icon = GunCaps.gun_icon
end
local ammo_icon = "rangedweapons_emergency_ammo_icon.png"
if reload_ammo:get_definition().inventory_image ~= nil then
ammo_icon = reload_ammo:get_definition().inventory_image
end
player:hud_change(gunimg, "text", gun_icon)
player:hud_change(ammoimg, "text", ammo_icon)
local gunMeta = itemstack:get_meta()
local ammoCount = gunMeta:get_int("RW_bullets")
local ammoName = gunMeta:get_string("RW_ammo_name")
local inv = player:get_inventory()
if ammoName ~= reload_ammo:get_name() then
inv:add_item("main",ammoName.." "..ammoCount)
gunMeta:set_int("RW_bullets",0)
end
if inv:contains_item("main",reload_ammo:get_name()) and
gunMeta:get_int("RW_bullets") < clipSize then
inv:remove_item("main",reload_ammo:get_name())
gunMeta:set_int("RW_bullets",gunMeta:get_int("RW_bullets")+1)
end
gunMeta:set_string("RW_ammo_name",reload_ammo:get_name())
player:hud_change(gunammo, "text", gunMeta:get_int("RW_bullets"))
if GunCaps.gun_unloaded ~= nil then
itemstack:set_name(GunCaps.gun_unloaded)
end
end
end
rangedweapons_yeet = function(itemstack, player)
if minetest.find_node_near(player:getpos(), 10,"rangedweapons:antigun_block")
then
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","throwable weapons are prohibited in this area!"))
else
ThrowCaps = itemstack:get_definition().RW_throw_capabilities
playerMeta = player:get_meta()
if ThrowCaps ~= nil then
throw_cooldown = ThrowCaps.throw_cooldown or 0
end
if playerMeta:get_float("rw_cooldown") <= 0 then
playerMeta:set_float("rw_cooldown", throw_cooldown)
local throw_damage = {fleshy=1}
local throw_sound = "rangedweapons_throw"
local throw_velocity = 20
local throw_accuracy = 100
local throw_cooling = 0
local throw_crit = 0
local throw_critEffc = 1
local throw_mobPen = 0
local throw_nodePen = 0
local throw_dps = 0
local throw_gravity = 0
local throw_door_breaking = 0
local throw_skill = ""
local throw_skillChance = 0
local throw_smokeSize = 0
local throw_ent = "rangedweapons:shot_bullet"
local throw_visual = "wielditem"
local throw_texture = "rangedweapons:shot_bullet_visual"
local throw_glass_breaking = 0
local throw_particles = {}
local throw_sparks = 0
local throw_bomb_ignite = 0
local throw_size = 0
local throw_glow = 0
if ThrowCaps ~= nil then
throw_damage = ThrowCaps.throw_damage or {fleshy=1}
throw_sound = ThrowCaps.throw_sound or "rangedweapons_glock"
throw_velocity = ThrowCaps.throw_velocity or 20
throw_accuracy = ThrowCaps.throw_accuracy or 100
throw_cooling = ThrowCaps.throw_cooling or itemstack:get_name()
throw_crit = ThrowCaps.throw_crit or 0
throw_critEffc = ThrowCaps.throw_critEffc or 1
throw_projectiles = ThrowCaps.throw_projectiles or 1
throw_mobPen = ThrowCaps.throw_mob_penetration or 0
throw_nodePen = ThrowCaps.throw_node_penetration or 0
throw_dps = ThrowCaps.throw_dps or 0
throw_gravity = ThrowCaps.throw_gravity or 0
throw_door_breaking = ThrowCaps.throw_door_breaking or 0
throw_ent = ThrowCaps.throw_entity or "rangedweapons:shot_bullet"
throw_visual = ThrowCaps.throw_visual or "wielditem"
throw_texture = ThrowCaps.throw_texture or "rangedweapons:shot_bullet_visual"
throw_glass_breaking = ThrowCaps.throw_glass_breaking or 0
throw_particles = ThrowCaps.throw_particles or nil
throw_sparks = ThrowCaps.throw_sparks or 0
throw_bomb_ignite = ThrowCaps.ignites_explosives or 0
throw_size = ThrowCaps.throw_projectile_size or 0
throw_glow = ThrowCaps.throw_projectile_glow or 0
OnCollision = ThrowCaps.OnCollision or function()end
if ThrowCaps.throw_skill ~= nil then
throw_skill = ThrowCaps.throw_skill[1] or ""
throw_skillChance = ThrowCaps.throw_skill[2] or 0
else
throw_skill = ""
throw_skillChance = 0
end
end
if throw_skillChance > 0 and throw_skill ~= "" then
rangedweapons_gain_skill(player,throw_skill,throw_skillChance)
end
if throw_skill ~= "" then
skill_value = playerMeta:get_int(throw_skill)/100
else
skill_value = 1
end
rangedweapons_launch_projectile(player,throw_projectiles,throw_damage,throw_ent,throw_visual,throw_texture,throw_sound,throw_velocity,throw_accuracy,skill_value,OnCollision,throw_crit,throw_critEffc,throw_mobPen,throw_nodePen,0,"","","",throw_dps,throw_gravity,throw_door_breaking,throw_glass_breaking,throw_particles,throw_sparks,throw_bomb_ignite,throw_size,0,itemstack:get_wear(),throw_glow)
itemstack:take_item()
end
end
end
rangedweapons_shoot_gun = function(itemstack, player)
if minetest.find_node_near(player:getpos(), 10,"rangedweapons:antigun_block")
then
minetest.sound_play("rangedweapons_empty", {player})
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Guns are prohibited in this area!"))
else
local gun_cooldown = 0
local GunCaps = itemstack:get_definition().RW_gun_capabilities
local gun_ammo_save = 0
if GunCaps ~= nil then
gun_cooldown = GunCaps.gun_cooldown or 0
gun_ammo_save = GunCaps.ammo_saving or 0
end
local gunMeta = itemstack:get_meta()
local playerMeta = player:get_meta()
if gunMeta:get_int("RW_bullets") > 0 and
playerMeta:get_float("rw_cooldown") <= 0 then
playerMeta:set_float("rw_cooldown", gun_cooldown)
if math.random(1,100) > gun_ammo_save then
gunMeta:set_int("RW_bullets",gunMeta:get_int("RW_bullets")-1)
end
player:hud_change(gunammo, "text", gunMeta:get_int("RW_bullets"))
local gun_icon = "rangedweapons_emergency_gun_icon.png"
if GunCaps.gun_icon ~= nil then
gun_icon = GunCaps.gun_icon
end
player:hud_change(gunimg, "text", gun_icon)
local OnCollision = function() end
local bulletStack = ItemStack({name = gunMeta:get_string("RW_ammo_name")})
AmmoCaps = bulletStack:get_definition().RW_ammo_capabilities
local gun_damage = {fleshy=1}
local gun_sound = "rangedweapons_glock"
local gun_velocity = 20
local gun_accuracy = 100
local gun_cooling = 0
local gun_crit = 0
local gun_critEffc = 1
local gun_mobPen = 0
local gun_nodePen = 0
local gun_shell = 0
local gun_durability = 0
local gun_dps = 0
local gun_gravity = 0
local gun_door_breaking = 0
local gun_skill = ""
local gun_skillChance = 0
local gun_smokeSize = 0
local bullet_damage = {fleshy=0}
local bullet_velocity = 0
local bullet_ent = "rangedweapons:shot_bullet"
local bullet_visual = "wielditem"
local bullet_texture = "rangedweapons:shot_bullet_visual"
local bullet_crit = 0
local bullet_critEffc = 0
local bullet_projMult = 1
local bullet_mobPen = 0
local bullet_nodePen = 0
local bullet_shell_ent = "rangedweapons:empty_shell"
local bullet_shell_visual = "wielditem"
local bullet_shell_texture = "rangedweapons:shelldrop"
local bullet_dps = 0
local bullet_gravity = 0
local bullet_glass_breaking = 0
local bullet_particles = {}
local bullet_sparks = 0
local bullet_bomb_ignite = 0
local bullet_size = 0
local bullet_glow = 20
if GunCaps ~= nil then
gun_damage = GunCaps.gun_damage or {fleshy=1}
gun_sound = GunCaps.gun_sound or "rangedweapons_glock"
gun_velocity = GunCaps.gun_velocity or 20
gun_accuracy = GunCaps.gun_accuracy or 100
gun_cooling = GunCaps.gun_cooling or itemstack:get_name()
gun_crit = GunCaps.gun_crit or 0
gun_critEffc = GunCaps.gun_critEffc or 1
gun_projectiles = GunCaps.gun_projectiles or 1
gun_mobPen = GunCaps.gun_mob_penetration or 0
gun_nodePen = GunCaps.gun_node_penetration or 0
gun_shell = GunCaps.has_shell or 0
gun_durability = GunCaps.gun_durability or 0
gun_dps = GunCaps.gun_dps or 0
gun_ammo_save = GunCaps.ammo_saving or 0
gun_gravity = GunCaps.gun_gravity or 0
gun_door_breaking = GunCaps.gun_door_breaking or 0
gun_smokeSize = GunCaps.gun_smokeSize or 0
if GunCaps.gun_skill ~= nil then
gun_skill = GunCaps.gun_skill[1] or ""
gun_skillChance = GunCaps.gun_skill[2] or 0
else
gun_skill = ""
gun_skillChance = 0
end
end
if gun_skillChance > 0 and gun_skill ~= "" then
rangedweapons_gain_skill(player,gun_skill,gun_skillChance)
end
local ammo_icon = "rangedweapons_emergency_ammo_icon.png"
if bulletStack:get_definition().inventory_image ~= nil then
ammo_icon = bulletStack:get_definition().inventory_image
end
player:hud_change(ammoimg, "text", ammo_icon)
if AmmoCaps ~= nil then
OnCollision = AmmoCaps.OnCollision or function()end
bullet_damage = AmmoCaps.ammo_damage or {fleshy=1}
bullet_velocity = AmmoCaps.ammo_velocity or 0
bullet_ent = AmmoCaps.ammo_entity or "rangedweapons:shot_bullet"
bullet_visual = AmmoCaps.ammo_visual or "wielditem"
bullet_texture = AmmoCaps.ammo_texture or "rangedweapons:shot_bullet_visual"
bullet_crit = AmmoCaps.ammo_crit or 0
bullet_critEffc = AmmoCaps.ammo_critEffc or 0
bullet_projMult = AmmoCaps.ammo_projectile_multiplier or 1
bullet_mobPen = AmmoCaps.ammo_mob_penetration or 0
bullet_nodePen = AmmoCaps.ammo_node_penetration or 0
bullet_shell_ent = AmmoCaps.shell_entity or "rangedweapons:empty_shell"
bullet_shell_visual = AmmoCaps.shell_visual or "wielditem"
bullet_shell_texture = AmmoCaps.shell_texture or "rangedweapons:shelldrop"
bullet_dps = AmmoCaps.ammo_dps or 0
bullet_gravity = AmmoCaps.ammo_gravity or 0
bullet_glass_breaking = AmmoCaps.ammo_glass_breaking or 0
bullet_particles = AmmoCaps.ammo_particles or nil
bullet_sparks = AmmoCaps.has_sparks or 0
bullet_bomb_ignite = AmmoCaps.ignites_explosives or 0
bullet_size = AmmoCaps.ammo_projectile_size or 0.0025
bullet_glow = AmmoCaps.ammo_projectile_glow or 20
end
local combined_crit = gun_crit + bullet_crit
local combined_critEffc = gun_critEffc + bullet_critEffc
local combined_velocity = gun_velocity + bullet_velocity
local combined_projNum = math.ceil(gun_projectiles * bullet_projMult)
local combined_mobPen = gun_mobPen + bullet_mobPen
local combined_nodePen = gun_nodePen + bullet_nodePen
local combined_dps = gun_dps + bullet_dps
local combined_dmg = {}
local combined_gravity = gun_gravity + bullet_gravity
for _, gunDmg in pairs(gun_damage) do
if bullet_damage[_] ~= nil then
combined_dmg[_] = gun_damage[_] + bullet_damage[_]
else
combined_dmg[_] = gun_damage[_]
end
end
for _, bulletDmg in pairs(bullet_damage) do
if gun_damage[_] == nil then
combined_dmg[_] = bullet_damage[_]
end
end
--minetest.chat_send_all(minetest.serialize(combined_dmg))
if gun_skill ~= "" then
skill_value = playerMeta:get_int(gun_skill)/100
else
skill_value = 1
end
rangedweapons_launch_projectile(player,combined_projNum,combined_dmg,bullet_ent,bullet_visual,bullet_texture,gun_sound,combined_velocity,gun_accuracy,skill_value,OnCollision,combined_crit,combined_critEffc,combined_mobPen,combined_nodePen,gun_shell,bullet_shell_ent,bullet_shell_texture,bullet_shell_visual,combined_dps,combined_gravity,gun_door_breaking,bullet_glass_breaking,bullet_particles,bullet_sparks,bullet_bomb_ignite,bullet_size,gun_smokeSize,0,bullet_glow)
if rweapons_gun_durability == "true" then
itemstack:add_wear(65535/gun_durability)
end
itemstack:set_name(gun_cooling)
end
end end
rangedweapons_shoot_powergun = function(itemstack, player)
if minetest.find_node_near(player:getpos(), 10,"rangedweapons:antigun_block")
then
minetest.sound_play("rangedweapons_empty", {player})
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Guns are prohibited in this area!"))
else
local power_cooldown = 0
PowerCaps = itemstack:get_definition().RW_powergun_capabilities
if PowerCaps ~= nil then
power_cooldown = PowerCaps.power_cooldown or 0
power_consumption = PowerCaps.power_consumption or 0
end
local inv = player:get_inventory()
local playerMeta = player:get_meta()
if inv:contains_item("main", "rangedweapons:power_particle "..PowerCaps.power_consumption) and
playerMeta:get_float("rw_cooldown") <= 0 then
playerMeta:set_float("rw_cooldown", power_cooldown)
local OnCollision = function() end
local power_damage = {fleshy=1}
local power_sound = "rangedweapons_laser"
local power_velocity = 20
local power_accuracy = 100
local power_cooling = 0
local power_crit = 0
local power_critEffc = 1
local power_mobPen = 0
local power_nodePen = 0
local power_durability = 0
local power_dps = 0
local power_gravity = 0
local power_door_breaking = 0
local power_skill = ""
local power_skillChance = 0
local power_ent = "rangedweapons:shot_bullet"
local power_visual = "wielditem"
local power_texture = "rangedweapons:shot_bullet_visual"
local power_glass_breaking = 0
local power_particles = {}
local power_sparks = 0
local power_bomb_ignite = 0
local power_size = 0
local power_glow = 20
if PowerCaps ~= nil then
power_damage = PowerCaps.power_damage or {fleshy=1}
power_sound = PowerCaps.power_sound or "rangedweapons_glock"
power_velocity = PowerCaps.power_velocity or 20
power_accuracy = PowerCaps.power_accuracy or 100
power_cooling = PowerCaps.power_cooling or itemstack:get_name()
power_crit = PowerCaps.power_crit or 0
power_critEffc = PowerCaps.power_critEffc or 1
power_projectiles = PowerCaps.power_projectiles or 1
power_mobPen = PowerCaps.power_mob_penetration or 0
power_nodePen = PowerCaps.power_node_penetration or 0
power_durability = PowerCaps.power_durability or 0
power_dps = PowerCaps.power_dps or 0
power_gravity = PowerCaps.power_gravity or 0
power_door_breaking = PowerCaps.power_door_breaking or 0
OnCollision = PowerCaps.OnCollision or function()end
power_ent = PowerCaps.power_entity or "rangedweapons:shot_bullet"
power_visual = PowerCaps.power_visual or "wielditem"
power_texture = PowerCaps.power_texture or "rangedweapons:shot_bullet_visual"
power_glass_breaking = PowerCaps.power_glass_breaking or 0
power_particles = PowerCaps.power_particles or nil
power_sparks = PowerCaps.has_sparks or 0
power_bomb_ignite = PowerCaps.ignites_explosives or 0
power_size = PowerCaps.power_projectile_size or 0.0025
power_glow = PowerCaps.power_projectile_glow or 20
if PowerCaps.power_skill ~= nil then
power_skill = PowerCaps.power_skill[1] or ""
power_skillChance = PowerCaps.power_skill[2] or 0
else
power_skill = ""
power_skillChance = 0
end
end
if power_skillChance > 0 and power_skill ~= "" then
rangedweapons_gain_skill(player,power_skill,power_skillChance)
end
if power_skill ~= "" then
skill_value = playerMeta:get_int(power_skill)/100
else
skill_value = 1
end
rangedweapons_launch_projectile(player,power_projectiles,power_damage,power_ent,power_visual,power_texture,power_sound,power_velocity,power_accuracy,skill_value,OnCollision,power_crit,power_critEffc,power_mobPen,power_nodePen,0,"","","",power_dps,power_gravity,power_door_breaking,power_glass_breaking,power_particles,power_sparks,power_bomb_ignite,power_size,0,0,power_glow)
if rweapons_gun_durability == "true" then
itemstack:add_wear(65535/power_durability)
end
itemstack:set_name(power_cooling)
inv:remove_item("main", "rangedweapons:power_particle "..PowerCaps.power_consumption)
end
end end
rangedweapons_launch_projectile = function(player,projNum,projDmg,projEnt,visualType,texture,shoot_sound,combined_velocity,accuracy,skill_value,ColResult,projCrit,projCritEffc,mobPen,nodePen,has_shell,shellEnt,shellTexture,shellVisual,dps,gravity,door_break,glass_break,bullet_particles,sparks,ignite,size,smokeSize,proj_wear,proj_glow)
--minetest.chat_send_all(accuracy)
----------------------------------
local pos = player:get_pos()
local dir = player:get_look_dir()
local yaw = player:get_look_yaw()
local svertical = player:get_look_vertical()
if pos and dir and yaw then
minetest.sound_play(shoot_sound, {player})
pos.y = pos.y + 1.45
if has_shell > 0 then
local shl = minetest.add_entity(pos, shellEnt)
shl:setvelocity({x=dir.x * -10, y=dir.y * -10, z=dir.z * -10})
shl:setacceleration({x=dir.x * -5, y= -10, z=dir.z * -5})
shl:set_rotation({x=0,y=yaw + math.pi,z=-svertical})
shl:set_properties({
textures = {shellTexture},
visual = shellVisual,})
end
if smokeSize > 0 then
minetest.add_particle({
pos = pos,
velocity = {x=(dir.x*3)+(math.random(-10,10)/10), y=(dir.y*3)+(math.random(-10,10)/10), z=(dir.z*3)+(math.random(-10,10)/10)} ,
acceleration = {x=dir.x * -3, y=2, z=dir.z * -3},
expirationtime = math.random(5,10)/10,
size = smokeSize,
collisiondetection = false,
vertical = false,
texture = "tnt_smoke.png",
glow = 5,
})
end
projectiles = projNum or 1
for i=1,projectiles do
rndacc = (100 - accuracy) or 0
local spawnpos_x = pos.x + (math.random(-rndacc,rndacc)/100)
local spawnpos_y = pos.y + (math.random(-rndacc,rndacc)/100)
local spawnpos_z = pos.z + (math.random(-rndacc,rndacc)/100)
local obj = minetest.add_entity({x=spawnpos_x,y=spawnpos_y,z=spawnpos_z}, projEnt)
local ent = obj:get_luaentity()
obj:set_properties(
{textures = {texture},
visual = visualType,
collisionbox = {-size,-size,-size, size,size,size},
glow = proj_glow,}
)
ent.owner = player:get_player_name()
if obj then
ent.damage = projDmg
ent.crit = projCrit
ent.critEffc = projCritEffc
ent.OnCollision = ColResult
ent.mobPen = mobPen
ent.nodePen = nodePen
ent.dps = dps
ent.door_break = door_break
ent.glass_break = glass_break
ent.skill_value = skill_value
ent.bullet_particles = bullet_particles
ent.sparks = sparks
ent.ignite = ignite
ent.size = size
ent.timer = 0 + (combined_velocity/2000)
ent.wear = proj_wear
obj:set_velocity({x=dir.x * combined_velocity, y=dir.y * combined_velocity, z=dir.z * combined_velocity})
acc = ((( 100 - accuracy ) / 10) / skill_value ) or 0
obj:set_acceleration({x=math.random(-acc,acc), y=math.random(-acc,acc)-gravity, z=math.random(-acc,acc)})
obj:set_rotation({x=0,y=yaw + math.pi,z=-svertical})
end end end
end
eject_shell = function(itemstack,player,rld_item,rld_time,rldsound,shell)
itemstack:set_name(rld_item)
local meta = player:get_meta()
meta:set_float("rw_cooldown", rld_time)
local gunMeta = itemstack:get_meta()
local bulletStack = ItemStack({name = gunMeta:get_string("RW_ammo_name")})
minetest.sound_play(rldsound, {player})
local pos = player:get_pos()
local dir = player:get_look_dir()
local yaw = player:get_look_yaw()
if pos and dir and yaw then
pos.y = pos.y + 1.6
local obj = minetest.add_entity(pos, "rangedweapons:empty_shell")
if AmmoCaps and bulletStack ~= "" then
AmmoCaps = bulletStack:get_definition().RW_ammo_capabilities
local bullet_shell_visual = "wielditem"
local bullet_shell_texture = "rangedweapons:shelldrop"
bullet_shell_visual = AmmoCaps.shell_visual or "wielditem"
bullet_shell_texture = AmmoCaps.shell_texture or "rangedweapons:shelldrop"
obj:set_properties({textures = {bullet_shell_texture}})
obj:set_properties({visual = bullet_shell_visual})
end
if obj then
obj:set_velocity({x=dir.x*-10, y=dir.y*-10, z=dir.z*-10})
obj:set_acceleration({x=dir.x*-5, y=-10, z=dir.z*-5})
obj:set_yaw(yaw + math.pi)
end end end
---------------------------------------------------
dofile(modpath.."/settings.lua")
dofile(modpath.."/cooldown_stuff.lua")
dofile(modpath.."/skills.lua")
dofile(modpath.."/misc.lua")
dofile(modpath.."/bullet_knockback.lua")
dofile(modpath.."/ammo.lua")
if rweapons_shurikens == "true" then
dofile(modpath.."/shurikens.lua")
end
if rweapons_handguns == "true" then
dofile(modpath.."/makarov.lua")
dofile(modpath.."/luger.lua")
dofile(modpath.."/beretta.lua")
dofile(modpath.."/m1991.lua")
dofile(modpath.."/glock17.lua")
dofile(modpath.."/deagle.lua")
end
if rweapons_forceguns == "true" then
dofile(modpath.."/forcegun.lua")
end
if rweapons_javelins == "true" then
dofile(modpath.."/javelin.lua")
end
if rweapons_machine_pistols == "true" then
dofile(modpath.."/tmp.lua")
dofile(modpath.."/tec9.lua")
dofile(modpath.."/uzi.lua")
dofile(modpath.."/kriss_sv.lua")
end
if rweapons_shotguns == "true" then
dofile(modpath.."/remington.lua")
dofile(modpath.."/spas12.lua")
dofile(modpath.."/benelli.lua")
end
--[[if rweapons_auto_shotguns == "true" then
dofile(modpath.."/jackhammer.lua")
dofile(modpath.."/aa12.lua")
end
if rweapons_smgs == "true" then
dofile(modpath.."/mp5.lua")
dofile(modpath.."/ump.lua")
dofile(modpath.."/mp40.lua")
dofile(modpath.."/thompson.lua")
end
if rweapons_rifles == "true" then
dofile(modpath.."/awp.lua")
dofile(modpath.."/svd.lua")
dofile(modpath.."/m200.lua")
end
if rweapons_heavy_machineguns == "true" then
dofile(modpath.."/m60.lua")
dofile(modpath.."/rpk.lua")
dofile(modpath.."/minigun.lua")
end
if rweapons_revolvers == "true" then
dofile(modpath.."/python.lua")
dofile(modpath.."/taurus.lua")
end
if rweapons_assault_rifles == "true" then
dofile(modpath.."/m16.lua")
dofile(modpath.."/g36.lua")
dofile(modpath.."/ak47.lua")
dofile(modpath.."/scar.lua")
end
if rweapons_explosives == "true" then
dofile(modpath.."/explosives.lua")
dofile(modpath.."/m79.lua")
dofile(modpath.."/milkor.lua")
dofile(modpath.."/rpg.lua")
dofile(modpath.."/hand_grenade.lua")
end]]
if rweapons_glass_breaking == "true" then
dofile(modpath.."/glass_breaking.lua")
end
if not minetest.settings:get_bool("glass_breaking") then
minetest.register_abm({
nodenames = {"rangedweapons:broken_glass"},
interval = 1,
chance = 1,
action = function(pos, node)
if minetest.get_node(pos).name == "rangedweapons:broken_glass" then
node.name = "main:planks"
minetest.set_node(pos, node)
end
end
})
end
local rangedweapons_empty_shell = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x=0.3, y=0.3},
textures = {"rangedweapons:shelldrop"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_empty_shell.on_step = function(self, dtime, pos)
self.timer = self.timer + dtime
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
if self.lastpos.y ~= nil then
if minetest.registered_nodes[node.name]~= nil then
if minetest.registered_nodes[node.name].walkable then
local vel = self.object:get_velocity()
local acc = self.object:get_acceleration()
self.object:set_velocity({x=vel.x*-0.3, y=vel.y*-0.75, z=vel.z*-0.3})
minetest.sound_play("rangedweapons_shellhit", {pos = self.lastpos, gain = 0.8})
self.object:set_acceleration({x=acc.x, y=acc.y, z=acc.z})
end end
end
if self.timer > 1.69 then
minetest.sound_play("rangedweapons_bulletdrop", {pos = self.lastpos, gain = 0.8})
self.object:remove()
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:empty_shell", rangedweapons_empty_shell )
minetest.register_abm({
nodenames = {"doors:hidden"},
interval = 1,
chance = 1,
action = function(pos, node)
pos.y = pos.y-1
if minetest.get_node(pos).name == "air" then
pos.y = pos.y+1
node.name = "air"
minetest.set_node(pos, node)
end
end
})
minetest.register_on_joinplayer(function(player)
gunammo =
player:hud_add({
hud_elem_type = "text",
name = "gunammo",
text = "",
number = 0xFFFFFF,
scale = {x = 100, y = 20},
position = {x = 0.7, y = 0.1},
offset = {x = 30, y = 100},
alignment = {x = 0, y = -1}
})
gunimg =
player:hud_add({
hud_elem_type = "image",
text = "rangedweapons_empty_icon.png",
scale = {x = 2, y = 2},
position = {x = 0.7, y = 0.065},
offset = {x = 30, y = 100},
alignment = {x = 0, y = -1}
})
ammoimg =
player:hud_add({
hud_elem_type = "image",
text = "rangedweapons_empty_icon.png",
scale = {x = 1.5, y = 1.5},
position = {x = 0.725, y = 0.1},
offset = {x = 30, y = 100},
alignment = {x = 0, y = -1}
})
hit =
player:hud_add({
hud_elem_type = "image",
text = "rangedweapons_empty_icon.png",
scale = {x = 2, y = 2},
position = {x = 0.5, y = 0.5},
offset = {x = 0, y = 0},
alignment = {x = 0, y = 0}
})
scope_hud =
player:hud_add({
hud_elem_type = "image",
position = { x=0.5, y=0.5 },
scale = { x=-100, y=-100 },
text = "rangedweapons_empty_icon.png",
})
end)
local timer = 0
minetest.register_globalstep(function(dtime, player)
timer = timer + dtime;
if timer >= 1.0 then
for _, player in pairs(minetest.get_connected_players()) do
player:hud_change(hit, "text", "rangedweapons_empty_icon.png")
timer = 0
end
end
end)

View File

@ -0,0 +1,69 @@
minetest.register_tool("rangedweapons:jackhammer_r", {
stack_max= 1,
wield_scale = {x=2.6,y=2.6,z=1.8},
description = "",
rw_next_reload = "rangedweapons:jackhammer_rr",
load_sound = "rangedweapons_rifle_clip_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_jackhammer_rld.png",
})
minetest.register_tool("rangedweapons:jackhammer_rr", {
stack_max= 1,
wield_scale = {x=2.6,y=2.6,z=1.8},
description = "",
rw_next_reload = "rangedweapons:jackhammer_rrr",
load_sound = "rangedweapons_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_jackhammer.png",
})
minetest.register_tool("rangedweapons:jackhammer_rrr", {
stack_max= 1,
wield_scale = {x=2.6,y=2.6,z=1.8},
description = "",
rw_next_reload = "rangedweapons:jackhammer",
load_sound = "rangedweapons_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_jackhammer.png",
})
-------------------------------------------
minetest.register_tool("rangedweapons:jackhammer", {
stack_max= 1,
wield_scale = {x=2.6,y=2.6,z=1.8},
description = "" ..core.colorize("#35cdff","Jackhammer\n") ..core.colorize("#FFFFFF", "Ranged damage: 3\n") ..core.colorize("#FFFFFF", "projectiles: 8\n") ..core.colorize("#FFFFFF", "Gun gravity: 3\n") ..core.colorize("#FFFFFF", "accuracy: 35%\n") ..core.colorize("#FFFFFF", "knockback: 6\n") ..core.colorize("#FFFFFF", "Reload delay: 1.6\n") ..core.colorize("#FFFFFF", "Clip size: 10\n") ..core.colorize("#FFFFFF", "Critical chance: 7%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.2x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shell\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.25 (full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: shotgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 30"),
range = 0,
inventory_image = "rangedweapons_jackhammer.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=3,knockback=6},
gun_crit = 7,
gun_critEffc = 2.2,
suitable_ammo = {{"rangedweapons:shell",10}},
gun_skill = {"shotgun_skill",35},
gun_magazine = "rangedweapons:drum_mag",
gun_icon = "rangedweapons_jackhammer_icon.png",
gun_unloaded = "rangedweapons:jackhammer_r",
gun_velocity = 30,
gun_accuracy = 35,
gun_cooldown = 0.25,
gun_reload = 1.6/4,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 825,
gun_smokeSize = 9,
gun_door_breaking = 1,
gun_projectiles = 8,
gun_gravity = 3,
gun_unload_sound = "rangedweapons_rifle_clip_out",
gun_sound = "rangedweapons_shotgun_shot",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,139 @@
minetest.register_craftitem("rangedweapons:thrown_javelin", {
wield_scale = {x=2.0,y=2.0,z=1.0},
inventory_image = "rangedweapons_thrown_javelin.png",
})
minetest.register_craftitem("rangedweapons:javelin", {
description = "" ..core.colorize("#35cdff","Javelin\n") ..core.colorize("#FFFFFF", "Mele damage: 9\n") ..core.colorize("#FFFFFF", "Mele range: 5\n")..core.colorize("#FFFFFF", "Full punch interval: 1.25\n") ..core.colorize("#FFFFFF", "Ranged damage: 4-16\n") ..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "Mob knockback: 10\n") ..core.colorize("#FFFFFF", "Critical chance: 15%\n") ..core.colorize("#FFFFFF", "Critical damage: 25-45\n") ..core.colorize("#FFFFFF", "javelin survival rate: 95%\n")..core.colorize("#FFFFFF", "Projectile gravity: 4\n") ..core.colorize("#FFFFFF", "Projectile velocity: 20\n")..core.colorize("#ffc000", "Right-click to throw, Left-click to stab") ,
wield_scale = {x=2.0,y=2.0,z=1.0},
range = 5,
stack_max= 10,
inventory_image = "rangedweapons_javelin.png",
on_secondary_use = function(itemstack, user, pointed_thing)
if not minetest.setting_getbool("creative_mode") then itemstack:take_item()
end
if pointed_thing.type ~= "nothing" then
local pointed = minetest.get_pointed_thing_position(pointed_thing)
if vector.distance(user:getpos(), pointed) < 8 then
return itemstack
end
end
local pos = user:getpos()
local dir = user:get_look_dir()
local yaw = user:get_look_yaw()
if pos and dir then
pos.y = pos.y + 1.5
local obj = minetest.add_entity(pos, "rangedweapons:javelin")
if obj then
minetest.sound_play("rangedweapons_throw", {object=obj})
obj:setvelocity({x=dir.x * 20, y=dir.y * 20, z=dir.z * 20})
obj:setacceleration({x=dir.x * -1, y=-4, z=dir.z * -1})
obj:setyaw(yaw + math.pi)
local ent = obj:get_luaentity()
if ent then
ent.player = ent.player or user
end
end
end
return itemstack
end,
tool_capabilities = {
full_punch_interval = 1.25,
max_drop_level = 0,
groupcaps = {
stabby = {times={[1]=0.25, [2]=0.50, [3]=0.75}, uses=0, maxlevel=1},
},
damage_groups = {fleshy=9,knockback=10},
}
})
local rangedweapons_javelin = {
physical = false,
timer = 0,
visual = "wielditem",
visual_size = {x=0.5, y=0.5,},
textures = {"rangedweapons:thrown_javelin"},
lastpos= {},
collisionbox = {0, 0, 0, 0, 0, 0},
}
rangedweapons_javelin.on_step = function(self, dtime)
self.timer = self.timer + dtime
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if self.timer > 0.15 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 ~= "rangedweapons:javelin" and obj:get_luaentity().name ~= "__builtin:item" then
if math.random(1, 100) <= 15 then
local damage = math.random(25,45)
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups= {fleshy = damage, knockback=20},
}, nil)
minetest.sound_play("crit", {pos = self.lastpos, gain = 0.8})
self.object:remove()
if not minetest.setting_getbool("creative_mode") and math.random(1, 100) <= 95 then
minetest.add_item(self.lastpos, "rangedweapons:javelin")
end
else
local damage = math.random(4,16)
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups= {fleshy = damage, knockback=10},
}, nil)
minetest.sound_play("default_dig_cracky", {pos = self.lastpos, gain = 0.8})
self.object:remove()
if not minetest.setting_getbool("creative_mode") and math.random(1, 100) <= 95 then
minetest.add_item(self.lastpos, "rangedweapons:javelin")
end
end
end
else
if math.random(1, 100) <= 15 then
local damage = math.random(25,45)
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups= {fleshy = damage},
}, nil)
minetest.sound_play("crit", {pos = self.lastpos, gain = 0.8})
self.object:remove()
if not minetest.setting_getbool("creative_mode") and math.random(1, 100) <= 95 then
minetest.add_item(self.lastpos, "rangedweapons:javelin")
end
else
local damage = math.random(4,16)
obj:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups= {fleshy = damage},
}, nil)
minetest.sound_play("default_dig_cracky", {pos = self.lastpos, gain = 0.8})
self.object:remove()
if not minetest.setting_getbool("creative_mode") and math.random(1, 100) <= 95 then
minetest.add_item(self.lastpos, "rangedweapons:javelin")
end
end
end
end
end
if self.lastpos.x ~= nil then
if minetest.registered_nodes[node.name].walkable then
if not minetest.setting_getbool("creative_mode") and math.random(1, 100) <= 95 then
minetest.add_item(self.lastpos, "rangedweapons:javelin")
end
minetest.sound_play("default_dig_cracky", {pos = self.lastpos, gain = 0.8})
self.object:remove()
end
end
self.lastpos= {x = pos.x, y = pos.y, z = pos.z}
end
minetest.register_entity("rangedweapons:javelin", rangedweapons_javelin)

View File

@ -0,0 +1,58 @@
minetest.register_craftitem("rangedweapons:thrown_javelin", {
wield_scale = {x=2.0,y=2.0,z=1.0},
inventory_image = "rangedweapons_thrown_javelin.png",
})
minetest.register_tool("rangedweapons:javelin", {
description = "" ..core.colorize("#35cdff","Javelin\n") ..core.colorize("#FFFFFF", "Melee damage: 8\n") ..core.colorize("#FFFFFF", "Melee range: 4.5\n")..core.colorize("#FFFFFF", "Full punch interval: 1.25\n") ..core.colorize("#FFFFFF", "Ranged damage: 9\n") ..core.colorize("#FFFFFF", "Accuracy: 92%\n") ..core.colorize("#FFFFFF", "knockback: 10\n") ..core.colorize("#FFFFFF", "Critical chance: 11%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.5x\n") ..core.colorize("#FFFFFF", "Projectile gravity: 6\n") ..core.colorize("#FFFFFF", "Projectile velocity: 35\n") ..core.colorize("#FFFFFF", "Enemy penetration: 50%\n") ..core.colorize("#ffc000", "Right-click to throw, Left-click to stab\n")..core.colorize("#ffc000", "Throwing wears the javelin out 5x faster than stabbing.") ,
wield_scale = {x=2.0,y=2.0,z=1.0},
range = 4.5,
inventory_image = "rangedweapons_javelin.png",
tool_capabilities = {
full_punch_interval = 1.25,
max_drop_level = 0,
groupcaps = {
stabby = {times={[1]=0.25, [2]=0.50, [3]=0.75}, uses=66.6, maxlevel=2},
},
damage_groups = {fleshy=8,knockback=10},
},
RW_throw_capabilities = {
throw_damage = {fleshy=9,knockback=10},
throw_crit = 11,
throw_critEffc = 2.5,
throw_skill = {"throw_skill",20},
throw_velocity = 40,
throw_accuracy = 92,
throw_cooldown = 0.0,
throw_projectiles = 1,
throw_gravity = 6,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 50,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:thrown_javelin",
throw_projectile_size = 0.15,
throw_glass_breaking = 1,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
local throwDur = 40
if bullet.wear+(65535/throwDur) < 65535 then
javStack = {name="rangedweapons:javelin",wear=(bullet.wear)+(65535/throwDur)}
minetest.add_item(bullet.object:get_pos(),javStack) end end,
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,68 @@
minetest.register_tool("rangedweapons:kriss_sv_r", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.15},
description = "",
rw_next_reload = "rangedweapons:kriss_sv_rr",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_kriss_sv_rld.png",
})
minetest.register_tool("rangedweapons:kriss_sv_rr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.15},
description = "",
rw_next_reload = "rangedweapons:kriss_sv_rrr",
load_sound = "rangedweapons_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_kriss_sv.png",
})
minetest.register_tool("rangedweapons:kriss_sv_rrr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.15},
description = "",
rw_next_reload = "rangedweapons:kriss_sv",
load_sound = "rangedweapons_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_kriss_sv.png",
})
minetest.register_tool("rangedweapons:kriss_sv", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.15},
description = "" ..core.colorize("#35cdff","Kriss Super V\n") ..core.colorize("#FFFFFF", "Gun damage: 1\n") ..core.colorize("#FFFFFF", "accuracy: 60%\n") ..core.colorize("#FFFFFF", "Gun knockback: 0\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 6%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 1.85x\n") ..core.colorize("#FFFFFF", "Reload delay: 0.9\n") ..core.colorize("#FFFFFF", "Clip size: 33/33/13\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm parabellum/10mm auto/.45 acp\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.05\n") ..core.colorize("#FFFFFF", "Gun type: machine pistol\n") ..core.colorize("#FFFFFF", "Bullet velocity: 20"),
range = 0,
inventory_image = "rangedweapons_kriss_sv.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=1,knockback=0},
gun_crit = 6,
gun_critEffc = 1.95,
suitable_ammo = {{"rangedweapons:9mm",33},{"rangedweapons:10mm",33},{"rangedweapons:45acp",13}},
gun_skill = {"mp_skill",90},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_kriss_sv_icon.png",
gun_unloaded = "rangedweapons:kriss_sv_r",
gun_velocity = 20,
gun_accuracy = 60,
gun_cooldown = 0.05,
gun_reload = 0.9/4,
gun_projectiles = 1,
has_shell = 1,
gun_gravity = 0,
gun_durability = 1750,
gun_smokeSize = 4,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_machine_pistol",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,46 @@
minetest.register_craftitem("rangedweapons:blue_ray_visual", {
wield_scale = {x=1.75,y=1.75,z=1.75},
inventory_image = "rangedweapons_blue_ray.png",
})
minetest.register_tool("rangedweapons:laser_blaster", {
stack_max= 1,
wield_scale = {x=1.15,y=1.15,z=1.15},
description = "" ..core.colorize("#35cdff","Laser blaster\n") ..core.colorize("#FFFFFF", "Ranged damage: 15\n") ..core.colorize("#FFFFFF", "accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 0\n") ..core.colorize("#FFFFFF", "Critical chance: 10%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.0x\n") ..core.colorize("#FFFFFF", "Power usage: 10\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.3\n") ..core.colorize("#FFFFFF", "Enemy penetration: 50%\n") ..core.colorize("#FFFFFF", "Gun type: power pistol\n") ..core.colorize("#FFFFFF", "Bullet velocity: 65"),
range = 0,
inventory_image = "rangedweapons_laser_blaster.png",
RW_powergun_capabilities = {
power_damage = {fleshy=15,knockback=0},
power_crit = 10,
power_critEffc = 2.0,
power_skill = {"",1},
power_cooling = "rangedweapons:laser_blaster",
power_velocity = 65,
power_accuracy = 100,
power_cooldown = 0.3,
power_projectiles = 1,
power_durability = 5000,
power_sound = "rangedweapons_laser",
power_glass_breaking = 1,
power_door_breaking = 1,
power_dps = 0,
power_mob_penetration = 50,
power_node_penetration = 0,
power_dps = 0,
power_consumption = 10,
power_entity = "rangedweapons:shot_bullet",
power_visual = "wielditem",
power_texture = "rangedweapons:blue_ray_visual",
power_projectile_size = 0.1,
has_sparks = 0,
ignites_explosives = 1,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_powergun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,38 @@
minetest.register_craftitem("rangedweapons:red_ray_visual", {
wield_scale = {x=1.5,y=1.5,z=2.0},
inventory_image = "rangedweapons_red_ray.png",
})
minetest.register_tool("rangedweapons:laser_rifle", {
wield_scale = {x=1.9,y=1.9,z=2.5},
description = "" ..core.colorize("#35cdff","Laser rifle\n") ..core.colorize("#FFFFFF", "Ranged damage: 12\n") ..core.colorize("#FFFFFF", "accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 0\n") ..core.colorize("#FFFFFF", "Critical chance: 9%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.0x\n") ..core.colorize("#FFFFFF", "Power usage: 8\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.1 (full-auto)\n") ..core.colorize("#FFFFFF", "Enemy penetration: 40%\n") ..core.colorize("#FFFFFF", "Gun type: power assault rifle\n") ..core.colorize("#FFFFFF", "Bullet velocity: 60"),
range = 0,
RW_powergun_capabilities = {
automatic_gun = 1,
power_damage = {fleshy=12,knockback=0},
power_crit = 9,
power_critEffc = 2.0,
power_skill = {"",1},
power_cooling = "rangedweapons:laser_rifle",
power_velocity = 60,
power_accuracy = 100,
power_cooldown = 0.1,
power_projectiles = 1,
power_durability = 12500,
power_sound = "rangedweapons_laser",
power_glass_breaking = 1,
power_door_breaking = 1,
power_dps = 0,
power_mob_penetration = 40,
power_node_penetration = 0,
power_dps = 0,
power_consumption = 8,
power_entity = "rangedweapons:shot_bullet",
power_visual = "wielditem",
power_texture = "rangedweapons:red_ray_visual",
power_projectile_size = 0.075,
has_sparks = 0,
ignites_explosives = 1,
},
inventory_image = "rangedweapons_laser_rifle.png",
})

View File

@ -0,0 +1,39 @@
minetest.register_tool("rangedweapons:laser_shotgun", {
stack_max= 1,
wield_scale = {x=2.0,y=2.0,z=1.75},
description = "" ..core.colorize("#35cdff","Laser shotgun\n") ..core.colorize("#FFFFFF", "Ranged damage: 10\n") ..core.colorize("#FFFFFF", "accuracy: 40%\n") ..core.colorize("#FFFFFF", "projectiles: 6\n") ..core.colorize("#FFFFFF", "knockback: 0\n") ..core.colorize("#FFFFFF", "Critical chance: 8%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.2x\n") ..core.colorize("#FFFFFF", "Power usage: 30\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.5\n") ..core.colorize("#FFFFFF", "Enemy penetration: 40%\n") ..core.colorize("#FFFFFF", "Gun type: power pistol\n") ..core.colorize("#FFFFFF", "Bullet velocity: 55"),
range = 0,
inventory_image = "rangedweapons_laser_shotgun.png",
RW_powergun_capabilities = {
power_damage = {fleshy=10,knockback=0},
power_crit = 8,
power_critEffc = 2.2,
power_skill = {"",1},
power_cooling = "rangedweapons:laser_shotgun",
power_velocity = 55,
power_accuracy = 40,
power_cooldown = 0.5,
power_projectiles = 1,
power_durability = 2000,
power_sound = "rangedweapons_laser",
power_glass_breaking = 1,
power_door_breaking = 1,
power_dps = 0,
power_mob_penetration = 40,
power_node_penetration = 0,
power_dps = 0,
power_consumption = 30,
power_entity = "rangedweapons:shot_bullet",
power_visual = "sprite",
power_texture = "rangedweapons_green_ray.png",
power_projectile_size = 0.005,
power_projectiles = 6,
has_sparks = 0,
ignites_explosives = 1,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_powergun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1 @@
cc-by-sa 4.0

View File

@ -0,0 +1,78 @@
------------reload--------------------
minetest.register_tool("rangedweapons:luger_r", {
stack_max= 1,
wield_scale = {x=0.9,y=0.9,z=1.0},
description = "",
range = 0,
groups = {not_in_creative_inventory = 1},
rw_next_reload = "rangedweapons:luger_rr",
load_sound = "rangedweapons_handgun_mag_in",
inventory_image = "rangedweapons_luger.png",
})
minetest.register_tool("rangedweapons:luger_rr", {
stack_max= 1,
wield_scale = {x=0.9,y=0.9,z=1.0},
description = "",
range = 0,
groups = {not_in_creative_inventory = 1},
rw_next_reload = "rangedweapons:luger_rrr",
load_sound = "rangedweapons_reload_a",
inventory_image = "rangedweapons_luger.png",
})
minetest.register_tool("rangedweapons:luger_rrr", {
stack_max= 1,
wield_scale = {x=0.9,y=0.9,z=1.0},
description = "",
range = 0,
groups = {not_in_creative_inventory = 1},
rw_next_reload = "rangedweapons:luger",
load_sound = "rangedweapons_reload_b",
inventory_image = "rangedweapons_luger_rld.png",
})
minetest.register_tool("rangedweapons:luger_rld", {
stack_max= 1,
wield_scale = {x=0.9,y=0.9,z=1.0},
description = "",
range = 0,
loaded_gun = "rangedweapons:luger",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_luger_rld.png",
})
-----------------gun--------------
minetest.register_tool("rangedweapons:luger", {
description = "" ..core.colorize("#35cdff","Luger P08\n") ..core.colorize("#FFFFFF", "Ranged damage: 4\n")..core.colorize("#FFFFFF", "Accuracy: 92%\n") ..core.colorize("#FFFFFF", "Gun knockback: 3\n") ..core.colorize("#FFFFFF", "Critical chance: 10%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2x\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm parabellum\n")..core.colorize("#FFFFFF", "Reload delay: 1.0\n")..core.colorize("#FFFFFF", "Clip size: 8\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.625\n") ..core.colorize("#FFFFFF", "Gun type: Handgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 20"),
range = 0,
wield_scale = {x=0.9,y=0.9,z=1.0},
inventory_image = "rangedweapons_luger.png",
RW_gun_capabilities = {
gun_damage = {fleshy=4,knockback=3},
gun_crit = 10,
gun_critEffc = 2.0,
suitable_ammo = {{"rangedweapons:9mm",8}},
gun_skill = {"handgun_skill",40},
gun_magazine = "rangedweapons:handgun_mag_black",
gun_icon = "rangedweapons_luger_icon.png",
gun_unloaded = "rangedweapons:luger_r",
gun_cooling = "rangedweapons:luger_rld",
gun_velocity = 20,
gun_accuracy = 92,
gun_cooldown = 0.625,
gun_reload = 1.0/4,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 600,
gun_smokeSize = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_glock",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,73 @@
minetest.register_tool("rangedweapons:m16_r", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:m16_rr",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m16_rld.png",
})
minetest.register_tool("rangedweapons:m16_rr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:m16_rrr",
load_sound = "rangedweapons_rifle_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m16.png",
})
minetest.register_tool("rangedweapons:m16_rrr", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "",
rw_next_reload = "rangedweapons:m16",
load_sound = "rangedweapons_rifle_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m16.png",
})
minetest.register_tool("rangedweapons:m16", {
stack_max= 1,
wield_scale = {x=1.75,y=1.75,z=1.3},
description = "" ..core.colorize("#35cdff","m16\n") ..core.colorize("#FFFFFF", "Gun damage: 6\n") ..core.colorize("#FFFFFF", "accuracy: 75%\n") ..core.colorize("#FFFFFF", "Gun knockback: 4\n") ..core.colorize("#FFFFFF", "Gun Critical chance: 11%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.75x\n") ..core.colorize("#FFFFFF", "Reload delay: 1.0\n") ..core.colorize("#FFFFFF", "Clip size: 20\n") ..core.colorize("#FFFFFF", "Ammunition: 5.56mm rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.067(full-auto)\n") ..core.colorize("#FFFFFF", "Gun type: assault rifle\n")
..core.colorize("#FFFFFF", "Enemy penetration: 10%\n") ..core.colorize("#FFFFFF", "Bullet velocity: 35"),
range = 0,
inventory_image = "rangedweapons_m16.png",
RW_gun_capabilities = {
automatic_gun = 1,
gun_damage = {fleshy=6,knockback=4},
gun_crit = 11,
gun_critEffc = 2.75,
suitable_ammo = {{"rangedweapons:556mm",20}},
gun_skill = {"arifle_skill",55},
gun_magazine = "rangedweapons:assaultrifle_mag",
gun_icon = "rangedweapons_m16_icon.png",
gun_unloaded = "rangedweapons:m16_r",
gun_velocity = 35,
gun_accuracy = 75,
gun_cooldown = 0.067,
gun_reload = 1.0/4,
gun_projectiles = 1,
has_shell = 1,
gun_gravity = 0,
gun_durability = 1350,
gun_smokeSize = 5,
gun_mob_penetration = 10,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_smg",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
inventory_image = "rangedweapons_m16.png",
})

View File

@ -0,0 +1,78 @@
minetest.register_tool("rangedweapons:m1991_rld", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
range = 0,
loaded_gun = "rangedweapons:m1991",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m1991_rld.png",
})
minetest.register_tool("rangedweapons:m1991_r", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
rw_next_reload = "rangedweapons:m1991_rr",
load_sound = "rangedweapons_handgun_mag_in",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m1991.png",
})
minetest.register_tool("rangedweapons:m1991_rr", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
rw_next_reload = "rangedweapons:m1991_rrr",
load_sound = "rangedweapons_reload_a",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m1991.png",
})
minetest.register_tool("rangedweapons:m1991_rrr", {
stack_max= 1,
wield_scale = {x=1.1,y=1.1,z=1.05},
description = "",
rw_next_reload = "rangedweapons:m1991",
load_sound = "rangedweapons_reload_b",
range = 0,
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_m1991_rld.png",
})
minetest.register_tool("rangedweapons:m1991", {
description = "" ..core.colorize("#35cdff","m1991\n") ..core.colorize("#FFFFFF", "Gun damage: 4\n")..core.colorize("#FFFFFF", "Accuracy: 92%\n") ..core.colorize("#FFFFFF", "gun knockback: 4\n") ..core.colorize("#FFFFFF", "Gun crit chance: 13%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Reload delay: 1.0\n")..core.colorize("#FFFFFF", "Clip size: 8\n") ..core.colorize("#FFFFFF", "Ammunition: .45acp\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.4\n") ..core.colorize("#FFFFFF", "Gun type: Handgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
wield_scale = {x=1.1,y=1.1,z=1.05},
range = 0,
inventory_image = "rangedweapons_m1991.png",
RW_gun_capabilities = {
gun_damage = {fleshy=4,knockback=4},
gun_crit = 15,
gun_critEffc = 2.1,
suitable_ammo = {{"rangedweapons:45acp",8}},
gun_skill = {"handgun_skill",40},
gun_magazine = "rangedweapons:handgun_mag_black",
gun_icon = "rangedweapons_m1991_icon.png",
gun_unloaded = "rangedweapons:m1991_r",
gun_cooling = "rangedweapons:m1991_rld",
gun_velocity = 25,
gun_accuracy = 92,
gun_cooldown = 0.4,
gun_reload = 1.0/4,
gun_projectiles = 1,
has_shell = 1,
gun_durability = 1000,
gun_smokeSize = 5,
gun_unload_sound = "rangedweapons_handgun_mag_out",
gun_sound = "rangedweapons_beretta",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})

Some files were not shown because too many files have changed in this diff Show More