Upload files to 'mods/rangedweapons'

This commit is contained in:
thunderdog1138 2021-05-26 15:19:14 +00:00
parent 52889661c7
commit 90c6173a9d
4 changed files with 589 additions and 0 deletions

View File

@ -0,0 +1,269 @@
minetest.register_craftitem("rangedweapons:wooden_shuriken", {
description = "" ..core.colorize("#35cdff","Wooden shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 2\n") ..core.colorize("#FFFFFF", "Accuracy: 80%\n") ..core.colorize("#FFFFFF", "knockback: 5\n") ..core.colorize("#FFFFFF", "Critical chance: 6%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 10%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 10\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.35\n") ..core.colorize("#FFFFFF", "Projectile velocity: 25"),
range = 0,
stack_max= 100,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_wooden_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=2,knockback=5},
throw_crit = 6,
throw_critEffc = 2.0,
throw_skill = {"throw_skill",35},
throw_velocity = 25,
throw_accuracy = 80,
throw_cooldown = 0.35,
throw_projectiles = 1,
throw_gravity = 10,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 0,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:wooden_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 0,
has_sparks = 0,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 10 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:wooden_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:stone_shuriken", {
description = "" ..core.colorize("#35cdff","Stone shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 4\n") ..core.colorize("#FFFFFF", "Accuracy: 75%\n") ..core.colorize("#FFFFFF", "knockback: 8\n") ..core.colorize("#FFFFFF", "Critical chance: 7%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 15%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 15\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.35\n") ..core.colorize("#FFFFFF", "Projectile velocity: 20"),
range = 0,
stack_max= 125,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_stone_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=4,knockback=8},
throw_crit = 7,
throw_critEffc = 2.1,
throw_skill = {"throw_skill",30},
throw_velocity = 20,
throw_accuracy = 75,
throw_cooldown = 0.5,
throw_projectiles = 1,
throw_gravity = 15,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 0,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:stone_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 1,
has_sparks = 0,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 15 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:stone_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:steel_shuriken", {
description = "" ..core.colorize("#35cdff","Steel shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 6\n") ..core.colorize("#FFFFFF", "Accuracy: 85%\n") ..core.colorize("#FFFFFF", "knockback: 3\n") ..core.colorize("#FFFFFF", "Critical chance: 8%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.2x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 35%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 8\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.25\n") ..core.colorize("#FFFFFF", "Projectile velocity: 30"),
range = 0,
stack_max= 150,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_steel_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=6,knockback=3},
throw_crit = 8,
throw_critEffc = 2.2,
throw_skill = {"throw_skill",40},
throw_velocity = 30,
throw_accuracy = 85,
throw_cooldown = 0.25,
throw_projectiles = 1,
throw_gravity = 8,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 0,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:steel_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 0,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 35 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:steel_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:bronze_shuriken", {
description = "" ..core.colorize("#35cdff","Bronze shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 6\n") ..core.colorize("#FFFFFF", "Accuracy: 85%\n") ..core.colorize("#FFFFFF", "knockback: 3\n") ..core.colorize("#FFFFFF", "Critical chance: 8%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.2x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 30%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 8\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.25\n") ..core.colorize("#FFFFFF", "Projectile velocity: 30"),
range = 0,
stack_max= 150,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_bronze_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=6,knockback=3},
throw_crit = 8,
throw_critEffc = 2.2,
throw_skill = {"throw_skill",40},
throw_velocity = 30,
throw_accuracy = 85,
throw_cooldown = 0.25,
throw_projectiles = 1,
throw_gravity = 8,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 0,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:bronze_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 0,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 30 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:bronze_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:golden_shuriken", {
description = "" ..core.colorize("#35cdff","Golden shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 8\n") ..core.colorize("#FFFFFF", "Accuracy: 75%\n") ..core.colorize("#FFFFFF", "knockback: 10\n") ..core.colorize("#FFFFFF", "Critical chance: 12%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.5x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 25%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 15\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.4\n") ..core.colorize("#FFFFFF", "Projectile velocity: 25"),
range = 0,
stack_max= 175,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_golden_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=8,knockback=10},
throw_crit = 12,
throw_critEffc = 2.5,
throw_skill = {"throw_skill",35},
throw_velocity = 25,
throw_accuracy = 75,
throw_cooldown = 0.4,
throw_projectiles = 1,
throw_gravity = 15,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 0,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:golden_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 1,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 25 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:golden_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:mese_shuriken", {
description = "" ..core.colorize("#35cdff","MESE shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 7\n") ..core.colorize("#FFFFFF", "Accuracy: 90%\n") ..core.colorize("#FFFFFF", "knockback: 2\n") ..core.colorize("#FFFFFF", "Critical chance: 9%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.3x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 50%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 5\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.2\n") ..core.colorize("#FFFFFF", "Enemy penetration: 25%\n") ..core.colorize("#FFFFFF", "Projectile velocity: 35"),
range = 0,
stack_max= 175,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_mese_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=7,knockback=2},
throw_crit = 9,
throw_critEffc = 2.3,
throw_skill = {"throw_skill",45},
throw_velocity = 35,
throw_accuracy = 90,
throw_cooldown = 0.2,
throw_projectiles = 1,
throw_gravity = 5,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 25,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:mese_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 1,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 50 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:mese_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})
minetest.register_craftitem("rangedweapons:diamond_shuriken", {
description = "" ..core.colorize("#35cdff","Diamond shuriken\n") ..core.colorize("#FFFFFF", "Ranged damage: 8\n") ..core.colorize("#FFFFFF", "Accuracy: 95%\n") ..core.colorize("#FFFFFF", "knockback: 2\n") ..core.colorize("#FFFFFF", "Critical chance: 10%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.4x\n") ..core.colorize("#FFFFFF", "Shuriken survival rate: 60%\n") ..core.colorize("#FFFFFF", "Projectile gravity: 5\n") ..core.colorize("#FFFFFF", "Throwing cooldown: 0.15\n") ..core.colorize("#FFFFFF", "Enemy penetration: 33%\n") ..core.colorize("#FFFFFF", "Projectile velocity: 40"),
range = 0,
stack_max= 200,
wield_scale = {x=0.6,y=0.6,z=0.5},
inventory_image = "rangedweapons_diamond_shuriken.png",
RW_throw_capabilities = {
throw_damage = {fleshy=8,knockback=2},
throw_crit = 10,
throw_critEffc = 2.4,
throw_skill = {"throw_skill",50},
throw_velocity = 40,
throw_accuracy = 95,
throw_cooldown = 0.15,
throw_projectiles = 1,
throw_gravity = 5,
throw_sound = "rangedweapons_throw",
throw_dps = 0,
throw_mob_penetration = 33,
throw_node_penetration = 0,
throw_entity = "rangedweapons:shot_bullet",
throw_visual = "wielditem",
throw_texture = "rangedweapons:diamond_shuriken",
throw_projectile_size = 0.15,
throw_glass_breaking = 1,
has_sparks = 1,
ignites_explosives = 0,
throw_door_breaking = 0,
OnCollision = function(player,bullet,target)
if math.random(1, 100) <= 60 then
minetest.add_item(bullet.object:get_pos(), "rangedweapons:diamond_shuriken") end end,
},
on_use = function(itemstack, user, pointed_thing)
rangedweapons_yeet(itemstack, user)
return itemstack
end,
})

View File

@ -0,0 +1,154 @@
minetest.register_on_joinplayer(function(player)
local meta = player:get_meta()
if meta:get_int("handgun_skill") == 0
then
meta:set_int("handgun_skill",100)
end
if meta:get_int("mp_skill") == 0
then
meta:set_int("mp_skill",100)
end
if meta:get_int("smg_skill") == 0
then
meta:set_int("smg_skill",100)
end
if meta:get_int("shotgun_skill") == 0
then
meta:set_int("shotgun_skill",100)
end
if meta:get_int("heavy_skill") == 0
then
meta:set_int("heavy_skill",100)
end
if meta:get_int("arifle_skill") == 0
then
meta:set_int("arifle_skill",100)
end
if meta:get_int("revolver_skill") == 0
then
meta:set_int("revolver_skill",100)
end
if meta:get_int("rifle_skill") == 0
then
meta:set_int("rifle_skill",100)
end
if meta:get_int("throw_skill") == 0
then
meta:set_int("throw_skill",100)
end
end)
minetest.register_chatcommand("gunskills", {
func = function(name, param)
for _, player in pairs(minetest.get_connected_players()) do
local meta = player:get_meta()
local handguns = meta:get_int("handgun_skill")
local mps = meta:get_int("mp_skill")
local smgs = meta:get_int("smg_skill")
local shotguns = meta:get_int("shotgun_skill")
local heavy = meta:get_int("heavy_skill")
local arifle = meta:get_int("arifle_skill")
local revolver = meta:get_int("revolver_skill")
local rifle = meta:get_int("rifle_skill")
local throw = meta:get_int("throw_skill")
minetest.show_formspec(name, "rangedweapons:gunskills_form",
"size[11,7]"..
"label[0,0;Gun efficiency: increases damage, accuracy and crit chance.]"..
"image[0,1;1,1;rangedweapons_handgun_img.png]"..
"label[1,1.2;Handgun efficiency: " .. handguns .. "%]"..
"image[0,2;1,1;rangedweapons_machinepistol_img.png]"..
"label[1,2.2;M.Pistol efficiency: " .. mps .. "%]"..
"image[0,3;1,1;rangedweapons_smg_img.png]"..
"label[1,3.2;S.M.G efficiency: " .. smgs .. "%]"..
"image[0,4;1,1;rangedweapons_shotgun_img.png]"..
"label[1,4.2;Shotgun efficiency: " .. shotguns .. "%]"..
"image[0,5;1,1;rangedweapons_heavy_img.png]"..
"label[1,5.2;Heavy.MG efficiency: " .. heavy .. "%]"..
"image[0,6;1,1;rangedweapons_arifle_img.png]"..
"label[1,6.2;A.rifle efficiency: " .. arifle .. "%]"..
"image[5,1;1,1;rangedweapons_revolver_img.png]"..
"label[6,1.2;Revl./mgn. efficiency: " .. revolver .. "%]"..
"image[5,2;1,1;rangedweapons_rifle_img.png]"..
"label[6,2.2;Rifle efficiency: " .. rifle .. "%]"..
"image[5,3;1,1;rangedweapons_yeetable_img.png]"..
"label[6,3.2;Throwing efficiency: " .. throw .. "%]"..
"button_exit[9,0;2,1;exit;Done]")
end
end
})
local timer = 0
minetest.register_globalstep(function(dtime, player)
timer = timer + dtime;
if timer >= 60.0 then
for _, player in pairs(minetest.get_connected_players()) do
local meta = player:get_meta()
local handguns = meta:get_int("handgun_skill")
local mps = meta:get_int("mp_skill")
local smgs = meta:get_int("smg_skill")
local shotguns = meta:get_int("shotgun_skill")
local heavy = meta:get_int("heavy_skill")
local arifle = meta:get_int("arifle_skill")
local revolver = meta:get_int("revolver_skill")
local rifle = meta:get_int("rifle_skill")
local throw = meta:get_int("throw_skill")
if math.random(1, 40) == 1 then
if handguns > rweapons_min_gun_efficiency then
meta:set_int("handgun_skill", handguns - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Handgun skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if mps > rweapons_min_gun_efficiency then
meta:set_int("mp_skill", mps - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Machine Pistol skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if smgs > rweapons_min_gun_efficiency then
meta:set_int("smg_skill", smgs - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","S.M.G skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if shotguns > rweapons_min_gun_efficiency then
meta:set_int("shotgun_skill", shotguns - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Shotgun skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if heavy > rweapons_min_gun_efficiency then
meta:set_int("heavy_skill", heavy - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Heavy.MG skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if arifle > rweapons_min_gun_efficiency then
meta:set_int("arifle_skill", arifle - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","A.Rifle skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if revolver > rweapons_min_gun_efficiency then
meta:set_int("revolver_skill", revolver - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Revolver/magnum skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if rifle > rweapons_min_gun_efficiency then
meta:set_int("rifle_skill", rifle - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Rifle skill degraded! "))
end
end
if math.random(1, 40) == 1 then
if throw > rweapons_min_gun_efficiency then
meta:set_int("throw_skill", throw - 1)
minetest.chat_send_player(player:get_player_name(), "" ..core.colorize("#ff0000","Throwing skill degraded! "))
end
end
timer = 0
end
end
end)

View File

@ -0,0 +1,63 @@
minetest.register_tool("rangedweapons:spas12_rld", {
stack_max= 1,
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
loaded_gun = "rangedweapons:spas12",
loaded_sound = "rangedweapons_shotgun_reload_b",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_spas12_rld.png",
})
minetest.register_tool("rangedweapons:spas12", {
description = "" ..core.colorize("#35cdff","spas-12\n") ..core.colorize("#FFFFFF", "Ranged damage: 3\n") ..core.colorize("#FFFFFF", "projectiles: 6\n") ..core.colorize("#FFFFFF", "Gun gravity: 3\n") ..core.colorize("#FFFFFF", "Accuracy: 52%\n")..core.colorize("#FFFFFF", "knockback: 7\n") ..core.colorize("#FFFFFF", "Critical chance: 7%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shells\n") ..core.colorize("#FFFFFF", "Pump delay: 0.45\n")..core.colorize("#FFFFFF", "Clip size: 8\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: 32"),
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
inventory_image = "rangedweapons_spas12.png",
RW_gun_capabilities = {
gun_damage = {fleshy=3,knockback=7},
gun_crit = 7,
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,
gun_accuracy = 52,
gun_cooldown = 0.45,
gun_gravity = 3,
gun_reload = 0.25,
gun_projectiles = 6,
has_shell = 0,
gun_durability = 550,
gun_smokeSize = 15,
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:spas12_uld", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.1},
range = 0,
description = "" ..core.colorize("#35cdff","spas-12\n") ..core.colorize("#FFFFFF", "Ranged damage: 2\n") ..core.colorize("#FFFFFF", "projectiles: 6\n") ..core.colorize("#FFFFFF", "Gun gravity: 3\n") ..core.colorize("#FFFFFF", "Accuracy: 52%\n")..core.colorize("#FFFFFF", "knockback: 7\n") ..core.colorize("#FFFFFF", "Critical chance: 7%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Ammunition: 12 gauge shells\n") ..core.colorize("#FFFFFF", "Pump delay: 0.45\n")..core.colorize("#FFFFFF", "Clip size: 8\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: 28"),
inventory_image = "rangedweapons_spas12.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:spas12_rld",0.6,"rangedweapons_shotgun_reload_a","rangedweapons:empty_shell")
return itemstack
end,
})

103
mods/rangedweapons/svd.lua Normal file
View File

@ -0,0 +1,103 @@
minetest.register_tool("rangedweapons:svd_uld", {
stack_max= 1,
wield_scale = {x=1.9,y=1.9,z=1.1},
range = 0,
description = "" ..core.colorize("#35cdff","S.V.D. \n") ..core.colorize("#FFFFFF", "Ranged damage:17 + 30/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 14\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 10x\n") ..core.colorize("#be0d00", "Right-click to eject empty bullet shell\n") ..core.colorize("#FFFFFF", "Clip size: 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_svd.png",
weapon_zoom = 9,
on_use = function(user)
minetest.sound_play("rangedweapons_empty", {user})
end,
on_secondary_use = function(itemstack, user, pointed_thing)
eject_shell(itemstack,user,"rangedweapons:svd_rld",1.0,"rangedweapons_rifle_reload_a","rangedweapons:empty_shell")
return itemstack
end,
})
minetest.register_tool("rangedweapons:svd_r", {
rw_next_reload = "rangedweapons:svd_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_svd_noclip.png",
})
minetest.register_tool("rangedweapons:svd_rr", {
rw_next_reload = "rangedweapons:svd_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_svd.png",
})
minetest.register_tool("rangedweapons:svd_rrr", {
rw_next_reload = "rangedweapons:svd",
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_svd_rld.png",
})
minetest.register_tool("rangedweapons:svd_rld", {
stack_max= 1,
range = 0,
wield_scale = {x=1.9,y=1.9,z=1.1},
description = "",
loaded_gun = "rangedweapons:svd",
loaded_sound = "rangedweapons_rifle_reload_b",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_svd_rld.png",
})
minetest.register_tool("rangedweapons:svd", {
description = "" ..core.colorize("#35cdff","S.V.D. \n") ..core.colorize("#FFFFFF", "Ranged damage:17 + 30/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 14\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 10x\n") ..core.colorize("#27a600", "The gun is loaded!\n") ..core.colorize("#FFFFFF", "Clip size: 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 = 9,
wield_scale = {x=1.9,y=1.9,z=1.1},
inventory_image = "rangedweapons_svd.png",
RW_gun_capabilities = {
gun_damage = {fleshy=17,knockback=14},
gun_crit = 30,
gun_critEffc = 3.0,
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,
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 = 30,
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,
})