From 6a26b8c1f314da0af63ce81186338f8b0d5446cb Mon Sep 17 00:00:00 2001 From: Alberyk Date: Mon, 3 Jul 2017 06:05:42 -0300 Subject: [PATCH] Fix player controlled range hostiles mobs being unable to fire (#2928) Pretty much fixes hostiles mobs that had a ranged attack being unable to use it if they are controlled by a player, so, we can have human controlled cavern dwellers and combat drones(in case of adminbus). Also, fixes a broken design that needed mutagen and being able to transfer reagens to species without blood using an iv. --- code/game/machinery/iv_drip.dm | 26 +++++++++++-------- .../living/simple_animal/hostile/hostile.dm | 9 ++++++- code/modules/research/designs.dm | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 4af1a071491..df18a935fe1 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -85,6 +85,21 @@ return if(src.attached && src.beaker) + + var/mob/living/carbon/human/T = attached + + if(!istype(T)) + return + + if(!T.dna) + return + + if(NOCLONE in T.mutations) + return + + if(T.species.flags & NO_BLOOD) + return + // Give blood if(mode) if(src.beaker.volume > 0) @@ -100,17 +115,6 @@ if(prob(5)) visible_message("\The [src] pings.") return - var/mob/living/carbon/human/T = attached - - if(!istype(T)) return - if(!T.dna) - return - if(NOCLONE in T.mutations) - return - - if(T.species.flags & NO_BLOOD) - return - // If the human is losing too much blood, beep. if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5)) visible_message("\The [src] beeps loudly.") diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ec90313e062..f66e66337e2 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -172,7 +172,7 @@ /mob/living/simple_animal/hostile/proc/OpenFire(target_mob) var/target = target_mob - visible_message(" [src] fires at [target]!", 1) + visible_message(" [src] fires at [target]!") if(rapid) var/datum/callback/shoot_cb = CALLBACK(src, .proc/shoot_wrapper, target, loc, src) @@ -217,6 +217,13 @@ return 1 return 0 +/mob/living/simple_animal/hostile/RangedAttack(atom/A, params) //Player firing + if(ranged) + setClickCooldown(attack_delay) + target = A + OpenFire(A) + ..() + /mob/living/simple_animal/hostile/proc/check_horde() return 0 diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index 24527170cd7..7e9195ac8e9 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -535,7 +535,7 @@ datum/design/circuit/telepad /datum/design/item/weapon/decloner id = "decloner" req_tech = list(TECH_COMBAT = 7, TECH_MATERIAL = 7, TECH_BIO = 5, TECH_POWER = 6) - materials = list("gold" = 5000,"uranium" = 10000, "mutagen" = 40) + materials = list("gold" = 5000,"uranium" = 10000) build_path = /obj/item/weapon/gun/energy/decloner sort_string = "TAAAE"