Magazine ammo count in stack counter, HUD ammo counter removed (#5)

* loaded ammo counting in gun stack counter string

* removed icons and their mentions in init.lua

* removed mention of gun icons from gun files

* removed leftovers of ammo HUD

* add version requirement because meta feature requires 5.8 according to wsor4035

* removed leftover mentions of ammo_icon

* removed depends.txt because of 5.8 requirement
This commit is contained in:
mruncreative 2024-06-02 03:14:24 +02:00 committed by GitHub
parent d719189262
commit 655e428c4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
74 changed files with 9 additions and 118 deletions

@ -46,7 +46,6 @@ minetest.register_tool("rangedweapons:aa12_rrr", {
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,

@ -49,7 +49,6 @@ minetest.register_tool("rangedweapons:ak47_rrr", {
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,

@ -72,7 +72,6 @@ RW_gun_capabilities = {
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,

@ -20,7 +20,6 @@ RW_gun_capabilities = {
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,

@ -32,7 +32,6 @@ RW_gun_capabilities = {
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,

@ -34,7 +34,6 @@ RW_gun_capabilities = {
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,
@ -93,7 +92,6 @@ RW_gun_capabilities = {
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,

@ -1,10 +0,0 @@
default
tnt
doors?
xpanes?
vessels?
moreores?
3d_armor?

@ -49,7 +49,6 @@ minetest.register_tool("rangedweapons:g36_rrr", {
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,

@ -59,7 +59,6 @@ RW_gun_capabilities = {
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,

@ -22,6 +22,11 @@ minetest.register_node("rangedweapons:antigun_block", {
---- gun_funcs
----
local function update_ammo_counter_on_gun(gunMeta)
gunMeta:set_string("count_meta", tostring(gunMeta:get_int("RW_bullets")))
end
make_sparks = function(pos)
minetest.sound_play("rengedweapons_ricochet", {pos = pos, gain = 0.75})
for i=1,9 do
@ -104,20 +109,6 @@ 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")
@ -140,7 +131,7 @@ end
gunMeta:set_string("RW_ammo_name",reload_ammo:get_name())
player:hud_change(gunammo, "text", gunMeta:get_int("RW_bullets"))
update_ammo_counter_on_gun(gunMeta)
if GunCaps.gun_magazine ~= nil then
local pos = player:get_pos()
@ -213,20 +204,6 @@ 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")
@ -248,7 +225,7 @@ end
gunMeta:set_string("RW_ammo_name",reload_ammo:get_name())
player:hud_change(gunammo, "text", gunMeta:get_int("RW_bullets"))
update_ammo_counter_on_gun(gunMeta)
if GunCaps.gun_unloaded ~= nil then
itemstack:set_name(GunCaps.gun_unloaded)
@ -385,13 +362,7 @@ 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)
update_ammo_counter_on_gun(gunMeta)
local OnCollision = function() end
@ -474,12 +445,6 @@ 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
@ -925,35 +890,6 @@ minetest.register_abm({
})
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",

@ -46,7 +46,6 @@ minetest.register_tool("rangedweapons:jackhammer_rrr", {
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,

@ -47,7 +47,6 @@ minetest.register_tool("rangedweapons:kriss_sv_rrr", {
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,

@ -52,7 +52,6 @@ minetest.register_tool("rangedweapons:luger", {
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,

@ -49,7 +49,6 @@ minetest.register_tool("rangedweapons:m16_rrr", {
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,

@ -52,7 +52,6 @@ RW_gun_capabilities = {
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,

@ -72,7 +72,6 @@ RW_gun_capabilities = {
suitable_ammo = {{"rangedweapons:408cheytac",7}},
gun_skill = {"rifle_skill",12},
gun_magazine = "rangedweapons:rifle_mag",
gun_icon = "rangedweapons_m200_icon.png",
gun_unloaded = "rangedweapons:m200_r",
gun_cooling = "rangedweapons:m200_uld",
gun_velocity = 80,

@ -24,7 +24,6 @@ minetest.register_tool("rangedweapons:m60_r", {
gun_critEffc = 3.0,
suitable_ammo = {{"rangedweapons:762mm",100}},
gun_skill = {"heavy_skill",60},
gun_icon = "rangedweapons_m60_icon.png",
gun_unloaded = "rangedweapons:m60_r",
gun_velocity = 64,
gun_accuracy = 65,

@ -22,7 +22,6 @@ minetest.register_tool("rangedweapons:m79", {
suitable_ammo = {{"rangedweapons:40mm",1}},
gun_skill = {"",1},
gun_magazine = "rangedweapons:shell_grenadedrop",
gun_icon = "rangedweapons_m79_icon.png",
gun_unloaded = "rangedweapons:m79_r",
gun_cooling = "rangedweapons:m79",
gun_velocity = 20,

@ -55,7 +55,6 @@ minetest.register_tool("rangedweapons:makarov", {
suitable_ammo = {{"rangedweapons:9mm",8}},
gun_skill = {"handgun_skill",40},
gun_magazine = "rangedweapons:handgun_mag_black",
gun_icon = "rangedweapons_makarov_icon.png",
gun_unloaded = "rangedweapons:makarov_r",
gun_cooling = "rangedweapons:makarov_rld",
gun_velocity = 20,

@ -22,7 +22,6 @@ RW_gun_capabilities = {
suitable_ammo = {{"rangedweapons:40mm",6}},
gun_skill = {"",1},
gun_magazine = "rangedweapons:shell_grenadedrop",
gun_icon = "rangedweapons_milkor_icon.png",
gun_unloaded = "rangedweapons:milkor_rld",
gun_cooling = "rangedweapons:milkor",
gun_velocity = 30,

@ -25,7 +25,6 @@ minetest.register_tool("rangedweapons:minigun_r", {
gun_critEffc = 3.0,
suitable_ammo = {{"rangedweapons:762mm",200}},
gun_skill = {"heavy_skill",100},
gun_icon = "rangedweapons_minigun_icon.png",
gun_unloaded = "rangedweapons:minigun_r",
gun_velocity = 70,
gun_accuracy = 50,

@ -2,3 +2,4 @@ name = rangedweapons
description = A mod that adds guns and throwable weapons
depends = default, tnt
optional_depends = doors, xpanes, vessels, moreores, 3d_armor
min_minetest_version = 5.8

@ -41,7 +41,6 @@
suitable_ammo = {{"rangedweapons:9mm",32}},
gun_skill = {"smg_skill",75},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_mp40_icon.png",
gun_unloaded = "rangedweapons:mp40_r",
gun_velocity = 25,
gun_accuracy = 75,

@ -47,7 +47,6 @@ minetest.register_tool("rangedweapons:mp5_rrr", {
suitable_ammo = {{"rangedweapons:9mm",40},{"rangedweapons:10mm",40}},
gun_skill = {"smg_skill",75},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_mp5_icon.png",
gun_unloaded = "rangedweapons:mp5_r",
gun_velocity = 25,
gun_accuracy = 74,

@ -25,7 +25,6 @@ RW_gun_capabilities = {
gun_critEffc = 2.2,
suitable_ammo = {{"rangedweapons:357",6}},
gun_skill = {"revolver_skill",40},
gun_icon = "rangedweapons_python_icon.png",
gun_unloaded = "rangedweapons:python_rld",
gun_cooling = "rangedweapons:python",
gun_velocity = 55,

@ -20,7 +20,6 @@ RW_gun_capabilities = {
gun_critEffc = 2.0,
suitable_ammo = {{"rangedweapons:shell",4}},
gun_skill = {"shotgun_skill",20},
gun_icon = "rangedweapons_remington_icon.png",
gun_unloaded = "rangedweapons:remington_rld",
gun_cooling = "rangedweapons:remington_uld",
gun_velocity = 18,

@ -10,7 +10,6 @@ minetest.register_tool("rangedweapons:rpg_rld", {
gun_critEffc = 3.0,
suitable_ammo = {{"rangedweapons:rocket",1}},
gun_skill = {"",1},
gun_icon = "rangedweapons_rpg_icon.png",
gun_unloaded = "rangedweapons:rpg_rld",
gun_cooling = "rangedweapons:rpg",
gun_velocity = 25,
@ -44,7 +43,6 @@ minetest.register_tool("rangedweapons:rpg", {
gun_critEffc = 3.0,
suitable_ammo = {{"rangedweapons:rocket",1}},
gun_skill = {"",1},
gun_icon = "rangedweapons_rpg_icon.png",
gun_unloaded = "rangedweapons:rpg_rld",
gun_cooling = "rangedweapons:rpg",
gun_velocity = 25,

@ -48,7 +48,6 @@ minetest.register_tool("rangedweapons:rpk_rrr", {
suitable_ammo = {{"rangedweapons:762mm",75}},
gun_skill = {"heavy_skill",55},
gun_magazine = "rangedweapons:drum_mag",
gun_icon = "rangedweapons_rpk_icon.png",
gun_unloaded = "rangedweapons:rpk_r",
gun_velocity = 55,
gun_accuracy = 70,

@ -47,7 +47,6 @@ minetest.register_tool("rangedweapons:scar_rrr", {
suitable_ammo = {{"rangedweapons:762mm",20},{"rangedweapons:556mm",30}},
gun_skill = {"arifle_skill",50},
gun_magazine = "rangedweapons:assaultrifle_mag",
gun_icon = "rangedweapons_scar_icon.png",
gun_unloaded = "rangedweapons:scar_r",
gun_velocity = 45,
gun_accuracy = 85,

@ -20,7 +20,6 @@ RW_gun_capabilities = {
gun_critEffc = 2.1,
suitable_ammo = {{"rangedweapons:shell",8}},
gun_skill = {"shotgun_skill",20},
gun_icon = "rangedweapons_spas12_icon.png",
gun_unloaded = "rangedweapons:spas12_rld",
gun_cooling = "rangedweapons:spas12_uld",
gun_velocity = 32,

@ -72,7 +72,6 @@ RW_gun_capabilities = {
suitable_ammo = {{"rangedweapons:762mm",10}},
gun_skill = {"rifle_skill",20},
gun_magazine = "rangedweapons:rifle_mag",
gun_icon = "rangedweapons_svd_icon.png",
gun_unloaded = "rangedweapons:svd_r",
gun_cooling = "rangedweapons:svd_uld",
gun_velocity = 75,

@ -22,7 +22,6 @@ RW_gun_capabilities = {
gun_critEffc = 3.1,
suitable_ammo = {{"rangedweapons:44",6}},
gun_skill = {"revolver_skill",40},
gun_icon = "rangedweapons_taurus_icon.png",
gun_unloaded = "rangedweapons:taurus_rld",
gun_cooling = "rangedweapons:taurus",
gun_velocity = 55,

@ -50,7 +50,6 @@ minetest.register_craftitem("rangedweapons:tec9_rrr", {
suitable_ammo = {{"rangedweapons:9mm",50}},
gun_skill = {"mp_skill",80},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_tec9_icon.png",
gun_unloaded = "rangedweapons:tec9_r",
gun_velocity = 20,
gun_accuracy = 75,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

@ -46,7 +46,6 @@ minetest.register_tool("rangedweapons:thompson_rrr", {
suitable_ammo = {{"rangedweapons:10mm",30},{"rangedweapons:45acp",30}},
gun_skill = {"smg_skill",65},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_thompson_icon.png",
gun_unloaded = "rangedweapons:thompson_r",
gun_velocity = 30,
gun_accuracy = 75,

@ -46,7 +46,6 @@ minetest.register_tool("rangedweapons:tmp_rrr", {
suitable_ammo = {{"rangedweapons:9mm",30}},
gun_skill = {"mp_skill",85},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_tmp_icon.png",
gun_unloaded = "rangedweapons:tmp_r",
gun_velocity = 20,
gun_accuracy = 64,

@ -47,7 +47,6 @@ minetest.register_tool("rangedweapons:ump_rrr", {
suitable_ammo = {{"rangedweapons:9mm",25},{"rangedweapons:45acp",25}},
gun_skill = {"smg_skill",60},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_ump_icon.png",
gun_unloaded = "rangedweapons:ump_r",
gun_velocity = 32,
gun_accuracy = 79,

@ -46,7 +46,6 @@ minetest.register_tool("rangedweapons:uzi_rrr", {
suitable_ammo = {{"rangedweapons:9mm",40},{"rangedweapons:45acp",22}},
gun_skill = {"mp_skill",80},
gun_magazine = "rangedweapons:machinepistol_mag",
gun_icon = "rangedweapons_uzi_icon.png",
gun_unloaded = "rangedweapons:uzi_r",
gun_velocity = 25,
gun_accuracy = 72,