-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsniper.lua
103 lines (92 loc) · 4.61 KB
/
dsniper.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
minetest.register_tool("rangedweapons:dsniper_uld", {
stack_max= 1,
wield_scale = {x=2.1,y=2.1,z=1.2},
range = 0,
description = "" ..core.colorize("#35cdff","Desert Camo Sniper \n") ..core.colorize("#FFFFFF", "Ranged damage:22 + 75/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 20\n") ..core.colorize("#FFFFFF", "Critical chance: 33%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3.25\n") ..core.colorize("#FFFFFF", "Ammunition: .408 chey tac\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.5\n") ..core.colorize("#FFFFFF", "Reload time: 2.5\n") ..core.colorize("#FFFFFF", "Zoom: 15x\n") ..core.colorize("#be0d00", "Right-click to eject empty bullet shell\n") ..core.colorize("#FFFFFF", "Clip size: 7\n") ..core.colorize("#FFFFFF", "Enemy penetration:45%\n") ..core.colorize("#FFFFFF", "Block penetration:15%\n") ..core.colorize("#FFFFFF", "Gun type: Rifle\n") ..core.colorize("#FFFFFF", "Bullet velocity: 80"),
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_dsniper.png",
weapon_zoom = 7.5,
on_use = function(user)
minetest.sound_play("rangedweapons_empty", {user})
end,
on_secondary_use = function(itemstack, user, pointed_thing)
eject_shell(itemstack,user,"rangedweapons:dsniper_rld",1.0,"rangedweapons_rifle_reload_a","rangedweapons:empty_shell")
return itemstack
end,
})
minetest.register_tool("rangedweapons:dsniper_r", {
rw_next_reload = "rangedweapons:dsniper_rr",
load_sound = "rangedweapons_rifle_clip_in",
range = 0,
wield_scale = {x=2.1,y=2.1,z=1.2},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_dsniper_noclip.png",
})
minetest.register_tool("rangedweapons:dsniper_rr", {
rw_next_reload = "rangedweapons:dsniper_rrr",
load_sound = "rangedweapons_rifle_reload_a",
range = 0,
wield_scale = {x=2.1,y=2.1,z=1.2},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_dsniper.png",
})
minetest.register_tool("rangedweapons:dsniper_rrr", {
rw_next_reload = "rangedweapons:dsniper",
load_sound = "rangedweapons_rifle_reload_b",
range = 0,
wield_scale = {x=2.1,y=2.1,z=1.2},
description = "",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_dsniper_rld.png",
})
minetest.register_tool("rangedweapons:dsniper_rld", {
stack_max= 1,
range = 0,
wield_scale = {x=2.1,y=2.1,z=1.2},
description = "",
loaded_gun = "rangedweapons:dsniper",
loaded_sound = "rangedweapons_rifle_reload_b",
groups = {not_in_creative_inventory = 1},
inventory_image = "rangedweapons_dsniper_rld.png",
})
minetest.register_tool("rangedweapons:dsniper", {
description = "" ..core.colorize("#35cdff","Desert Camo Sniper \n") ..core.colorize("#FFFFFF", "Ranged damage:22 + 75/sec of bullet lifetime\n")..core.colorize("#FFFFFF", "Accuracy: 100%\n") ..core.colorize("#FFFFFF", "knockback: 20\n") ..core.colorize("#FFFFFF", "Critical chance: 33%\n") ..core.colorize("#FFFFFF", "Critical efficiency: x3.25\n") ..core.colorize("#FFFFFF", "Ammunition: .408 chey tac\n") ..core.colorize("#FFFFFF", "Rate of fire: 1.5\n") ..core.colorize("#FFFFFF", "Reload time: 2.5\n") ..core.colorize("#FFFFFF", "Zoom: 15x\n") ..core.colorize("#27a600", "The gun is loaded!\n") ..core.colorize("#FFFFFF", "Clip size: 7\n") ..core.colorize("#FFFFFF", "Enemy penetration:45%\n") ..core.colorize("#FFFFFF", "Block penetration:15%\n") ..core.colorize("#FFFFFF", "Gun type: Rifle\n") ..core.colorize("#FFFFFF", "Bullet velocity: 80"),
range = 0,
weapon_zoom = 6,
wield_scale = {x=2.1,y=2.1,z=1.2},
inventory_image = "rangedweapons_dsniper.png",
RW_gun_capabilities = {
gun_damage = {fleshy=22,knockback=20},
gun_crit = 33,
gun_critEffc = 3.25,
suitable_ammo = {{"rangedweapons:408cheytac",7}},
gun_skill = {"rifle_skill",12},
gun_magazine = "rangedweapons:rifle_mag",
gun_icon = "rangedweapons_dsniper_icon.png",
gun_unloaded = "rangedweapons:dsniper_r",
gun_cooling = "rangedweapons:dsniper_uld",
gun_velocity = 80,
gun_accuracy = 100,
gun_cooldown = 1.5,
gun_reload = 2.5/4,
gun_projectiles = 1,
has_shell = 0,
gun_durability = 900,
gun_smokeSize = 8,
gun_dps = 75,
gun_mob_penetration = 45,
gun_node_penetration = 15,
gun_unload_sound = "rangedweapons_rifle_clip_out",
gun_sound = "rangedweapons_rifle_b",
},
on_secondary_use = function(itemstack, user, pointed_thing)
rangedweapons_reload_gun(itemstack, user)
return itemstack
end,
on_use = function(itemstack, user, pointed_thing)
rangedweapons_shoot_gun(itemstack, user)
return itemstack
end,
})