awp.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. minetest.register_tool("rangedweapons:awp_uld", {
  2. stack_max= 1,
  3. wield_scale = {x=1.9,y=1.9,z=1.1},
  4. range = 0,
  5. description = "" ..core.colorize("#35cdff","A.W.P. \n") ..core.colorize("#FFFFFF", "Ranged damage:18 + 35/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 15\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round/308.Winchester rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 12x\n") ..core.colorize("#be0d00", "Right-click to eject empty bullet shell\n") ..core.colorize("#FFFFFF", "Clip size: 10/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"),
  6. groups = {not_in_creative_inventory = 1},
  7. inventory_image = "rangedweapons_awp.png",
  8. weapon_zoom = 7.5,
  9. on_use = function(user)
  10. minetest.sound_play("rangedweapons_empty", {user})
  11. end,
  12. on_secondary_use = function(itemstack, user, pointed_thing)
  13. eject_shell(itemstack,user,"rangedweapons:awp_rld",1.0,"rangedweapons_rifle_reload_a","rangedweapons:empty_shell")
  14. return itemstack
  15. end,
  16. })
  17. minetest.register_tool("rangedweapons:awp_r", {
  18. rw_next_reload = "rangedweapons:awp_rr",
  19. load_sound = "rangedweapons_rifle_clip_in",
  20. range = 0,
  21. wield_scale = {x=1.9,y=1.9,z=1.1},
  22. description = "",
  23. groups = {not_in_creative_inventory = 1},
  24. inventory_image = "rangedweapons_awp_noclip.png",
  25. })
  26. minetest.register_tool("rangedweapons:awp_rr", {
  27. rw_next_reload = "rangedweapons:awp_rrr",
  28. load_sound = "rangedweapons_rifle_reload_a",
  29. range = 0,
  30. wield_scale = {x=1.9,y=1.9,z=1.1},
  31. description = "",
  32. groups = {not_in_creative_inventory = 1},
  33. inventory_image = "rangedweapons_awp.png",
  34. })
  35. minetest.register_tool("rangedweapons:awp_rrr", {
  36. rw_next_reload = "rangedweapons:awp",
  37. load_sound = "rangedweapons_rifle_reload_b",
  38. range = 0,
  39. wield_scale = {x=1.9,y=1.9,z=1.1},
  40. description = "",
  41. groups = {not_in_creative_inventory = 1},
  42. inventory_image = "rangedweapons_awp_rld.png",
  43. })
  44. minetest.register_tool("rangedweapons:awp_rld", {
  45. stack_max= 1,
  46. range = 0,
  47. wield_scale = {x=1.9,y=1.9,z=1.1},
  48. description = "",
  49. loaded_gun = "rangedweapons:awp",
  50. loaded_sound = "rangedweapons_rifle_reload_b",
  51. groups = {not_in_creative_inventory = 1},
  52. inventory_image = "rangedweapons_awp_rld.png",
  53. })
  54. minetest.register_tool("rangedweapons:awp", {
  55. description = "" ..core.colorize("#35cdff","A.W.P. \n") ..core.colorize("#FFFFFF", "Ranged damage:18 + 35/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 15\n") ..core.colorize("#FFFFFF", "Critical chance: 30%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3\n") ..core.colorize("#FFFFFF", "Ammunition: 7.62mm round/308.Winchester rounds\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.0\n") ..core.colorize("#FFFFFF", "Reload time: 2.0\n") ..core.colorize("#FFFFFF", "Zoom: 12x\n") ..core.colorize("#27a600", "The gun is loaded!\n") ..core.colorize("#FFFFFF", "Clip size: 10/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"),
  56. range = 0,
  57. weapon_zoom = 7.5,
  58. wield_scale = {x=1.9,y=1.9,z=1.1},
  59. inventory_image = "rangedweapons_awp.png",
  60. RW_gun_capabilities = {
  61. gun_damage = {fleshy=18,knockback=15},
  62. gun_crit = 30,
  63. gun_critEffc = 3.0,
  64. suitable_ammo = {{"rangedweapons:762mm",10},{"rangedweapons:308winchester",10}},
  65. gun_skill = {"rifle_skill",20},
  66. gun_magazine = "rangedweapons:rifle_mag",
  67. gun_icon = "rangedweapons_awp_icon.png",
  68. gun_unloaded = "rangedweapons:awp_r",
  69. gun_cooling = "rangedweapons:awp_uld",
  70. gun_velocity = 75,
  71. gun_accuracy = 100,
  72. gun_cooldown = 1.0,
  73. gun_reload = 2.0/4,
  74. gun_projectiles = 1,
  75. has_shell = 0,
  76. gun_durability = 700,
  77. gun_smokeSize = 8,
  78. gun_dps = 35,
  79. gun_mob_penetration = 30,
  80. gun_node_penetration = 10,
  81. gun_unload_sound = "rangedweapons_rifle_clip_out",
  82. gun_sound = "rangedweapons_rifle_b",
  83. },
  84. on_secondary_use = function(itemstack, user, pointed_thing)
  85. rangedweapons_reload_gun(itemstack, user)
  86. return itemstack
  87. end,
  88. on_use = function(itemstack, user, pointed_thing)
  89. rangedweapons_shoot_gun(itemstack, user)
  90. return itemstack
  91. end,
  92. })