From bdaeb2c6fb369418c6dac7d15b5a94a598b334cd Mon Sep 17 00:00:00 2001 From: comma Date: Wed, 10 Jul 2013 21:19:21 +0400 Subject: [PATCH 1/2] 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. --- code/modules/projectiles/gun.dm | 14 ++++++++++++++ code/modules/projectiles/guns/energy/laser.dm | 2 ++ code/modules/projectiles/guns/energy/pulse.dm | 2 +- .../projectiles/guns/projectile/automatic.dm | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 41c84823a62..35af50877cb 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -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 << "[src] is not ready to fire again!" + return + if(!load_into_chamber()) //CHECK return click_empty(user) diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 6ed8669912f..c7026905b62 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -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 diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm index 73b5b3710c5..cd990a66a72 100644 --- a/code/modules/projectiles/guns/energy/pulse.dm +++ b/code/modules/projectiles/guns/energy/pulse.dm @@ -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) diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index c5e3ed37846..93a7010d7d1 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -9,6 +9,8 @@ ammo_type = "/obj/item/ammo_casing/c9mm" automatic = 1 + fire_delay = 0 + isHandgun() return 0 From aaa1228e1180ba64e370d8f15ec4bc2b469ea211 Mon Sep 17 00:00:00 2001 From: comma Date: Thu, 11 Jul 2013 02:52:36 +0400 Subject: [PATCH 2/2] Changelog. --- html/changelog.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/html/changelog.html b/html/changelog.html index 4e37e06ec64..c20db3b1cee 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,7 +56,13 @@ Changelog Section Stuff which is in development and not yet visible to players or just code related (ie. code improvements for expandability, etc.) should not be listed here. They should be listed in the changelog upon commit though. Thanks. --> - +
+

2013-11-07

+

Chinsky updated:

+
    +
  • Gun delays. All guns now have delays between shots. Most have less than second, lasercannons and pulse rifles have around 2 seconds delay. Automatics have zero, click-speed.
  • +
+

05.07.2013

Spamcat updated: