From 78312c23bfe1f952fa89e23b8c1c9b27c2e632d9 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Tue, 28 Jul 2020 21:53:07 -0700 Subject: [PATCH 1/2] sigh --- code/_onclick/hud/alert.dm | 2 +- code/_onclick/item_attack.dm | 11 +++++++++++ code/modules/mob/mob_defines.dm | 3 --- code/modules/reagents/reagent_containers.dm | 3 ++- .../modules/reagents/reagent_containers/glass.dm | 5 +++++ .../reagents/reagent_containers/hypospray.dm | 4 ++++ code/modules/reagents/reagent_containers/pill.dm | 16 +++++++++------- .../reagents/reagent_containers/syringes.dm | 5 ++++- .../code/game/objects/cit_screenshake.dm | 12 ------------ 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 3942d96f29..64250f6dd0 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -624,7 +624,7 @@ so as to remain in compliance with the most up-to-date laws." var/mob/living/carbon/C = usr if(!istype(C) || !C.can_resist() || C != mob_viewer || !C.shoes) return - C.changeNext_move(CLICK_CD_RESIST) + C.MarkResistTime() C.shoes.handle_tying(C) // PRIVATE = only edit, use, or override these if you're editing the system as a whole diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 199e401e39..eba125384b 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -104,6 +104,17 @@ if(weight) user.adjustStaminaLossBuffered(weight) + // CIT SCREENSHAKE + if(force >= 15) + shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01)) + if(M.client) + switch (M.client.prefs.damagescreenshake) + if (1) + shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015)) + if (2) + if(!CHECK_MOBILITY(M, MOBILITY_MOVE)) + shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015)) + //the equivalent of the standard version of attack() but for object targets. /obj/item/proc/attack_obj(obj/O, mob/living/user) if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_OBJ, O, user) & COMPONENT_NO_ATTACK_OBJ) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 0da221ef49..195c50e958 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -162,6 +162,3 @@ var/typing_indicator_timerid /// Current state of our typing indicator. Used for cut overlay, DO NOT RUNTIME ASSIGN OTHER THAN FROM SHOW/CLEAR. Used to absolutely ensure we do not get stuck overlays. var/typing_indicator_current - - ///For storing what do_after's someone has, in case we want to restrict them to only one of a certain do_after at a time - var/list/do_afters diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index fbdbb5f656..b71584982c 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -69,7 +69,8 @@ to_chat(user, "[src]'s transfer amount is now [amount_per_transfer_from_this] units.") return -/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone) +/obj/item/reagent_containers/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1) + . = ..() if(user.a_intent == INTENT_HARM) return ..() diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 37ea2ca70d..ec26182813 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -9,6 +9,11 @@ container_HP = 2 /obj/item/reagent_containers/glass/attack(mob/M, mob/user, obj/target) + // WARNING: This entire section is shitcode and prone to breaking at any time. + INVOKE_ASYNC(src, .proc/attempt_feed, M, user, target) // for example, the arguments in this proc are wrong + // but i don't have time to properly fix it right now. + +/obj/item/reagent_containers/glass/proc/attempt_feed(mob/M, mob/user, obj/target) if(!canconsume(M, user)) return diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index c36dc9d1db..27db55d7af 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -368,6 +368,10 @@ return /obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity) + . = ..() + INVOKE_ASYNC(src, .proc/attempt_inject, target, user, proximity) + +/obj/item/hypospray/mkii/proc/attempt_inject(atom/target, mob/user, proximity) if(!vial || !proximity || !isliving(target)) return var/mob/living/L = target diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index ec1e7823ed..3c23794e5a 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -28,22 +28,24 @@ /obj/item/reagent_containers/pill/get_w_volume() // DEFAULT_VOLUME_TINY at 25u, DEFAULT_VOLUME_SMALL at 50u return DEFAULT_VOLUME_TINY/2 + reagents.total_volume / reagents.maximum_volume * DEFAULT_VOLUME_TINY -/obj/item/reagent_containers/pill/attack(mob/M, mob/user, def_zone) +/obj/item/reagent_containers/pill/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1) + INVOKE_ASYNC(src, .proc/attempt_feed, M, user) + +/obj/item/reagent_containers/pill/proc/attempt_feed(mob/living/M, mob/living/user) if(!canconsume(M, user)) - return 0 + return FALSE if(M == user) M.visible_message("[user] attempts to [apply_method] [src].") if(self_delay) if(!do_mob(user, M, self_delay)) - return 0 + return FALSE to_chat(M, "You [apply_method] [src].") - else M.visible_message("[user] attempts to force [M] to [apply_method] [src].", \ "[user] attempts to force [M] to [apply_method] [src].") if(!do_mob(user, M)) - return 0 + return FALSE M.visible_message("[user] forces [M] to [apply_method] [src].", \ "[user] forces [M] to [apply_method] [src].") @@ -56,8 +58,7 @@ reagents.reaction(M, apply_type) reagents.trans_to(M, reagents.total_volume) qdel(src) - return 1 - + return TRUE /obj/item/reagent_containers/pill/afterattack(obj/target, mob/user , proximity) . = ..() @@ -77,6 +78,7 @@ "You dissolve [src] in [target].", vision_distance = 2) reagents.trans_to(target, reagents.total_volume) qdel(src) + return STOP_ATTACK_PROC_CHAIN /obj/item/reagent_containers/pill/tox name = "toxins pill" diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 52284b2c11..0220802c3e 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -52,8 +52,11 @@ /obj/item/reagent_containers/syringe/attackby(obj/item/I, mob/user, params) return -/obj/item/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity) +/obj/item/reagent_containers/syringe/afterattack(atom/target, mob/user, proximity) . = ..() + INVOKE_ASYNC(src, .proc/attempt_inject, target, user, proximity) + +/obj/item/reagent_containers/syringe/proc/attempt_inject(atom/target, mob/user, proximity) if(busy) return if(!proximity) diff --git a/modular_citadel/code/game/objects/cit_screenshake.dm b/modular_citadel/code/game/objects/cit_screenshake.dm index 188b8a48f9..222de37f82 100644 --- a/modular_citadel/code/game/objects/cit_screenshake.dm +++ b/modular_citadel/code/game/objects/cit_screenshake.dm @@ -45,18 +45,6 @@ . = ..() shake_camera(user, (pressureSetting * 0.75 + 1), (pressureSetting * 0.75)) -/obj/item/attack(mob/living/M, mob/living/user) - . = ..() - if(force >= 15) - shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01)) - if(M.client) - switch (M.client.prefs.damagescreenshake) - if (1) - shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015)) - if (2) - if(!CHECK_MOBILITY(M, MOBILITY_MOVE)) - shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015)) - /obj/item/attack_obj(obj/O, mob/living/user) . = ..() if(force >= 20)