glock17.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. minetest.register_tool("rangedweapons:glock17_rld", {
  2. stack_max= 1,
  3. wield_scale = {x=1.1,y=1.1,z=1.05},
  4. description = "",
  5. loaded_gun = "rangedweapons:glock17",
  6. range = 0,
  7. groups = {not_in_creative_inventory = 1},
  8. inventory_image = "rangedweapons_glock17_rld.png",
  9. })
  10. minetest.register_tool("rangedweapons:glock17_r", {
  11. stack_max= 1,
  12. wield_scale = {x=1.2,y=1.2,z=1.2},
  13. description = "",
  14. rw_next_reload = "rangedweapons:glock17_rr",
  15. load_sound = "rangedweapons_handgun_mag_in",
  16. range = 0,
  17. groups = {not_in_creative_inventory = 1},
  18. inventory_image = "rangedweapons_glock17.png",
  19. })
  20. minetest.register_tool("rangedweapons:glock17_rr", {
  21. stack_max= 1,
  22. wield_scale = {x=1.2,y=1.2,z=1.2},
  23. description = "",
  24. rw_next_reload = "rangedweapons:glock17_rrr",
  25. load_sound = "rangedweapons_reload_a",
  26. range = 0,
  27. groups = {not_in_creative_inventory = 1},
  28. inventory_image = "rangedweapons_glock17.png",
  29. })
  30. minetest.register_tool("rangedweapons:glock17_rrr", {
  31. stack_max= 1,
  32. wield_scale = {x=1.2,y=1.2,z=1.2},
  33. description = "",
  34. rw_next_reload = "rangedweapons:glock17",
  35. load_sound = "rangedweapons_reload_b",
  36. range = 0,
  37. groups = {not_in_creative_inventory = 1},
  38. inventory_image = "rangedweapons_glock17_rld.png",
  39. })
  40. minetest.register_tool("rangedweapons:glock17", {
  41. 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"),
  42. wield_scale = {x=1.2,y=1.2,z=1.2},
  43. range = 0,
  44. inventory_image = "rangedweapons_glock17.png",
  45. RW_gun_capabilities = {
  46. gun_damage = {fleshy=5,knockback=4},
  47. gun_crit = 15,
  48. gun_critEffc = 2.2,
  49. suitable_ammo = {{"rangedweapons:9mm",17},{"rangedweapons:10mm",17},{"rangedweapons:45acp",17}},
  50. gun_skill = {"handgun_skill",45},
  51. gun_magazine = "rangedweapons:handgun_mag_black",
  52. gun_icon = "rangedweapons_glock17_icon.png",
  53. gun_unloaded = "rangedweapons:glock17_r",
  54. gun_cooling = "rangedweapons:glock17_rld",
  55. gun_velocity = 30,
  56. gun_accuracy = 96,
  57. gun_cooldown = 0.35,
  58. gun_reload = 0.9/4,
  59. gun_projectiles = 1,
  60. has_shell = 1,
  61. gun_durability = 1400,
  62. gun_smokeSize = 5,
  63. gun_unload_sound = "rangedweapons_handgun_mag_out",
  64. gun_sound = "rangedweapons_glock",
  65. },
  66. on_secondary_use = function(itemstack, user, pointed_thing)
  67. rangedweapons_reload_gun(itemstack, user)
  68. return itemstack
  69. end,
  70. on_use = function(itemstack, user, pointed_thing)
  71. rangedweapons_shoot_gun(itemstack, user)
  72. return itemstack
  73. end,
  74. })