diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 5bf70cfc2b9..7b151fbc73c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -190,26 +190,55 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/neurotoxin name = "Spit Neurotoxin" desc = "Spits neurotoxin at someone, paralyzing them for a short time." - plasma_cost = 50 - action_icon_state = "alien_neurotoxin" + action_icon_state = "alien_neurotoxin_0" + var/active = 0 -/obj/effect/proc_holder/alien/neurotoxin/fire(mob/living/carbon/alien/user) - user.visible_message("[user] spits neurotoxin!", "You spit neurotoxin.") +/obj/effect/proc_holder/alien/neurotoxin/fire(mob/living/carbon/user) + if(active) + user.ranged_ability = null + user << "You empty your neurotoxin gland." + active = 0 + else if(user.ranged_ability && user.ranged_ability != src) + user << "You already have another aimed ability readied! Cancel it first." + return + else + user.ranged_ability = src + active = 1 + user << "You prepare your neurotoxin gland. Left-click to fire at a target!" + + user.client.click_intercept = user.ranged_ability + action.button_icon_state = "alien_neurotoxin_[active]" + action.UpdateButtonIcon() + +/obj/effect/proc_holder/alien/neurotoxin/InterceptClickOn(mob/living/carbon/user, params, atom/target) + var/p_cost = 50 + if(!iscarbon(user) || user.lying || user.stat) + return + user.next_click = world.time + 6 + user.face_atom(target) + if(user.getPlasma() < p_cost) + user << "You need at least [p_cost] plasma to spit." + return var/turf/T = user.loc var/turf/U = get_step(user, user.dir) // Get the tile infront of the move, based on their direction if(!isturf(U) || !isturf(T)) return 0 + user.visible_message("[user] spits neurotoxin!", "You spit neurotoxin.") var/obj/item/projectile/bullet/neurotoxin/A = new /obj/item/projectile/bullet/neurotoxin(user.loc) A.current = U - A.yo = U.y - T.y - A.xo = U.x - T.x + A.preparePixelProjectile(target, get_turf(target), user, params) A.fire() user.newtonian_move(get_dir(U, T)) + user.adjustPlasma(-p_cost) return 1 +/obj/effect/proc_holder/alien/neurotoxin/on_lose(mob/living/carbon/user) + if(user.ranged_ability == src) + user.ranged_ability = null + /obj/effect/proc_holder/alien/resin name = "Secrete Resin" diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 2a338caa35e..a456046c5d5 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -69,4 +69,5 @@ var/mob/living/mental_dominator //The person controlling the mind of this person, if applicable var/mob/living/mind_control_holder/mind_control_holder //If the mob is being mind controlled, where their old mind is stored (check clock_mobs.dm) - var/blood_volume = 0 //how much blood the mob has \ No newline at end of file + var/blood_volume = 0 //how much blood the mob has + var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 24634ca635a..043188a383e 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -17,3 +17,6 @@ if(ventcrawler) src << "You can ventcrawl! Use alt+click on vents to quickly travel about the station." + if(ranged_ability) + client.click_intercept = ranged_ability + src << "You currently have [ranged_ability.name] active!" \ No newline at end of file diff --git a/code/modules/mob/living/logout.dm b/code/modules/mob/living/logout.dm index b766df1b4bd..04a68b4cc5b 100644 --- a/code/modules/mob/living/logout.dm +++ b/code/modules/mob/living/logout.dm @@ -1,4 +1,4 @@ /mob/living/Logout() ..() if(!key && mind) //key and mind have become seperated. - mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body. + mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body. \ No newline at end of file diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index f5005746041..635b718adfd 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -71,4 +71,5 @@ if(AA) AA.display_to(list(src)) - update_client_colour() \ No newline at end of file + update_client_colour() + client.click_intercept = null \ No newline at end of file diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 54c5a5a6b93..4fa5a695236 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -6,6 +6,10 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin verb for now +/obj/effect/proc_holder/proc/InterceptClickOn(mob/user, params, atom/A) + return + + /obj/effect/proc_holder/spell name = "Spell" desc = "A wizard spell" diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index 08dc8e19428..0887bdd92c5 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ