This commit is contained in:
Kraseo
2020-03-01 23:39:16 +01:00
5 changed files with 58 additions and 32 deletions
@@ -10,6 +10,7 @@
amToggle = TRUE
warn_constant_cost = TRUE
var/moveintent_was_run
var/runintent
var/walk_threshold = 0.4 // arbitrary number, to be changed. edit in last commit: this is fine after testing on box station for a bit
var/lum
@@ -31,23 +32,25 @@
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
var/mob/living/user = owner
moveintent_was_run = (user.m_intent == MOVE_INTENT_RUN)
while(bloodsuckerdatum && ContinueActive(user))
// Pay Blood Toll (if awake)
owner.alpha = max(35, owner.alpha - min(75, 10 + 5 * level_current))
bloodsuckerdatum.AddBloodVolume(-0.2)
moveintent_was_run = (user.m_intent == MOVE_INTENT_RUN)
runintent = (user.m_intent == MOVE_INTENT_RUN)
var/turf/T = get_turf(user)
lum = T.get_lumcount()
if(istype(owner.loc))
if(lum > walk_threshold)
if(moveintent_was_run)
if(runintent)
user.toggle_move_intent()
ADD_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
if(lum < walk_threshold)
if(!moveintent_was_run)
if(!runintent)
user.toggle_move_intent()
REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
@@ -65,5 +68,8 @@
..()
REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
user.alpha = 255
if(!moveintent_was_run)
runintent = (user.m_intent == MOVE_INTENT_RUN)
if(!runintent && moveintent_was_run)
user.toggle_move_intent()
@@ -7,7 +7,7 @@
button_icon_state = "power_lunge"
bloodcost = 10
cooldown = 120
target_range = 5
target_range = 3
power_activates_immediately = TRUE
message_Trigger = "Whom will you ensnare within your grasp?"
must_be_capacitated = TRUE
@@ -61,7 +61,7 @@
addtimer(CALLBACK(owner, .proc/_walk, 0), 2 SECONDS)
target.playsound_local(get_turf(owner), 'sound/bloodsucker/lunge_warn.ogg', 60, FALSE, pressure_affected = FALSE) // target-only telegraphing
owner.playsound_local(owner, 'sound/bloodsucker/lunge_warn.ogg', 60, FALSE, pressure_affected = FALSE) // audio feedback to the user
if(do_mob(owner, owner, 6, TRUE, TRUE))
if(do_mob(owner, owner, 7, TRUE, TRUE))
walk_towards(owner, T, 0.1, 10) // yes i know i shouldn't use this but i don't know how to work in anything better
if(get_turf(owner) != T && !(isliving(target) && target.Adjacent(owner)) && owner.incapacitated() && owner.resting)
var/send_dir = get_dir(owner, T)
@@ -80,7 +80,7 @@
target.grabbedby(owner) // Taken from mutations.dm under changelings
target.grippedby(owner, instant = TRUE) //instant aggro grab
break
sleep(i*3)
sleep(3)
/datum/action/bloodsucker/targeted/lunge/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
@@ -11,7 +11,7 @@
button_icon_state = "power_mez"
bloodcost = 30
cooldown = 300
target_range = 3
target_range = 2
power_activates_immediately = TRUE
message_Trigger = "Whom will you subvert to your will?"
must_be_capacitated = TRUE
@@ -73,7 +73,7 @@
to_chat(owner, "<span class='warning'>You're too far outside your victim's view.</span>")
return FALSE
if(target.has_status_effect(STATUS_EFFECT_MESMERIZE)) // ?
if(target.has_status_effect(STATUS_EFFECT_MESMERIZE)) // ignores facing once the windup has started
return TRUE
// Check: Facing target?
@@ -88,39 +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, "<span class='warning'>[target] has escaped your gaze!</span>")
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)
if(do_mob(user, target, 30, TRUE, TRUE)) // 3 seconds windup
success = CheckCanTarget(target)
if(success) // target just has to be out of view when it is fully charged in order to avoid
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, "<span class='notice'>[target] is fixed in place by your hypnotic gaze.</span>")
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.
else
to_chat(user, "<span class='warning'>[target] has escaped your gaze!</span>")
DeactivatePower()
DeactivateRangedAbility()
StartCooldown()
// oops! if they knew how they could just spam stun the victim and themselves.
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/ContinueTarget)
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))) )
// 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, "<span class='notice'>[target] is fixed in place by your hypnotic gaze.</span>")
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, "<span class='warning'>[target] has snapped out of their trance.</span>")
/datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target)
return ..() && CheckCanUse() && CheckCanTarget(target)