From 9783fa55c9abaf89c753dd4a76a757ee37b7707e Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sat, 8 Jun 2024 18:31:36 +0200 Subject: [PATCH] Fixed ling stings targeting (#19377) Fixed ling stings targeting. A DMDoc and some SDMM markings. Marked one proc for the hostile mobs AI as waitfor = FALSE. --- code/_onclick/click.dm | 18 +++--- code/_onclick/other_mobs.dm | 2 +- .../changeling/helpers/sting_click.dm | 10 ++-- .../changeling/implements/powers/stings.dm | 8 ++- .../living/simple_animal/hostile/hostile.dm | 2 + html/changelogs/fluffyghost-fixlingstings.yml | 60 +++++++++++++++++++ 6 files changed, 85 insertions(+), 15 deletions(-) create mode 100644 html/changelogs/fluffyghost-fixlingstings.yml diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 4d00b9d752b..a57fbf004ab 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -221,15 +221,17 @@ return 1 -/* - Ranged unarmed attack: +/** + * Ranged unarmed attack: + * + * This currently is just a default for all mobs, involving + * laser eyes and telekinesis. You could easily add exceptions + * for things like ranged glove touches, spitting alien acid/neurotoxin, + * animals lunging, etc. + */ +/mob/proc/RangedAttack(atom/A, params) + SHOULD_NOT_SLEEP(TRUE) - This currently is just a default for all mobs, involving - laser eyes and telekinesis. You could easily add exceptions - for things like ranged glove touches, spitting alien acid/neurotoxin, - animals lunging, etc. -*/ -/mob/proc/RangedAttack(var/atom/A, var/params) if((mutations & LASER_EYES) && a_intent == I_HURT) LaserEyes(A, params) // moved into a proc below return diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 046437687d7..e718cf5cfe6 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -39,7 +39,7 @@ /mob/proc/attack_empty_hand(var/bp_hand) return -/mob/living/carbon/human/RangedAttack(var/atom/A) +/mob/living/carbon/human/RangedAttack(atom/A) var/obj/item/clothing/gloves/GV = gloves var/obj/item/clothing/glasses/GS = glasses diff --git a/code/game/gamemodes/changeling/helpers/sting_click.dm b/code/game/gamemodes/changeling/helpers/sting_click.dm index 17a5dc8a5ad..cd4d3b43c1e 100644 --- a/code/game/gamemodes/changeling/helpers/sting_click.dm +++ b/code/game/gamemodes/changeling/helpers/sting_click.dm @@ -1,13 +1,15 @@ -/mob/living/proc/check_sting(var/mob/living/holder, var/atom/target) +/mob/living/proc/check_sting(mob/living/holder, atom/target) + SHOULD_NOT_SLEEP(TRUE) + if(isliving(target) && holder.a_intent == I_HURT && holder.mind) var/datum/changeling/changeling = holder.mind.antag_datums[MODE_CHANGELING] if(changeling && changeling.prepared_sting) - if(changeling.prepared_sting.can_sting(holder)) - changeling.prepared_sting.do_sting(holder) + if(changeling.prepared_sting.can_sting(target)) + changeling.prepared_sting.do_sting(target) QDEL_NULL(changeling.prepared_sting) return TRUE -/mob/living/RangedAttack(var/atom/A, var/params) +/mob/living/RangedAttack(atom/A, params) if(!get_active_hand()) check_sting(src, A) . = ..() diff --git a/code/game/gamemodes/changeling/implements/powers/stings.dm b/code/game/gamemodes/changeling/implements/powers/stings.dm index eda5ab18ca8..d4efa78eff7 100644 --- a/code/game/gamemodes/changeling/implements/powers/stings.dm +++ b/code/game/gamemodes/changeling/implements/powers/stings.dm @@ -13,7 +13,9 @@ required_chems = set_required_chems stealthy = set_stealthy -/datum/changeling_sting/proc/can_sting(var/mob/living/target) +/datum/changeling_sting/proc/can_sting(mob/living/target) + SHOULD_NOT_SLEEP(TRUE) + if(!target || !owner.mind) return FALSE var/datum/changeling/changeling = owner.mind.antag_datums[MODE_CHANGELING] @@ -32,7 +34,9 @@ return FALSE return TRUE -/datum/changeling_sting/proc/do_sting(var/mob/living/target) +/datum/changeling_sting/proc/do_sting(mob/living/target) + SHOULD_NOT_SLEEP(TRUE) + var/datum/changeling/changeling = owner.mind.antag_datums[MODE_CHANGELING] changeling.use_charges(required_chems) changeling.sting_range = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ed014b1d1d8..76d7dac1be9 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -324,6 +324,8 @@ return TRUE /mob/living/simple_animal/hostile/proc/OpenFire(target_mob) + set waitfor = FALSE + if(!see_target()) LoseTarget() var/target = target_mob diff --git a/html/changelogs/fluffyghost-fixlingstings.yml b/html/changelogs/fluffyghost-fixlingstings.yml new file mode 100644 index 00000000000..a885dc18fbe --- /dev/null +++ b/html/changelogs/fluffyghost-fixlingstings.yml @@ -0,0 +1,60 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixed ling stings targeting." + - code_imp: "A DMDoc and some SDMM markings." + - code_imp: "Marked one proc for the hostile mobs AI as waitfor = FALSE."