From 6ac830a123e7fa97c5eb70b297c986268018973c Mon Sep 17 00:00:00 2001 From: deathride58 Date: Mon, 28 May 2018 00:18:40 +0000 Subject: [PATCH] Combat rework adjustments (Making use of 512's new filter feature, small balance tweaks, and more) (#6092) * makes use of 512's filters, adds combat mode toggle component signals, and more * Update phantomthief.dm * Update living.dm --- code/__DEFINES/citadel_defines.dm | 7 ++- .../code/datums/components/phantomthief.dm | 49 +++++++++++++++++++ .../game/objects/items/melee/transforming.dm | 4 ++ .../modules/clothing/glasses/phantomthief.dm | 11 +++++ .../code/modules/mob/living/carbon/carbon.dm | 1 + .../code/modules/mob/living/living.dm | 2 + .../code/modules/uplink/uplink_items.dm | 7 +++ tgstation.dme | 2 + 8 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 modular_citadel/code/datums/components/phantomthief.dm create mode 100644 modular_citadel/code/modules/clothing/glasses/phantomthief.dm diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 2fed84553e..d6ce47ea62 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -13,6 +13,8 @@ #define ui_boxarea "EAST-4:6,SOUTH+1:6" #define ui_boxlang "EAST-5:22,SOUTH+1:6" +//Filters +#define CIT_FILTER_STAMINACRIT filter(type="drop_shadow", x=0, y=0, size=-3, border=0, color="#04080F") //organ defines #define COCK_SIZE_MIN 1 @@ -130,4 +132,7 @@ #define EATING_NOISES 2 #define DIGESTION_NOISES 4 -#define TOGGLES_CITADEL (MEDIHOUND_SLEEPER|EATING_NOISES|DIGESTION_NOISES) \ No newline at end of file +#define TOGGLES_CITADEL (MEDIHOUND_SLEEPER|EATING_NOISES|DIGESTION_NOISES) + +//component stuff +#define COMSIG_COMBAT_TOGGLED "combatmode_toggled" //called by combat mode toggle on all equipped items. args: (mob/user, combatmode) diff --git a/modular_citadel/code/datums/components/phantomthief.dm b/modular_citadel/code/datums/components/phantomthief.dm new file mode 100644 index 0000000000..8b62971a2a --- /dev/null +++ b/modular_citadel/code/datums/components/phantomthief.dm @@ -0,0 +1,49 @@ +//This component applies a customizable drop_shadow filter to its wearer when they toggle combat mode on or off. This can stack. + +/datum/component/phantomthief + dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS + + var/filter_x + var/filter_y + var/filter_size + var/filter_border + var/filter_color + + var/datum/component/redirect/combattoggle_redir + +/datum/component/phantomthief/Initialize(_x = -2, _y = 0, _size = 0, _border = 0, _color = "#E62111") + filter_x = _x + filter_y = _y + filter_size = _size + filter_border = _border + filter_color = _color + + RegisterSignal(COMSIG_COMBAT_TOGGLED, .proc/handlefilterstuff) + RegisterSignal(COMSIG_ITEM_EQUIPPED, .proc/OnEquipped) + RegisterSignal(COMSIG_ITEM_DROPPED, .proc/OnDropped) + +/datum/component/phantomthief/proc/handlefilterstuff(mob/user, combatmodestate) + if(istype(user)) + var/thefilter = filter(type = "drop_shadow", x = filter_x, y = filter_y, size = filter_size, border = filter_border, color = filter_color) + if(!combatmodestate) + user.filters -= thefilter + else + user.filters += thefilter + +/datum/component/phantomthief/proc/stripdesiredfilter(mob/user) + if(istype(user)) + var/thefilter = filter(type = "drop_shadow", x = filter_x, y = filter_y, size = filter_size, border = filter_border, color = filter_color) + user.filters -= thefilter + +/datum/component/phantomthief/proc/OnEquipped(mob/user, slot) + if(!istype(user)) + return + if(!combattoggle_redir) + combattoggle_redir = user.AddComponent(/datum/component/redirect,list(COMSIG_COMBAT_TOGGLED),CALLBACK(src,.proc/handlefilterstuff)) + +/datum/component/phantomthief/proc/OnDropped(mob/user) + if(!istype(user)) + return + if(combattoggle_redir) + QDEL_NULL(combattoggle_redir) + stripdesiredfilter(user) diff --git a/modular_citadel/code/game/objects/items/melee/transforming.dm b/modular_citadel/code/game/objects/items/melee/transforming.dm index 211118bbce..46610f4e54 100644 --- a/modular_citadel/code/game/objects/items/melee/transforming.dm +++ b/modular_citadel/code/game/objects/items/melee/transforming.dm @@ -9,3 +9,7 @@ return max(total_mass,MIN_MELEE_STAMCOST) else return initial(w_class)*1.25 + +/obj/item/melee/transforming/cleaving_saw + total_mass = 2.75 + total_mass_on = 5 diff --git a/modular_citadel/code/modules/clothing/glasses/phantomthief.dm b/modular_citadel/code/modules/clothing/glasses/phantomthief.dm new file mode 100644 index 0000000000..be8812416a --- /dev/null +++ b/modular_citadel/code/modules/clothing/glasses/phantomthief.dm @@ -0,0 +1,11 @@ +/obj/item/clothing/glasses/phantomthief + name = "suspicious paper mask" + desc = "A cheap, Syndicate-branded paper face mask. They'll never see it coming." + alternate_worn_icon = 'icons/mob/mask.dmi' + icon = 'icons/obj/clothing/masks.dmi' + icon_state = "s-ninja" + item_state = "s-ninja" + +/obj/item/clothing/glasses/phantomthief/Initialize() + . = ..() + AddComponent(/datum/component/phantomthief) diff --git a/modular_citadel/code/modules/mob/living/carbon/carbon.dm b/modular_citadel/code/modules/mob/living/carbon/carbon.dm index a05d7ecf87..2fcf5a4c9d 100644 --- a/modular_citadel/code/modules/mob/living/carbon/carbon.dm +++ b/modular_citadel/code/modules/mob/living/carbon/carbon.dm @@ -27,6 +27,7 @@ if(hud_used && hud_used.static_inventory) for(var/obj/screen/combattoggle/selector in hud_used.static_inventory) selector.rebasetointerbay(src) + SendSignal(COMSIG_COMBAT_TOGGLED, src, combatmode) return TRUE /mob/living/carbon/Move(atom/newloc, direct = 0) diff --git a/modular_citadel/code/modules/mob/living/living.dm b/modular_citadel/code/modules/mob/living/living.dm index c70ed640b4..e0fb43f5df 100644 --- a/modular_citadel/code/modules/mob/living/living.dm +++ b/modular_citadel/code/modules/mob/living/living.dm @@ -111,9 +111,11 @@ if(combatmode) toggle_combat_mode() recoveringstam = TRUE + filters += CIT_FILTER_STAMINACRIT update_canmove() if(recoveringstam && total_health >= STAMINA_SOFTCRIT_TRADITIONAL) to_chat(src, "You don't feel nearly as exhausted anymore.") recoveringstam = FALSE + filters -= CIT_FILTER_STAMINACRIT update_canmove() update_health_hud() diff --git a/modular_citadel/code/modules/uplink/uplink_items.dm b/modular_citadel/code/modules/uplink/uplink_items.dm index 4f9e54f320..99e0d8a203 100644 --- a/modular_citadel/code/modules/uplink/uplink_items.dm +++ b/modular_citadel/code/modules/uplink/uplink_items.dm @@ -10,3 +10,10 @@ /datum/uplink_item/dangerous/revolver item = /obj/item/gun/ballistic/revolver/syndie + +/datum/uplink_item/badass/phantomthief + name = "Syndicate Mask" + desc = "A cheap paper mask to slap over your eyes." + item = /obj/item/clothing/glasses/phantomthief + cost = 0 + limited_stock = 4 diff --git a/tgstation.dme b/tgstation.dme index 7b461370cf..789b98b4e4 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2659,6 +2659,7 @@ #include "modular_citadel\code\controllers\subsystem\shuttle.dm" #include "modular_citadel\code\datums\uplink_items_cit.dm" #include "modular_citadel\code\datums\components\material_container.dm" +#include "modular_citadel\code\datums\components\phantomthief.dm" #include "modular_citadel\code\datums\mood_events\generic_negative_events.dm" #include "modular_citadel\code\datums\mood_events\generic_positive_events.dm" #include "modular_citadel\code\datums\mood_events\moodular.dm" @@ -2749,6 +2750,7 @@ #include "modular_citadel\code\modules\client\loadout\uniform.dm" #include "modular_citadel\code\modules\client\verbs\who.dm" #include "modular_citadel\code\modules\clothing\clothing.dm" +#include "modular_citadel\code\modules\clothing\glasses\phantomthief.dm" #include "modular_citadel\code\modules\clothing\spacesuits\flightsuit.dm" #include "modular_citadel\code\modules\clothing\suits\polychromic_cloaks.dm" #include "modular_citadel\code\modules\clothing\suits\suits.dm"