mp40.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. minetest.register_tool("rangedweapons:mp40_r", {
  2. wield_scale = {x=1.75,y=1.75,z=1.5},
  3. description = "",
  4. range = 0,
  5. rw_next_reload = "rangedweapons:mp40_rr",
  6. load_sound = "rangedweapons_handgun_mag_in",
  7. inventory_image = "rangedweapons_mp40_rld.png",
  8. groups = {not_in_creative_inventory = 1},
  9. })
  10. minetest.register_tool("rangedweapons:mp40_rr", {
  11. wield_scale = {x=1.75,y=1.75,z=1.5},
  12. description = "",
  13. range = 0,
  14. rw_next_reload = "rangedweapons:mp40_rrr",
  15. load_sound = "rangedweapons_reload_a",
  16. inventory_image = "rangedweapons_mp40.png",
  17. groups = {not_in_creative_inventory = 1},
  18. })
  19. minetest.register_tool("rangedweapons:mp40_rrr", {
  20. wield_scale = {x=1.75,y=1.75,z=1.5},
  21. description = "",
  22. range = 0,
  23. inventory_image = "rangedweapons_mp40.png",
  24. rw_next_reload = "rangedweapons:mp40",
  25. load_sound = "rangedweapons_reload_b",
  26. groups = {not_in_creative_inventory = 1},
  27. })
  28. minetest.register_tool("rangedweapons:mp40", {
  29. stack_max= 1,
  30. wield_scale = {x=1.75,y=1.75,z=1.5},
  31. description = "" ..core.colorize("#35cdff","MP-40\n") ..core.colorize("#FFFFFF", "Ranged damage: 2\n") ..core.colorize("#FFFFFF", "accuracy: 75%\n") ..core.colorize("#FFFFFF", "Gun knockback: 1\n") ..core.colorize("#FFFFFF", "Critical chance: 8%\n") ..core.colorize("#FFFFFF", "Critical efficiency: 2x\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm parabellum\n") ..core.colorize("#FFFFFF", "Clip size: 32\n") ..core.colorize("#FFFFFF", "Reload delay: 1.3\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.14\n") ..core.colorize("#FFFFFF", "Gun type: sub-machinegun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
  32. range = 0,
  33. inventory_image = "rangedweapons_mp40.png",
  34. RW_gun_capabilities = {
  35. automatic_gun = 1,
  36. gun_damage = {fleshy=2,knockback=1},
  37. gun_crit = 8,
  38. gun_critEffc = 2.0,
  39. suitable_ammo = {{"rangedweapons:9mm",32}},
  40. gun_skill = {"smg_skill",75},
  41. gun_magazine = "rangedweapons:machinepistol_mag",
  42. gun_icon = "rangedweapons_mp40_icon.png",
  43. gun_unloaded = "rangedweapons:mp40_r",
  44. gun_velocity = 25,
  45. gun_accuracy = 75,
  46. gun_cooldown = 0.14,
  47. gun_reload = 1.3/4,
  48. gun_projectiles = 1,
  49. has_shell = 1,
  50. gun_gravity = 0,
  51. gun_durability = 1500,
  52. gun_smokeSize = 4,
  53. gun_unload_sound = "rangedweapons_handgun_mag_out",
  54. gun_sound = "rangedweapons_machine_pistol",
  55. },
  56. on_secondary_use = function(itemstack, user, pointed_thing)
  57. rangedweapons_reload_gun(itemstack, user)
  58. return itemstack
  59. end,
  60. })