Files
Bubberstation/code/modules/admin/smites/berforate.dm
AnturK 4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00

54 lines
1.6 KiB
Plaintext

/// Fires an absurd amount of bullets at the target
/datum/smite/berforate
name = ":B:erforate"
/// Determines how fucked the target is
var/hatred
/datum/smite/berforate/configure(client/user)
var/static/list/how_fucked_is_this_dude = list("A little", "A lot", "So fucking much", "FUCK THIS DUDE")
hatred = input(user, "How much do you hate this guy?") in how_fucked_is_this_dude
/datum/smite/berforate/effect(client/user, mob/living/target)
. = ..()
if (!iscarbon(target))
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
return
var/repetitions
var/shots_per_limb_per_rep = 2
var/damage
switch (hatred)
if ("A little")
repetitions = 1
damage = 5
if ("A lot")
repetitions = 2
damage = 8
if ("So fucking much")
repetitions = 3
damage = 10
if ("FUCK THIS DUDE")
repetitions = 4
damage = 10
var/mob/living/carbon/dude = target
var/list/open_adj_turfs = get_adjacent_open_turfs(dude)
var/list/wound_bonuses = list(15, 70, 110, 250)
var/delay_per_shot = 1
var/delay_counter = 1
dude.Immobilize(5 SECONDS)
for (var/wound_bonus_rep in 1 to repetitions)
for (var/_limb in dude.bodyparts)
var/obj/item/bodypart/limb = _limb
var/shots_this_limb = 0
for (var/_iter_turf in shuffle(open_adj_turfs))
var/turf/iter_turf = _iter_turf
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(firing_squad), dude, iter_turf, limb.body_zone, wound_bonuses[wound_bonus_rep], damage), delay_counter)
delay_counter += delay_per_shot
shots_this_limb += 1
if (shots_this_limb > shots_per_limb_per_rep)
break