From b34b53193f122395de6a43ce57d41e109d057801 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Fri, 7 Sep 2018 10:24:39 -0400 Subject: [PATCH] tgstation/tgstation#39287 - Makes rapid fire mobs more configurable (#7549) --- .../mob/living/simple_animal/hostile/hivebot.dm | 2 +- .../mob/living/simple_animal/hostile/hostile.dm | 10 +++++----- .../mob/living/simple_animal/hostile/nanotrasen.dm | 2 +- .../modules/mob/living/simple_animal/hostile/pirate.dm | 4 ++-- .../living/simple_animal/hostile/retaliate/spaceman.dm | 2 +- .../mob/living/simple_animal/hostile/russian.dm | 2 +- .../mob/living/simple_animal/hostile/syndicate.dm | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 1a92e0b69f..3f0c468d26 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -48,7 +48,7 @@ icon_living = "ranged" icon_dead = "ranged" ranged = 1 - rapid = 1 + rapid = 3 retreat_distance = 5 minimum_distance = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 017af381f0..acb3550454 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -5,7 +5,8 @@ environment_smash = ENVIRONMENT_SMASH_STRUCTURES //Bitflags. Set to ENVIRONMENT_SMASH_STRUCTURES to break closets,tables,racks, etc; ENVIRONMENT_SMASH_WALLS for walls; ENVIRONMENT_SMASH_RWALLS for rwalls var/atom/target var/ranged = 0 - var/rapid = 0 + var/rapid = 0 //How many shots per volley. + var/rapid_fire_delay = 2 //Time between rapid fire shots var/projectiletype //set ONLY it and NULLIFY casingtype var, if we have ONLY projectile var/projectilesound var/casingtype //set ONLY it and NULLIFY projectiletype, if we have projectile IN CASING @@ -330,11 +331,10 @@ return visible_message("[src] [ranged_message] at [A]!") - if(rapid) + if(rapid > 1) var/datum/callback/cb = CALLBACK(src, .proc/Shoot, A) - addtimer(cb, 1) - addtimer(cb, 4) - addtimer(cb, 6) + for(var/i in 1 to rapid) + addtimer(cb, (i - 1)*rapid_fire_delay) else Shoot(A) ranged_cooldown = world.time + ranged_cooldown_time diff --git a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm index c02b9259b8..b170ae0574 100644 --- a/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm +++ b/code/modules/mob/living/simple_animal/hostile/nanotrasen.dm @@ -53,7 +53,7 @@ /mob/living/simple_animal/hostile/nanotrasen/ranged/smg icon_state = "nanotrasenrangedsmg" icon_living = "nanotrasenrangedsmg" - rapid = 1 + rapid = 3 casingtype = /obj/item/ammo_casing/c46x30mm projectilesound = 'sound/weapons/gunshot_smg.ogg' loot = list(/obj/item/gun/ballistic/automatic/wt550, diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index 714d2c7e33..f76357de1b 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -47,7 +47,7 @@ icon_dead = "piratemelee_dead" projectilesound = 'sound/weapons/laser.ogg' ranged = 1 - rapid = 1 + rapid = 3 retreat_distance = 5 minimum_distance = 5 projectiletype = /obj/item/projectile/beam/laser @@ -72,7 +72,7 @@ icon_living = "piratespaceranged" projectilesound = 'sound/weapons/laser.ogg' ranged = 1 - rapid = 1 + rapid = 3 retreat_distance = 5 minimum_distance = 5 projectiletype = /obj/item/projectile/beam/laser diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm index 4e4849297c..a132503786 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/spaceman.dm @@ -64,7 +64,7 @@ icon_state = "nanotrasenrangedsmg" icon_living = "nanotrasenrangedsmg" vision_range = 9 - rapid = 1 + rapid = 3 ranged = 1 retreat_distance = 3 minimum_distance = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/russian.dm b/code/modules/mob/living/simple_animal/hostile/russian.dm index 30924d5519..c083b8fdd5 100644 --- a/code/modules/mob/living/simple_animal/hostile/russian.dm +++ b/code/modules/mob/living/simple_animal/hostile/russian.dm @@ -62,7 +62,7 @@ icon_living = "russianofficer" maxHealth = 65 health = 65 - rapid = 1 + rapid = 3 casingtype = /obj/item/ammo_casing/c9mm loot = list(/obj/effect/mob_spawn/human/corpse/russian/ranged/officer, /obj/item/gun/ballistic/automatic/pistol/APS) diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 73283468f6..8efa3e4d35 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -109,7 +109,7 @@ /mob/living/simple_animal/hostile/syndicate/ranged ranged = 1 - rapid = 1 + rapid = 3 retreat_distance = 5 minimum_distance = 5 icon_state = "syndicateranged"