From 5d3519b9cf3645c1fc5ec9ebb7aa81321a24b5ba Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:23:46 -0500 Subject: [PATCH] Adds Dustself, dust smite, divine smites (#89973) ## About The Pull Request - Adds `dustself` admin verb - Adds Dust admin smite - Does what it says on the tin - Adds Divine smites - Variations of smites that come with the prayer sound and special effects - so you can get the message across that this is a punishment from god. https://github.com/user-attachments/assets/1cf89ece-3e89-4135-a984-79ca10c278a6 ## Why It's Good For The Game - Request. Parity for `gibself` - Request. Parity with "Gib" - Request. Someone wanted to add some more flair to smites so I obliged. ## Changelog :cl: Melbert admin: Adds "Dustself" admin: Adds "Dust" smite. Does what it says on the tin admin: Adds "Divine" smites. They are variations of normal smites themed around divine intervention. /:cl: --- code/__DEFINES/admin.dm | 8 ++++++++ code/datums/status_effects/neutral.dm | 17 ++++++++++++---- code/modules/admin/smites/_smite.dm | 23 +++++++++++++++++++++- code/modules/admin/smites/become_object.dm | 4 ++++ code/modules/admin/smites/berforate.dm | 4 ++++ code/modules/admin/smites/dust.dm | 10 ++++++++++ code/modules/admin/smites/gib.dm | 4 ++++ code/modules/admin/smites/lightning.dm | 6 +++++- code/modules/admin/smites/petrify.dm | 4 ++++ code/modules/admin/verbs/adminfun.dm | 14 ++++++++++++- code/modules/buildmode/submodes/smite.dm | 2 +- tgstation.dme | 1 + 12 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 code/modules/admin/smites/dust.dm diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index ea5c52bf36f..518af39f61f 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -178,3 +178,11 @@ GLOBAL_VAR_INIT(ghost_role_flags, ALL) /// Used in logging uses of admin verbs (and sometimes some non-admin or debug verbs) to the blackbox /// Only pass it a string key, the verb being used. #define BLACKBOX_LOG_ADMIN_VERB(the_verb) SSblackbox.record_feedback("tally", "admin_verb", 1, the_verb) + +// Smite flags +/// Plays sfx and adds an overlay to the target +#define SMITE_DIVINE (1<<0) +/// Adds a delay before the effect is applied +#define SMITE_DELAY (1<<1) +/// Stuns the target for a short duration, ignores stun immunity +#define SMITE_STUN (1<<2) diff --git a/code/datums/status_effects/neutral.dm b/code/datums/status_effects/neutral.dm index 4a3dc8bd0b7..dd80a09e43f 100644 --- a/code/datums/status_effects/neutral.dm +++ b/code/datums/status_effects/neutral.dm @@ -734,6 +734,8 @@ id = "spotlight_light" processing_speed = STATUS_EFFECT_NORMAL_PROCESS alert_type = null + /// Color of the light + var/spotlight_color = "#e2e2ca" /// Dummy lighting object to simulate the spotlight highlighting the mob. var/obj/effect/dummy/lighting_obj/moblight/mob_light_obj /// First visual overlay, this one sits on the back of the mob. @@ -747,14 +749,16 @@ return ..() /datum/status_effect/spotlight_light/on_apply() - mob_light_obj = owner.mob_light(2, 1.5, "#e2e2ca") + mob_light_obj = owner.mob_light(2, 1.5, spotlight_color) beam_from_above_a = new /obj/effect/overlay/spotlight + beam_from_above_a.color = spotlight_color beam_from_above_a.alpha = BEAM_ALPHA owner.vis_contents += beam_from_above_a beam_from_above_a.layer = BELOW_MOB_LAYER beam_from_above_b = new /obj/effect/overlay/spotlight + beam_from_above_b.color = spotlight_color beam_from_above_b.alpha = BEAM_ALPHA beam_from_above_b.layer = ABOVE_MOB_LAYER beam_from_above_b.pixel_y = -2 //Slight vertical offset for an illusion of volume @@ -763,9 +767,14 @@ return TRUE /datum/status_effect/spotlight_light/on_remove() - if(beam_from_above_a || beam_from_above_b) - owner.vis_contents -= beam_from_above_a - owner.vis_contents -= beam_from_above_b + owner.vis_contents -= beam_from_above_a + owner.vis_contents -= beam_from_above_b + QDEL_NULL(beam_from_above_a) + QDEL_NULL(beam_from_above_b) QDEL_NULL(mob_light_obj) +/datum/status_effect/spotlight_light/divine + id = "divine_spotlight" + duration = 3 SECONDS + #undef BEAM_ALPHA diff --git a/code/modules/admin/smites/_smite.dm b/code/modules/admin/smites/_smite.dm index b767f47f8fe..ca66bedf2d5 100644 --- a/code/modules/admin/smites/_smite.dm +++ b/code/modules/admin/smites/_smite.dm @@ -2,7 +2,8 @@ /datum/smite /// The name of the smite, shown in the menu var/name - + /// Flags which modify how the smite fires + var/smite_flags = NONE /// Should this smite write to logs? var/should_log = TRUE @@ -11,6 +12,26 @@ /// Return FALSE if the smite should not be used. /datum/smite/proc/configure(client/user) +/// Invoked externally to actually perform the smite +/datum/smite/proc/do_effect(client/user, mob/living/target) + if(smite_flags & SMITE_DIVINE) + playsound(target, 'sound/effects/pray.ogg', 50, FALSE, -1) + target.add_overlay(mutable_appearance('icons/mob/effects/genetics.dmi', "servitude", -MUTATIONS_LAYER)) + target.apply_status_effect(/datum/status_effect/spotlight_light/divine) + + if(smite_flags & SMITE_STUN) + target.Stun(3 SECONDS, ignore_canstun = TRUE) + if(smite_flags & SMITE_DELAY) + addtimer(CALLBACK(src, PROC_REF(delayed_effect), user, target), 2 SECONDS, TIMER_UNIQUE) + else + effect(user, target) + +/// Called after a delay if the smite has the SMITE_DELAY flag +/datum/smite/proc/delayed_effect(client/user, mob/living/target) + if(QDELETED(target)) + return + effect(user, target) + /// The effect of the smite, make sure to call this in your own smites /datum/smite/proc/effect(client/user, mob/living/target) if (should_log) diff --git a/code/modules/admin/smites/become_object.dm b/code/modules/admin/smites/become_object.dm index 5f1af4bee28..542d1666bda 100644 --- a/code/modules/admin/smites/become_object.dm +++ b/code/modules/admin/smites/become_object.dm @@ -40,3 +40,7 @@ addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(objectify), target, transform_path), OBJECTIFY_TIME) #undef OBJECTIFY_TIME + +/datum/smite/objectify/divine + name = "Become Object (Divine)" + smite_flags = SMITE_DIVINE|SMITE_STUN diff --git a/code/modules/admin/smites/berforate.dm b/code/modules/admin/smites/berforate.dm index 3d05afd519d..6b5fffa38e6 100644 --- a/code/modules/admin/smites/berforate.dm +++ b/code/modules/admin/smites/berforate.dm @@ -51,3 +51,7 @@ shots_this_limb += 1 if (shots_this_limb > shots_per_limb_per_rep) break + +/datum/smite/berforate/divine + name = ":B:erforate (Divine)" + smite_flags = SMITE_DIVINE diff --git a/code/modules/admin/smites/dust.dm b/code/modules/admin/smites/dust.dm new file mode 100644 index 00000000000..22ca6c536cb --- /dev/null +++ b/code/modules/admin/smites/dust.dm @@ -0,0 +1,10 @@ +/datum/smite/dust + name = "Dust" + +/datum/smite/dust/effect(client/user, mob/living/target) + . = ..() + target.dust(just_ash = FALSE, drop_items = TRUE, force = TRUE) + +/datum/smite/dust/divine + name = "Dust (Divine)" + smite_flags = SMITE_DIVINE|SMITE_DELAY|SMITE_STUN diff --git a/code/modules/admin/smites/gib.dm b/code/modules/admin/smites/gib.dm index 4c7c4324823..02007582a8d 100644 --- a/code/modules/admin/smites/gib.dm +++ b/code/modules/admin/smites/gib.dm @@ -5,3 +5,7 @@ /datum/smite/gib/effect(client/user, mob/living/target) . = ..() target.gib(DROP_ORGANS|DROP_BODYPARTS) + +/datum/smite/gib/divine + name = "Gib (Divine)" + smite_flags = SMITE_DIVINE|SMITE_DELAY|SMITE_STUN diff --git a/code/modules/admin/smites/lightning.dm b/code/modules/admin/smites/lightning.dm index 6ffd8eb5869..99cb46bdaac 100644 --- a/code/modules/admin/smites/lightning.dm +++ b/code/modules/admin/smites/lightning.dm @@ -1,6 +1,6 @@ /// Strikes the target with a lightning bolt /datum/smite/lightning - name = "Lightning bolt" + name = "Lightning Bolt" /datum/smite/lightning/effect(client/user, mob/living/target) . = ..() @@ -16,3 +16,7 @@ if(ishuman(user)) var/mob/living/carbon/human/human_target = user human_target.electrocution_animation(LIGHTNING_BOLT_ELECTROCUTION_ANIMATION_LENGTH) + +/datum/smite/lightning/divine + name = "Lightning Bolt (Divine)" + smite_flags = SMITE_DIVINE diff --git a/code/modules/admin/smites/petrify.dm b/code/modules/admin/smites/petrify.dm index 5380b93d732..c03a197c518 100644 --- a/code/modules/admin/smites/petrify.dm +++ b/code/modules/admin/smites/petrify.dm @@ -10,3 +10,7 @@ return var/mob/living/carbon/human/human_target = target human_target.petrify(statue_timer = INFINITY, save_brain = FALSE) + +/datum/smite/petrify/divine + name = "Petrify (Divine)" + smite_flags = SMITE_DIVINE|SMITE_DELAY|SMITE_STUN diff --git a/code/modules/admin/verbs/adminfun.dm b/code/modules/admin/verbs/adminfun.dm index 87109dd01f9..4da149a9c18 100644 --- a/code/modules/admin/verbs/adminfun.dm +++ b/code/modules/admin/verbs/adminfun.dm @@ -76,6 +76,18 @@ ADMIN_VERB(gib_self, R_ADMIN, "Gibself", "Give yourself the same treatment you g if (istype(ourself)) ourself.gib() +ADMIN_VERB(dust_self, R_ADMIN, "Dustself", "Give yourself the same treatment you give others.", ADMIN_CATEGORY_FUN) + var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) + if(confirm != "Yes") + return + log_admin("[key_name(user)] used dustself.") + message_admins(span_adminnotice("[key_name_admin(user)] used dustself.")) + BLACKBOX_LOG_ADMIN_VERB("Dust Self") + + var/mob/living/ourself = user.mob + if (istype(ourself)) + ourself.dust(just_ash = FALSE, drop_items = FALSE, force = TRUE) + ADMIN_VERB(everyone_random, R_SERVER, "Make Everyone Random", "Make everyone have a random appearance.", ADMIN_CATEGORY_FUN) if(SSticker.HasRoundStarted()) to_chat(user, "Nope you can't do this, the game's already started. This only works before rounds!", confidential = TRUE) @@ -164,7 +176,7 @@ ADMIN_VERB_AND_CONTEXT_MENU(admin_smite, R_ADMIN|R_FUN, "Smite", "Smite a player var/configuration_success = smite.configure(user) if (configuration_success == FALSE) return - smite.effect(user, target) + smite.do_effect(user, target) /// "Turns" people into objects. Really, we just add them to the contents of the item. /proc/objectify(atom/movable/target, path_or_instance) diff --git a/code/modules/buildmode/submodes/smite.dm b/code/modules/buildmode/submodes/smite.dm index 7e382926c59..39fa7d150ad 100644 --- a/code/modules/buildmode/submodes/smite.dm +++ b/code/modules/buildmode/submodes/smite.dm @@ -37,4 +37,4 @@ to_chat(user, span_notice("No smite selected.")) return - selected_smite.effect(user, object) + selected_smite.do_effect(user, object) diff --git a/tgstation.dme b/tgstation.dme index f8e82035ab5..7e9f736d143 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2981,6 +2981,7 @@ #include "code\modules\admin\smites\bsa.dm" #include "code\modules\admin\smites\curse_of_babel.dm" #include "code\modules\admin\smites\dock_pay.dm" +#include "code\modules\admin\smites\dust.dm" #include "code\modules\admin\smites\fake_bwoink.dm" #include "code\modules\admin\smites\fat.dm" #include "code\modules\admin\smites\fireball.dm"