beretta.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. minetest.register_tool("rangedweapons:beretta_rld", {
  2. stack_max= 1,
  3. wield_scale = {x=1.1,y=1.1,z=1.05},
  4. description = "",
  5. range = 0,
  6. loaded_gun = "rangedweapons:beretta",
  7. groups = {not_in_creative_inventory = 1},
  8. inventory_image = "rangedweapons_beretta_rld.png",
  9. })
  10. minetest.register_tool("rangedweapons:beretta_r", {
  11. stack_max= 1,
  12. wield_scale = {x=1.1,y=1.1,z=1.05},
  13. description = "",
  14. rw_next_reload = "rangedweapons:beretta",
  15. load_sound = "rangedweapons_handgun_mag_in",
  16. range = 0,
  17. groups = {not_in_creative_inventory = 1},
  18. inventory_image = "rangedweapons_beretta_rld.png",
  19. })
  20. minetest.register_tool("rangedweapons:beretta", {
  21. description = "" ..core.colorize("#35cdff","Beretta M9\n") ..core.colorize("#FFFFFF", "Gun damage: 4\n")..core.colorize("#FFFFFF", "Accuracy: 94%\n") ..core.colorize("#FFFFFF", "gun knockback: 4\n") ..core.colorize("#FFFFFF", "Gun crit chance: 13%\n")..core.colorize("#FFFFFF", "Critical efficiency: 2.1x\n") ..core.colorize("#FFFFFF", "Reload delay: 0.5\n")..core.colorize("#FFFFFF", "Clip size: 15\n") ..core.colorize("#FFFFFF", "Ammunition: 9x19mm Parabellum\n") ..core.colorize("#FFFFFF", "Rate of fire: 0.4\n") ..core.colorize("#FFFFFF", "Gun type: Handgun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 25"),
  22. wield_scale = {x=1.1,y=1.1,z=1.05},
  23. range = 0,
  24. inventory_image = "rangedweapons_beretta.png",
  25. RW_gun_capabilities = {
  26. gun_damage = {fleshy=4,knockback=4},
  27. gun_crit = 15,
  28. gun_critEffc = 2.1,
  29. suitable_ammo = {{"rangedweapons:9mm",15}},
  30. gun_skill = {"handgun_skill",43},
  31. gun_magazine = "rangedweapons:handgun_mag_black",
  32. gun_icon = "rangedweapons_beretta_icon.png",
  33. gun_unloaded = "rangedweapons:beretta_r",
  34. gun_cooling = "rangedweapons:beretta_rld",
  35. gun_velocity = 25,
  36. gun_accuracy = 94,
  37. gun_cooldown = 0.4,
  38. gun_reload = 0.5,
  39. gun_projectiles = 1,
  40. has_shell = 1,
  41. gun_durability = 1150,
  42. gun_smokeSize = 5,
  43. gun_unload_sound = "rangedweapons_handgun_mag_out",
  44. gun_sound = "rangedweapons_beretta",
  45. },
  46. on_secondary_use = function(itemstack, user, pointed_thing)
  47. rangedweapons_reload_gun(itemstack, user)
  48. return itemstack
  49. end,
  50. on_use = function(itemstack, user, pointed_thing)
  51. rangedweapons_shoot_gun(itemstack, user)
  52. return itemstack
  53. end,
  54. })