diff --git a/code/__DEFINES/~~bubber_defines/traits/declarations.dm b/code/__DEFINES/~~bubber_defines/traits/declarations.dm index 4c562e5747f..6b6c9ab69ab 100644 --- a/code/__DEFINES/~~bubber_defines/traits/declarations.dm +++ b/code/__DEFINES/~~bubber_defines/traits/declarations.dm @@ -36,3 +36,6 @@ // makes it so cult cannot get another blood stone from this mob #define TRAIT_HAS_BEEN_CULT_SACRIFICED "has_been_cult_sacrificed" +// makes it so held items float by their head +#define TRAIT_FLOATING_HELD "held_items_float" + diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 94e5b668294..8375d8b1bcd 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -850,6 +850,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_XENO_HEAL_AURA" = TRAIT_XENO_HEAL_AURA, "TRAIT_XENO_INNATE" = TRAIT_XENO_INNATE, "TRAIT_CLOTHES_DAMAGED_BY_PIERCING" = TRAIT_CLOTHES_DAMAGED_BY_PIERCING, + "TRAIT_FLOATING_HELD" = TRAIT_FLOATING_HELD, + ), // SKYRAT EDIT ADDITION END )) diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index 9e7594138d3..02c0bb4a1fc 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -485,6 +485,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_XENO_HEAL_AURA" = TRAIT_XENO_HEAL_AURA, "TRAIT_XENO_INNATE" = TRAIT_XENO_INNATE, "TRAIT_CLOTHES_DAMAGED_BY_PIERCING" = TRAIT_CLOTHES_DAMAGED_BY_PIERCING, + "TRAIT_FLOATING_HELD" = TRAIT_FLOATING_HELD, ), // SKYRAT EDIT ADDITION END )) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 136c07f06f5..b92fbc7ac17 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -69,6 +69,15 @@ if (mob_mood) QDEL_NULL(mob_mood) + // BUBBER EDIT START + if(held_left) + held_left.UnregisterSignal(src, COMSIG_ATOM_DIR_CHANGE) + QDEL_NULL(held_left) + if(held_right) + held_right.UnregisterSignal(src, COMSIG_ATOM_DIR_CHANGE) + QDEL_NULL(held_right) + // BUBBER EDIT END + return ..() /mob/living/carbon/human/prepare_data_huds() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 97626d33c54..3346a07513c 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -101,3 +101,9 @@ VAR_PRIVATE/base_mob_height = HUMAN_HEIGHT_MEDIUM /// Actual height of the mob. Don't touch this one, it is set via update_mob_height() VAR_FINAL/mob_height = HUMAN_HEIGHT_MEDIUM + + // BUBBER EDIT START - Floating Hands quirk + var/obj/effect/abstract/held_tk_effect/left/held_left + var/obj/effect/abstract/held_tk_effect/right/held_right + var/held_hover_color + // BUBBER EDIT END diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 41c0a57ca80..54c07bc3049 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -720,9 +720,72 @@ There are several things that need to be remembered: // SKYRAT EDIT END overlays_standing[BACK_LAYER] = back_overlay apply_overlay(BACK_LAYER) +// BUBBER EDIT START +/obj/effect/abstract/held_tk_effect + name = "held_tk_effect" + icon = 'modular_skyrat/master_files/icons/effects/tele_effects.dmi' + icon_state = "holder" + layer = HANDS_LAYER + vis_flags = VIS_INHERIT_DIR | VIS_INHERIT_PLANE | VIS_INHERIT_ID + var/is_right = TRUE + var/list/base_x + var/list/base_y +/obj/effect/abstract/held_tk_effect/proc/on_parent_dir_change(datum/source, _old_dir, new_dir) + SIGNAL_HANDLER + set_direction_facing(new_dir) + +/obj/effect/abstract/held_tk_effect/proc/set_direction_facing(new_dir) + if(base_x && base_y) + var/current_dir = dir2text(new_dir) + pixel_x = length(base_x) ? ((current_dir in base_x) ? base_x[current_dir] : base_x["south"]) : 0 + pixel_y = length(base_y) ? ((current_dir in base_y) ? base_y[current_dir] : base_y["south"]) : 0 + switch(new_dir) + if(NORTH) + if(is_right) + pixel_x += 5 + pixel_y += 10 + else + pixel_x += -5 + pixel_y += 10 + if(SOUTH) + if(is_right) + pixel_x += -5 + pixel_y += 10 + else + pixel_x += 5 + pixel_y += 10 + if(EAST) + if(is_right) + pixel_x += 0 + pixel_y += 10 + else + pixel_x += 0 + pixel_y += 10 + if(WEST) + if(is_right) + pixel_x += 0 + pixel_y += 10 + else + pixel_x += 0 + pixel_y += 10 + +/obj/effect/abstract/held_tk_effect/right + is_right = TRUE + +/obj/effect/abstract/held_tk_effect/left + is_right = FALSE +// BUBBER EDIT END /mob/living/carbon/human/get_held_overlays() var/list/hands = list() + // BUBBER EDIT START + if(held_left) + held_left.overlays.Cut() + held_left.underlays.Cut() + if(held_right) + held_right.overlays.Cut() + held_right.underlays.Cut() + // BUBBER EDIT END for(var/obj/item/worn_item in held_items) var/held_index = get_held_index_of_item(worn_item) if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) @@ -747,9 +810,68 @@ There are several things that need to be remembered: var/icon_file = IS_RIGHT_INDEX(held_index) ? worn_item.righthand_file : worn_item.lefthand_file hand_overlay = worn_item.build_worn_icon(default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE) var/obj/item/bodypart/arm/held_in_hand = hand_bodyparts[held_index] - held_in_hand?.held_hand_offset?.apply_offset(hand_overlay) - - hands += hand_overlay + // BUBBER EDIT START + if(HAS_TRAIT(src, TRAIT_FLOATING_HELD)) + if(!held_left) + held_left = new(src) + held_left.render_target = "*[REF(src)]_hover_left" + held_left.RegisterSignal(src, COMSIG_ATOM_DIR_CHANGE, TYPE_PROC_REF(/obj/effect/abstract/held_tk_effect, on_parent_dir_change)) + src.vis_contents += held_left + if(!held_right) + held_right = new(src) + held_right.render_target = "*[REF(src)]_hover_right" + held_right.RegisterSignal(src, COMSIG_ATOM_DIR_CHANGE, TYPE_PROC_REF(/obj/effect/abstract/held_tk_effect, on_parent_dir_change)) + src.vis_contents += held_right + if(held_index % 2 == 0) + held_right.overlays.Cut() + held_right.underlays.Cut() + held_right.pixel_y = 0 + held_right.pixel_x = 0 + held_right.overlays += hand_overlay + var/mutable_appearance/hover_effect = mutable_appearance(held_left.icon, "hover_right", HANDS_LAYER) + if(held_hover_color) + hover_effect.color = held_hover_color + held_right.underlays += hover_effect + var/list/offset = held_in_hand?.held_hand_offset?.get_offset() + if(offset) + held_right.base_x = held_in_hand?.held_hand_offset?.offset_x + held_right.base_y = held_in_hand?.held_hand_offset?.offset_y + else + held_right.base_x = list("south" = 0) + held_right.base_y = list("south" = 0) + held_right.set_direction_facing(src.dir) + else + held_left.overlays.Cut() + held_left.underlays.Cut() + held_left.pixel_y = 0 + held_left.pixel_x = 0 + held_left.overlays += hand_overlay + var/mutable_appearance/hover_effect = mutable_appearance(held_left.icon, "hover_left", HANDS_LAYER) + if(held_hover_color) + hover_effect.color = held_hover_color + held_left.underlays += hover_effect + var/list/offset = held_in_hand?.held_hand_offset?.get_offset() + if(offset) + held_left.base_x = held_in_hand?.held_hand_offset?.offset_x + held_left.base_y = held_in_hand?.held_hand_offset?.offset_y + else + held_left.base_x = list("south" = 0) + held_left.base_y = list("south" = 0) + held_left.set_direction_facing(src.dir) + var/mutable_appearance/hand_overlay_real = mutable_appearance(layer = HANDS_LAYER, offset_spokesman = src) + if(held_index % 2 == 0) + hand_overlay_real.render_source = "*[REF(src)]_hover_right" + animate(held_right, pixel_y = 2, time = 1 SECONDS, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_y = -2, time = 1 SECONDS, flags = ANIMATION_RELATIVE) + else + hand_overlay_real.render_source = "*[REF(src)]_hover_left" + animate(held_left, pixel_y = 2, time = 1 SECONDS, loop = -1, flags = ANIMATION_RELATIVE) + animate(pixel_y = -2, time = 1 SECONDS, flags = ANIMATION_RELATIVE) + hands += hand_overlay_real + else + held_in_hand?.held_hand_offset?.apply_offset(hand_overlay) + hands += hand_overlay + // BUBBER EDIT END return hands /// Modifies a sprite slightly to conform to female body shapes diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod.png index 82f06aabc25..73ad2f80113 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod.png and b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod.png differ diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod_podweak.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod_podweak.png index 82f06aabc25..73ad2f80113 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod_podweak.png and b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_pod_podweak.png differ diff --git a/modular_skyrat/master_files/icons/effects/tele_effects.dmi b/modular_skyrat/master_files/icons/effects/tele_effects.dmi index 2ace46ef27b..3cce136d5cc 100644 Binary files a/modular_skyrat/master_files/icons/effects/tele_effects.dmi and b/modular_skyrat/master_files/icons/effects/tele_effects.dmi differ diff --git a/modular_zubbers/code/datums/quirks/positive_quirks/floating_items.dm b/modular_zubbers/code/datums/quirks/positive_quirks/floating_items.dm new file mode 100644 index 00000000000..d7c1683851d --- /dev/null +++ b/modular_zubbers/code/datums/quirks/positive_quirks/floating_items.dm @@ -0,0 +1,52 @@ +/datum/quirk/floating_items + name = "Psionic Holding" + desc = "You find holding items with your hands so inconvenient, and use your mind powers to do so instead." + value = 0 + icon = FA_ICON_METEOR + medical_record_text = "Subject's mind is capable of extremely limited telekinesis." + gain_text = "Your mind feels like it can lift weights!" + lose_text = "Your mind feels like it took a cheat day." + mob_trait = TRAIT_FLOATING_HELD + +/datum/quirk_constant_data/floating_items + associated_typepath = /datum/quirk/floating_items + customization_options = list(/datum/preference/color/floating_items) + +/datum/preference/color/floating_items + category = PREFERENCE_CATEGORY_MANUALLY_RENDERED + savefile_key = "floating_items" + savefile_identifier = PREFERENCE_CHARACTER + +/datum/preference/color/floating_items/apply_to_human(mob/living/carbon/human/target, value) + target.held_hover_color = value + +/datum/quirk/floating_items/add(client/client_source) + . = ..() + var/datum/action/innate/toggle_floating_items/toggle = new + toggle.Grant(quirk_holder) + +/datum/preference/color/floating_items/create_default_value() + return "#FF99FF" + +/datum/action/innate/toggle_floating_items + name = "Toggle Psionic Holding" + button_icon = 'modular_skyrat/master_files/icons/effects/tele_effects.dmi' + button_icon_state = "telekinesishead" + check_flags = AB_CHECK_INCAPACITATED|AB_CHECK_CONSCIOUS + +/datum/action/innate/toggle_floating_items/Trigger(trigger_flags) + . = ..() + if(!.) + return FALSE + if(owner) + if(HAS_TRAIT(owner, TRAIT_FLOATING_HELD)) + REMOVE_TRAIT(owner, TRAIT_FLOATING_HELD, QUIRK_TRAIT) + if(ishuman(owner)) + var/mob/living/carbon/human/owner_human = owner + owner_human.update_held_items() + else + ADD_TRAIT(owner, TRAIT_FLOATING_HELD, QUIRK_TRAIT) + if(ishuman(owner)) + var/mob/living/carbon/human/owner_human = owner + owner_human.update_held_items() + return TRUE diff --git a/tgstation.dme b/tgstation.dme index 46c1897a8ac..b598b4ddf9c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8850,6 +8850,7 @@ #include "modular_zubbers\code\datums\quirks\positive_quirks\dominant_aura.dm" #include "modular_zubbers\code\datums\quirks\positive_quirks\empath_override.dm" #include "modular_zubbers\code\datums\quirks\positive_quirks\featherweight.dm" +#include "modular_zubbers\code\datums\quirks\positive_quirks\floating_items.dm" #include "modular_zubbers\code\datums\quirks\positive_quirks\life_savings.dm" #include "modular_zubbers\code\datums\quirks\positive_quirks\masquerade_food.dm" #include "modular_zubbers\code\datums\quirks\positive_quirks\venemous_bite\venomous_bite.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/floating_hands.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/floating_hands.tsx new file mode 100644 index 00000000000..608c6b77f42 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/floating_hands.tsx @@ -0,0 +1,6 @@ +import { Feature, FeatureColorInput } from '../base'; + +export const floating_items: Feature = { + name: 'Hover Effect Color', + component: FeatureColorInput, +};