Adds fire delay to all weapons (except automatics).

For most weapons it is only slightly bigger than clicking own delay, but still can see difference between revolver and SMG.
Shotungs do not get special delay because they are slow as they are anyway.
Biggest delays go to laser cannon (40 damage per shot) and pulse rifle, ~2 seconds for one shot.
This commit is contained in:
comma
2013-07-10 21:19:21 +04:00
parent c5e2f86cc3
commit bdaeb2c6fb
4 changed files with 19 additions and 1 deletions
+14
View File
@@ -30,6 +30,15 @@
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered,
//1 for keep shooting until aim is lowered
var/fire_delay = 6
var/last_fired = 0
proc/ready_to_fire()
if(world.time >= last_fired + fire_delay)
last_fired = world.time
return 1
else
return 0
proc/load_into_chamber()
return 0
@@ -87,6 +96,11 @@
if(!special_check(user))
return
if (!ready_to_fire())
if (world.time % 3) //to prevent spam
user << "<span class='warning'>[src] is not ready to fire again!"
return
if(!load_into_chamber()) //CHECK
return click_empty(user)
@@ -71,6 +71,8 @@ obj/item/weapon/gun/energy/laser/retro
origin_tech = "combat=4;materials=3;powerstorage=3"
projectile_type = "/obj/item/projectile/beam/heavylaser"
fire_delay = 20
isHandgun()
return 0
@@ -9,7 +9,7 @@
projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/cell/super"
var/mode = 2
fire_delay = 25
attack_self(mob/living/user as mob)
switch(mode)
@@ -9,6 +9,8 @@
ammo_type = "/obj/item/ammo_casing/c9mm"
automatic = 1
fire_delay = 0
isHandgun()
return 0