From 8953877a69163fa059601047ab0881af1495d487 Mon Sep 17 00:00:00 2001 From: raspyosu Date: Fri, 28 Feb 2020 01:01:45 -0500 Subject: [PATCH] makes mesmerize not shitcode woooooooo --- .../bloodsucker/powers/mesmerize.dm | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm index e904b69e12..07a98b24a5 100644 --- a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm +++ b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm @@ -88,44 +88,53 @@ return FALSE return TRUE +/datum/action/bloodsucker/targeted/mesmerize/proc/ContinueTarget(atom/A) + var/mob/living/carbon/target = A + var/mob/living/user = owner + + var/cancontinue=CheckCanTarget(target) + if(!cancontinue) + success=FALSE + target.remove_status_effect(STATUS_EFFECT_MESMERIZE) + user.remove_status_effect(STATUS_EFFECT_MESMERIZE) + DeactivatePower() + DeactivateRangedAbility() + StartCooldown() + to_chat(user, "[target] has escaped your gaze!") + UnregisterSignal(target, COMSIG_MOVABLE_MOVED) + /datum/action/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A) // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. var/mob/living/carbon/target = A var/mob/living/user = owner if(istype(target)) + success=TRUE var/power_time = 138 + level_current * 12 target.apply_status_effect(STATUS_EFFECT_MESMERIZE, 30) user.apply_status_effect(STATUS_EFFECT_MESMERIZE, 30) - for(var/i in 1 to 6) // this is a test lol - success = CheckCanTarget(target) - if(success) - if(i==6) - PowerActivatedSuccessfully() // blood & cooldown only altered if power activated successfully - less "fuck you"-y - target.face_atom(user) - target.apply_status_effect(STATUS_EFFECT_MESMERIZE, power_time) // pretty much purely cosmetic - target.Stun(power_time) - to_chat(user, "[target] is fixed in place by your hypnotic gaze.") - target.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // target.changeNext_move(power_time) // check click.dm - target.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze. - - spawn(power_time) - target.notransform = FALSE - // They Woke Up! (Notice if within view) - if(istype(user) && target.stat == CONSCIOUS && (target in view(10, get_turf(user)))) - to_chat(user, "[target] has snapped out of their trance.") - break - sleep(5) - else - to_chat(user, "[target] has escaped your gaze!") - target.remove_status_effect(STATUS_EFFECT_MESMERIZE) - user.remove_status_effect(STATUS_EFFECT_MESMERIZE) - DeactivatePower() - DeactivateRangedAbility() - StartCooldown() - break - // oops! if they knew how they could just spam stun the victim and themselves. + + RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/ContinueTarget) + // 3 second windup + sleep(30) + if(success) + PowerActivatedSuccessfully() // blood & cooldown only altered if power activated successfully - less "fuck you"-y + target.face_atom(user) + target.apply_status_effect(STATUS_EFFECT_MESMERIZE, power_time) // pretty much purely cosmetic + target.Stun(power_time) + to_chat(user, "[target] is fixed in place by your hypnotic gaze.") + target.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // target.changeNext_move(power_time) // check click.dm + target.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze. + + UnregisterSignal(target, COMSIG_MOVABLE_MOVED) + + spawn(power_time) + if(istype(target) && success) + target.notransform = FALSE + // They Woke Up! (Notice if within view) + if(istype(user) && target.stat == CONSCIOUS && (target in view(10, get_turf(user))) ) + to_chat(user, "[target] has snapped out of their trance.") /datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target) return ..() && CheckCanUse() && CheckCanTarget(target)