From d75cfbcdb84e1785286be826e616f5cc4a254cf3 Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Thu, 2 Mar 2023 00:38:11 -0500 Subject: [PATCH] fixes wooo --- code/__SPLURTCODE/DEFINES/signals.dm | 1 + modular_splurt/code/_onclick/hud/hud.dm | 2 - modular_splurt/code/_onclick/hud/human.dm | 9 ++-- .../code/datums/interactions/lewd/_lewd.dm | 8 ++++ .../code/modules/arousal/arousal.dm | 46 +++++++++---------- 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/code/__SPLURTCODE/DEFINES/signals.dm b/code/__SPLURTCODE/DEFINES/signals.dm index 43df4522e7..cf09d785af 100644 --- a/code/__SPLURTCODE/DEFINES/signals.dm +++ b/code/__SPLURTCODE/DEFINES/signals.dm @@ -4,3 +4,4 @@ #define COMSIG_ORGAN_REMOVED "organ_removed" #define COMSIG_MOB_CLIMAX "mob_coomed" #define COMSIG_OBJ_WRITTEN_ON "written_on" +#define COMSIG_MOB_LUST_UPDATED "mob_lust_updated" diff --git a/modular_splurt/code/_onclick/hud/hud.dm b/modular_splurt/code/_onclick/hud/hud.dm index 0d1691ec87..7f600277e6 100644 --- a/modular_splurt/code/_onclick/hud/hud.dm +++ b/modular_splurt/code/_onclick/hud/hud.dm @@ -13,5 +13,3 @@ GLOBAL_LIST_INIT(splurt_ui_styles, list( return GLOB.splurt_ui_styles[ui_style] || GLOB.splurt_ui_styles[GLOB.splurt_ui_styles[1]] else return GLOB.splurt_ui_styles[ui_style] || GLOB.splurt_ui_styles[GLOB.splurt_ui_styles[1]] - -/datum/hud/var/atom/movable/screen/arousal diff --git a/modular_splurt/code/_onclick/hud/human.dm b/modular_splurt/code/_onclick/hud/human.dm index 0ba8d48af8..b32cf36508 100644 --- a/modular_splurt/code/_onclick/hud/human.dm +++ b/modular_splurt/code/_onclick/hud/human.dm @@ -7,7 +7,8 @@ using.hud = src static_inventory += using - arousal = new /atom/movable/screen/arousal() - arousal.icon_state = (owner.client?.prefs.arousable == 1 ? "arousal0" : "") - arousal.hud = src - infodisplay += arousal + if(owner.client?.prefs.arousable) + using = new /atom/movable/screen/arousal(null, owner) + using.icon_state = "arousal0" + using.hud = src + infodisplay += using diff --git a/modular_splurt/code/datums/interactions/lewd/_lewd.dm b/modular_splurt/code/datums/interactions/lewd/_lewd.dm index 2cd1a55817..93b4619aae 100644 --- a/modular_splurt/code/datums/interactions/lewd/_lewd.dm +++ b/modular_splurt/code/datums/interactions/lewd/_lewd.dm @@ -6,6 +6,14 @@ return has_genital(ORGAN_SLOT_ANUS, visibility) . = ..() +/mob/living/add_lust(add) + . = ..() + SEND_SIGNAL(src, COMSIG_MOB_LUST_UPDATED) + +/mob/living/set_lust(num) + . = ..() + SEND_SIGNAL(src, COMSIG_MOB_LUST_UPDATED) + /mob/living/moan() var/moaned = lastmoan var/miming = mind ? mind?.miming : FALSE diff --git a/modular_splurt/code/modules/arousal/arousal.dm b/modular_splurt/code/modules/arousal/arousal.dm index eaecd3fddb..b5370894f0 100644 --- a/modular_splurt/code/modules/arousal/arousal.dm +++ b/modular_splurt/code/modules/arousal/arousal.dm @@ -110,6 +110,10 @@ to_chat(L, span_userlove("[src] climaxes all over you using [p_their()] [G.name]!")) do_climax(fluid_source, L, G, spillage, cover = TRUE) +/mob/living/carbon/human/proc/getPercentAroused() + var/percentage = ((get_lust() / (get_lust_tolerance() * 3)) * 100) + return percentage + /atom/proc/add_cum_overlay() //This can go in a better spot, for now its here. cum_splatter_icon = icon(initial(icon), initial(icon_state), dir = 1) cum_splatter_icon.Blend("#fff", ICON_ADD) @@ -131,37 +135,29 @@ icon = 'icons/obj/genitals/hud.dmi' screen_loc = ui_arousal +/atom/movable/screen/arousal/Initialize(mapload, mob/living/carbon/human/owner) + . = ..() + if(!istype(owner)) + return INITIALIZE_HINT_QDEL + RegisterSignal(owner, COMSIG_MOB_LUST_UPDATED, .proc/update_lust) + /atom/movable/screen/arousal/Click() - if(!isliving(usr)) + if(!ishuman(usr)) return FALSE - if(isobserver(usr)) - return if(!usr.client?.prefs.arousable) return var/mob/living/M = usr M.interact_with() -/mob/living/carbon/human/proc/getPercentAroused() - var/percentage = ((get_lust() / get_lust_tolerance()) * 100) - return percentage +/atom/movable/screen/arousal/proc/update_lust(mob/living/carbon/human/source) + SIGNAL_HANDLER -/mob/living/carbon/human/proc/update_arousal_hud() - if(!client || !hud_used) - return FALSE - else - if(hud_used.arousal) - var/arousal_state = "arousal0" - if(stat != DEAD) - var/arousal_percent = getPercentAroused() - var/arousal_rounded = min(FLOOR(arousal_percent, 10),100) - arousal_state = "arousal[arousal_rounded]" - hud_used.arousal.icon_state = arousal_state - return TRUE + if(!istype(source)) + return + if(!source.client || !source.hud_used) + return -/mob/living/carbon/human/adjust_arousal() - ..() - update_arousal_hud() - -/mob/living/carbon/human/mob_climax() - ..() - update_arousal_hud() + var/arousal_level = 0 + if(source.stat != DEAD) + arousal_level = min(FLOOR(source.getPercentAroused(), 10),100) + icon_state = "arousal[arousal_level]"