|
276 | 276 | ////////////////////////////////////////////////////////////////////////// |
277 | 277 | //-----------------------Global AOE Buff spells-------------------------// |
278 | 278 | ////////////////////////////////////////////////////////////////////////// |
279 | | -/datum/action/cooldown/spell/thrallbuff |
| 279 | +/datum/action/cooldown/spell/pointed/thrallbuff |
280 | 280 | name = "Empower thrall" |
281 | | - desc = "buffs all thralls with some sort of effect." |
| 281 | + desc = "buffs all thralls within a certain range of the target with some sort of effect." |
282 | 282 | panel = "Darkspawn" |
283 | 283 | button_icon = 'yogstation/icons/mob/actions/actions_darkspawn.dmi' |
284 | 284 | background_icon_state = "bg_alien" |
|
291 | 291 | cooldown_time = 1 MINUTES |
292 | 292 | spell_requirements = SPELL_CASTABLE_AS_BRAIN |
293 | 293 | sound = 'sound/magic/staff_healing.ogg' |
| 294 | + cast_range = INFINITY |
294 | 295 | /// If the buff also buffs all darkspawns |
295 | 296 | var/darkspawns_too = FALSE |
296 | 297 | /// Text to be put in the balloon alert upon cast |
297 | 298 | var/language_output = "DEBUGIFY" |
298 | | - |
299 | | -/datum/action/cooldown/spell/thrallbuff/before_cast(atom/cast_on) |
| 299 | + /// radius of the buff aoe |
| 300 | + var/buff_range = 4 |
| 301 | + /// Colour of the outline that gets temporarily applied |
| 302 | + var/outline_colour |
| 303 | + /// Duration of the buff (also used for the visual effect) |
| 304 | + var/buff_duration = 1 SECONDS |
| 305 | + |
| 306 | +/datum/action/cooldown/spell/pointed/thrallbuff/before_cast(atom/cast_on) |
300 | 307 | . = ..() |
301 | 308 | var/datum/antagonist/darkspawn/dude = isdarkspawn(owner) |
302 | 309 | if(dude) |
303 | 310 | darkspawns_too = HAS_TRAIT(dude, TRAIT_DARKSPAWN_BUFFALLIES) |
304 | 311 |
|
305 | | -/datum/action/cooldown/spell/thrallbuff/cast(atom/cast_on) //this looks like a mess, i'm sure it can be optimized |
| 312 | +/datum/action/cooldown/spell/pointed/thrallbuff/cast(atom/cast_on) //this looks like a mess, i'm sure it can be optimized |
306 | 313 | . = ..() |
| 314 | + if(get_dist(cast_on, owner) > 7) |
| 315 | + playsound(get_turf(cast_on), sound, 50, TRUE) |
307 | 316 | owner.balloon_alert(owner, "[language_output]") |
308 | | - for(var/datum/antagonist/thrall/lackey in GLOB.antagonists) |
309 | | - if(lackey.owner?.current && ishuman(lackey.owner.current)) |
310 | | - var/mob/living/carbon/human/target = lackey.owner.current |
311 | | - if(target && istype(target))//sanity check |
312 | | - empower(target) |
313 | | - if(darkspawns_too) |
314 | | - for(var/datum/antagonist/darkspawn/ally in GLOB.antagonists) |
315 | | - if(ally.owner?.current && ishuman(ally.owner.current)) |
316 | | - var/mob/living/carbon/human/target = ally.owner.current |
317 | | - if(target && istype(target))//sanity check |
318 | | - if(target == owner)//no self buffing |
319 | | - continue |
320 | | - empower(target) |
| 317 | + for(var/mob/living/carbon/target in range(buff_range, cast_on)) |
| 318 | + if(target == owner) //no buffing yourself |
| 319 | + continue |
| 320 | + if(!is_team_darkspawn(target)) |
| 321 | + continue |
| 322 | + if(!darkspawns_too && isdarkspawn(target)) //doesn't buff allied darkspawns unless it's upgraded |
| 323 | + continue |
| 324 | + empower(target) |
| 325 | + if(outline_colour) |
| 326 | + add_outline(target) |
321 | 327 |
|
322 | | -/datum/action/cooldown/spell/thrallbuff/proc/empower(mob/living/carbon/human/target) |
| 328 | +/datum/action/cooldown/spell/pointed/thrallbuff/proc/add_outline(mob/living/carbon/target) |
| 329 | + target.add_filter(name, 2, list("type" = "outline", "color" = outline_colour, "alpha" = 0, "size" = 1)) |
| 330 | + var/filter = target.get_filter(name) |
| 331 | + animate(filter, alpha = 200, time = 0.5 SECONDS, loop = -1) |
| 332 | + animate(alpha = 0, time = 0.5 SECONDS) |
| 333 | + addtimer(CALLBACK(src, PROC_REF(remove_outline), target), buff_duration, TIMER_UNIQUE | TIMER_OVERRIDE) |
| 334 | + |
| 335 | +/datum/action/cooldown/spell/pointed/thrallbuff/proc/remove_outline(mob/living/carbon/target) |
| 336 | + if(!target || QDELETED(target)) |
| 337 | + return |
| 338 | + var/filter = target.get_filter(name) |
| 339 | + animate(filter) |
| 340 | + target.remove_filter(name) |
| 341 | + |
| 342 | +/datum/action/cooldown/spell/pointed/thrallbuff/proc/empower(mob/living/carbon/target) |
323 | 343 | return |
324 | 344 |
|
325 | 345 | ////////////////////////////Global AOE heal////////////////////////// |
326 | | -/datum/action/cooldown/spell/thrallbuff/heal |
327 | | - name = "thrall recovery" |
328 | | - desc = "Heals all thralls for an amount of brute and burn." |
| 346 | +/datum/action/cooldown/spell/pointed/thrallbuff/heal |
| 347 | + name = "Thrall recovery" |
| 348 | + desc = "Target a location, heals all thralls within a 9x9 area." |
329 | 349 | button_icon_state = "heal_veils" |
330 | | - var/heal_amount = 50 |
331 | 350 | language_output = "Plyn othra" |
| 351 | + var/heal_amount = 70 |
332 | 352 |
|
333 | | -/datum/action/cooldown/spell/thrallbuff/heal/empower(mob/living/carbon/human/target) |
| 353 | +/datum/action/cooldown/spell/pointed/thrallbuff/heal/empower(mob/living/carbon/target) |
334 | 354 | to_chat(target, span_velvet("You feel healed.")) |
335 | | - target.heal_ordered_damage(heal_amount, list(STAMINA, BURN, BRUTE, TOX, OXY, CLONE, BRAIN), BODYPART_ANY) |
| 355 | + if(target.heal_ordered_damage(heal_amount, list(BURN, BRUTE, TOX, OXY, STAMINA, CLONE, BRAIN), BODYPART_ANY)) |
| 356 | + new /obj/effect/temp_visual/heal(get_turf(target), COLOR_GREEN) //if it does any healing, spawn a heal visual, maybe it won't blow the cover of a thrall that happens to be full health |
336 | 357 |
|
337 | 358 | ////////////////////////////Temporary speed boost////////////////////////// |
338 | | -/datum/action/cooldown/spell/thrallbuff/speed |
339 | | - name = "Thrall envigorate" |
340 | | - desc = "Give all thralls a temporary movespeed bonus." |
| 359 | +/datum/action/cooldown/spell/pointed/thrallbuff/speed |
| 360 | + name = "Thrall invigorate" |
| 361 | + desc = "Target a location, gives a temporary speed boost to all thralls within a 9x9 area." |
341 | 362 | button_icon_state = "speedboost_veils" |
342 | 363 | language_output = "Vyzthun" |
| 364 | + outline_colour = COLOR_YELLOW |
| 365 | + buff_duration = 15 SECONDS |
| 366 | + var/speed_strength = -0.7 |
343 | 367 |
|
344 | | -/datum/action/cooldown/spell/thrallbuff/speed/empower(mob/living/carbon/human/target) |
| 368 | +/datum/action/cooldown/spell/pointed/thrallbuff/speed/empower(mob/living/carbon/target) |
345 | 369 | to_chat(target, span_velvet("You feel fast.")) |
346 | | - target.apply_status_effect(STATUS_EFFECT_SPEEDBOOST, -0.5, 15 SECONDS, type) |
| 370 | + target.apply_status_effect(STATUS_EFFECT_SPEEDBOOST, speed_strength, buff_duration, type) |
347 | 371 |
|
348 | 372 | ////////////////////////////////////////////////////////////////////////// |
349 | 373 | //----------------Single target global ally giga buff-------------------// |
|
0 commit comments