spas12.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. minetest.register_tool("rangedweapons:spas12_rld", {
  2. stack_max= 1,
  3. range = 0,
  4. wield_scale = {x=1.9,y=1.9,z=1.1},
  5. description = "",
  6. loaded_gun = "rangedweapons:spas12",
  7. loaded_sound = "rangedweapons_shotgun_reload_b",
  8. groups = {not_in_creative_inventory = 1},
  9. inventory_image = "rangedweapons_spas12_rld.png",
  10. })
  11. minetest.register_tool("rangedweapons:spas12", {
  12. 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"),
  13. range = 0,
  14. wield_scale = {x=1.9,y=1.9,z=1.1},
  15. inventory_image = "rangedweapons_spas12.png",
  16. RW_gun_capabilities = {
  17. gun_damage = {fleshy=3,knockback=7},
  18. gun_crit = 7,
  19. gun_critEffc = 2.1,
  20. suitable_ammo = {{"rangedweapons:shell",8}},
  21. gun_skill = {"shotgun_skill",20},
  22. gun_icon = "rangedweapons_spas12_icon.png",
  23. gun_unloaded = "rangedweapons:spas12_rld",
  24. gun_cooling = "rangedweapons:spas12_uld",
  25. gun_velocity = 32,
  26. gun_accuracy = 52,
  27. gun_cooldown = 0.45,
  28. gun_gravity = 3,
  29. gun_reload = 0.25,
  30. gun_projectiles = 6,
  31. has_shell = 0,
  32. gun_durability = 550,
  33. gun_smokeSize = 15,
  34. gun_door_breaking = 1,
  35. gun_sound = "rangedweapons_shotgun_shot",
  36. gun_unload_sound = "rangedweapons_shell_insert",
  37. },
  38. on_secondary_use = function(itemstack, user, pointed_thing)
  39. rangedweapons_single_load_gun(itemstack, user, "")
  40. return itemstack
  41. end,
  42. on_use = function(itemstack, user, pointed_thing)
  43. rangedweapons_shoot_gun(itemstack, user)
  44. return itemstack
  45. end,
  46. })
  47. minetest.register_tool("rangedweapons:spas12_uld", {
  48. stack_max= 1,
  49. wield_scale = {x=1.9,y=1.9,z=1.1},
  50. range = 0,
  51. 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"),
  52. inventory_image = "rangedweapons_spas12.png",
  53. groups = {not_in_creative_inventory = 1},
  54. on_use = function(user)
  55. minetest.sound_play("rangedweapons_empty", {user})
  56. end,
  57. on_secondary_use = function(itemstack, user, pointed_thing)
  58. eject_shell(itemstack,user,"rangedweapons:spas12_rld",0.6,"rangedweapons_shotgun_reload_a","rangedweapons:empty_shell")
  59. return itemstack
  60. end,
  61. })