mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Replaces "Bread" smite with "Objectify" (#78445)
Instead of turning people into bread, the bread smite can now turn people into any object (including bread).
This commit is contained in:
@@ -34,10 +34,9 @@
|
||||
// Grouped effect sources, see also code/__DEFINES/traits.dm
|
||||
|
||||
#define STASIS_MACHINE_EFFECT "stasis_machine"
|
||||
|
||||
#define STASIS_CHEMICAL_EFFECT "stasis_chemical"
|
||||
|
||||
#define STASIS_SHAPECHANGE_EFFECT "stasis_shapechange"
|
||||
#define STASIS_ADMIN "stasis_admin"
|
||||
|
||||
/// Causes the mob to become blind via the passed source
|
||||
#define become_blind(source) apply_status_effect(/datum/status_effect/grouped/blindness, source)
|
||||
|
||||
@@ -11,19 +11,39 @@
|
||||
if(QDELETED(passed_container))
|
||||
return
|
||||
containerref = WEAKREF(passed_container)
|
||||
RegisterSignal(passed_container, COMSIG_ATOM_EXAMINE_MORE, PROC_REF(on_examined))
|
||||
move_tracker = new(parent, CALLBACK(src, PROC_REF(verify_containment)))
|
||||
|
||||
|
||||
/datum/component/itembound/RegisterWithParent()
|
||||
. = ..()
|
||||
ADD_TRAIT(parent, TRAIT_INCAPACITATED, SMITE_TRAIT)
|
||||
if (isliving(parent))
|
||||
var/mob/living/living_parent = parent
|
||||
living_parent.apply_status_effect(/datum/status_effect/grouped/stasis, STASIS_ADMIN)
|
||||
|
||||
/datum/component/itembound/UnregisterFromParent()
|
||||
REMOVE_TRAIT(parent, TRAIT_INCAPACITATED, SMITE_TRAIT)
|
||||
if (isliving(parent))
|
||||
var/mob/living/living_parent = parent
|
||||
living_parent.remove_status_effect(/datum/status_effect/grouped/stasis, STASIS_ADMIN)
|
||||
return ..()
|
||||
|
||||
/datum/component/itembound/proc/on_examined(atom/source, mob/user, list/examine_list)
|
||||
SIGNAL_HANDLER
|
||||
examine_list += span_notice("If you hold it up to your ear, you can hear the screams of the damned.")
|
||||
|
||||
/// Ensure that when we move, we still are in the container. If not in the container, remove all the traits.
|
||||
/datum/component/itembound/proc/verify_containment()
|
||||
var/atom/movable/container = containerref.resolve()
|
||||
if(!QDELETED(container) && container.contains(parent))
|
||||
return
|
||||
REMOVE_TRAIT(parent, TRAIT_INCAPACITATED, SMITE_TRAIT)
|
||||
qdel(src)
|
||||
|
||||
/datum/component/itembound/Destroy(force, silent)
|
||||
var/atom/movable/container = containerref?.resolve()
|
||||
if (!QDELETED(container))
|
||||
UnregisterSignal(container, COMSIG_ATOM_EXAMINE_MORE)
|
||||
containerref = null
|
||||
QDEL_NULL(move_tracker)
|
||||
return ..()
|
||||
|
||||
@@ -55,10 +55,6 @@
|
||||
. = ..()
|
||||
AddComponent(/datum/component/customizable_reagent_holder, /obj/item/food/bread/empty, CUSTOM_INGREDIENT_ICON_FILL, max_ingredients = 8)
|
||||
|
||||
// special subtype we use for the "Bread" Admin Smite (or the breadify proc)
|
||||
/obj/item/food/bread/plain/smite
|
||||
desc = "If you hold it up to your ear, you can hear the screams of the damned."
|
||||
|
||||
/obj/item/food/breadslice/plain
|
||||
name = "bread slice"
|
||||
desc = "A slice of home."
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#define OBJECTIFY_TIME (5 SECONDS)
|
||||
|
||||
/// Turns the target into an object (for instance bread)
|
||||
/datum/smite/objectify
|
||||
name = "Become Object"
|
||||
/// What are we going to turn them into?
|
||||
var/atom/transform_path = /obj/item/food/bread/plain
|
||||
|
||||
/datum/smite/objectify/configure(client/user)
|
||||
var/attempted_target_path = input(
|
||||
user,
|
||||
"Enter typepath of an atom you'd like to turn your victim into.",
|
||||
"Typepath",
|
||||
"[/obj/item/food/bread/plain]",
|
||||
) as null|text
|
||||
|
||||
if (isnull(attempted_target_path))
|
||||
return FALSE //The user pressed "Cancel"
|
||||
|
||||
var/desired_object = text2path(attempted_target_path)
|
||||
if(!ispath(desired_object))
|
||||
desired_object = pick_closest_path(attempted_target_path, get_fancy_list_of_atom_types())
|
||||
if(isnull(desired_object) || !ispath(desired_object))
|
||||
return FALSE //The user pressed "Cancel"
|
||||
if(!ispath(desired_object, /atom))
|
||||
tgui_alert(user, "ERROR: Incorrect / improper path given.")
|
||||
return FALSE
|
||||
transform_path = desired_object
|
||||
|
||||
/datum/smite/objectify/effect(client/user, mob/living/target)
|
||||
if (!isliving(target))
|
||||
return // This doesn't work on ghosts
|
||||
. = ..()
|
||||
var/mutable_appearance/objectified_player = mutable_appearance(initial(transform_path.icon), initial(transform_path.icon_state))
|
||||
objectified_player.pixel_x = initial(transform_path.pixel_x)
|
||||
objectified_player.pixel_y = initial(transform_path.pixel_y)
|
||||
var/mutable_appearance/transform_scanline = mutable_appearance('icons/effects/effects.dmi', "transform_effect")
|
||||
target.transformation_animation(objectified_player, OBJECTIFY_TIME, transform_scanline.appearance)
|
||||
target.Immobilize(OBJECTIFY_TIME, ignore_canstun = TRUE)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(objectify), target, transform_path), OBJECTIFY_TIME)
|
||||
|
||||
#undef OBJECTIFY_TIME
|
||||
@@ -1,14 +0,0 @@
|
||||
#define BREADIFY_TIME (5 SECONDS)
|
||||
|
||||
/// Turns the target into bread
|
||||
/datum/smite/bread
|
||||
name = "Bread"
|
||||
|
||||
/datum/smite/bread/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
var/mutable_appearance/bread_appearance = mutable_appearance('icons/obj/food/burgerbread.dmi', "bread")
|
||||
var/mutable_appearance/transform_scanline = mutable_appearance('icons/effects/effects.dmi', "transform_effect")
|
||||
target.transformation_animation(bread_appearance, BREADIFY_TIME, transform_scanline.appearance)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(breadify), target), BREADIFY_TIME)
|
||||
|
||||
#undef BREADIFY_TIME
|
||||
@@ -219,9 +219,9 @@
|
||||
return
|
||||
smite.effect(src, target)
|
||||
|
||||
///"Turns" people into bread. Really, we just add them to the contents of the bread food item.
|
||||
/proc/breadify(atom/movable/target)
|
||||
var/obj/item/food/bread/plain/smite/tomb = new(get_turf(target))
|
||||
/// "Turns" people into objects. Really, we just add them to the contents of the item.
|
||||
/proc/objectify(atom/movable/target, path)
|
||||
var/atom/tomb = new path(get_turf(target))
|
||||
target.forceMove(tomb)
|
||||
target.AddComponent(/datum/component/itembound, tomb)
|
||||
|
||||
|
||||
+1
-1
@@ -2609,11 +2609,11 @@
|
||||
#include "code\modules\admin\whitelist.dm"
|
||||
#include "code\modules\admin\callproc\callproc.dm"
|
||||
#include "code\modules\admin\smites\bad_luck.dm"
|
||||
#include "code\modules\admin\smites\become_object.dm"
|
||||
#include "code\modules\admin\smites\berforate.dm"
|
||||
#include "code\modules\admin\smites\bloodless.dm"
|
||||
#include "code\modules\admin\smites\boneless.dm"
|
||||
#include "code\modules\admin\smites\brain_damage.dm"
|
||||
#include "code\modules\admin\smites\bread.dm"
|
||||
#include "code\modules\admin\smites\bsa.dm"
|
||||
#include "code\modules\admin\smites\curse_of_babel.dm"
|
||||
#include "code\modules\admin\smites\dock_pay.dm"
|
||||
|
||||
Reference in New Issue
Block a user