diff --git a/beestation.dme b/beestation.dme index 1649910fbb7d8..f94941905ecf7 100644 --- a/beestation.dme +++ b/beestation.dme @@ -89,6 +89,7 @@ #include "code\__DEFINES\html_assistant.dm" #include "code\__DEFINES\hud.dm" #include "code\__DEFINES\icon_smoothing.dm" +#include "code\__DEFINES\icons.dm" #include "code\__DEFINES\important_recursive_contents.dm" #include "code\__DEFINES\instruments.dm" #include "code\__DEFINES\interaction_flags.dm" diff --git a/code/__DEFINES/icons.dm b/code/__DEFINES/icons.dm new file mode 100644 index 0000000000000..3e006f4fc1799 --- /dev/null +++ b/code/__DEFINES/icons.dm @@ -0,0 +1,7 @@ +/** + * Stores a list of items that had their leftmost and rightmost pixels found before, for the sake of optimization + * + * Format : + * * cached_image_borders[type] = list("left" = x, "right" = y, "bottom" = z, "top" = w) + */ +GLOBAL_LIST_EMPTY(cached_image_borders) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index d6a4b15c867f7..e1f016b2380c2 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1459,3 +1459,83 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) animate(src, pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2, loop = duration) pixel_x = initialpixelx pixel_y = initialpixely + +/** + * Returns a list that contains the leftmost, rightmost, bottom and top pixels in an atom's icon + */ +/atom/proc/get_bounding_box() + var/list/return_list = list() + for(var/found_type in GLOB.cached_image_borders) + if(found_type == "[type]_[icon_state]") + return_list["left"] = GLOB.cached_image_borders[found_type]["left"] + return_list["right"] = GLOB.cached_image_borders[found_type]["right"] + return_list["top"] = GLOB.cached_image_borders[found_type]["top"] + return_list["bottom"] = GLOB.cached_image_borders[found_type]["bottom"] + return return_list + + var/icon/tempicon = icon(icon, icon_state, dir, 1) + tempicon = getFlatIcon(src) + var/x_coord = 1 + var/y_coord = 1 + var/height = 1 + var/width = tempicon.Width() + var/left_border = width + var/right_border = 1 + + tempicon.Scale(width, 1) //Flatten the icon into a 1 pixel high line + while(y_coord <= 1) + x_coord = 1 + while(x_coord <= width) + var/pixel = tempicon.GetPixel(x_coord, y_coord) + if(!isnull(pixel)) + if(left_border > x_coord) + left_border = x_coord + x_coord++ + break + x_coord++ + x_coord = width + while(x_coord > 0) + var/pixel = tempicon.GetPixel(x_coord, y_coord) + if(!isnull(pixel)) + if(right_border < x_coord) + right_border = x_coord + x_coord-- + break + x_coord-- + y_coord++ + return_list["left"] = left_border + return_list["right"] = right_border + + tempicon = icon(icon, icon_state, dir, 1) + height = tempicon.Height() + width = 1 + var/bottom_border = height + var/top_border = 1 + x_coord = 1 + y_coord = 1 + tempicon.Scale(1, height) //Squash the icon into a 1 pixel wide pillar + + while(x_coord <= 1) + y_coord = 1 + while(y_coord <= height) + var/pixel = tempicon.GetPixel(x_coord, y_coord) + if(!isnull(pixel)) + if(bottom_border > y_coord) + bottom_border = y_coord + y_coord++ + break + y_coord++ + y_coord = height + while(y_coord > 0) + var/pixel = tempicon.GetPixel(x_coord, y_coord) + if(!isnull(pixel)) + if(top_border < y_coord) + top_border = y_coord + y_coord-- + break + y_coord-- + x_coord++ + return_list["top"] = top_border + return_list["bottom"] = bottom_border + GLOB.cached_image_borders["[type]_[icon_state]"] = return_list + return return_list diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index fd7679d468711..2f131cf991366 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -5,6 +5,13 @@ #define FACING_EACHOTHER 2 /// Two mobs one is facing a person, but the other is perpendicular #define FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR 3 //! Do I win the most informative but also most stupid define award? +/// Used for the image that replaces the progressbar in do_after +#define BOUNDING_BOX_WIDTH 30 +#define BOUNDING_BOX_HEIGHT 25 + +/// Gets the client of the mob, allowing for mocking of the client. +/// You only need to use this if you know you're going to be mocking clients somewhere else. +#define GET_CLIENT(mob) (##mob.client || ##mob.mock_client) /proc/random_blood_type() return pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") @@ -254,16 +261,23 @@ GLOBAL_LIST_EMPTY(species_list) * * target - the (optional) target mob of the do_after. If they move/cease to exist, the do_after is cancelled. * * timed_action_flags - optional flags to override certain do_after checks (see DEFINES/timed_action.dm). * * progress - if TRUE, a progress bar is displayed. + * * show_to_target - if TRUE, shows the bar and item to the target * * extra_checks - a callback that can be used to add extra checks to the do_after. Returning false in this callback will cancel the do_after. + * * add_item - shows said item being 'filled up' instead of the progress bar + * * x_offset - moves left/right increase/decrease for the item rendered above the bar + * * y_offset - moves up/down the item rendered above the bar */ -/proc/do_after(mob/user, delay = 3 SECONDS, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks) +/proc/do_after(mob/user, delay = 3 SECONDS, atom/target, timed_action_flags = NONE, progress = TRUE, show_to_target = FALSE, \ +datum/callback/extra_checks, atom/add_item, x_offset = 0, y_offset = 0) if(!user) return FALSE - if(target) + if(target in user.do_afters) // No stacking multiple do_afters on one target by a single person if there's a shown item + if(add_item) + to_chat(user, "You're already trying to use [add_item] on [target]!") + return FALSE LAZYADD(user.do_afters, target) LAZYADD(target.targeted_by, user) - var/atom/user_loc = user.loc var/atom/target_loc = target?.loc @@ -275,13 +289,47 @@ GLOBAL_LIST_EMPTY(species_list) delay *= user.cached_multiplicative_actions_slowdown + var/left_border = 1 + var/right_border = 32 + var/bottom_border = 1 + var/top_border = 32 + var/scale = 1 + if(add_item) + var/list/temp_list = add_item.get_bounding_box() + left_border = temp_list["left"] + right_border = temp_list["right"] + bottom_border = temp_list["bottom"] + top_border = temp_list["top"] + var/leftright_diff = 0 + var/topbottom_diff = 0 + if((right_border - left_border + 1) > BOUNDING_BOX_WIDTH) + leftright_diff = right_border - left_border + 1 + if((top_border - bottom_border + 1) > BOUNDING_BOX_HEIGHT) + topbottom_diff = top_border - bottom_border + 1 + if(leftright_diff != 0 || topbottom_diff != 0) + if(topbottom_diff > leftright_diff) + scale = BOUNDING_BOX_HEIGHT / top_border + else + scale = BOUNDING_BOX_WIDTH / right_border + if(y_offset + bottom_border < 7) + y_offset = 7 - bottom_border + var/client/targeted_client + if(show_to_target) + if(target == user) + show_to_target = FALSE + else if(ismob(target)) + var/mob/temp_mob = target + targeted_client = temp_mob.client + if(isnull(targeted_client)) + show_to_target = FALSE + else + show_to_target = FALSE var/datum/progressbar/progbar if(progress) - if(target) // the progress bar needs a target, so if we don't have one just pass it the user. - progbar = new(user, delay, target) + if(add_item) + progbar = new(user, delay, target || user, show_to_target, add_item.appearance, left_border, right_border, x_offset, y_offset, scale, targeted_client) else - progbar = new(user, delay, user) - + progbar = new(user, delay, target || user, show_to_target, targeted_client = targeted_client) var/endtime = world.time + delay var/starttime = world.time . = TRUE @@ -325,6 +373,7 @@ GLOBAL_LIST_EMPTY(species_list) break if(progress) + //progbar.end_progress() qdel(progbar) if(!QDELETED(target)) @@ -514,10 +563,6 @@ GLOBAL_LIST_EMPTY(species_list) if(player.stat != DEAD && player.mind && is_station_level(player.z)) . |= player.mind -/// Gets the client of the mob, allowing for mocking of the client. -/// You only need to use this if you know you're going to be mocking clients somewhere else. -#define GET_CLIENT(mob) (##mob.client || ##mob.mock_client) - ///Return a string for the specified body zone. Should be used for parsing non-instantiated bodyparts, otherwise use [/obj/item/bodypart/var/plaintext_zone] /proc/parse_zone(zone) if(zone == BODY_ZONE_PRECISE_R_HAND) @@ -761,3 +806,5 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) #undef FACING_SAME_DIR #undef FACING_EACHOTHER #undef FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR +#undef BOUNDING_BOX_WIDTH +#undef BOUNDING_BOX_HEIGHT diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1d3272f786fa6..d7bdeff8e0990 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -41,9 +41,12 @@ if(user.a_intent == INTENT_HARM && stat == DEAD && (butcher_results || guaranteed_butcher_results)) //can we butcher it? var/datum/component/butchering/butchering = I.GetComponent(/datum/component/butchering) if(butchering?.butchering_enabled) + if(src in user.do_afters) + to_chat(user, "You're already butchering [src]!") + return FALSE to_chat(user, "You begin to butcher [src]...") playsound(loc, butchering.butcher_sound, 50, TRUE, -1) - if(do_after(user, butchering.speed, src) && Adjacent(I)) + if(do_after(user, butchering.speed, src, show_to_target = TRUE, add_item = I) && Adjacent(I)) butchering.Butcher(user, src) return 1 else if(I.is_sharp() && !butchering) //give sharp objects butchering functionality, for consistency diff --git a/code/datums/ai/generic_actions.dm b/code/datums/ai/generic_actions.dm index a32adc2063eb8..c76f06f9cfecc 100644 --- a/code/datums/ai/generic_actions.dm +++ b/code/datums/ai/generic_actions.dm @@ -132,7 +132,7 @@ "[pawn] starts trying to give [held_item] to [living_target]!", "[pawn] tries to give you [held_item]!" ) - if(!do_after(pawn, 1 SECONDS, living_target)) + if(!do_after(pawn, 1 SECONDS, living_target, show_to_target = TRUE, add_item = held_item)) return if(QDELETED(held_item) || QDELETED(living_target)) finish_action(controller, FALSE) diff --git a/code/datums/ai/monkey/monkey_behaviors.dm b/code/datums/ai/monkey/monkey_behaviors.dm index 01303801b7292..5e78f108c4f26 100644 --- a/code/datums/ai/monkey/monkey_behaviors.dm +++ b/code/datums/ai/monkey/monkey_behaviors.dm @@ -93,7 +93,7 @@ var/success = FALSE - if(do_after(living_pawn, MONKEY_ITEM_SNATCH_DELAY, victim) && target && living_pawn.CanReach(victim)) + if(do_after(living_pawn, MONKEY_ITEM_SNATCH_DELAY, victim, show_to_target = TRUE, add_item = target) && target && living_pawn.CanReach(victim)) for(var/obj/item/I in victim.held_items) if(I == target) diff --git a/code/datums/brain_damage/special.dm b/code/datums/brain_damage/special.dm index 4603c003d694b..11cfad98b412a 100644 --- a/code/datums/brain_damage/special.dm +++ b/code/datums/brain_damage/special.dm @@ -135,7 +135,7 @@ var/slip_out_message = pick("silently fades in", "leaps out of thin air","appears", "walks out of an invisible doorway",\ "slides out of a fold in spacetime") to_chat(user, "You try to align with the bluespace stream...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src)) new /obj/effect/temp_visual/bluespace_fissure(get_turf(src)) new /obj/effect/temp_visual/bluespace_fissure(get_turf(linked_to)) if(do_teleport(user, get_turf(linked_to), no_effects = TRUE)) diff --git a/code/datums/components/butchering.dm b/code/datums/components/butchering.dm index 9a5bb35ceace7..f8f7790bf1426 100644 --- a/code/datums/components/butchering.dm +++ b/code/datums/components/butchering.dm @@ -40,12 +40,18 @@ return COMPONENT_ITEM_NO_ATTACK /datum/component/butchering/proc/startButcher(obj/item/source, mob/living/M, mob/living/user) + if(M in user.do_afters) + to_chat(user, "You're already butchering [M]!") + return to_chat(user, "You begin to butcher [M]...") playsound(M.loc, butcher_sound, 50, TRUE, -1) - if(do_after(user, speed, M) && M.Adjacent(source)) + if(do_after(user, speed, M, show_to_target = TRUE, add_item = source) && M.Adjacent(source)) Butcher(user, M) /datum/component/butchering/proc/startNeckSlice(obj/item/source, mob/living/carbon/human/H, mob/living/user) + if(H in user.do_afters) + to_chat(user, "You're already sliding the throat of [H]!") + return user.visible_message("[user] is slitting [H]'s throat!", \ "You start slicing [H]'s throat!", \ "You hear a cutting noise!") @@ -56,7 +62,7 @@ var/item_force = source.force if(!item_force) //Division by 0 protection item_force = 1 - if(do_after(user, clamp(500 / item_force, 30, 100), H) && H.Adjacent(source)) + if(do_after(user, clamp(500 / item_force, 30, 100), H, show_to_target = TRUE, add_item = source) && H.Adjacent(source)) if(H.has_status_effect(/datum/status_effect/neck_slice)) user.show_message("[H]'s neck has already been already cut, you can't make the bleeding any worse!", 1, \ "Their neck has already been already cut, you can't make the bleeding any worse!") diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 5dd074a820830..7d1a4936ab70f 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -178,8 +178,15 @@ if(check_contents(a, R, contents)) if(check_tools(a, R, contents)) //If we're a mob we'll try a do_after; non mobs will instead instantly construct the item - if(ismob(a) && !do_after(a, R.time, target = a)) + var/atom/movable/fake_atom = new + var/atom/fake_result = R.result + fake_atom.icon = initial(fake_result.icon) + fake_atom.icon_state = initial(fake_result.icon_state_preview) || initial(fake_result.icon_state) + fake_atom.color = initial(fake_result.color) + if(ismob(a) && !do_after(a, R.time, target = a, add_item = fake_atom, x_offset = R.bar_x_offset, y_offset = R.bar_y_offset)) + qdel(fake_atom) return "interrupted." + qdel(fake_atom) contents = get_surroundings(a,R.blacklist) if(!check_contents(a, R, contents)) return "missing component." @@ -187,6 +194,8 @@ return "missing tool." var/list/parts = del_reqs(R, a) var/atom/movable/I = new R.result (get_turf(a.loc)) + I.loc = get_turf(a.loc) + I.CheckParts(parts, R) if(send_feedback) SSblackbox.record_feedback("tally", "object_crafted", 1, I.type) diff --git a/code/datums/components/crafting/recipes.dm b/code/datums/components/crafting/recipes.dm index 64c2a5ce940f0..1d80526d5bbe4 100644 --- a/code/datums/components/crafting/recipes.dm +++ b/code/datums/components/crafting/recipes.dm @@ -13,6 +13,8 @@ var/always_available = TRUE //Set to FALSE if it needs to be learned first. var/one_per_turf = FALSE ///Should only one object exist on the same turf? var/dangerous_craft = FALSE /// Should admins be notified about this getting created by a non-antagonist? + var/bar_x_offset = 0 + var/bar_y_offset = 0 /datum/crafting_recipe/New() if(!(result in reqs)) @@ -221,6 +223,8 @@ /obj/item/bodypart/r_arm/robot = 1) time = 40 category = CAT_ROBOT + bar_x_offset = -3 + bar_y_offset = 5 /datum/crafting_recipe/honkbot name = "Honkbot" @@ -231,6 +235,8 @@ /obj/item/bikehorn/ = 1) time = 40 category = CAT_ROBOT + bar_x_offset = -3 + bar_y_offset = 5 /datum/crafting_recipe/Firebot name = "Firebot" @@ -819,6 +825,7 @@ reqs = list(/obj/item/grown/log = 5) result = /obj/structure/bonfire category = CAT_PRIMAL + bar_x_offset = 5 /datum/crafting_recipe/skeleton_key name = "Skeleton Key" diff --git a/code/datums/components/cult_ritual_item.dm b/code/datums/components/cult_ritual_item.dm index 418f2b3edbbf1..5384fee094ecf 100644 --- a/code/datums/components/cult_ritual_item.dm +++ b/code/datums/components/cult_ritual_item.dm @@ -310,7 +310,7 @@ scribe_mod *= 0.5 SEND_SOUND(cultist, sound('sound/weapons/slice.ogg', 0, 1, 10)) - if(!do_after(cultist, scribe_mod, target = get_turf(cultist))) + if(!do_after(cultist, scribe_mod, target = get_turf(cultist), add_item = tool)) cleanup_shields() return FALSE if(!can_scribe_rune(tool, cultist)) diff --git a/code/datums/components/embedded.dm b/code/datums/components/embedded.dm index 9ff1903fb255f..0ad0c368d4f64 100644 --- a/code/datums/components/embedded.dm +++ b/code/datums/components/embedded.dm @@ -199,7 +199,7 @@ /datum/component/embedded/proc/complete_rip_out(mob/living/carbon/victim, obj/item/I, obj/item/bodypart/limb, time_taken) victim.visible_message("[victim] attempts to remove [weapon] from [victim.p_their()] [limb.name].","You attempt to remove [weapon] from your [limb.name]... (It will take [DisplayTimeText(time_taken)].)") - if(!do_after(victim, time_taken, target = victim)) + if(!do_after(victim, time_taken, target = victim, add_item = weapon)) return if(!weapon || !limb || weapon.loc != victim || !(weapon in limb.embedded_objects)) qdel(src) @@ -304,7 +304,7 @@ //Pluck time var/pluck_time = 4 SECONDS * weapon.w_class * time_multiplier - if(!do_after(user, pluck_time, target = victim)) + if(!do_after(user, pluck_time, target = victim, add_item = weapon)) if(self_pluck) to_chat(user, "You fail to remove [weapon] from your [limb.name].") else diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index ef2ae7346db6d..9773586f1ef5c 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -295,7 +295,7 @@ Behavior that's still missing from this component that original food items had t var/time_to_eat = (eater = feeder) ? eat_time : EAT_TIME_FORCE_FEED if(eater == feeder)//If you're eating it yourself. - if(eat_time && !do_after(feeder, time_to_eat, eater, timed_action_flags = food_flags & FOOD_FINGER_FOOD ? IGNORE_USER_LOC_CHANGE | IGNORE_TARGET_LOC_CHANGE : NONE)) //Gotta pass the minimal eat time + if(eat_time && !do_after(feeder, time_to_eat, eater, timed_action_flags = food_flags & FOOD_FINGER_FOOD ? IGNORE_USER_LOC_CHANGE | IGNORE_TARGET_LOC_CHANGE : NONE, add_item = parent)) //Gotta pass the minimal eat time return if(IsFoodGone(owner, feeder)) return @@ -321,6 +321,9 @@ Behavior that's still missing from this component that original food items had t else //If you're feeding it to someone else. + if(eater in feeder.do_afters) + to_chat(feeder, "You're already feeding [eater]!") + return if(isbrain(eater)) to_chat(feeder, "[eater] doesn't seem to have a mouth!") return @@ -339,11 +342,14 @@ Behavior that's still missing from this component that original food items had t if(eater.is_blind()) to_chat(eater, "You're too full to eat what's being fed to you!") return - if(!do_after(feeder, delay = time_to_eat, target = eater)) //Wait 3 seconds before you can feed + if(COOLDOWN_TIMELEFT(eater, faster_feeding)) + time_to_eat = time_to_eat / 3 + if(!do_after(feeder, delay = time_to_eat, target = eater, show_to_target = TRUE, add_item = parent)) //Wait 3 seconds before you can feed return if(IsFoodGone(owner, feeder)) return log_combat(feeder, eater, "fed", owner.reagents.log_list()) + COOLDOWN_START(eater, faster_feeding, 5 SECONDS) eater.visible_message( "[feeder] forces [eater] to eat [parent]!", \ "[feeder] forces you to eat [parent]!" diff --git a/code/datums/components/food/food_storage.dm b/code/datums/components/food/food_storage.dm index 6e1226b2dc69b..e25489bd7a37a 100644 --- a/code/datums/components/food/food_storage.dm +++ b/code/datums/components/food/food_storage.dm @@ -66,7 +66,9 @@ if(HAS_TRAIT(inserted_item, TRAIT_NODROP)) to_chat(user, "\the [inserted_item] is stuck to your hand, you can't put into \the [parent]!") return - + if(parent in user.do_afters) + to_chat(user, "You're already inserting [inserted_item] into [parent]!") + return user.visible_message("[user.name] begins inserting [inserted_item.name] into \the [parent].", \ "You start to insert the [inserted_item.name] into \the [parent].") @@ -94,6 +96,10 @@ if(!food.can_interact(user)) return + if(parent in user.do_afters) + to_chat(user, "You're already ripping into [parent]!") + return + user.visible_message("[user.name] begins tearing at \the [parent].", \ "You start to rip into \the [parent].") @@ -107,7 +113,7 @@ * user - the person inserting the item. */ /datum/component/food_storage/proc/insert_item(obj/item/inserted_item, mob/user) - if(do_after(user, 1.5 SECONDS, target = parent)) + if(do_after(user, 1.5 SECONDS, target = parent, add_item = inserted_item)) var/atom/food = parent to_chat(user, "You slip [inserted_item.name] inside \the [parent].") inserted_item.forceMove(food) @@ -167,7 +173,7 @@ if(prob(good_chance_of_discovery)) //finding the item, without biting it discovered = TRUE to_chat(target, "It feels like there's something in \the [parent]...!") - + else if(prob(bad_chance_of_discovery)) //finding the item, BY biting it user.log_message("[key_name(user)] just fed [key_name(target)] a/an [stored_item] which was hidden in [parent] at [AREACOORD(target)]", LOG_ATTACK) discovered = stored_item.on_accidental_consumption(target, user, parent) diff --git a/code/datums/components/storage/concrete/rped.dm b/code/datums/components/storage/concrete/rped.dm index 5e55f15553773..2b39fd1db5039 100644 --- a/code/datums/components/storage/concrete/rped.dm +++ b/code/datums/components/storage/concrete/rped.dm @@ -44,7 +44,7 @@ to_chat(M, "You start dumping out Tier/Cell rating [lowest_rating] parts from [parent].") var/turf/T = get_turf(A) var/datum/progressbar/progress = new(M, length(things), T) - while (do_after(M, 10, progress = FALSE, extra_checks = CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) + while (do_after(M, 1 SECONDS, progress = FALSE, extra_checks = CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) stoplag(1) qdel(progress) @@ -94,6 +94,6 @@ to_chat(M, "You start dumping out Tier/Cell rating [lowest_rating] parts from [parent].") var/turf/T = get_turf(A) var/datum/progressbar/progress = new(M, length(things), T) - while (do_after(M, 10, progress = FALSE, extra_checks = CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) + while (do_after(M, 1 SECONDS, progress = FALSE, extra_checks = CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) stoplag(1) qdel(progress) diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 27f419f677271..087f7e579d6f4 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -212,7 +212,7 @@ return var/datum/progressbar/progress = new(pre_attack_mob, len, attack_item.loc) var/list/rejections = list() - while(do_after(pre_attack_mob, 1 SECONDS, parent, NONE, FALSE, CALLBACK(src, PROC_REF(handle_mass_pickup), things, attack_item.loc, rejections, progress))) + while(do_after(pre_attack_mob, 1 SECONDS, parent, NONE, FALSE, extra_checks = CALLBACK(src, PROC_REF(handle_mass_pickup), things, attack_item.loc, rejections, progress))) stoplag(1) qdel(progress) to_chat(pre_attack_mob, "You put everything you could [insert_preposition] [parent].") @@ -273,7 +273,7 @@ var/turf/T = get_turf(A) var/list/things = contents() var/datum/progressbar/progress = new(M, length(things), T) - while (do_after(M, 1 SECONDS, T, NONE, FALSE, CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) + while (do_after(M, 1 SECONDS, T, NONE, FALSE, extra_checks = CALLBACK(src, PROC_REF(mass_remove_from_storage), T, things, progress))) stoplag(1) qdel(progress) diff --git a/code/datums/elements/climbable.dm b/code/datums/elements/climbable.dm index 75df2e26f0de6..0ebef99dd56ef 100644 --- a/code/datums/elements/climbable.dm +++ b/code/datums/elements/climbable.dm @@ -54,6 +54,9 @@ /datum/element/climbable/proc/climb_structure(atom/climbed_thing, mob/living/user, params) if(!can_climb(climbed_thing, user)) return + if(climbed_thing in user.do_afters) + to_chat(user, "You're already trying to climb onto \the [src]!") + return climbed_thing.add_fingerprint(user) user.visible_message("[user] starts climbing onto [climbed_thing].", \ "You start climbing onto [climbed_thing]...") diff --git a/code/datums/elements/mechanical_repair.dm b/code/datums/elements/mechanical_repair.dm index 121654f246bee..3b3f7f2ded798 100644 --- a/code/datums/elements/mechanical_repair.dm +++ b/code/datums/elements/mechanical_repair.dm @@ -22,30 +22,43 @@ if((!affecting || (IS_ORGANIC_LIMB(affecting))) || user.a_intent == INTENT_HARM) return + //can only do one progress bar at a time if(target in user.do_afters) - return COMPONENT_NO_AFTERATTACK + to_chat(user, "You're already trying to repair [target == user ? "you" : "[target]'s"] structural damage!") + return // Handles welder repairs on human limbs if(I.tool_behaviour == TOOL_WELDER) - if(I.use_tool(source, user, 0, volume=50, amount=1)) - if(user == target) - user.visible_message("[user] starts to fix some of the dents on [target == user ? "[p_their()]" : "[target]'s"] [parse_zone(affecting.body_zone)].", - "You start fixing some of the dents on [target == user ? "your" : "[target]'s"] [parse_zone(affecting.body_zone)].") - if(!do_after(user, 1.5 SECONDS, target)) - return COMPONENT_NO_AFTERATTACK - item_heal_robotic(target, user, 15, 0, affecting) + var/speed_mod = 1 + while(affecting.brute_dam > 0) + if(I.use_tool(source, user, 0, volume=50, amount=1)) + if(user == target) + user.visible_message("[user] starts to fix some of the dents on [target == user ? "[p_their()]" : "[target]'s"] [parse_zone(affecting.body_zone)].", + "You start fixing some of the dents on [target == user ? "your" : "[target]'s"] [parse_zone(affecting.body_zone)].") + if(!do_after(user, 1.5 SECONDS * speed_mod, target, show_to_target = TRUE, add_item = I)) + break + item_heal_robotic(target, user, 15, 0, affecting) + if(speed_mod > 0.2) + speed_mod -= 0.1 + else + break user.changeNext_move(CLICK_CD_MELEE * 0.5) //antispam return COMPONENT_NO_AFTERATTACK // Handles cable repairs if(istype(I, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/coil = I - if(user == target) - user.visible_message("[user] starts to fix some of the burn wires in [target == user ? "[p_their()]" : "[target]'s"] [parse_zone(affecting.body_zone)].", - "You start fixing some of the burnt wires in [target == user ? "your" : "[target]'s"] [parse_zone(affecting.body_zone)].") - if(!do_after(user, 1.5 SECONDS, target)) - return COMPONENT_NO_AFTERATTACK - if(coil.amount && item_heal_robotic(target, user, 0, 15, affecting)) - coil.use(1) + var/speed_mod = 1 + while(affecting.burn_dam > 0) + if(user == target) + user.visible_message("[user] starts to fix some of the burn wires in [target == user ? "[p_their()]" : "[target]'s"] [parse_zone(affecting.body_zone)].", + "You start fixing some of the burnt wires in [target == user ? "your" : "[target]'s"] [parse_zone(affecting.body_zone)].") + if(!do_after(user, 1.5 SECONDS * speed_mod, target, show_to_target = TRUE, add_item = coil)) + break + item_heal_robotic(target, user, 0, 15, affecting) + if(coil.amount) + coil.use(1) + if(speed_mod > 0.2) + speed_mod -= 0.1 user.changeNext_move(CLICK_CD_MELEE * 0.5) //antispam return COMPONENT_NO_AFTERATTACK diff --git a/code/datums/elements/rust.dm b/code/datums/elements/rust.dm index d53a43a99e628..09164651bee10 100644 --- a/code/datums/elements/rust.dm +++ b/code/datums/elements/rust.dm @@ -49,14 +49,14 @@ if(TOOL_WELDER) if(item.use(5)) user.balloon_alert(user, "You start burning off the rust...") - if(!do_after(user, 5 SECONDS * item.toolspeed, target = source)) + if(!do_after(user, 5 SECONDS * item.toolspeed, target = source, show_to_target = TRUE, add_item = item)) return user.balloon_alert(user, "Sucessfully burned off the rust!") Detach(source) return if(TOOL_RUSTSCRAPER) user.balloon_alert(user, "You start scraping off the rust...") - if(!do_after(user, 2 SECONDS * item.toolspeed, target = source)) + if(!do_after(user, 2 SECONDS * item.toolspeed, target = source, show_to_target = TRUE, add_item = item)) return if(istype(item, /obj/item/wirebrush/advanced)) var/obj/item/wirebrush/advanced/brush = item diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index b4d8481ec9590..141a2ff61d1d2 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -157,7 +157,7 @@ /// Start the unequipping process. This is the proc you should yield in. /// Returns TRUE/FALSE depending on if it is allowed. -/datum/strippable_item/proc/start_unequip(atom/source, mob/user) +/datum/strippable_item/proc/start_unequip(atom/source, mob/user, obscured = FALSE) var/obj/item/item = get_item(source) if(isnull(item)) @@ -165,7 +165,9 @@ if(HAS_TRAIT(item, TRAIT_NO_STRIP)) return FALSE - + if(source in user.do_afters) + to_chat(user, "You're already stripping [source]!") + return FALSE source.visible_message( "[user] tries to remove [source]'s [item.name].", "[user] tries to remove your [item.name].", @@ -245,7 +247,7 @@ if(!ismob(source)) return FALSE - if(!do_after(user, get_equip_delay(equipping), source)) + if(!do_after(user, get_equip_delay(equipping), source, show_to_target = TRUE, add_item = equipping)) return FALSE if(!equipping.mob_can_equip( @@ -278,12 +280,12 @@ return FALSE -/datum/strippable_item/mob_item_slot/start_unequip(atom/source, mob/user) +/datum/strippable_item/mob_item_slot/start_unequip(atom/source, mob/user, obscured = FALSE) . = ..() if(!.) return - return start_unequip_mob(get_item(source), source, user) + return start_unequip_mob(get_item(source), source, user, obscured) /datum/strippable_item/mob_item_slot/finish_unequip(atom/source, mob/user) var/obj/item/item = get_item(source) @@ -309,10 +311,16 @@ return TRUE /// A utility function for `/datum/strippable_item`s to start unequipping an item from a mob. -/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay) - if(!do_after(user, strip_delay || item.strip_delay, source)) +/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay, obscured = FALSE) + var/strip_time = strip_delay || item.strip_delay + if(COOLDOWN_TIMELEFT(source, faster_stripping)) + strip_time = strip_time / 3 + if(obscured) + if(!do_after(user, strip_time, source, show_to_target = TRUE)) + return FALSE + else if(!do_after(user, strip_time, source, show_to_target = TRUE, add_item = item)) return FALSE - + COOLDOWN_START(source, faster_stripping, 5 SECONDS) return TRUE /// A utility function for `/datum/strippable_item`s to finish unequipping an item from a mob. @@ -484,7 +492,11 @@ LAZYORASSOCLIST(interactions, user, key) SStgui.update_uis(src) - var/should_unequip = strippable_item.start_unequip(owner, user) + var/obscuring = strippable_item.get_obscuring(owner) + var/obscured = FALSE + if(obscuring != STRIPPABLE_OBSCURING_NONE) + obscured = TRUE + var/should_unequip = strippable_item.start_unequip(owner, user, obscured) LAZYREMOVEASSOC(interactions, user, key) . = TRUE diff --git a/code/datums/martial/mushpunch.dm b/code/datums/martial/mushpunch.dm index 4cd51ec8c7192..0c26a4e20892c 100644 --- a/code/datums/martial/mushpunch.dm +++ b/code/datums/martial/mushpunch.dm @@ -5,7 +5,7 @@ /datum/martial_art/mushpunch/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) var/atk_verb to_chat(A, "You begin to wind up an attack...") - if(!do_after(A, 25, target = D)) + if(!do_after(A, 2.5 SECONDS, target = D)) to_chat(A, "Your attack was interrupted!") return TRUE //martial art code was a mistake A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index 3dc2a6572d5d3..e9818228eb5ee 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -9,44 +9,137 @@ var/mob/user var/client/client var/listindex + var/image/shown_image + var/image/shown_image_darkened + var/alpha_filter + var/icon/alpha_icon + var/leftmost_pixel + var/rightmost_pixel + var/current_target + var/show_bar = TRUE + var/x_image_offset + var/y_image_offset + var/client/target_client + var/current_outline_color = COLOR_BLUE_GRAY -/datum/progressbar/New(mob/User, goal_number, atom/target) +/datum/progressbar/New(mob/User, goal_number, atom/target, show_to_target = FALSE, mutable_appearance/additional_image, \ +l_pix = 1, r_pix = 32, x_offset = 0, y_offset = 0, scale = 1, targeted_client) . = ..() if (!istype(target)) EXCEPTION("Invalid target given") if (goal_number) goal = goal_number - bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0") - bar.plane = ABOVE_HUD_PLANE - bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA + leftmost_pixel = l_pix + rightmost_pixel = r_pix + current_target = target + x_image_offset = x_offset + y_image_offset = y_offset + if(show_to_target) + target_client = targeted_client + if(additional_image) + show_bar = FALSE user = User if(user) client = user.client + if(show_bar) + bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0") + bar.plane = ABOVE_HUD_PLANE + bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA + bar.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + LAZYINITLIST(user.progressbars) + LAZYINITLIST(user.progressbars[bar.loc]) + var/list/bars = user.progressbars[bar.loc] + bars.Add(src) + listindex = bars.len + bar.pixel_y = 0 + bar.alpha = 0 + if(user?.client) + user?.client.images += bar + if(show_to_target && target_client) + target_client?.images += bar + animate(bar, pixel_y = 32 + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) + if(additional_image) + shown_image = image(additional_image.icon, target, additional_image.icon_state, (ABOVE_HUD_PLANE - 0.1)) + shown_image.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + shown_image.appearance_flags = KEEP_TOGETHER | APPEARANCE_UI_IGNORE_ALPHA + if(color_hex2num(additional_image.color) >= 350)//Colors that are too hard to see are rejected + shown_image.color = additional_image.color + shown_image.underlays = additional_image.underlays + shown_image.overlays = additional_image.overlays + shown_image.plane = HUD_PLANE + shown_image.transform = shown_image.transform.Scale(scale, scale) + shown_image.pixel_y = 0 + y_image_offset + shown_image.pixel_x = 0 + x_image_offset + shown_image.alpha = 0 - LAZYINITLIST(user.progressbars) - LAZYINITLIST(user.progressbars[bar.loc]) - var/list/bars = user.progressbars[bar.loc] - bars.Add(src) - listindex = bars.len - bar.pixel_y = 0 - bar.alpha = 0 - animate(bar, pixel_y = 32 + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) + shown_image_darkened = image(additional_image.icon, target, additional_image.icon_state, (ABOVE_HUD_PLANE - 0.2)) + shown_image_darkened.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + shown_image_darkened.appearance_flags = KEEP_TOGETHER | APPEARANCE_UI_IGNORE_ALPHA + shown_image_darkened.underlays = additional_image.underlays + shown_image_darkened.overlays = additional_image.overlays + shown_image_darkened.plane = HUD_PLANE + shown_image_darkened.transform = shown_image_darkened.transform.Scale(scale, scale) + shown_image_darkened.pixel_y = 0 + y_image_offset + shown_image_darkened.pixel_x = 0 + x_image_offset + shown_image_darkened.alpha = 0 + + alpha_icon = icon('icons/effects/64x64.dmi', "black_pillar") + alpha_filter = filter(type = "alpha", x = -33 + leftmost_pixel , y = 0, icon = alpha_icon) + shown_image.filters = alpha_filter + if(user?.client) + user?.client.images += shown_image + if(show_to_target && target_client) + target_client?.images += shown_image + animate(shown_image, pixel_y = 32 + y_image_offset + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) + shown_image_darkened.filters += filter(type = "color", color = list(0.07,0.07,0.07,0,0.07,0.07,0.07,0,0.07,0.07,0.07,0,0,0,0,1)) + if(user?.client?.prefs) + current_outline_color = user.client.prefs.read_player_preference(/datum/preference/color/outline_color) + shown_image_darkened.filters += filter(type = "outline", size = 1, color = current_outline_color) + if(user?.client) + user?.client.images += shown_image_darkened + if(show_to_target) + target_client?.images += shown_image_darkened + animate(shown_image_darkened, pixel_y = 32 + y_image_offset + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) /datum/progressbar/proc/update(progress) - if (!user || !user.client) + if ((!user || !user?.client) && (!target_client)) shown = FALSE return - if (user.client != client) + if (user?.client != client) if (client) - client.images -= bar - if (user.client) - user.client.images += bar + if(show_bar) + client.images -= bar + if(shown_image) + client.images -= shown_image + client.images -= shown_image_darkened + if (user?.client) + if(show_bar) + user?.client.images += bar + if(shown_image) + user?.client.images += shown_image + user?.client.images += shown_image_darkened + if(target_client && shown_image && !shown) + target_client?.images -= shown_image + target_client?.images -= shown_image_darkened progress = clamp(progress, 0, goal) last_progress = progress - bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]" + if(show_bar) + bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]" + if(shown_image) + shown_image.filters -= alpha_filter + alpha_filter = filter(type = "alpha", x = -33 + leftmost_pixel + round(((progress / goal) * (rightmost_pixel - leftmost_pixel + 1)), 1) , y = 0, icon = alpha_icon) + shown_image.filters += alpha_filter if (!shown) - user.client.images += bar + if(show_bar && user && user?.client) + user.client.images += bar + if(shown_image) + if(user && user?.client) + user.client.images += shown_image + user.client.images += shown_image_darkened + if(target_client) + target_client?.images += shown_image + target_client?.images += shown_image_darkened shown = TRUE /datum/progressbar/proc/shiftDown() @@ -54,29 +147,70 @@ bar.pixel_y = 32 + (PROGRESSBAR_HEIGHT * (listindex - 1)) var/dist_to_travel = 32 + (PROGRESSBAR_HEIGHT * (listindex - 1)) - PROGRESSBAR_HEIGHT animate(bar, pixel_y = dist_to_travel, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) + if(shown_image) + shown_image.pixel_y = 32 + y_image_offset + (PROGRESSBAR_HEIGHT * (listindex - 1)) + animate(shown_image, pixel_y = dist_to_travel, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) + shown_image_darkened.pixel_y = 32 + y_image_offset + (PROGRESSBAR_HEIGHT * (listindex - 1)) + animate(shown_image_darkened, pixel_y = dist_to_travel, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING) /datum/progressbar/Destroy() - if(last_progress != goal) - bar.icon_state = "[bar.icon_state]_fail" - for(var/I in user?.progressbars[bar.loc]) - var/datum/progressbar/P = I - if(P != src && P.listindex > listindex) - P.shiftDown() - - var/list/bars = user.progressbars[bar.loc] - bars.Remove(src) - if(!bars.len) - LAZYREMOVE(user.progressbars, bar.loc) - - animate(bar, alpha = 0, time = PROGRESSBAR_ANIMATION_TIME) + if(show_bar) + if(last_progress != goal) + bar.icon_state = "[bar.icon_state]_fail" + for(var/I in user?.progressbars[bar.loc]) + var/datum/progressbar/P = I + if(P != src && P.listindex > listindex) + P.shiftDown() + var/list/bars = user.progressbars[bar.loc] + bars.Remove(src) + if(!bars.len) + LAZYREMOVE(user.progressbars, bar.loc) + animate(bar, alpha = 0, time = PROGRESSBAR_ANIMATION_TIME) addtimer(CALLBACK(src, PROC_REF(remove_from_client)), PROGRESSBAR_ANIMATION_TIME, TIMER_CLIENT_TIME) - QDEL_IN(bar, PROGRESSBAR_ANIMATION_TIME * 2) //for garbage collection safety + if(show_bar) + QDEL_IN(bar, PROGRESSBAR_ANIMATION_TIME * 2) //for garbage collection safety + if(shown_image) + if(user?.client) + user.client.images -= shown_image + user.client.images -= shown_image_darkened + if(target_client) + target_client.images -= shown_image + target_client.images -= shown_image_darkened + if(goal != last_progress) + shown_image.filters += filter(type = "color", color = rgb(255, 0, 51)) + shown_image_darkened.filters -= filter(type = "outline", size = 1, color = current_outline_color) + current_outline_color = COLOR_DARK_RED + shown_image_darkened.filters += filter(type = "color", color = rgb(128, 0, 0)) + shown_image_darkened.filters += filter(type = "outline", size = 1, color = current_outline_color) + if(user?.client) + user.client.images += shown_image + user.client.images += shown_image_darkened + if(target_client) + target_client?.images += shown_image + target_client?.images += shown_image_darkened + animate(shown_image, alpha = 0, time = PROGRESSBAR_ANIMATION_TIME) + animate(shown_image_darkened, alpha = 0, time = PROGRESSBAR_ANIMATION_TIME) + if(target_client) + target_client.images -= shown_image + target_client.images -= shown_image_darkened + QDEL_IN(shown_image, PROGRESSBAR_ANIMATION_TIME * 2) //for garbage collection safety + QDEL_IN(shown_image_darkened, PROGRESSBAR_ANIMATION_TIME * 2) //same as above . = ..() /datum/progressbar/proc/remove_from_client() if(client) - client.images -= bar + if(show_bar) + client.images -= bar + if(shown_image) + client.images -= shown_image + client.images -= shown_image_darkened client = null + if(target_client) + if(show_bar) + client.images -= bar + if(shown_image) + client.images -= shown_image + client.images -= shown_image_darkened #undef PROGRESSBAR_ANIMATION_TIME #undef PROGRESSBAR_HEIGHT diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 8a447462570ef..249b78a3cca41 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -206,7 +206,7 @@ if(usr != owner) return to_chat(owner, "You attempt to remove the durathread strand from around your neck.") - if(do_after(owner, 35, target = owner, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(owner, 3.5 SECONDS, target = owner, timed_action_flags = IGNORE_HELD_ITEM)) if(isliving(owner)) var/mob/living/L = owner to_chat(owner, "You successfuly remove the durathread strand.") @@ -261,7 +261,7 @@ if(istype(syringestatus, /datum/status_effect/syringe)) var/obj/item/reagent_containers/syringe/syringe = syringestatus.syringe to_chat(owner, "You begin carefully pulling the syringe out.") - if(do_after(C, 20, target = owner, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(C, 2 SECONDS, target = owner, timed_action_flags = IGNORE_HELD_ITEM, add_item = syringe)) to_chat(C, "You succesfuly remove the syringe.") syringe.forceMove(C.loc) C.put_in_hands(syringe) diff --git a/code/datums/status_effects/gas.dm b/code/datums/status_effects/gas.dm index 42715522e8f30..3d3821babccb3 100644 --- a/code/datums/status_effects/gas.dm +++ b/code/datums/status_effects/gas.dm @@ -32,7 +32,7 @@ /datum/status_effect/freon/proc/do_resist() to_chat(owner, "You start breaking out of the ice cube!") - if(do_after(owner, 40)) + if(do_after(owner, 4 SECONDS)) if(!QDELETED(src)) to_chat(owner, "You break out of the ice cube!") owner.remove_status_effect(/datum/status_effect/freon) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 99c8aa3fd2e70..0947bd81cef81 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1010,7 +1010,7 @@ var/list/things = src_object.contents() var/datum/progressbar/progress = new(user, things.len, src) var/datum/component/storage/STR = GetComponent(/datum/component/storage) - while (do_after(user, 1 SECONDS, src, NONE, FALSE, CALLBACK(STR, TYPE_PROC_REF(/datum/component/storage, handle_mass_item_insertion), things, src_object, user, progress))) + while (do_after(user, 1 SECONDS, src, NONE, FALSE, extra_checks = CALLBACK(STR, TYPE_PROC_REF(/datum/component/storage, handle_mass_item_insertion), things, src_object, user, progress))) stoplag(1) qdel(progress) to_chat(user, "You dump as much of [src_object.parent]'s contents into [STR.insert_preposition]to [src] as you can.") diff --git a/code/game/machinery/airlock_cycle_control.dm b/code/game/machinery/airlock_cycle_control.dm index a9c06882e13b5..3a035f3e44f88 100644 --- a/code/game/machinery/airlock_cycle_control.dm +++ b/code/game/machinery/airlock_cycle_control.dm @@ -482,9 +482,12 @@ if(cable.get_amount() < 5) to_chat(user, "You need five lengths of cable to wire the airlock controller!") return + if(src in user.do_afters) + to_chat(user, "You're wiring the airlock controller of [src]!") + return user.visible_message("[user.name] wires the airlock controller.", \ "You start wiring the airlock controller...") - if (do_after(user, 20, target = src)) + if (do_after(user, 2 SECONDS, target = src, add_item = cable)) if (cable.get_amount() >= 5 && buildstage == 1) cable.use(5) to_chat(user, "You wire the airlock controller.") diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 45a43a97ae61b..8f4359c8cbd85 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -112,8 +112,12 @@ /obj/machinery/button/eminence_act(mob/living/simple_animal/eminence/eminence) . = ..() + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to manipulate [src]!") + return to_chat(usr, "You begin manipulating [src]!") - if(do_after(eminence, 20, target=get_turf(eminence))) + if(do_after(eminence, 2 SECONDS, target=get_turf(eminence))) attack_hand(eminence) /obj/machinery/button/attack_ai(mob/user) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index bc00f8f9d6e47..31e4c354cbd77 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -28,11 +28,14 @@ /obj/machinery/computer/operating/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/disk/surgery)) + if(src in user.do_afters) + to_chat(user, "You're already inserting [O] into [src]!") + return user.visible_message("[user] begins to load \the [O] in \the [src]...", "You begin to load a surgery protocol from \the [O]...", "You hear the chatter of a floppy drive.") var/obj/item/disk/surgery/D = O - if(do_after(user, 10, target = src)) + if(do_after(user, 1 SECONDS, target = src, add_item = O)) advanced_surgeries |= D.surgeries return TRUE return ..() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 758be27d3c8da..ba9b686f14e66 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1252,8 +1252,11 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( if(obj_flags & EMAGGED) if(!c_user.get_bodypart(BODY_ZONE_L_ARM) && !c_user.get_bodypart(BODY_ZONE_R_ARM)) return + if(src in user.do_afters) + to_chat(user, "You're already inserting your hand [src]!") + return to_chat(c_user, "You move your hand towards the machine, and begin to hesitate as an extra-bloodied guillotine emerges from inside of it...") - if(do_after(c_user, 50, target = src)) + if(do_after(c_user, 5 SECONDS, target = src)) to_chat(c_user, "Robotic arms shoot out of the machine, remove all your limbs, and suck them in!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) for(var/X in c_user.bodyparts) @@ -1270,8 +1273,11 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( else if(!c_user.get_bodypart(BODY_ZONE_L_ARM) && !c_user.get_bodypart(BODY_ZONE_R_ARM)) return + if(src in user.do_afters) + to_chat(user, "You're already inserting your hand inside [src]!") + return to_chat(c_user, "You move your hand towards the machine, and begin to hesitate as a bloodied guillotine emerges from inside of it...") - if(do_after(c_user, 50, target = src)) + if(do_after(c_user, 5 SECONDS, target = src)) to_chat(c_user, "The guillotine drops on your arm, and the machine sucks it in!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) var/which_hand = BODY_ZONE_L_ARM diff --git a/code/game/machinery/defibrillator_mount.dm b/code/game/machinery/defibrillator_mount.dm index 2c2c3579ba33e..e8a6137aef775 100644 --- a/code/game/machinery/defibrillator_mount.dm +++ b/code/game/machinery/defibrillator_mount.dm @@ -118,10 +118,13 @@ if(!clamps_locked) to_chat(user, "[src]'s clamps are disengaged!") return TRUE + if(src in user.do_afters) + to_chat(user, "You're already manipulating [src]!") + return user.visible_message("[user] presses [multitool] into [src]'s ID slot...", \ "You begin overriding the clamps on [src]...") playsound(src, 'sound/machines/click.ogg', 50, TRUE) - if(!do_after(user, 100, target = src) || !clamps_locked) + if(!do_after(user, 10 SECONDS, target = src, add_item = multitool) || !clamps_locked) return user.visible_message("[user] pulses [multitool], and [src]'s clamps slide up.", \ "You override the locking clamps on [src]!") diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index f1931a655c929..d3ce630300892 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -14,7 +14,7 @@ var/scan_level var/precision_coeff var/message_cooldown - var/breakout_time = 1200 + var/breakout_time = 120 SECONDS var/ignore_id = FALSE /obj/machinery/dna_scannernew/Initialize() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 78f1e89468a66..5cd5576a809df 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -348,8 +348,12 @@ /obj/machinery/door/airlock/eminence_act(mob/living/simple_animal/eminence/eminence) ..() + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to manipulate [src]!") + return to_chat(usr, "You begin manipulating [src]!") - if(do_after(eminence, 20, target=get_turf(eminence))) + if(do_after(eminence, 2 SECONDS, target=get_turf(eminence), add_item = src)) if(welded) to_chat(eminence, "The airlock has been welded shut!") else if(locked) @@ -913,8 +917,11 @@ if(S.get_amount() < 2) to_chat(user, "You need at least 2 iron sheets to reinforce [src].") return + if(src in user.do_afters) + to_chat(user, "You're already attempting to reinforce [src]!") + return to_chat(user, "You start reinforcing [src].") - if(do_after(user, 20, src)) + if(do_after(user, 2 SECONDS, src, add_item = C)) if(!panel_open || !S.use(2)) return user.visible_message("[user] reinforces \the [src] with iron.", @@ -927,8 +934,11 @@ if(S.get_amount() < 2) to_chat(user, "You need at least 2 plasteel sheets to reinforce [src].") return + if(src in user.do_afters) + to_chat(user, "You're already attempting to reinforce [src]!") + return to_chat(user, "You start reinforcing [src].") - if(do_after(user, 20, src)) + if(do_after(user, 2 SECONDS, src, add_item = C)) if(!panel_open || !S.use(2)) return user.visible_message("[user] reinforces \the [src] with plasteel.", @@ -1085,13 +1095,16 @@ to_chat(user, "It's welded, it won't budge!") return - var/time_to_open = 5 + var/time_to_open = 0.5 SECONDS if(hasPower() && !prying_so_hard && density) - time_to_open = 50 + if(src in user.do_afters) + to_chat(user, "You're already trying to try open \the [src]!") + return + time_to_open = 5 SECONDS playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, TRUE) prying_so_hard = TRUE to_chat(user, "You begin prying open the airlock...") - if(do_after(user, time_to_open, src)) + if(do_after(user, time_to_open, src, add_item = C)) if(!open(2) && density) to_chat(user, "Despite your attempts, [src] refuses to open.") prying_so_hard = FALSE @@ -1368,12 +1381,15 @@ if(locked || welded) //Extremely generic, as aliens only understand the basics of how airlocks work. to_chat(user, "[src] refuses to budge!") return + if(src in user.do_afters) + to_chat(user, "You're already attempting to pry open [src]!") + return user.visible_message("[user] begins prying open [src].",\ "You begin digging your claws into [src] with all your might!",\ "You hear groaning metal...") - var/time_to_open = 5 + var/time_to_open = 0.5 SECONDS if(hasPower()) - time_to_open = 50 //Powered airlocks take longer to open, and are loud. + time_to_open = 5 SECONDS //Powered airlocks take longer to open, and are loud. playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, 1) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 1ea68064ed26e..b53b154a534f1 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -202,11 +202,17 @@ LAZYADD(access_log, "MOTOR_ERR:|MOTOR CONTROLLER REPORTED BACKDRIVE|T_OFFSET:[DisplayTimeText(world.time - SSticker.round_start_time)]") if(length(access_log) > 20) //Unless this is getting spammed this shouldn't happen. access_log.Remove(access_log[1]) + if(src in user.do_afters) + to_chat(user, "You're already attempting to force open [src]!") + return to_chat(user, "You begin forcing open \the [src], the motors whine...") playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, TRUE) if(!crowbar.use_tool(src, user, 10 SECONDS)) return else + if(src in user.do_afters) + to_chat(user, "You're already attempting to force open [src]!") + return to_chat(user, "You begin forcing open \the [src], the motors don't resist...") playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, TRUE) if(!crowbar.use_tool(src, user, 1 SECONDS)) @@ -589,10 +595,13 @@ if(P.get_amount() < 2) to_chat(user, "You need more plasteel to reinforce [src].") return + if(src in user.do_afters) + to_chat(user, "You're already attempting to reinforce [src]!") + return user.visible_message("[user] begins reinforcing [src]...", \ "You begin reinforcing [src]...") playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1) - if(do_after(user, 60, target = src)) + if(do_after(user, 6 SECONDS, target = src, add_item = C)) if(constructionStep != CONSTRUCTION_PANEL_OPEN || reinforced || P.get_amount() < 2 || !P) return user.visible_message("[user] reinforces [src].", \ @@ -651,10 +660,13 @@ if(B.get_amount() < 5) to_chat(user, "You need more wires to add wiring to [src].") return + if(src in user.do_afters) + to_chat(user, "You're already wiring up [src]!") + return user.visible_message("[user] begins wiring [src]...", \ "You begin adding wires to [src]...") playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1) - if(do_after(user, 60, target = src)) + if(do_after(user, 6 SECONDS, target = src, add_item = C)) if(constructionStep != CONSTRUCTION_GUTTED || B.get_amount() < 5 || !B) return user.visible_message("[user] adds wires to [src].", \ @@ -692,10 +704,13 @@ qdel(src) return if(istype(C, /obj/item/electronics/firelock)) + if(src in user.do_afters) + to_chat(user, "You're already adding [C] to [src]!") + return user.visible_message("[user] starts adding [C] to [src]...", \ "You begin adding a circuit board to [src]...") playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, 1) - if(!do_after(user, 40, target = src)) + if(!do_after(user, 4 SECONDS, target = src, add_item = C)) return if(constructionStep != CONSTRUCTION_NOCIRCUIT) return diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 052ea58a3dfed..bad627dfbcfaf 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -40,15 +40,21 @@ to_chat(user, "You change the ID to [id].") if(W.tool_behaviour == TOOL_CROWBAR &&deconstruction == BLASTDOOR_FINISHED) + if(src in user.do_afters) + to_chat(user, "You're already removing the airlock electronics from [src]!") + return to_chat(user, "You start to remove the airlock electronics.") - if(do_after(user, 10 SECONDS, target = src)) + if(do_after(user, 10 SECONDS, target = src, add_item = W)) new /obj/item/electronics/airlock(loc) id = null deconstruction = BLASTDOOR_NEEDS_ELECTRONICS else if(W.tool_behaviour == TOOL_WIRECUTTER && deconstruction == BLASTDOOR_NEEDS_ELECTRONICS) + if(src in user.do_afters) + to_chat(user, "You're already attempting to remove the internal cables from [src]!") + return to_chat(user, "You start to remove the internal cables.") - if(do_after(user, 10 SECONDS, target = src)) + if(do_after(user, 10 SECONDS, target = src, add_item = W)) deconstruction = TRUE var/datum/crafting_recipe/recipe = locate(recipe_type) in GLOB.crafting_recipes var/amount = recipe.reqs[/obj/item/stack/cable_coil] @@ -58,10 +64,12 @@ else if(W.tool_behaviour == TOOL_WELDER && deconstruction == BLASTDOOR_NEEDS_WIRES) if(!W.tool_start_check(user, amount=0)) return - + if(src in user.do_afters) + to_chat(user, "You're already tearing apart the [src]!") + return to_chat(user, "You start tearing apart the [src].") playsound(src.loc, 'sound/items/welder.ogg', 50, 1) - if(do_after(user, 15 SECONDS, target = src)) + if(do_after(user, 15 SECONDS, target = src, add_item = W)) new /obj/item/stack/sheet/plasteel(loc, 15) qdel(src) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 7321d5a7aa380..3f36f51dd999c 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -319,10 +319,16 @@ to_chat(user, "The windoor's motors resist your efforts to force it!") return else if(!hasPower()) + if(src in user.do_afters) + to_chat(user, "You're already trying to force open [src]!") + return to_chat(user, "You begin forcing open \the [src], the motors don't resist...") if(!crowbar.use_tool(src, user, 1 SECONDS)) return else + if(src in user.do_afters) + to_chat(user, "You're already trying to force open [src]!") + return to_chat(user, "You begin forcing open \the [src]...") if(!crowbar.use_tool(src, user, 5 SECONDS)) return diff --git a/code/game/machinery/fat_sucker.dm b/code/game/machinery/fat_sucker.dm index d3e490d60e983..3a0cdbcbebdd4 100644 --- a/code/game/machinery/fat_sucker.dm +++ b/code/game/machinery/fat_sucker.dm @@ -16,7 +16,7 @@ var/nutrients //amount of nutrients we got build up var/nutrient_to_meat = 90 //one slab of meat gives about 52 nutrition var/datum/looping_sound/microwave/soundloop //100% stolen from microwaves - var/breakout_time = 600 + var/breakout_time = 60 SECONDS var/next_fact = 10 //in ticks, so about 20 seconds var/static/list/fat_facts = list(\ diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index c7b99332c25f4..aaf3105343d75 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -125,8 +125,12 @@ /obj/machinery/firealarm/eminence_act(mob/living/simple_animal/eminence/eminence) . = ..() + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to manipulate [src]!") + return to_chat(usr, "You begin manipulating [src]!") - if(do_after(eminence, 20, target=get_turf(eminence))) + if(do_after(eminence, 2 SECONDS, target=get_turf(eminence), add_item = src)) attack_hand(eminence) /obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 3bf522f8adc48..5a8f8d562ddb5 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -96,8 +96,12 @@ /obj/machinery/flasher/eminence_act(mob/living/simple_animal/eminence/eminence) . = ..() + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to manipulate [src]!") + return to_chat(usr, "You begin manipulating [src]!") - if(do_after(eminence, 20, target=get_turf(eminence))) + if(do_after(eminence, 2 SECONDS, target=get_turf(eminence), add_item = src)) if(anchored) flash() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index f040c0b14fddb..adc9a4f2c0d82 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -236,20 +236,23 @@ . = ..() if(beaker) to_chat(user, "You need to remove the [beaker] first!") - return + return COMPONENT_NO_AFTERATTACK if(user.is_holding_item_of_type(/obj/item/clothing/mask/breath) && can_convert) + if(src in user.do_afters) + to_chat(user, "You're already attempting to attach a breath mask to [src]!") + return visible_message("[user] attempts to attach the breath mask to [src].", "You attempt to attach the breath mask to [src].") - if(!do_after(user, 100, src, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(user, 10 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM, add_item = I)) to_chat(user, "You fail to attach the breath mask to [src]!") - return + return COMPONENT_NO_AFTERATTACK var/item = user.is_holding_item_of_type(/obj/item/clothing/mask/breath) if(!item) // Check after the do_after as well - return + return COMPONENT_NO_AFTERATTACK visible_message("[user] attaches the breath mask to [src].", "You attach the breath mask to [src].") qdel(item) new /obj/machinery/anesthetic_machine(loc) qdel(src) - + return COMPONENT_NO_AFTERATTACK /obj/machinery/iv_drip/saline name = "saline drip" diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm index 91bbd26be528f..8100ccdb15995 100644 --- a/code/game/machinery/launch_pad.dm +++ b/code/game/machinery/launch_pad.dm @@ -251,8 +251,12 @@ DEFINE_BUFFER_HANDLER(/obj/machinery/launchpad) return if(!usr.canUseTopic(src, BE_CLOSE, ismonkey(usr))) return + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to close [src]!") + return usr.visible_message("[usr] starts closing [src]...", "You start closing [src]...") - if(do_after(usr, 30, target = usr)) + if(do_after(usr, 3 SECONDS, target = usr, add_item = src)) usr.put_in_hands(briefcase) moveToNullspace() //hides it from suitcase contents closed = TRUE @@ -287,10 +291,14 @@ DEFINE_BUFFER_HANDLER(/obj/machinery/launchpad) /obj/item/storage/briefcase/launchpad/attack_self(mob/user) if(!isturf(user.loc)) //no setting up in a locker + to_chat(user, "") + return + if(src in user.do_afters) + to_chat(user, "You're already attempting to set down [src]!") return add_fingerprint(user) user.visible_message("[user] starts setting down [src]...", "You start setting up [pad]...") - if(do_after(user, 30, target = user)) + if(do_after(user, 3 SECONDS, target = user, add_item = src)) pad.forceMove(get_turf(src)) pad.update_indicator() pad.closed = FALSE diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 5fc8e0e5b085f..c11289ab22e84 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -107,8 +107,12 @@ /obj/machinery/light_switch/eminence_act(mob/living/simple_animal/eminence/eminence) . = ..() + var/mob/M = usr + if(src in M.do_afters) + to_chat(M, "You're already attempting to manipulate [src]!") + return to_chat(usr, "You begin manipulating [src]!") - if(do_after(eminence, 20, target=get_turf(eminence))) + if(do_after(eminence, 2 SECONDS, target=get_turf(eminence), add_item = src)) interact(eminence) /obj/machinery/light_switch/tcomms diff --git a/code/game/machinery/quantum_pad.dm b/code/game/machinery/quantum_pad.dm index 301dcd373b71a..4f2e92a416345 100644 --- a/code/game/machinery/quantum_pad.dm +++ b/code/game/machinery/quantum_pad.dm @@ -72,8 +72,11 @@ to_chat(user, "You insert [K] into [src]'s card slot, activating it.") interact(user, K.qpad) else + if(src in user.do_afters) + to_chat(user, "You're already attempting to link [src]!") + return to_chat(user, "You insert [K] into [src]'s card slot, initiating the link procedure.") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = K)) to_chat(user, "You complete the link between [K] and [src].") K.qpad = src diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index b398a0a0b7bcf..0965602e5a798 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -160,8 +160,11 @@ if (coil.get_amount() < 1) to_chat(user, "You need one length of cable to repair [src]!") return + if(src in user.do_afters) + to_chat(user, "You're already attempting to repair [src]!") + return to_chat(user, "You begin to replace the wires...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, add_item = W)) if(coil.get_amount() < 1) return coil.use(1) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 08df28c3d5b42..dba8f38b94c5c 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -54,7 +54,7 @@ /// Cooldown for occupant breakout messages via relaymove() var/message_cooldown /// How long it takes to break out of the SSU. - var/breakout_time = 300 + var/breakout_time = 30 SECONDS /// How fast it charges cells in a suit var/charge_rate = 250 @@ -368,12 +368,18 @@ if(occupant || helmet || suit || storage) to_chat(user, "It's too cluttered inside to fit in!") return + if(src in user.do_afters) + if(target == user) + to_chat(user, "You're already attempting to squeeze inside [src]!") + else + to_chat(user, "You're already attempting to shove [target] into [src]!") + return if(target == user) user.visible_message("[user] starts squeezing into [src]!", "You start working your way into [src]...") else target.visible_message("[user] starts shoving [target] into [src]!", "[user] starts shoving you into [src]!") - if(do_after(user, 30, target)) + if(do_after(user, 3 SECONDS, target, show_to_target = TRUE)) if(occupant || helmet || suit || storage) return if(target == user) @@ -505,7 +511,7 @@ if(!state_open) visible_message("[user] starts prying open the doors of [src]!", "You start prying open the doors of [src]!") I.play_tool_sound(src, 50) - if(do_after(user, 20, target=src)) + if(do_after(user, 2 SECONDS, target=src)) playsound(src, 'sound/effects/bin_open.ogg', 50, TRUE) open_machine(0) return diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 3e21586a9863a..f9b738842d6e8 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -191,7 +191,10 @@ if(stack_sheets.amount < PLASTEEL_REPAIR_AMOUNT) to_chat(user, "You need at least [PLASTEEL_REPAIR_AMOUNT] sheets of plasteel to repair [src].") return - if(do_after(user, delay = 2.5 SECONDS, target = src) && stack_sheets.use(PLASTEEL_REPAIR_AMOUNT)) + if(src in user.do_afters) + to_chat(user, "You're already attempting to repair [src]!") + return + if(do_after(user, delay = 2.5 SECONDS, target = src, add_item = I) && stack_sheets.use(PLASTEEL_REPAIR_AMOUNT)) obj_integrity = min(obj_integrity + 100, max_integrity) else var/old_integ = obj_integrity diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 0a656d66d2fb4..5d4d852f277ac 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -49,7 +49,10 @@ return ..() /obj/item/mecha_parts/mecha_equipment/try_attach_part(mob/user, obj/mecha/M) - if(!do_after(user, 15, M)) + if(src in user.do_afters) + to_chat(user, "You're already attaching something to \the [M]!") + return FALSE + if(!do_after(user, 1.5 SECONDS, M, add_item = src)) return FALSE if(!can_attach(M)) to_chat(user, "You are unable to attach [src] to [M]!") @@ -110,7 +113,7 @@ var/C = chassis.loc set_ready_state(0) chassis.use_power(energy_drain) - . = do_after(chassis.occupant, equip_cooldown, target=target) + . = do_after(chassis.occupant, equip_cooldown, target=target, add_item = src) set_ready_state(1) if(!chassis || chassis.loc != C || src != chassis.selected || !(get_dir(chassis, target)&chassis.dir)) return 0 @@ -119,7 +122,7 @@ if(!chassis) return var/C = chassis.loc - . = do_after(chassis.occupant, delay, target=target) + . = do_after(chassis.occupant, delay, target=target, add_item = src, show_to_target = TRUE) if(!chassis || chassis.loc != C || src != chassis.selected || !(get_dir(chassis, target)&chassis.dir)) return 0 diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index a5bedff3ee04c..ede7e992f3342 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -923,6 +923,9 @@ to_chat(user, "You can't enter the exosuit with other creatures attached to you!") log_message("Permission denied (Attached mobs).", LOG_MECHA) return + if(src in user.do_afters) + to_chat(user, "You're already climbing into \the [name]!") + return visible_message("[user] starts to climb into [name].") @@ -969,9 +972,14 @@ else if(occupant) to_chat(user, "Occupant detected!") return FALSE + + if(src in user.do_afters) + to_chat(user, "You're already inserting an MMI into \the [name]!") + return + visible_message("[user] starts to insert an MMI into [name].") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = mmi_as_oc)) if(!occupant) return mmi_moved_inside(mmi_as_oc, user) else diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 3c6883377c157..6040c7e83d9d1 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -125,7 +125,10 @@ return ..() /obj/item/mecha_parts/mecha_tracking/try_attach_part(mob/user, obj/mecha/M) - if(!do_after(user, 15, M)) + if(src in user.do_afters) + to_chat(user, "You're already attaching \the [src] to \the [M]!") + return + if(!do_after(user, 1.5 SECONDS, M, add_item = src)) return if(!..()) return diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 35850c15dd97c..23b634be43c0a 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -226,8 +226,11 @@ drill.equip_cooldown = initial(drill.equip_cooldown) /obj/mecha/working/ripley/relay_container_resist(mob/living/user, obj/O) + if(O in user.do_afters) + to_chat(user, "You're already leaning on the back of \the [O]!") + return to_chat(user, "You lean on the back of [O] and start pushing so it falls out of [src].") - if(do_after(user, 300, target = O)) + if(do_after(user, 30 SECONDS, target = O)) if(!user || user.stat != CONSCIOUS || user.loc != src || O.loc != src ) return to_chat(user, "You successfully pushed [O] out of [src]!") diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 6ff54ceb0814e..c1e37537bb162 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -231,10 +231,13 @@ // If the mob we're attempting to buckle is not stood on this atom's turf and it isn't the user buckling themselves, // we'll try it with a 2 second do_after delay. if(M != user && (get_turf(M) != get_turf(src))) + if(M in user.do_afters) + to_chat(user, "You're already bucking [M] to \the [src]!") + return FALSE M.visible_message("[user] starts buckling [M] to [src]!",\ "[user] starts buckling you to [src]!",\ "You hear metal clanking.") - if(!do_after(user, 2 SECONDS, M)) + if(!do_after(user, 2 SECONDS, M, show_to_target = TRUE, add_item = src)) return FALSE // Sanity check before we attempt to buckle. Is everything still in a kosher state for buckling after the 3 seconds have elapsed? diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm index a283f551f1eca..3e49fea2c222b 100644 --- a/code/game/objects/effects/contraband.dm +++ b/code/game/objects/effects/contraband.dm @@ -141,6 +141,9 @@ if(stuff_on_wall == 3) to_chat(user, "The wall is far too cluttered to place a poster!") return + if(src in user.do_afters) + to_chat(user, "You're already placing something on \the [src]!") + return to_chat(user, "You start placing the poster on the wall..." ) diff --git a/code/game/objects/effects/mainttraps.dm b/code/game/objects/effects/mainttraps.dm index 56c111cf972e9..f7c3d8f436a7c 100644 --- a/code/game/objects/effects/mainttraps.dm +++ b/code/game/objects/effects/mainttraps.dm @@ -290,8 +290,11 @@ /obj/effect/rune/cluwne/attackby(obj/I, mob/user, params) if(istype(I, /obj/item/melee/cultblade/dagger) && iscultist(user)) + if(I in user.do_afters) + to_chat(user, "You're already using trying to erase [src]!") + return SEND_SOUND(user,'sound/items/sheath.ogg') - if(do_after(user, 15, target = src)) + if(do_after(user, 1.5 SECONDS, target = src, add_item = I)) to_chat(user, "It's not within your power to erase the [lowertext(cultist_name)].") else if(istype(I, /obj/item/nullrod)) user.say("BEGONE FOUL MAGIKS!!", forced = "nullrod") diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index b102b9468a399..24c7d3ff0bdb4 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -77,9 +77,11 @@ if((istype(plantspot,/turf/open/lava)) || (istype(plantspot,/turf/open/chasm))) to_chat(user, "You can't plant the mine here!") return - + if(src in user.do_afters) + to_chat(user, "You're already arming \the [src]!") + return to_chat(user, "You start arming the [src]...") - if(do_after(user, arming_time, target = src)) + if(do_after(user, arming_time, target = src, add_item = src)) new mine_type(plantspot) to_chat(user, "You plant and arm the [src].") log_combat(user, src, "planted and armed") @@ -108,8 +110,11 @@ /obj/effect/mine/attackby(obj/I, mob/user, params) if(istype(I, /obj/item/multitool)) + if(src in user.do_afters) + to_chat(user, "You're already attempting to disarm \the [src]!") + return to_chat(user, "You begin to disarm the [src]...") - if(do_after(user, disarm_time, target = src)) + if(do_after(user, disarm_time, target = src, add_item = I)) to_chat(user, "You disarm the [src].") new disarm_product(src.loc) qdel(src) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index b3dbe045cd0c5..5c6e55fcbfb8c 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -332,7 +332,10 @@ . = ..() /obj/structure/spider/cocoon/container_resist(mob/living/user) - var/breakout_time = 600 + if(src in user.do_afters) + to_chat(user, "You're already attempting to break out of \the [src]!") + return + var/breakout_time = 60 SECONDS user.changeNext_move(CLICK_CD_BREAKOUT) user.last_special = world.time + CLICK_CD_BREAKOUT to_chat(user, "You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)") diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 2d541f3b7dd3c..9739e0c6f516d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -486,8 +486,11 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) var/grav = user.has_gravity() if(grav > STANDARD_GRAVITY) var/grav_power = min(3,grav - STANDARD_GRAVITY) + if(src in user.do_afters) + to_chat(user, "You're already picking up \the [src]!") + return to_chat(user,"You start picking up [src]...") - if(!do_after(user, 30*grav_power, src)) + if(!do_after(user, 3 SECONDS * grav_power, src, show_to_target = TRUE, add_item = src)) return @@ -1094,7 +1097,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) // No delay means there is no start message, and no reason to call tool_start_check before use_tool. // Run the start check here so we wouldn't have to call it manually. if(!delay && !tool_start_check(user, amount)) - return + return TRUE delay *= toolspeed @@ -1102,24 +1105,21 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) play_tool_sound(target, volume) if(delay) + if(target in user.do_afters) + to_chat(user, "You're already using [src] on \the [target]!") + return FALSE // Create a callback with checks that would be called every tick by do_after. var/datum/callback/tool_check = CALLBACK(src, PROC_REF(tool_check_callback), user, amount, extra_checks) - - if(ismob(target)) - if(!do_after(user, delay, target, extra_checks=tool_check)) - return - - else - if(!do_after(user, delay, target=target, extra_checks=tool_check)) - return + if(!do_after(user, delay, target, extra_checks=tool_check, show_to_target = TRUE, add_item = src)) + return FALSE else // Invoke the extra checks once, just in case. if(extra_checks && !extra_checks.Invoke()) - return + return FALSE // Use tool's fuel, stack sheets or charges if amount is set. if(amount && !use(amount)) - return + return FALSE // Play tool sound at the end of tool usage, // but only if the delay between the beginning and the end is not too small diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 074992b8f980f..e47db8e552c3d 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -414,7 +414,7 @@ RLD var/delay = rcd_results["delay"] * delay_mod var/obj/effect/constructing_effect/rcd_effect = new(get_turf(A), delay, src.mode) if(checkResource(rcd_results["cost"], user)) - if(do_after(user, delay, target = A)) + if(do_after(user, delay, target = A, add_item = src)) if(checkResource(rcd_results["cost"], user)) if(A.rcd_act(user, src, rcd_results["mode"])) rcd_effect.end_animation() @@ -704,7 +704,7 @@ RLD to_chat(user, "You start deconstructing [A]...") user.Beam(A,icon_state="nzcrentrs_power", time = 15) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - if(do_after(user, decondelay, target = A)) + if(do_after(user, decondelay, target = A, add_item = src)) if(!useResource(deconcost, user)) return 0 activate() @@ -719,7 +719,7 @@ RLD user.Beam(A,icon_state="nzcrentrs_power", time = 15) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 0) - if(do_after(user, floordelay, target = A)) + if(do_after(user, floordelay, target = A, add_item = src)) if(!istype(W)) return FALSE var/list/candidates = list() @@ -765,7 +765,7 @@ RLD user.Beam(A,icon_state="nzcrentrs_power", time = 15) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 1) - if(do_after(user, floordelay, target = A)) + if(do_after(user, floordelay, target = A, add_item = src)) if(!istype(F)) return 0 if(!useResource(floorcost, user)) @@ -835,7 +835,7 @@ RLD return FALSE if(checkResource(machinery_data["cost"][blueprint], user) && blueprint) - if(do_after(user, machinery_data["delay"][blueprint], target = A)) + if(do_after(user, machinery_data["delay"][blueprint], target = A, add_item = src)) if(checkResource(machinery_data["cost"][blueprint], user) && canPlace(A)) useResource(machinery_data["cost"][blueprint], user) activate() @@ -860,7 +860,7 @@ RLD if(P.anchored) to_chat(user, "The [P.name] needs to be unanchored!") return - if(do_after(user, 20, target = P)) + if(do_after(user, 2 SECONDS, target = P, add_item = src)) P.deconstruct() //Let's not substract matter playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE) //this is just such a great sound effect else diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm index a2dccf179b13d..58bd9ef938394 100644 --- a/code/game/objects/items/RPD.dm +++ b/code/game/objects/items/RPD.dm @@ -474,7 +474,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( if((mode & DESTROY_MODE) && is_type_in_typecache(A, rpd_targets)) to_chat(user, "You start destroying a pipe...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, destroy_speed, target = attack_target)) + if(do_after(user, destroy_speed, target = attack_target, add_item = src)) activate() qdel(attack_target) return @@ -484,7 +484,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( if(istype(M) && M.paintable) to_chat(user, "You start painting \the [M] [paint_color]...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, paint_speed, target = M)) + if(do_after(user, paint_speed, target = M, add_item = src)) M.paint(GLOB.pipe_paint_colors[paint_color]) //paint the pipe user.visible_message("[user] paints \the [M] [paint_color].","You paint \the [M] [paint_color].") return @@ -492,7 +492,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( if(istype(P) && P.paintable) to_chat(user, "You start painting \the [P] [paint_color]...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, paint_speed, target = P)) + if(do_after(user, paint_speed, target = P, add_item = src)) P.add_atom_colour(GLOB.pipe_paint_colors[paint_color], FIXED_COLOUR_PRIORITY) //paint the pipe user.visible_message("[user] paints \the [P] [paint_color].","You paint \the [P] [paint_color].") return @@ -505,7 +505,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) if (recipe.type == /datum/pipe_info/meter) to_chat(user, "You start building a meter...") - if(do_after(user, atmos_build_speed, target = attack_target)) + if(do_after(user, atmos_build_speed, target = attack_target, add_item = src)) activate() var/obj/item/pipe_meter/PM = new /obj/item/pipe_meter(get_turf(attack_target)) PM.setAttachLayer(piping_layer) @@ -516,7 +516,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( to_chat(user, "You can't build this object on the layer...") return to_chat(user, "You start building a pipe...") - if(do_after(user, atmos_build_speed, target = attack_target)) + if(do_after(user, atmos_build_speed, target = attack_target, add_item = src)) if(recipe.all_layers == FALSE && (piping_layer == 1 || piping_layer == 5)) // double check to stop cheaters (and to not waste time waiting for something that can't be placed) to_chat(user, "You can't build this object on the layer...") return @@ -546,7 +546,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( return to_chat(user, "You start building a disposals pipe...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, disposal_build_speed, target = attack_target)) + if(do_after(user, disposal_build_speed, target = attack_target, add_item = src)) var/obj/structure/disposalconstruct/C = new (attack_target, queued_p_type, queued_p_dir, queued_p_flipped) if(!C.can_place()) @@ -571,7 +571,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( return to_chat(user, "You start building a transit tube...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, transit_build_speed, target = attack_target)) + if(do_after(user, transit_build_speed, target = attack_target, add_item = src)) activate() if(queued_p_type == /obj/structure/c_transit_tube_pod) var/obj/structure/c_transit_tube_pod/pod = new /obj/structure/c_transit_tube_pod(attack_target) @@ -601,7 +601,7 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( return to_chat(user, "You start building a fluid duct...") playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, plumbing_build_speed, target = A)) + if(do_after(user, plumbing_build_speed, target = A, add_item = src)) var/obj/machinery/duct/D if(recipe.type == /datum/pipe_info/plumbing/multilayer) var/temp_connects = NORTH + SOUTH diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 08c093bd55c4b..959fd0ea85ac8 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -88,7 +88,10 @@ var/new_appearance = input(user, "Choose a new appearance for [src].", "26th Century Deception") as null|anything in sort_list(possible_appearances) if(!new_appearance || !crayon || !user.canUseTopic(src, BE_CLOSE)) return - if(!do_after(user, 10, src, progress = TRUE)) + if(src in user.do_afters) + to_chat(user, "You're already re-shaping \the [src]!") + return + if(!do_after(user, 1 SECONDS, src, progress = TRUE, add_item = crayon)) return user.visible_message("[user] gives [src] a new look.", "Voila! You give [src] a new look.") crayon.use_charges(1) diff --git a/code/game/objects/items/carp_lasso.dm b/code/game/objects/items/carp_lasso.dm index 09fe3a0a41ff5..41f4e85d07470 100644 --- a/code/game/objects/items/carp_lasso.dm +++ b/code/game/objects/items/carp_lasso.dm @@ -52,8 +52,11 @@ to_chat(user, "[target] is dead.") return if(user.a_intent == INTENT_HELP && C == mob_target) //if trying to tie up previous target + if(target in user.do_afters) + to_chat(user, "You're already untying \the [target]!") + return to_chat(user, "You begin to untie [C]") - if(proximity_flag && do_after(user, 2 SECONDS, target, timed_action_flags = IGNORE_HELD_ITEM)) + if(proximity_flag && do_after(user, 2 SECONDS, target, timed_action_flags = IGNORE_HELD_ITEM, show_to_target = TRUE, add_item = src)) user.faction |= "carpboy_[user]" C.faction = list("neutral") C.faction |= "carpboy_[user]" diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index ce20d2bc87112..5dfd541ea3802 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -93,8 +93,11 @@ if(user.client && ((target in user.client.screen) && !user.is_holding(target))) to_chat(user, "You need to take that [target.name] off before cleaning it!") else if(istype(target, /obj/effect/decal/cleanable)) + if(target in user.do_afters) + to_chat(user, "You're already scrubbing \the [target.name]!") + return user.visible_message("[user] begins to scrub \the [target.name] out with [src].", "You begin to scrub \the [target.name] out with [src]...") - if(do_after(user, src.cleanspeed, target = target)) + if(do_after(user, src.cleanspeed, target = target, show_to_target = TRUE, add_item = src)) to_chat(user, "You scrub \the [target.name] out.") qdel(target) decreaseUses(user) @@ -107,15 +110,21 @@ decreaseUses(user) return else if(istype(target, /obj/structure/window)) + if(target in user.do_afters) + to_chat(user, "You're already cleaning \the [target]!") + return user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") - if(do_after(user, src.cleanspeed, target = target)) + if(do_after(user, src.cleanspeed, target = target, show_to_target = TRUE, add_item = src)) to_chat(user, "You clean \the [target.name].") target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) target.set_opacity(initial(target.opacity)) decreaseUses(user) else + if(target in user.do_afters) + to_chat(user, "You're already cleaning \the [target]!") + return user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") - if(do_after(user, src.cleanspeed, target = target)) + if(do_after(user, src.cleanspeed, target = target, show_to_target = TRUE, add_item = src)) to_chat(user, "You clean \the [target.name].") if(isclothing(target) && HAS_TRAIT(target, TRAIT_SPRAYPAINTED)) var/obj/item/clothing/C = target diff --git a/code/game/objects/items/cosmetics.dm b/code/game/objects/items/cosmetics.dm index 1b19b16310f5b..566da79c2b037 100644 --- a/code/game/objects/items/cosmetics.dm +++ b/code/game/objects/items/cosmetics.dm @@ -65,9 +65,15 @@ H.lip_color = colour H.update_body() else + if(H in user.do_afters) + if(H == user) + to_chat(user, "You're already applying \the [src] to your lips!") + else + to_chat(user, "You're already applying \the [src] to [H]'s lips!") + return user.visible_message("[user] begins to do [H]'s lips with \the [src].", \ "You begin to apply \the [src] on [H]'s lips...") - if(do_after(user, 20, target = H)) + if(do_after(user, 2 SECONDS, target = H, show_to_target = TRUE, add_item = src)) user.visible_message("[user] does [H]'s lips with \the [src].", \ "You apply \the [src] on [H]'s lips.") H.lip_style = "lipstick" @@ -81,8 +87,10 @@ if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH) if(!ismob(M)) return - if(ishuman(M)) + if(src in user.do_afters) + to_chat(user, "You're already wiping the lipstick off [user == M ? "yourself" : "[M]"]!") + return var/mob/living/carbon/human/H = M if(H == user) to_chat(user, "You wipe off the lipstick with [src].") @@ -91,7 +99,7 @@ else user.visible_message("[user] begins to wipe [H]'s lipstick off with \the [src].", \ "You begin to wipe off [H]'s lipstick...") - if(do_after(user, 10, target = H)) + if(do_after(user, 1 SECONDS, target = H, show_to_target = TRUE, add_item = src)) user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \ "You wipe off [H]'s lipstick.") H.lip_style = null @@ -151,18 +159,20 @@ if(H.facial_hair_style == "Shaved") to_chat(user, "Already clean-shaven!") return - + if(M in user.do_afters) + to_chat(user, "You're already shaving [user == M ? "yourself" : "[M]"]!") + return if(H == user) //shaving yourself user.visible_message("[user] starts to shave [user.p_their()] facial hair with [src].", \ "You take a moment to shave your facial hair with [src]...") - if(do_after(user, 50, target = H)) + if(do_after(user, 5 SECONDS, target = H, add_item = src)) user.visible_message("[user] shaves [user.p_their()] facial hair clean with [src].", \ "You finish shaving with [src]. Fast and clean!") shave(H, location) else user.visible_message("[user] tries to shave [H]'s facial hair with [src].", \ "You start shaving [H]'s facial hair...") - if(do_after(user, 50, target = H)) + if(do_after(user, 5 SECONDS, target = H, show_to_target = TRUE, add_item = src)) user.visible_message("[user] shaves off [H]'s facial hair with [src].", \ "You shave [H]'s facial hair clean off.") shave(H, location) @@ -181,11 +191,13 @@ if(H.hair_style == "Bald" || H.hair_style == "Balding Hair" || H.hair_style == "Skinhead") to_chat(user, "There is not enough hair left to shave!") return - + if(M in user.do_afters) + to_chat(user, "You're already shaving [user == M ? "yourself" : "[M]"]!") + return if(H == user) //shaving yourself user.visible_message("[user] starts to shave [user.p_their()] head with [src].", \ "You start to shave your head with [src]...") - if(do_after(user, 5, target = H)) + if(do_after(user, 0.5 SECONDS, target = H, add_item = src)) user.visible_message("[user] shaves [user.p_their()] head with [src].", \ "You finish shaving with [src].") shave(H, location) @@ -193,7 +205,7 @@ var/turf/H_loc = H.loc user.visible_message("[user] tries to shave [H]'s head with [src]!", \ "You start shaving [H]'s head...") - if(do_after(user, 50, target = H)) + if(do_after(user, 5 SECONDS, target = H, show_to_target = TRUE, add_item = src)) if(H_loc == H.loc) user.visible_message("[user] shaves [H]'s head bald with [src]!", \ "You shave [H]'s head bald.") @@ -214,8 +226,11 @@ if(!get_location_accessible(H, location)) to_chat(user, "The headgear is in the way!") return + if(H in user.do_afters) + to_chat(user, "You're already changing [user == H ? "your" : "[H]'s"] hairstyle!") + return user.visible_message("[user] tries to change [H]'s hairstyle using [src].", "You try to change [H]'s hairstyle using [src].") - if(new_style && do_after(user, 60, target = H)) + if(new_style && do_after(user, 6 SECONDS, target = H, show_to_target = TRUE, add_item = src)) user.visible_message("[user] successfully changes [H]'s hairstyle using [src].", "You successfully change [H]'s hairstyle using [src].") H.hair_style = new_style H.update_hair() @@ -231,8 +246,11 @@ if(!get_location_accessible(H, location)) to_chat(user, "The mask is in the way!") return + if(H in user.do_afters) + to_chat(user, "You're already changing [user == H ? "your" : "[H]'s"] facial hair style!") + return user.visible_message("[user] tries to change [H]'s facial hair style using [src].", "You try to change [H]'s facial hair style using [src].") - if(new_style && do_after(user, 60, target = H)) + if(new_style && do_after(user, 6 SECONDS, target = H)) user.visible_message("[user] successfully changes [H]'s facial hair style using [src].", "You successfully change [H]'s facial hair style using [src].") H.facial_hair_style = new_style H.update_hair() diff --git a/code/game/objects/items/crab17.dm b/code/game/objects/items/crab17.dm index ac9ef7a82875c..a667b2fce25ff 100644 --- a/code/game/objects/items/crab17.dm +++ b/code/game/objects/items/crab17.dm @@ -76,7 +76,10 @@ if(protected_accounts["[card.registered_account.account_id]"]) to_chat(user, "It appears that your funds are safe from draining!") return - if(do_after(user, 40, target = src)) + if(src in user.do_afters) + to_chat(user, "You're already swiping your ID on [src]!") + return + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(protected_accounts["[card.registered_account.account_id]"]) return to_chat(user, "You quickly cash out your funds to a more secure banking location. Funds are safu.") // This is a reference and not a typo diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 45f1329e95136..97daad9d0e8fb 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -352,10 +352,12 @@ if (territory_claimed(get_area(target), user)) wait_time = 20 SECONDS if(!instant || paint_mode == PAINT_LARGE_HORIZONTAL) + if(target in user.do_afters) + to_chat(user, "You're already drawing on [target]!") + return to_chat(user, "You start drawing a [temp] on the [target.name]...") // hippie -- removed a weird tab that had no reason to be here - if(!do_after(user, wait_time, target = target)) + if(!do_after(user, wait_time, target = target, show_to_target = TRUE, add_item = src)) return - if(length(text_buffer)) drawing = text_buffer[1] diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 060db4f20f390..2310fc9a84f49 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -535,11 +535,17 @@ return if(!req_defib && !combat) return + if(H in user.do_afters) + to_chat(user, "You're already trying to use [src] on [H]!") + return user.visible_message("[user] begins to place [src] on [H]'s chest.", "You overcharge the paddles and begin to place them onto [H]'s chest...") busy = TRUE update_icon() - if(do_after(user, 15, target = H)) + var/atom/temp_paddles = new type//make a temporary set of paddles that have both paddles showing instead of one + temp_paddles.appearance = appearance + temp_paddles.icon_state = initial(icon_state) + if(do_after(user, 1.5 SECONDS, target = H, show_to_target = TRUE, add_item = temp_paddles)) user.visible_message("[user] places [src] on [H]'s chest.", "You place [src] on [H]'s chest and begin to charge them.") var/turf/T = get_turf(defib) @@ -548,7 +554,8 @@ T.audible_message("\The [defib] lets out an urgent beep and lets out a steadily rising hum...") else user.audible_message("[src] let out an urgent beep.") - if(do_after(user, 15, target = H)) //Takes longer due to overcharging + if(do_after(user, 1.5 SECONDS, target = H, show_to_target = TRUE, add_item = temp_paddles)) //Takes longer due to overcharging + QDEL_NULL(temp_paddles) if(!H) busy = FALSE update_icon() @@ -582,21 +589,30 @@ recharge(60) if(req_defib && (defib.cooldowncheck(user))) return + if(temp_paddles) + QDEL_NULL(temp_paddles) busy = FALSE update_icon() /obj/item/shockpaddles/proc/do_help(mob/living/carbon/H, mob/living/user) + if(H in user.do_afters) + to_chat(user, "You're already trying to use [src] on [H]!") + return user.visible_message("[user] begins to place [src] on [H]'s chest.", "You begin to place [src] on [H]'s chest...") busy = TRUE update_icon() - if(do_after(user, 30, target = H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process + var/atom/temp_paddles = new type + temp_paddles.appearance = appearance + temp_paddles.icon_state = initial(icon_state) + if(do_after(user, 3 SECONDS, target = H, show_to_target = TRUE, add_item = temp_paddles)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process user.visible_message("[user] places [src] on [H]'s chest.", "You place [src] on [H]'s chest.") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) var/total_burn = 0 var/total_brute = 0 var/tplus = world.time - H.timeofdeath //length of time spent dead var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) - if(do_after(user, 20, target = H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total + if(do_after(user, 2 SECONDS, target = H, show_to_target = TRUE, add_item = temp_paddles)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total + QDEL_NULL(temp_paddles) for(var/obj/item/carried_item in H.contents) if(istype(carried_item, /obj/item/clothing/suit/space)) if((!combat && !req_defib) || (req_defib && !defib.combat)) @@ -683,6 +699,8 @@ else user.visible_message("[req_defib ? "[defib]" : "[src]"] buzzes: Patient is not in a valid state. Operation aborted.") playsound(src, 'sound/machines/defib_failed.ogg', 50, 0) + if(temp_paddles) + QDEL_NULL(temp_paddles) busy = FALSE update_icon() diff --git a/code/game/objects/items/deployable/barricade.dm b/code/game/objects/items/deployable/barricade.dm index ee8c46727a671..7d735e7315464 100644 --- a/code/game/objects/items/deployable/barricade.dm +++ b/code/game/objects/items/deployable/barricade.dm @@ -100,7 +100,7 @@ return usr.visible_message("[usr] begins breaking down [src]", "You begin breaking down [src].") - if(do_after(usr, pickup_delay, src)) + if(do_after(usr, pickup_delay, src, add_item = src)) //If the barricade is made of parts, some of them are damaged when the barricade is damaged so we set how many are being returned here if(initial(drop_amount) > 1) @@ -135,7 +135,7 @@ return else to_chat(user, "You start adding [I] to [src]...") - if(do_after(user, 50, target=src)) + if(do_after(user, 5 SECONDS, target=src, add_item = I)) W.use(5) var/turf/T = get_turf(src) T.PlaceOnTop(/turf/closed/wall/mineral/wood/nonmetal) diff --git a/code/game/objects/items/devices/antivirus.dm b/code/game/objects/items/devices/antivirus.dm index 50f7c761053b0..f9db2f650709e 100644 --- a/code/game/objects/items/devices/antivirus.dm +++ b/code/game/objects/items/devices/antivirus.dm @@ -10,7 +10,7 @@ var/cured = 0 if(MOB_ROBOTIC in H.mob_biotypes) H.say("Installing [src]. Please do not turn your [H.dna.species] unit off or otherwise disturb it during the installation process", forced = "antivirus") - if(do_after(user, 45 SECONDS, H)) //it has unlimited uses, but that's balanced by being very slow + if(do_after(user, 45 SECONDS, H, show_to_target = TRUE, add_item = src)) //it has unlimited uses, but that's balanced by being very slow H.say("[src] successfully installed. Initiating scan.", forced = "antivirus") for(var/thing in H.diseases) var/datum/disease/D = thing diff --git a/code/game/objects/items/devices/compressionkit.dm b/code/game/objects/items/devices/compressionkit.dm index 7305865cd483b..c3d31e8b2e69a 100644 --- a/code/game/objects/items/devices/compressionkit.dm +++ b/code/game/objects/items/devices/compressionkit.dm @@ -60,7 +60,7 @@ if(O.w_class > 1) playsound(get_turf(src), 'sound/weapons/flash.ogg', 50, 1) user.visible_message("[user] is compressing [O] with their bluespace compression kit!") - if(do_after(user, 40, O) && charges > 0 && O.w_class > 1) + if(do_after(user, 4 SECONDS, O, add_item = src) && charges > 0 && O.w_class > 1) playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 50, 1) sparks() flash_lighting_fx(3, 3, LIGHT_COLOR_CYAN) diff --git a/code/game/objects/items/devices/quantum_keycard.dm b/code/game/objects/items/devices/quantum_keycard.dm index fc9ccddaf9e15..b74aee86e9048 100644 --- a/code/game/objects/items/devices/quantum_keycard.dm +++ b/code/game/objects/items/devices/quantum_keycard.dm @@ -21,7 +21,7 @@ if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return to_chat(user, "You start pressing [src]'s unlink button...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = src)) to_chat(user, "The keycard beeps twice and disconnects the quantum link.") qpad = null diff --git a/code/game/objects/items/devices/reverse_bear_trap.dm b/code/game/objects/items/devices/reverse_bear_trap.dm index 2597bea3b625f..9111edcbd2ac1 100644 --- a/code/game/objects/items/devices/reverse_bear_trap.dm +++ b/code/game/objects/items/devices/reverse_bear_trap.dm @@ -66,7 +66,7 @@ fear_string = "" C.visible_message("[C] fiddles with and pulls at [src]...", \ "You [fear_string] try to pull at [src]...", "You hear clicking and ticking.") - if(!do_after(user, 20, target = src)) + if(!do_after(user, 2 SECONDS, target = src)) struggling = FALSE return if(!prob(escape_chance)) @@ -89,7 +89,7 @@ target.visible_message("[user] starts forcing [src] onto [target]'s head!", \ "[target] starts forcing [src] onto your head!", "You hear clanking.") to_chat(user, "You start forcing [src] onto [target]'s head...") - if(!do_after(user, 30, target = target) || target.get_item_by_slot(ITEM_SLOT_HEAD)) + if(!do_after(user, 3 SECONDS, target = target, show_to_target = TRUE, add_item = src) || target.get_item_by_slot(ITEM_SLOT_HEAD)) return target.visible_message("[user] forces and locks [src] onto [target]'s head!", \ "[target] locks [src] onto your head!", "You hear a click, and then a timer ticking down.") diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 8eab94ac5e663..c874e5f3bec11 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -1226,7 +1226,7 @@ GENE SCANNER symptom_holder.symptoms += chosen symptom_holder.Finalize() symptom_holder.Refresh() - if(do_after(user, extract_time, target = target)) + if(do_after(user, extract_time, target = target, show_to_target = TRUE, add_item = src)) create_culture(user, symptom_holder, target) return TRUE @@ -1237,7 +1237,7 @@ GENE SCANNER . = FALSE user.visible_message("[user] begins to thoroughly scan [target] with [src]...", \ "[icon2html(src, user)] You begin isolating [target_disease.name] from [target]...") - if(do_after(user, isolate_time, target = target)) + if(do_after(user, isolate_time, target = target, show_to_target = TRUE, add_item = src)) create_culture(user, target_disease, target) return TRUE diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index b3a72c79d3116..92acd9766fe42 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -60,9 +60,12 @@ log_combat(user, target, "attempted to inject", src) if(target != user) + if(target in user.do_afters) + to_chat(user, "You're already trying to inject [target]!") + return target.visible_message("[user] is trying to inject [target] with [src]!", \ "[user] is trying to inject you with [src]!") - if(!do_after(user, target = target) || used) + if(!do_after(user, target = target, show_to_target = TRUE, add_item = src) || used) return target.visible_message("[user] injects [target] with the syringe with [src]!", \ "[user] injects you with the syringe with [src]!") diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index 14be01effddea..220f00d4acacb 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -59,7 +59,7 @@ shaking = TRUE start_shaking(user) - if(do_after(user, shake_time, target=user)) + if(do_after(user, shake_time, target=user, add_item = src)) var/answer = get_answer() say(answer) diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index b9e0a8ab618fd..7ef92dbd19ed3 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -12,7 +12,7 @@ /obj/item/book/granter/proc/turn_page(mob/user) playsound(user, pick('sound/effects/pageturn1.ogg','sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg'), 30, 1) - if(do_after(user,50, user)) + if(do_after(user, 5 SECONDS, user, add_item = src)) if(remarks.len) to_chat(user, "[pick(remarks)]") else @@ -57,7 +57,7 @@ on_reading_stopped() reading = FALSE return - if(do_after(user,50, user)) + if(do_after(user, 5 SECONDS, user, add_item = src)) on_reading_finished(user) reading = FALSE return TRUE @@ -126,7 +126,7 @@ if(knownspell.type == spell) if(user.mind) if(iswizard(user)) - to_chat(user,"You're already far more versed in this spell than this flimsy how-to book can provide.") + to_chat(user,"You're already far more versed in this spell than this flimsy how-to book can provide.") else to_chat(user,"You've already read this one.") return TRUE diff --git a/code/game/objects/items/grenades/_grenade.dm b/code/game/objects/items/grenades/_grenade.dm index b4cef71600967..efca95f0a3bbe 100644 --- a/code/game/objects/items/grenades/_grenade.dm +++ b/code/game/objects/items/grenades/_grenade.dm @@ -85,7 +85,7 @@ /obj/item/grenade/attack_self(mob/user) if(HAS_TRAIT(src, TRAIT_NODROP)) to_chat(user, "You try prying [src] off your hand...") - if(do_after(user, 70, target=src)) + if(do_after(user, 7 SECONDS, target=src)) to_chat(user, "You manage to remove [src] from your hand.") REMOVE_TRAIT(src, TRAIT_NODROP, STICKY_NODROP) diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index 114822d13d90d..31b7bb4c00c98 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -63,7 +63,7 @@ if(I.tool_behaviour == TOOL_SCREWDRIVER) if(dud_flags & GRENADE_USED) to_chat(user, "You started to reset the trigger.") - if (do_after(user, 2 SECONDS, src)) + if (do_after(user, 2 SECONDS, src, add_item = I)) to_chat(user, "You reset the trigger.") dud_flags &= ~GRENADE_USED return diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 8e645dd4a3ec9..b7843a72bc7f8 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -120,7 +120,7 @@ to_chat(user, "You start planting [src]. The timer is set to [det_time]...") - if(do_after(user, 30, target = AM)) + if(do_after(user, 3 SECONDS, target = AM, add_item = src)) if(!user.temporarilyRemoveItemFromInventory(src)) return target = AM diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index cf5478cfbd15b..12c3cdf41dd77 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -54,11 +54,14 @@ if(!C.handcuffed) if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()) + if(C in user.do_afters) + to_chat(user, "You're already trying to cuff [C]!") + return C.visible_message("[user] is trying to put [src.name] on [C]!", \ "[user] is trying to put [src.name] on you!") playsound(loc, cuffsound, 30, 1, -2) - if(do_after(user, 4 SECONDS, C) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) + if(do_after(user, 4 SECONDS, C, show_to_target = TRUE, add_item = src) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) if(iscyborg(user)) apply_cuffs(C, user, TRUE) else @@ -165,16 +168,21 @@ if(M.get_amount() < 6) to_chat(user, "You need at least six iron sheets to make good enough weights!") return + if(src in user.do_afters) + to_chat(user, "You're already applying [I] to [src]!") + return to_chat(user, "You begin to apply [I] to [src]...") - if(do_after(user, 35, target = src)) + var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola + if(do_after(user, 3.5 SECONDS, target = src, add_item = S)) if(M.get_amount() < 6 || !M) return - var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola M.use(6) user.put_in_hands(S) to_chat(user, "You make some weights out of [I] and tie them to [src].") remove_item_from_storage(user) qdel(src) + else + qdel(S) else return ..() diff --git a/code/game/objects/items/holosign_creator.dm b/code/game/objects/items/holosign_creator.dm index 2fabe9eeca14b..90b476e915d54 100644 --- a/code/game/objects/items/holosign_creator.dm +++ b/code/game/objects/items/holosign_creator.dm @@ -46,7 +46,7 @@ playsound(src.loc, 'sound/machines/click.ogg', 20, 1) if(creation_time) holocreator_busy = TRUE - if(!do_after(user, creation_time, target = target)) + if(!do_after(user, creation_time, target = target, add_item = src)) holocreator_busy = FALSE return holocreator_busy = FALSE diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 4c8ad227a2ff5..c5fd696a5accf 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -19,7 +19,7 @@ var/special = FALSE var/special_name = "special function" var/message_cooldown - var/breakout_time = 600 + var/breakout_time = 60 SECONDS /obj/machinery/implantchair/Initialize(mapload) . = ..() diff --git a/code/game/objects/items/implants/implanter.dm b/code/game/objects/items/implants/implanter.dm index bfa06589c23cd..e8d36ff0873e5 100644 --- a/code/game/objects/items/implants/implanter.dm +++ b/code/game/objects/items/implants/implanter.dm @@ -26,11 +26,14 @@ return if(user && imp) if(M != user) + if(M in user.do_afters) + to_chat(user, "You're already trying to implant [M]!") + return M.visible_message("[user] is attempting to implant [M].", \ "[user] is trying to implant you with [src]!") var/turf/T = get_turf(M) - if(T && (M == user || do_after(user, 5 SECONDS, M))) + if(T && (M == user || do_after(user, 5 SECONDS, M, show_to_target = TRUE, add_item = src))) if(src && imp) if(imp.implant(M, user)) if (M == user) diff --git a/code/game/objects/items/inducer.dm b/code/game/objects/items/inducer.dm index f0d32cf422051..7d9cd2099ceef 100644 --- a/code/game/objects/items/inducer.dm +++ b/code/game/objects/items/inducer.dm @@ -126,7 +126,7 @@ return TRUE user.visible_message("[user] starts recharging [A] with [src].","You start recharging [A] with [src].") while((battery?.charge || C.charge) < maxcharge) - if(do_after(user, 10, target = user) && cell.charge) + if(do_after(user, 1 SECONDS, target = user, add_item = src) && cell.charge) done_any = TRUE if(battery) battery.adjust_charge(min(cell.charge,250)) diff --git a/code/game/objects/items/mail.dm b/code/game/objects/items/mail.dm index 963d2f56385e2..c1108b30589f5 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -158,11 +158,13 @@ if(user.real_name != recipient.name && !can_open) to_chat(user, "We must keep our disguise intact.") // cuz your disguise cant open the mail so you shouldnt either return - + if(src in user.do_afters) + to_chat(user, "You're already trying to unwrap [src]!") + return user.visible_message("[user] start to unwrap a package...", \ "You start to unwrap the package...", \ "You hear paper ripping.") - if(!do_after(user, 1.5 SECONDS, target = user)) + if(!do_after(user, 1.5 SECONDS, target = user, add_item = src)) return user.temporarilyRemoveItemFromInventory(src, TRUE) if(contents.len) diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 4cb503ea7afe9..b24703fee6586 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -839,7 +839,7 @@ playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1) else return - if(do_after(user, 100, target = user)) + if(do_after(user, 10 SECONDS, target = user, add_item = src)) finish_roasting(user, target) else QDEL_NULL(beam) diff --git a/code/game/objects/items/miscellaneous.dm b/code/game/objects/items/miscellaneous.dm index dac0fb93cb424..861e9b458ca37 100644 --- a/code/game/objects/items/miscellaneous.dm +++ b/code/game/objects/items/miscellaneous.dm @@ -301,8 +301,11 @@ kidnaptime += 10 SECONDS if(target == user) kidnaptime = 1 SECONDS + if(kidnapee in user.do_afters) + to_chat(user, "You're already trying to pull [src] over [kidnapee]'s head!") + return kidnapee.visible_message("[user] starts pulling [src] over [kidnapee]'s head!", "[user] starts pulling [src] over your head!") - if(do_after(user, kidnaptime * kidnappingcoefficient, kidnapee)) + if(do_after(user, kidnaptime * kidnappingcoefficient, kidnapee, show_to_target = TRUE, add_item = src)) if(kidnapee == user) kidnapee.drop_all_held_items() if(HAS_TRAIT(src, TRAIT_NODROP)) @@ -358,7 +361,7 @@ user.last_special = world.time + CLICK_CD_BREAKOUT to_chat(user, "You claw at the fabric of [src], trying to tear it open...") to_chat(loc, "Someone starts trying to break free of [src]!") - if(!do_after(user, 100, target = src)) + if(!do_after(user, 10 SECONDS, target = src, add_item = src)) to_chat(loc, "The pressure subsides. It seems that they've stopped resisting...") return loc.visible_message("[user] suddenly appears in front of [loc]!", "[user] breaks free of [src]!") diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm index 2c349132e474c..ad107db41fed0 100644 --- a/code/game/objects/items/mop.dm +++ b/code/game/objects/items/mop.dm @@ -54,6 +54,9 @@ return if(T) + if(T in user.do_afters) + to_chat(user, "You're already cleaning [T]!") + return user.visible_message("[user] begins to clean \the [T] with [src].", "You begin to clean \the [T] with [src]...") if(do_after(user, src.mopspeed, target = T)) diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index 5efe3a176391e..b03e6797c07dd 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -123,7 +123,7 @@ if(user.mob_size <= MOB_SIZE_SMALL) to_chat(user, "You poke a limb through [src]'s bars and start fumbling for the lock switch... (This will take some time.)") to_chat(loc, "You see [user] reach through the bars and fumble for the lock switch!") - if(!do_after(user, rand(300, 400), target = user) || open || !locked || !(user in occupants)) + if(!do_after(user, rand(30 SECONDS, 40 SECONDS), target = user, add_item = src) || open || !locked || !(user in occupants)) return loc.visible_message("[user] flips the lock switch on [src] by reaching through!", null, null, null, user) to_chat(user, "Bingo! The lock pops open!") @@ -133,7 +133,7 @@ else loc.visible_message("[src] starts rattling as something pushes against the door!", null, null, null, user) to_chat(user, "You start pushing out of [src]... (This will take about 20 seconds.)") - if(!do_after(user, 200, target = user) || open || !locked || !(user in occupants)) + if(!do_after(user, 20 SECONDS, target = user, add_item = src) || open || !locked || !(user in occupants)) return loc.visible_message("[user] shoves out of [src]!", null, null, null, user) to_chat(user, "You shove open [src]'s door against the lock's resistance and fall out!") @@ -166,7 +166,7 @@ user.visible_message("[user] starts loading [target] into [src].", \ "You start loading [target] into [src]...", null, null, target) to_chat(target, "[user] starts loading you into [user.p_their()] [name]!") - if(!do_after(user, 3 SECONDS, target)) + if(!do_after(user, 3 SECONDS, target, show_to_target = TRUE, add_item = src)) return if(target in occupants) return diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm index 316e537f4ce54..e02a26d914827 100644 --- a/code/game/objects/items/religion.dm +++ b/code/game/objects/items/religion.dm @@ -310,7 +310,7 @@ if(staffcooldown + staffwait > world.time) return user.visible_message("[user] chants deeply and waves [user.p_their()] staff!") - if(do_after(user, 20,src)) + if(do_after(user, 2 SECONDS, src, add_item = src)) target.add_atom_colour(conversion_color, WASHABLE_COLOUR_PRIORITY) //wololo staffcooldown = world.time diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 6a260a2db9ba3..c6dd936d57f88 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -251,7 +251,7 @@ work_mode = mode if(istype(cell)) - while(do_after(user, 15, target = target, extra_checks = CALLBACK(src, PROC_REF(mode_check)))) + while(do_after(user, 1.5 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(mode_check)), add_item = src)) if(!user?.cell) active = FALSE return @@ -287,7 +287,7 @@ active = FALSE else var/obj/machinery/M = target - while(do_after(user, 15, target = M, extra_checks = CALLBACK(src, PROC_REF(mode_check)))) + while(do_after(user, 1.5 SECONDS, target = M, extra_checks = CALLBACK(src, PROC_REF(mode_check)), add_item = src)) if(!user?.cell) active = FALSE return @@ -315,7 +315,7 @@ /obj/item/borg/charger/proc/charging_loop(mob/living/silicon/robot/user, atom/target, obj/item/stock_parts/cell/cell) work_mode = mode - while(do_after(user, 15, target = target, extra_checks = CALLBACK(src, PROC_REF(mode_check)))) + while(do_after(user, 1.5 SECONDS, target = target, extra_checks = CALLBACK(src, PROC_REF(mode_check)), add_item = src)) if(!user?.cell) active = FALSE return diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 4bb85d92ddfba..118391b02e245 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -216,7 +216,7 @@ return else to_chat(user, "You begin to replace the bulb.") - if(do_after(user, 20, target = user)) + if(do_after(user, 2 SECONDS, target = user, add_item = src)) if(flash.burnt_out || !flash || QDELETED(flash)) return playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 988b1341f3313..a13b8a00b8279 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -93,9 +93,9 @@ if(C == user) user.visible_message("[user] starts to apply [src] on [user.p_them()]self...", "You begin applying [src] on yourself...") - if(!do_after(user, self_delay, M)) + if(!do_after(user, self_delay, M, add_item = src)) return - //After the do_mob to ensure metabolites have had time to process at least one tick. + //After the do_mob to ensure metabolites have had time to process at least one tick. if(reagent && (C.reagents.get_reagent_amount(/datum/reagent/metabolite/medicine/styptic_powder) || C.reagents.get_reagent_amount(/datum/reagent/metabolite/medicine/silver_sulfadiazine))) to_chat(user, "That stuff really hurt! You'll need to wait for the pain to go away before you can apply [src] to your wounds again, maybe someone else can help put it on for you.") return diff --git a/code/game/objects/items/stacks/sheets/organic/cloths.dm b/code/game/objects/items/stacks/sheets/organic/cloths.dm index 86b38a29b3a9a..ec4df9f58cff2 100644 --- a/code/game/objects/items/stacks/sheets/organic/cloths.dm +++ b/code/game/objects/items/stacks/sheets/organic/cloths.dm @@ -20,7 +20,7 @@ Various Cloths merge_type = /obj/item/stack/sheet/cotton drop_sound = 'sound/items/handling/cloth_drop.ogg' pickup_sound = 'sound/items/handling/cloth_pickup.ogg' - var/pull_effort = 30 + var/pull_effort = 3 SECONDS var/loom_result = /obj/item/stack/sheet/cotton/cloth /obj/item/stack/sheet/cotton/cloth @@ -34,7 +34,7 @@ Various Cloths force = 0 throwforce = 0 merge_type = /obj/item/stack/sheet/cotton/cloth - pull_effort = 50 + pull_effort = 5 SECONDS loom_result = /obj/item/stack/sheet/silk /obj/item/stack/sheet/cotton/cloth/get_recipes() @@ -48,7 +48,7 @@ Various Cloths singular_name = "raw durathread ball" icon_state = "sheet-durathreadraw" merge_type = /obj/item/stack/sheet/cotton/durathread - pull_effort = 70 + pull_effort = 7 SECONDS loom_result = /obj/item/stack/sheet/cotton/cloth/durathread /obj/item/stack/sheet/cotton/cloth/durathread diff --git a/code/game/objects/items/stacks/sheets/organic/hides.dm b/code/game/objects/items/stacks/sheets/organic/hides.dm index 0914e09bec9c5..734fbc95cca3b 100644 --- a/code/game/objects/items/stacks/sheets/organic/hides.dm +++ b/code/game/objects/items/stacks/sheets/organic/hides.dm @@ -133,9 +133,12 @@ /obj/item/stack/sheet/animalhide/attackby(obj/item/W, mob/user, params) if(W.is_sharp()) + if(src in user.do_afters) + to_chat(user, "You're already cutting the hair off from [src]!") + return playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1) user.visible_message("[user] starts cutting hair off \the [src].", "You start cutting the hair off \the [src]...", "You hear the sound of a knife rubbing against flesh.") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = W)) to_chat(user, "You cut the hair from this [src.singular_name].") new /obj/item/stack/sheet/leather/hairlesshide(user.drop_location(), 1) use(1) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 8def62c565494..3f8213438dd86 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -221,8 +221,13 @@ if(!building_checks(R, multiplier)) return if(R.time) + var/atom/movable/fake_atom = new + var/atom/fake_result = R.result_type + fake_atom.icon = initial(fake_result.icon) + fake_atom.icon_state = initial(fake_result.icon_state_preview) || initial(fake_result.icon_state) + fake_atom.color = initial(fake_result.color) usr.visible_message("[usr] starts building \a [R.title].", "You start building \a [R.title]...") - if(!do_after(usr, R.time, target = usr)) + if(!do_after(usr, R.time, target = usr, add_item = fake_atom)) return if(!building_checks(R, multiplier)) return diff --git a/code/game/objects/items/stacks/tape.dm b/code/game/objects/items/stacks/tape.dm index dc668431d989f..5b0a88408cd2c 100644 --- a/code/game/objects/items/stacks/tape.dm +++ b/code/game/objects/items/stacks/tape.dm @@ -24,7 +24,7 @@ user.visible_message("[user] begins wrapping [I] with [src].", "You begin wrapping [I] with [src].") - if(do_after(user, 30, target=I)) + if(do_after(user, 3 SECONDS, target=I, add_item = src)) I.embedding = conferred_embed I.updateEmbedding() to_chat(user, "You finish wrapping [I] with [src].") diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index ca57ac8d7251d..9d400f2eb9251 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -228,7 +228,7 @@ var/obj/item/cult_bastard/sword = A to_chat(user, "You begin to exorcise [sword].") playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,1) - if(do_after(user, 40, target = sword)) + if(do_after(user, 4 SECONDS, target = sword, show_to_target = TRUE, add_item = src)) playsound(src,'sound/effects/pray_chaplain.ogg',60,1) for(var/obj/item/soulstone/SS in sword.contents) SS.usability = TRUE @@ -248,7 +248,7 @@ return to_chat(user, "You begin to exorcise [SS].") playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,1) - if(do_after(user, 40, target = SS)) + if(do_after(user, 4 SECONDS, target = SS, show_to_target = TRUE, add_item = src)) playsound(src,'sound/effects/pray_chaplain.ogg',60,1) SS.usability = TRUE SS.purified = TRUE diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index a21ee3a523953..ca30db787acfc 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -56,7 +56,7 @@ return else if(istype(C) && C.has_status_effect(STATUS_EFFECT_CHOKINGSTRAND)) to_chat(C, "You attempt to remove the durathread strand from around your neck.") - if(do_after(user, 15, C)) + if(do_after(user, 1.5 SECONDS, C, add_item = src)) to_chat(C, "You succesfuly remove the durathread strand.") C.remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND) else diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 7835f3f62aaf7..96493c0c50d92 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -694,12 +694,12 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 ..() return if(homerun_ready) - to_chat(user, "You're already ready to do a home run!") + to_chat(user, "You're already ready to do a home run!") ..() return to_chat(user, "You begin gathering strength...") playsound(get_turf(src), 'sound/magic/lightning_chargeup.ogg', 65, 1) - if(do_after(user, 90, target = src)) + if(do_after(user, 9 SECONDS, target = src, add_item = src)) to_chat(user, "You gather power! Time for a home run!") homerun_ready = 1 ..() diff --git a/code/game/objects/noose.dm b/code/game/objects/noose.dm index 3ea669528fc79..f4b36c4e83b04 100644 --- a/code/game/objects/noose.dm +++ b/code/game/objects/noose.dm @@ -57,17 +57,23 @@ /obj/structure/chair/noose/user_unbuckle_mob(mob/living/M,mob/living/user) if(has_buckled_mobs()) if(M != user) + if(src in user.do_afters) + to_chat(user, "You're untying the noose over [M]'s neck!") + return user.visible_message("[user] begins to untie the noose over [M]'s neck...") to_chat(user, "You begin to untie the noose over [M]'s neck...") - if(!do_after(user, 10 SECONDS, M)) + if(!do_after(user, 10 SECONDS, M, show_to_target = TRUE, add_item = src)) return user.visible_message("[user] unties the noose over [M]'s neck!") to_chat(user,"You untie the noose over [M]'s neck!") M.Knockdown(60) else + if(src in user.do_afters) + to_chat(user, "You're already struggling to untie the noose over your neck!") + return M.visible_message("[M] struggles to untie the noose over their neck!") to_chat(M,"You struggle to untie the noose over your neck... (Stay still for 15 seconds.)") - if(!do_after(M, 150, target = src)) + if(!do_after(M, 15 SECONDS, target = src, add_item = src)) if(M && M.buckled) to_chat(M, "You fail to untie yourself!") return @@ -93,13 +99,18 @@ if(M.loc != src.loc) return FALSE //Can only noose someone if they're on the same tile as noose - + if(M in user.do_afters) + if(user == M) + to_chat(user, "You're already tying the noose over your neck!") + else + to_chat(user, "You're already tying a noose over [M]'s neck!") + return add_fingerprint(user) log_combat(user, M, "Attempted to Hang", src) M.visible_message("[user] attempts to tie \the [src] over [M]'s neck!") if(user != M) to_chat(user, "It will take 20 seconds and you have to stand still.") - if(do_after(user, user == M ? 0:20 SECONDS, M)) + if(do_after(user, user == M ? 0:20 SECONDS, M, show_to_target = TRUE, add_item = src)) if(buckle_mob(M)) user.visible_message("[user] ties \the [src] over [M]'s neck!") if(user == M) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 167899620ac9c..a6cb5f9c5d09e 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -55,6 +55,7 @@ /// If the emag behavior should be toggleable var/emag_toggleable = FALSE + /obj/vv_edit_var(vname, vval) switch(vname) if("anchored") diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 82ca8fbdf6a2d..d8823eedea79f 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -141,7 +141,7 @@ if(C.get_amount() >= 5) playsound(loc, 'sound/items/deconstruct.ogg', 50, 1) to_chat(user, "You start to add cables to the frame...") - if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5)) + if(do_after(user, 2 SECONDS, target = src, add_item = P) && state == SCREWED_CORE && C.use(5)) to_chat(user, "You add cables to the frame.") state = CABLED_CORE update_icon() @@ -165,7 +165,7 @@ if(G.get_amount() >= 2) playsound(loc, 'sound/items/deconstruct.ogg', 50, 1) to_chat(user, "You start to put in the glass panel...") - if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2)) + if(do_after(user, 2 SECONDS, target = src, add_item = P) && state == CABLED_CORE && G.use(2)) to_chat(user, "You put in the glass panel.") state = GLASS_CORE update_icon() diff --git a/code/game/objects/structures/bot_elevator.dm b/code/game/objects/structures/bot_elevator.dm index fc4505cb69a8e..411826c1f88a1 100644 --- a/code/game/objects/structures/bot_elevator.dm +++ b/code/game/objects/structures/bot_elevator.dm @@ -56,7 +56,7 @@ if(!is_ghost && isbot(user)) user.say("Weeeeeee!") if(needs_do_after) - if(!do_after(user, 1 SECONDS, target=src)) + if(!do_after(user, 1 SECONDS, target=src, show_to_target = TRUE)) return FALSE user.forceMove(T) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 0c2d20f5d8344..e4a91759f2086 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -18,7 +18,7 @@ var/locked = FALSE var/large = TRUE var/wall_mounted = 0 //never solid (You can always pass over it) - var/breakout_time = 1200 + var/breakout_time = 120 SECONDS var/message_cooldown var/can_weld_shut = TRUE var/horizontal = FALSE diff --git a/code/game/objects/structures/crates_lockers/crates/critter.dm b/code/game/objects/structures/crates_lockers/crates/critter.dm index c1ddb4ee64649..a73e0d3c5bd4c 100644 --- a/code/game/objects/structures/crates_lockers/crates/critter.dm +++ b/code/game/objects/structures/crates_lockers/crates/critter.dm @@ -4,7 +4,7 @@ icon_state = "critter_crate" horizontal = FALSE allow_objects = FALSE - breakout_time = 600 + breakout_time = 60 SECONDS material_drop = /obj/item/stack/sheet/wood material_drop_amount = 4 delivery_icon = "deliverybox" diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index ba3ff3240c553..694db70feb146 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -186,7 +186,7 @@ to_chat(user, "You need two glass sheets to fix the case!") return to_chat(user, "You start fixing [src]...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) G.use(2) broken = FALSE obj_integrity = max_integrity @@ -246,14 +246,14 @@ else if(istype(I, /obj/item/electronics/airlock)) to_chat(user, "You start installing the electronics into [src]...") I.play_tool_sound(src) - if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src)) + if(do_after(user, 3 SECONDS, target = src, add_item = I) && user.transferItemToLoc(I,src)) electronics = I to_chat(user, "You install the airlock electronics.") else if(istype(I, /obj/item/stock_parts/manipulator)) var/obj/item/stock_parts/manipulator/M = I to_chat(user, "You start adding [M] to [src]...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = I)) var/obj/structure/displaycase/forsale/sale = new(src.loc) if(electronics) electronics.forceMove(sale) @@ -271,7 +271,7 @@ to_chat(user, "You need ten glass sheets to do this!") return to_chat(user, "You start adding [G] to [src]...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = I)) G.use(10) var/obj/structure/displaycase/display = new(src.loc) if(electronics) @@ -562,7 +562,7 @@ . = ..() if(obj_integrity <= (integrity_failure * max_integrity)) to_chat(user, "You start recalibrating [src]'s hover field...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = I)) broken = FALSE obj_integrity = max_integrity update_icon() diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 3adb0b8c64364..02cca3d71e32c 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -151,7 +151,7 @@ W.play_tool_sound(src, 100) user.visible_message("[user] installs the electronics into the airlock assembly.", \ "You start to install electronics into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if( state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS ) return if(!user.transferItemToLoc(W, src)) @@ -172,7 +172,7 @@ AE.play_tool_sound(src, 100) user.visible_message("[user] installs the electronics into the airlock assembly.", \ "You start to install electronics into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if( state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS ) qdel(AE) return @@ -216,7 +216,7 @@ playsound(src, 'sound/items/crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", \ "You start to install [G.name] into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(G.get_amount() < 1 || glass) return if(G.type == /obj/item/stack/sheet/rglass) @@ -235,7 +235,7 @@ playsound(src, 'sound/items/crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", \ "You start to install [G.name] into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(G.get_amount() < 2 || mineral) return to_chat(user, "You install [M] plating into the airlock assembly.") diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index 27672ffa8215c..0804d8e46d41c 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -73,7 +73,7 @@ user.visible_message("\The [user] starts cutting through \the [src] with \the [W].",\ "You start cutting through \the [src] with \the [W].") - if(do_after(user, CUT_TIME*W.toolspeed, target = src)) + if(do_after(user, CUT_TIME * W.toolspeed, target = src, add_item = W)) if(current_stage == hole_size) switch(++hole_size) if(MEDIUM_HOLE) diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index a9f1c9f3ec988..1b725a9b9096b 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -45,7 +45,7 @@ to_chat(user, "You need two glass sheets to fix [src]!") return to_chat(user, "You start fixing [src]...") - if(do_after(user, 20, target = src) && G.use(2)) + if(do_after(user, 20, target = src, add_item = I) && G.use(2)) broken = 0 obj_integrity = max_integrity update_appearance() diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 7cc8bf747b9e7..9204cca014d24 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -18,7 +18,7 @@ if(W.hitsound) playsound(get_turf(src), W.hitsound, 100, 0, 0) user.visible_message("[user] begins to cut down [src] with [W].","You begin to cut down [src] with [W].", "You hear the sound of sawing.") - if(do_after(user, 1000/W.force, target = src)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard. + if(do_after(user, 100 SECONDS/W.force, target = src, add_item = W)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard. user.visible_message("[user] fells [src] with the [W].","You fell [src] with the [W].", "You hear the sound of a tree falling.") playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0) for(var/i=1 to log_amount) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 74c01cb144705..c1e2b96205772 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -64,7 +64,7 @@ to_chat(user, "You need at least two rods to create a false wall!") return balloon_alert(user, "You start building a reinforced false wall...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -78,7 +78,7 @@ to_chat(user, "You need at least five rods to add plating!") return balloon_alert(user, "You start adding plating...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(S.get_amount() < 5) return S.use(5) @@ -99,7 +99,7 @@ to_chat(user, "You need two sheets of iron to create a false wall!") return balloon_alert(user, "You start building false wall...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -113,7 +113,7 @@ to_chat(user, "You need two sheets of iron to finish a wall!") return balloon_alert(user, "You start adding plating...") - if (do_after(user, 40, target = src)) + if (do_after(user, 4 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -130,7 +130,7 @@ to_chat(user, "You need at least two sheets to create a false wall!") return balloon_alert(user, "You start building reinforced false wall...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -144,7 +144,7 @@ if(S.get_amount() < 1) return balloon_alert(user, "You start finilizing reinforced wall...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = W)) if(S.get_amount() < 1) return S.use(1) @@ -158,7 +158,7 @@ if(S.get_amount() < 1) return balloon_alert(user, "You start reinforcing [src]...") - if(do_after(user, 60, target = src)) + if(do_after(user, 6 SECONDS, target = src, add_item = W)) if(S.get_amount() < 1) return S.use(1) @@ -174,7 +174,7 @@ if(S.get_amount() < 2) to_chat(user, "You need at least two sheets to create a false wall!") return - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -189,7 +189,7 @@ to_chat(user, "You need at least two sheets to add plating!") return balloon_alert(user, "You start adding plating...") - if (do_after(user, 40, target = src)) + if (do_after(user, 4 SECONDS, target = src, add_item = W)) if(S.get_amount() < 2) return S.use(2) @@ -363,7 +363,7 @@ to_chat(user, "You need at least one sheet of runed metal to construct a runed wall!") return 0 user.visible_message("[user] begins laying runed metal on [src]...", "You begin constructing a runed wall...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = W)) if(R.get_amount() < 1) return user.visible_message("[user] plates [src] with runed metal.", "You construct a runed wall.") @@ -450,7 +450,7 @@ to_chat(user, "You need at least two bronze sheets to build a bronze wall!") return FALSE user.visible_message("[user] begins plating [src] with bronze...", "You begin constructing a bronze wall...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = W)) if(B.get_amount() < 2) return user.visible_message("[user] plates [src] with bronze!", "You construct a bronze wall.") diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index c1784d4cbf8ae..08374b56fd7a4 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -185,7 +185,7 @@ to_chat(user, "There is already a window there!") return to_chat(user, "You start placing the window...") - if(do_after(user,20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if(!src.loc || !anchored) //Grille broken or unanchored while waiting return for(var/obj/structure/window/WINDOW in loc) //Another window already installed on grille diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index 3fa02ac03fbfb..c669108abf960 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -156,7 +156,7 @@ if (blade_status == GUILLOTINE_BLADE_RAISED) if (blade_sharpness < GUILLOTINE_BLADE_MAX_SHARP) blade_status = GUILLOTINE_BLADE_SHARPENING - if(do_after(user, 7, target = src)) + if(do_after(user, 7, target = src, add_item = W)) blade_status = GUILLOTINE_BLADE_RAISED user.visible_message("[user] sharpens the large blade of the guillotine.", "You sharpen the large blade of the guillotine.") @@ -237,7 +237,7 @@ current_action = GUILLOTINE_ACTION_WRENCH - if (do_after(user, GUILLOTINE_WRENCH_DELAY, target = src)) + if (do_after(user, GUILLOTINE_WRENCH_DELAY, target = src, add_item = I)) current_action = 0 default_unfasten_wrench(user, I, 0) setDir(SOUTH) diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index 7baea226b00e2..aad6d1eb1606c 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -103,7 +103,7 @@ "[user] tries to pull [M] free of [src]!",\ "[user] is trying to pull you off [src], opening up fresh wounds!",\ "You hear a squishy wet noise.") - if(!do_after(user, 300, target = src)) + if(!do_after(user, 30 SECONDS, target = src)) if(M?.buckled) M.visible_message(\ "[user] fails to free [M]!",\ @@ -116,7 +116,7 @@ "You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)",\ "You hear a wet squishing noise..") M.adjustBruteLoss(30) - if(!do_after(M, 1200, target = src, timed_action_flags = IGNORE_RESTRAINED)) + if(!do_after(M, 120 SECONDS, target = src, timed_action_flags = IGNORE_RESTRAINED)) if(M && M.buckled) to_chat(M, "You fail to free yourself!") return diff --git a/code/game/objects/structures/lavaland/geyser.dm b/code/game/objects/structures/lavaland/geyser.dm index 0ed3926978cdb..516c71d234d99 100644 --- a/code/game/objects/structures/lavaland/geyser.dm +++ b/code/game/objects/structures/lavaland/geyser.dm @@ -38,9 +38,11 @@ if(activated) to_chat(user, "The [name] is already active!") return - + if(src in user.do_afters) + to_chat(user, "You're already plunging [src]!") + return to_chat(user, "You start vigorously plunging [src]!") - if(do_after(user, 50*P.plunge_mod, target = src) && !activated) + if(do_after(user, 5 SECONDS * P.plunge_mod, target = src, add_item = src) && !activated) start_chemming() /obj/structure/geyser/random diff --git a/code/game/objects/structures/loom.dm b/code/game/objects/structures/loom.dm index 28ff5a8de732f..85f10777dbbe8 100644 --- a/code/game/objects/structures/loom.dm +++ b/code/game/objects/structures/loom.dm @@ -30,12 +30,27 @@ if(W.amount < FABRIC_PER_SHEET) user.show_message("You need at least [FABRIC_PER_SHEET] units of fabric before using this.", MSG_VISUAL) return FALSE + if(src in user.do_afters) + to_chat(user,"You already are weaving \the [W.name] through the loom!") + return FALSE user.show_message("You start weaving \the [W.name] through the loom..", MSG_VISUAL) - if(W.use_tool(src, user, W.pull_effort)) - if(W.amount >= FABRIC_PER_SHEET) - new W.loom_result(drop_location()) - W.use(FABRIC_PER_SHEET) - user.show_message("You weave \the [W.name] into a workable fabric.", MSG_VISUAL) + var/speed_mult = 1 + var/atom/movable/fake_atom = new + var/atom/fake_result = W.loom_result + fake_atom.icon = initial(fake_result.icon) + fake_atom.icon_state = initial(fake_result.icon_state) + while(W.amount >= FABRIC_PER_SHEET) + if(!do_after(user, W.pull_effort * speed_mult, src, add_item = fake_atom)) + return + if(W.amount < FABRIC_PER_SHEET) + user.show_message("You need at least [FABRIC_PER_SHEET] units of fabric before using this.") + return + new W.loom_result(drop_location()) + W.use(FABRIC_PER_SHEET) + user.show_message("You weave \the [W.name] into a workable fabric.") + if(speed_mult > 0.2) + speed_mult -= 0.1 + user.show_message("You finish weaving.") return TRUE #undef FABRIC_PER_SHEET diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index de83e3d47ae59..416162f47c202 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -337,7 +337,7 @@ if((user.a_intent != INTENT_HARM) && istype(I, /obj/item/paper) && (obj_integrity < max_integrity)) user.visible_message("[user] starts to patch the holes in [src].", "You start patching some of the holes in [src]!") - if(do_after(user, 20, src)) + if(do_after(user, 2 SECONDS, src, add_item = I)) obj_integrity = min(obj_integrity+4,max_integrity) qdel(I) user.visible_message("[user] patches some of the holes in [src].", "You patch some of the holes in [src]!") diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 388d58bfaddcc..52790a774b878 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an var/locked = FALSE dir = SOUTH var/message_cooldown - var/breakout_time = 600 + var/breakout_time = 60 SECONDS /obj/structure/bodycontainer/Initialize(mapload) . = ..() diff --git a/code/game/objects/structures/popout_cake.dm b/code/game/objects/structures/popout_cake.dm index 5ec12cc547464..998c99c108cf5 100644 --- a/code/game/objects/structures/popout_cake.dm +++ b/code/game/objects/structures/popout_cake.dm @@ -50,7 +50,7 @@ else user.visible_message("[user] starts stuffing [target] into [src]!", "You start stuffing [target] into [src]!") - if(do_after(user, 60, src)) + if(do_after(user, 6 SECONDS, src)) if(occupant) to_chat(user, "There's already someone inside!") return @@ -70,7 +70,7 @@ return else if(contents.Find(user)) to_chat(user, "You begin climbing out of the [src]...") - if(do_after(user, 20)) + if(do_after(user, 2 SECONDS)) user.forceMove(get_turf(src)) occupant = null @@ -79,14 +79,14 @@ user.visible_message("[user] sticks the [W] inside [src] and stars fiddling around!", \ "", \ "[user] begins cutting into [src] with [W]!", "There's no space for [src] inside!") else user.visible_message("[user] begins inserting [W] into [src]!", "You begin inserting [W] into [src]!") - if(do_after(user, 30, src, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(user, 3 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM, add_item = W)) strong_surprise = TRUE user.visible_message("After some fiddling, [user] inserts [W] into [src]!", "You attach [W] to the hidden mechanism inside!") qdel(W) diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm index 3ce45ef6557c8..652b4c7eb78d6 100644 --- a/code/game/objects/structures/shower.dm +++ b/code/game/objects/structures/shower.dm @@ -25,7 +25,7 @@ /obj/structure/showerframe/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/stack/sheet/plastic)) balloon_alert(user, "You start constructing a shower...") - if(do_after(user, 4 SECONDS, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = I)) I.use(1) balloon_alert(user, "You create a shower.") var/obj/machinery/shower/new_shower = new /obj/machinery/shower(loc) diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index 42f036e48b770..e92833cf82134 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -38,7 +38,7 @@ if(!check_turf_contents(user)) return to_chat(user, "You start adding [material] to [src]...") - if(do_after(user, 20, target = src) && material.use(1)) + if(do_after(user, 2 SECONDS, target = src, add_item = I) && material.use(1)) make_new_table(material.tableVariant, user) else return ..() @@ -96,7 +96,7 @@ if(!check_turf_contents(user)) return to_chat(user, "You start adding [material] to [src]...") - if(do_after(user, 20, target = src) && material.use(1)) + if(do_after(user, 2 SECONDS, target = src, add_item = I) && material.use(1)) make_new_table(toConstruct) else return ..() @@ -118,7 +118,7 @@ if(!check_turf_contents(user)) return to_chat(user, "You start adding [W] to [src]...") - if(do_after(user, 20, target = src) && W.use(1)) + if(do_after(user, 2 SECONDS, target = src, add_item = I) && W.use(1)) make_new_table(/obj/structure/table/brass) else return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 764c96ec104a0..27504564c5614 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -99,7 +99,7 @@ if(user.a_intent == INTENT_HELP) pushed_mob.visible_message("[user] begins to place [pushed_mob] onto [src]...", \ "[user] begins to place [pushed_mob] onto [src]...") - if(do_after(user, 35, target = pushed_mob)) + if(do_after(user, 3.5 SECONDS, target = pushed_mob, show_to_target = TRUE)) tableplace(user, pushed_mob) else return @@ -217,7 +217,7 @@ skills_space = " quickly" carried_mob.visible_message("[user] begins to[skills_space] place [carried_mob] onto [src]...", "[user] begins to[skills_space] place [carried_mob] onto [src]...") - if(do_after(user, tableplace_delay, target = carried_mob)) + if(do_after(user, tableplace_delay, target = carried_mob, show_to_target = TRUE)) user.unbuckle_mob(carried_mob) tableplace(user, carried_mob) else @@ -727,7 +727,7 @@ return building = TRUE to_chat(user, "You start constructing a rack...") - if(do_after(user, 50, target = user)) + if(do_after(user, 5 SECONDS, target = user, add_item = src)) if(!user.temporarilyRemoveItemFromInventory(src)) return var/obj/structure/rack/R = new /obj/structure/rack(user.loc) diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm index b082356aa00a3..913df46749bdd 100644 --- a/code/game/objects/structures/transit_tubes/station.dm +++ b/code/game/objects/structures/transit_tubes/station.dm @@ -73,7 +73,7 @@ return for(var/obj/structure/transit_tube_pod/pod in loc) pod.visible_message("[user] starts putting [GM] into the [pod]!") - if(do_after(user, 15, target = src)) + if(do_after(user, 1.5 SECONDS, target = src)) if(open_status == STATION_TUBE_OPEN && GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.has_buckled_mobs()) GM.Paralyze(100) src.Bumped(GM) @@ -87,7 +87,7 @@ else if(open_status == STATION_TUBE_OPEN) if(pod.contents.len && user.loc != pod) user.visible_message("[user] starts emptying [pod]'s contents onto the floor.", "You start emptying [pod]'s contents onto the floor...") - if(do_after(user, 10, target = src)) //So it doesn't default to close_animation() on fail + if(do_after(user, 1 SECONDS, target = src)) //So it doesn't default to close_animation() on fail if(pod && pod.loc == loc) for(var/atom/movable/AM in pod) AM.forceMove(get_turf(user)) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index ddcdb05e101a7..21d4198962695 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -81,7 +81,7 @@ user.changeNext_move(CLICK_CD_BREAKOUT) user.last_special = world.time + CLICK_CD_BREAKOUT to_chat(user, "You start trying to escape from the pod...") - if(do_after(user, 600, target = src)) + if(do_after(user, 60 SECONDS, target = src)) to_chat(user, "You manage to open the pod.") empty_pod() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index fb4d5e1c3285e..736a64e47a7fd 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -38,7 +38,7 @@ if(open) GM.visible_message("[user] starts to give [GM] a swirlie!", "[user] starts to give you a swirlie...") swirlie = GM - if(do_after(user, 30, target = src, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(user, 3 SECONDS, target = src, timed_action_flags = IGNORE_HELD_ITEM)) GM.visible_message("[user] gives [GM] a swirlie!", "[user] gives you a swirlie!", "You hear a toilet flushing.") if(iscarbon(GM)) var/mob/living/carbon/C = GM @@ -228,7 +228,7 @@ /obj/structure/sinkframe/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/stack/sheet/plastic)) balloon_alert(user, "You start constructing a sink...") - if(do_after(user, 4 SECONDS, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = I)) I.use(1) balloon_alert(user, "You create a sink.") var/obj/structure/sink/new_sink = new /obj/structure/sink(loc) @@ -268,7 +268,7 @@ "You start washing your [washing_face ? "face" : "hands"]...") busy = TRUE - if(!do_after(user, 40, target = src)) + if(!do_after(user, 4 SECONDS, target = src)) busy = FALSE return @@ -337,7 +337,7 @@ if(user.a_intent != INTENT_HARM) to_chat(user, "You start washing [O]...") busy = TRUE - if(!do_after(user, 40, target = src)) + if(!do_after(user, 4 SECONDS, target = src)) busy = FALSE return 1 busy = FALSE diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index bdc4bb8cf90f4..20f601ed2a830 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -159,7 +159,7 @@ return to_chat(user, "You start to reinforce the windoor with plasteel...") - if(do_after(user,40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(!src || secure || P.get_amount() < 2) return @@ -175,7 +175,7 @@ else if(istype(W, /obj/item/stack/cable_coil) && anchored) user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(!src || !anchored || src.state != "01") return var/obj/item/stack/cable_coil/CC = W @@ -217,7 +217,7 @@ user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(!src || electronics) W.forceMove(drop_location()) return @@ -242,7 +242,7 @@ user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(!src || electronics) qdel(AE) return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 9b4ccdb196164..e5133db644d11 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -737,7 +737,7 @@ return ..() if(istype(W, /obj/item/paper) && obj_integrity < max_integrity) user.visible_message("[user] starts to patch the holes in \the [src].") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src)) obj_integrity = min(obj_integrity+4,max_integrity) qdel(W) user.visible_message("[user] patches some of the holes in \the [src].") diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index c8171f581e529..6a77507a29d0b 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -98,9 +98,12 @@ ..() /turf/closed/mineral/attack_alien(mob/living/carbon/alien/M) + if(src in M.do_afters) + to_chat(M, "You're already digging into [src]!") + return to_chat(M, "You start digging into the rock...") playsound(src, 'sound/effects/break_stone.ogg', 50, 1) - if(do_after(M, 40, target = src)) + if(do_after(M, 4 SECONDS, target = src)) to_chat(M, "You tunnel into the rock.") gets_drilled(M) diff --git a/code/game/turfs/closed/wall/mineral_walls.dm b/code/game/turfs/closed/wall/mineral_walls.dm index b5c06cbb081c2..c709c042a93fc 100644 --- a/code/game/turfs/closed/wall/mineral_walls.dm +++ b/code/game/turfs/closed/wall/mineral_walls.dm @@ -163,10 +163,13 @@ /turf/closed/wall/mineral/wood/attackby(obj/item/W, mob/user) if(W.is_sharp() && W.force) + if(src in user.do_afters) + to_chat(user, "You're already taking apart [src]!") + return var/duration = (48/W.force) * 2 //In seconds, for now. if(istype(W, /obj/item/hatchet) || istype(W, /obj/item/fireaxe)) duration /= 4 //Much better with hatchets and axes. - if(do_after(user, duration*10, target=src)) //Into deciseconds. + if(do_after(user, duration*10, target=src, add_item = W)) //Into deciseconds. dismantle_wall(FALSE,FALSE) return return ..() diff --git a/code/game/turfs/open/floor/plating.dm b/code/game/turfs/open/floor/plating.dm index 3e92a6bb566e0..cb0876eb3a66e 100644 --- a/code/game/turfs/open/floor/plating.dm +++ b/code/game/turfs/open/floor/plating.dm @@ -74,8 +74,11 @@ to_chat(user, "You need one sheet to make a reinforced floor!") return else + if(src in user.do_afters) + to_chat(user, "You're already trying to reinforce [src]!") + return to_chat(user, "You begin reinforcing the floor...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, add_item = C)) if (R.get_amount() >= 1 && !istype(src, /turf/open/floor/engine)) PlaceOnTop(/turf/open/floor/engine, flags = CHANGETURF_INHERIT_AIR) playsound(src, 'sound/items/deconstruct.ogg', 80, 1) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index f56ae01bdb9d5..f8ab8e78b3bbd 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -366,12 +366,12 @@ GLOBAL_LIST_EMPTY(created_baseturf_lists) return if(length(src_object.contents())) balloon_alert(usr, "You dump out the contents.") - if(!do_after(usr,20,target=src_object.parent)) + if(!do_after(usr, 2 SECONDS, target=src_object.parent, add_item = src_object.parent)) return FALSE var/list/things = src_object.contents() var/datum/progressbar/progress = new(user, things.len, src) - while (do_after(usr, 10, src, progress = FALSE, extra_checks = CALLBACK(src_object, TYPE_PROC_REF(/datum/component/storage, mass_remove_from_storage), src, things, progress))) + while (do_after(usr, 1 SECONDS, src, progress = FALSE, extra_checks = CALLBACK(src_object, TYPE_PROC_REF(/datum/component/storage, mass_remove_from_storage), src, things, progress))) stoplag(1) qdel(progress) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 8922b68e23d64..ced5f20f63637 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -239,8 +239,11 @@ if(get_dist(target,user)>1) to_chat(user, "You need to be next to the specimen to prepare it for transport!") return + if(target in user.do_afters) + to_chat(user, "You're already trying to prepare [target] for transport!") + return to_chat(user, "You begin preparing [target] for transport...") - if(do_after(user, 100, target = target)) + if(do_after(user, 10 SECONDS, target = target, show_to_target = TRUE, add_item = src)) marked = target to_chat(user, "You finish preparing [target] for transport.") @@ -556,10 +559,13 @@ Congratulations! You are now trained for invasive xenobiology research!"} var/mob/living/carbon/C = L if(!C.handcuffed) if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()) + if(C in user.do_afters) + to_chat(user, "You're already trying to restrain [C]!") + return playsound(src, 'sound/weapons/cablecuff.ogg', 30, TRUE, -2) C.visible_message("[user] begins restraining [C] with [src]!", \ "[user] begins shaping an energy field around your hands!") - if(do_after(user, 3 SECONDS, C) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) + if(do_after(user, 3 SECONDS, C, show_to_target = TRUE, add_item = src) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())) if(!C.handcuffed) C.handcuffed = new /obj/item/restraints/handcuffs/energy/used(C) C.update_handcuffed() @@ -779,8 +785,11 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(P.get_amount() < 1) to_chat(user, "You need one alien alloy sheet to do this!") return + if(src in user.do_afters) + to_chat(user, "You're already adding something to [src]!") + return to_chat(user, "You start adding [P] to [src]...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = I)) P.use(1) new /obj/structure/table/abductor(src.loc) qdel(src) @@ -790,8 +799,11 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(P.get_amount() < 1) to_chat(user, "You need one sheet of silver to do this!") return + if(src in user.do_afters) + to_chat(user, "You're already adding something to [src]!") + return to_chat(user, "You start adding [P] to [src]...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = P)) P.use(1) new /obj/structure/table/optable/abductor(src.loc) qdel(src) diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index e56a20a22cee3..aaa6eb5946db2 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -51,8 +51,11 @@ if(.) return if(!HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING) && !HAS_TRAIT(user.mind, TRAIT_ABDUCTOR_TRAINING)) + if(src in user.do_afters) + to_chat(user, "You're already trying your best here!") + return to_chat(user, "You start mashing alien buttons at random!") - if(do_after(user,100, target = src)) + if(do_after(user, 10 SECONDS, target = src)) TeleporterSend() /obj/machinery/abductor/console/ui_status(mob/user) diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm index 42ca6bea048be..fa56dfff5fefc 100644 --- a/code/modules/antagonists/abductor/machinery/experiment.dm +++ b/code/modules/antagonists/abductor/machinery/experiment.dm @@ -13,7 +13,7 @@ var/flash = "Awaiting subject." var/obj/machinery/abductor/console/console var/message_cooldown = 0 - var/breakout_time = 450 + var/breakout_time = 45 SECONDS /obj/machinery/abductor/experiment/MouseDrop_T(mob/target, mob/user) var/mob/living/L = user diff --git a/code/modules/antagonists/clock_cult/items/integration_cog.dm b/code/modules/antagonists/clock_cult/items/integration_cog.dm index 6c2ba0c8b3b38..cdced054b99e7 100644 --- a/code/modules/antagonists/clock_cult/items/integration_cog.dm +++ b/code/modules/antagonists/clock_cult/items/integration_cog.dm @@ -16,16 +16,22 @@ return if(!A.panel_open) //Cut open the panel + if(A in user.do_afters) + to_chat(user, "You're already trying to cut open \the [A]!") + return to_chat(user, "You begin cutting open \the [A].") - if(do_after(user, 50, target=A)) + if(do_after(user, 5 SECONDS, target=A, add_item = src)) to_chat(user, "You cut open \the [A] with \the [src].") A.panel_open = TRUE A.update_icon() return return //Insert the cog + if(src in user.do_afters) + to_chat(user, "You're already trying to insert \the [src] into \the [A]!") + return to_chat(user, "You begin inserting \the [src] into \the [A].") - if(do_after(user, 40, target=A)) + if(do_after(user, 4 SECONDS, target=A, add_item = src)) A.integration_cog = src forceMove(A) A.panel_open = FALSE diff --git a/code/modules/antagonists/clock_cult/items/replica_fabricator.dm b/code/modules/antagonists/clock_cult/items/replica_fabricator.dm index 3ede705c2568a..c0d1089d0417c 100644 --- a/code/modules/antagonists/clock_cult/items/replica_fabricator.dm +++ b/code/modules/antagonists/clock_cult/items/replica_fabricator.dm @@ -47,8 +47,14 @@ if(C.max_integrity == C.obj_integrity) to_chat(user, "\The [C] is already repaired!") return + if(target in user.do_afters) + to_chat(user, "You're already trying to repair [target]!") + return to_chat(user, "You begin repairing [C]...") - if(do_after(user, 60, target=target)) + var/speed_mult = 1 + while(GLOB.clockcult_power >= 200) + if(!do_after(user, 6 SECONDS * speed_mult, target=target, add_item = src)) + return if(C.max_integrity == C.obj_integrity) to_chat(user, "\The [C] is already repaired!") return @@ -58,8 +64,8 @@ GLOB.clockcult_power -= 200 to_chat(user, "You repair some of the damage on \the [C].") C.obj_integrity = clamp(C.obj_integrity + 15, 0, C.max_integrity) - else - to_chat(user, "You fail to repair the damage of \the [C]...") + if(speed_mult > 0.5) + speed_mult -= 0.15 /obj/item/clockwork/replica_fabricator/proc/fabricate_sheets(turf/target, mob/user) var/sheets = FLOOR(clamp(GLOB.clockcult_power / BRASS_POWER_COST, 0, 50), 1) diff --git a/code/modules/antagonists/clock_cult/mobs/clockwork_marauder.dm b/code/modules/antagonists/clock_cult/mobs/clockwork_marauder.dm index 2e7bfb21164af..30a40def170ea 100644 --- a/code/modules/antagonists/clock_cult/mobs/clockwork_marauder.dm +++ b/code/modules/antagonists/clock_cult/mobs/clockwork_marauder.dm @@ -87,12 +87,20 @@ GLOBAL_LIST_EMPTY(clockwork_marauders) to_chat(src, "You require a welding tool to repair your damaged shield!") /mob/living/simple_animal/hostile/clockwork_marauder/welder_act(mob/living/user, obj/item/I) - if(do_after(user, 25, target=src)) + if(src in user.do_afters) + to_chat(user, "You're already repairing [src]!") + return + var/speed_mult = 1 + while(shield_health < MARAUDER_SHIELD_MAX) + if(!do_after(user, 2.5 SECONDS * speed_mult, target=src, add_item = I)) + return TRUE health = min(health + 10, maxHealth) to_chat(user, "You repair some of [src]'s damage.") - if(shield_health < MARAUDER_SHIELD_MAX) - shield_health ++ - playsound(src, 'sound/magic/charge.ogg', 60, TRUE) + shield_health ++ + playsound(src, 'sound/magic/charge.ogg', 60, TRUE) + if(speed_mult > 0.25) + speed_mult -= 0.15 + to_chat(user, "You finish repairing [src]'s damage.") return TRUE #undef MARAUDER_SHIELD_RECHARGE diff --git a/code/modules/antagonists/clock_cult/mobs/eminence.dm b/code/modules/antagonists/clock_cult/mobs/eminence.dm index 06056a2d9e95f..fa8b0a7db7e4c 100644 --- a/code/modules/antagonists/clock_cult/mobs/eminence.dm +++ b/code/modules/antagonists/clock_cult/mobs/eminence.dm @@ -276,7 +276,7 @@ to_chat(E, "You begin recalling [L]...") to_chat(L, "The Eminence is summoning you...") L.visible_message("[L] flares briefly.") - if(do_after(E, 70, target=L)) + if(do_after(E, 7 SECONDS, target=L)) L.visible_message("[L] phases out of existence!") var/turf/T = get_turf(pick(GLOB.servant_spawns)) try_warp_servant(L, T, FALSE) diff --git a/code/modules/antagonists/clock_cult/scriptures/hateful_manacles.dm b/code/modules/antagonists/clock_cult/scriptures/hateful_manacles.dm index aa9c63c8f0e86..a2dc923605881 100644 --- a/code/modules/antagonists/clock_cult/scriptures/hateful_manacles.dm +++ b/code/modules/antagonists/clock_cult/scriptures/hateful_manacles.dm @@ -24,10 +24,17 @@ if(M.handcuffed) to_chat(invoker, "[M] is already restrained!") return FALSE + if(M in invoker.do_afters) + to_chat(invoker, "You're already trying to restrain [M]!") + return FALSE playsound(M, 'sound/weapons/handcuffs.ogg', 30, TRUE, -2) M.visible_message("[invoker] forms a well of energy around [M], brass appearing at their wrists!",\ "[invoker] is trying to restrain you!") - if(do_after(invoker, 30, target=M)) + var/atom/movable/fake_atom = new + var/atom/fake_result = /obj/item/restraints/handcuffs/clockwork + fake_atom.icon = initial(fake_result.icon) + fake_atom.icon_state = initial(fake_result.icon_state) + if(do_after(invoker, 3 SECONDS, target=M, show_to_target = TRUE, add_item = fake_atom)) if(M.handcuffed) return FALSE M.handcuffed = new /obj/item/restraints/handcuffs/clockwork(M) diff --git a/code/modules/antagonists/clock_cult/scriptures/stargazer.dm b/code/modules/antagonists/clock_cult/scriptures/stargazer.dm index 4edfa82546b6e..1ad7f98cad9b8 100644 --- a/code/modules/antagonists/clock_cult/scriptures/stargazer.dm +++ b/code/modules/antagonists/clock_cult/scriptures/stargazer.dm @@ -108,7 +108,7 @@ to_chat(user, "[I] has already been enhanced!") return to_chat(user, "You begin placing [I] onto [src].") - if(do_after(user, 60, target=I)) + if(do_after(user, 6 SECONDS, target=I)) if(cooldowntime > world.time) to_chat(user, "[src] is still warming up, it will be ready in [DisplayTimeText(cooldowntime - world.time)].") return diff --git a/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm b/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm index 55eb9795502b5..90d9ebfbda600 100644 --- a/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm +++ b/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm @@ -40,7 +40,7 @@ button_icon_state = "warp_cancel" owner.update_action_buttons_icon() var/mob/previous_mob = owner - if(do_after(M, 50, target=target_loc, extra_checks=CALLBACK(src, PROC_REF(special_check)))) + if(do_after(M, 5 SECONDS, target=target_loc, extra_checks=CALLBACK(src, PROC_REF(special_check)))) try_warp_servant(M, target_loc, 50, FALSE) var/obj/machinery/computer/camera_advanced/console = cam.origin console.remove_eye_control(M) diff --git a/code/modules/antagonists/clock_cult/structure/dimensional_rift.dm b/code/modules/antagonists/clock_cult/structure/dimensional_rift.dm index 5a904c68d3649..3219406a1142e 100644 --- a/code/modules/antagonists/clock_cult/structure/dimensional_rift.dm +++ b/code/modules/antagonists/clock_cult/structure/dimensional_rift.dm @@ -26,7 +26,7 @@ return if(ismob(M)) to_chat(M, "You begin climbing into the rift.") - if(do_after(M, 50, target=src)) + if(do_after(M, 5 SECONDS, target=src)) var/obj/effect/landmark/city_of_cogs/target_spawn = pick(GLOB.city_of_cogs_spawns) var/turf/T = get_turf(target_spawn) do_teleport(M, T, no_effects = TRUE, channel = TELEPORT_CHANNEL_FREE, forced = TRUE) diff --git a/code/modules/antagonists/clock_cult/structure/wall_gear.dm b/code/modules/antagonists/clock_cult/structure/wall_gear.dm index 660335d99f739..deb4a6c0a750f 100644 --- a/code/modules/antagonists/clock_cult/structure/wall_gear.dm +++ b/code/modules/antagonists/clock_cult/structure/wall_gear.dm @@ -50,8 +50,11 @@ if(locate(/obj/structure/falsewall) in T.contents) to_chat(user, "There is already a false wall present!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to add [W] to [src]!") + return to_chat(user, "You start adding [W] to [src]...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) var/brass_floor = FALSE if(istype(T, /turf/open/floor/clockwork)) //if the floor is already brass, costs less to make(conservation of masssssss) brass_floor = TRUE diff --git a/code/modules/antagonists/clock_cult/traps/receivers/skewer.dm b/code/modules/antagonists/clock_cult/traps/receivers/skewer.dm index 377d63f93a9c5..72dd743151907 100644 --- a/code/modules/antagonists/clock_cult/traps/receivers/skewer.dm +++ b/code/modules/antagonists/clock_cult/traps/receivers/skewer.dm @@ -50,7 +50,7 @@ if(!buckled_mob.break_do_after_checks()) return to_chat(buckled_mob, "You begin climbing out of [src].") - if(do_after(buckled_mob, 50, target=src)) + if(do_after(buckled_mob, 5 SECONDS, target=src)) . = ..() else to_chat(buckled_mob, "You fail to detach yourself from [src].") diff --git a/code/modules/antagonists/clock_cult/traps/trap.dm b/code/modules/antagonists/clock_cult/traps/trap.dm index 4de6d647db0bf..33707f025e0ed 100644 --- a/code/modules/antagonists/clock_cult/traps/trap.dm +++ b/code/modules/antagonists/clock_cult/traps/trap.dm @@ -50,8 +50,11 @@ /obj/structure/destructible/clockwork/trap/wrench_act(mob/living/user, obj/item/I) . = ..() + if(src in user.do_afters) + to_chat(user, "You're already unwrenching [src]!") + return to_chat(user, "You begin unwrenching [src]...") - if(do_after(user, 50, target=src)) + if(do_after(user, 5 SECONDS, target=src, add_item = I)) to_chat(user, "You detach [src], clearing all the connections associated with it.") new unwrench_path(get_turf(src)) qdel(src) diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 8eeb79dbdb4c9..14e2861129345 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -517,10 +517,13 @@ /obj/item/melee/blood_magic/shackles/proc/CuffAttack(mob/living/carbon/C, mob/living/user) if(!C.handcuffed) + if(C in user.do_afters) + to_chat(user, "You're already trying to restrain [C]!") + return playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) C.visible_message("[user] begins restraining [C] with dark magic!", \ "[user] begins shaping dark magic shackles around your wrists!") - if(do_after(user, 3 SECONDS, C)) + if(do_after(user, 3 SECONDS, C, show_to_target = TRUE)) if(!C.handcuffed) C.handcuffed = new /obj/item/restraints/handcuffs/energy/cult/used(C) C.update_handcuffed() @@ -597,7 +600,7 @@ playsound(T, 'sound/machines/airlock_alien_prying.ogg', 80, 1) var/prev_color = candidate.color candidate.color = "black" - if(do_after(user, 90, target = candidate)) + if(do_after(user, 9 SECONDS, target = candidate, show_to_target = TRUE, add_item = src)) candidate.emp_act(EMP_HEAVY) var/construct_class = alert(user, "Please choose which type of construct you wish to create.",,"Juggernaut","Wraith","Artificer") if(QDELETED(candidate)) @@ -630,7 +633,7 @@ channeling = TRUE playsound(T, 'sound/machines/airlockforced.ogg', 50, 1) do_sparks(5, TRUE, target) - if(do_after(user, 50, target = user)) + if(do_after(user, 5 SECONDS, target = user, add_item = src)) if(QDELETED(target)) channeling = FALSE return diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index 5f30e3fc67785..f21327ffec66a 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -168,7 +168,7 @@ if(!LAZYLEN(destinations)) to_chat(owner, "You need more space to summon your cult!") return - if(do_after(owner, 30, target = owner)) + if(do_after(owner, 3 SECONDS, target = owner)) for(var/datum/mind/B in antag.cult_team.members) if(B.current && B.current.stat != DEAD) var/turf/mobloc = get_turf(B.current) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index ddd669818fc8d..087428be061de 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -822,11 +822,11 @@ Striking a noncultist, however, will tear their flesh."} return charging = TRUE INVOKE_ASYNC(src, PROC_REF(charge), user) - if(do_after(user, 90, target = user)) + if(do_after(user, 9 SECONDS, target = user)) firing = TRUE INVOKE_ASYNC(src, PROC_REF(pewpew), user, params) var/obj/structure/emergency_shield/invoker/N = new(user.loc) - if(do_after(user, 90, target = user)) + if(do_after(user, 9 SECONDS, target = user)) user.Paralyze(40) to_chat(user, "You have exhausted the power of this spell!") firing = FALSE diff --git a/code/modules/antagonists/cult/rune_spawn_action.dm b/code/modules/antagonists/cult/rune_spawn_action.dm index dc1b0c0109b65..49f349cc6b662 100644 --- a/code/modules/antagonists/cult/rune_spawn_action.dm +++ b/code/modules/antagonists/cult/rune_spawn_action.dm @@ -6,7 +6,7 @@ var/obj/effect/rune/rune_type var/cooldown = 0 var/base_cooldown = 1800 - var/scribe_time = 60 + var/scribe_time = 6 SECONDS var/damage_interrupt = TRUE var/action_interrupt = TRUE var/obj/effect/temp_visual/cult/rune_spawn/rune_word_type diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 3dc4b39cd7727..66c9178b3812c 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -543,8 +543,11 @@ structure_check() searches for nearby cultist structures required for the invoca /obj/effect/rune/narsie/attackby(obj/I, mob/user, params) //Since the narsie rune takes a long time to make, add logging to removal. if((istype(I, /obj/item/melee/cultblade/dagger) && iscultist(user))) + if(src in user.do_afters) + to_chat(user, "You're already trying to erase [src]!") + return user.visible_message("[user.name] begins erasing [src]...", "You begin erasing [src]...") - if(do_after(user, 50, target = src)) //Prevents accidental erasures. + if(do_after(user, 5 SECONDS, target = src, add_item = I)) //Prevents accidental erasures. log_game("Summon Narsie rune erased by [key_name(user)] with [I.name]") message_admins("[ADMIN_LOOKUPFLW(user)] erased a Narsie rune with [I.name]") ..() diff --git a/code/modules/antagonists/fugitive/fugitive_ship.dm b/code/modules/antagonists/fugitive/fugitive_ship.dm index 9a609b98f890c..678ced29b24f3 100644 --- a/code/modules/antagonists/fugitive/fugitive_ship.dm +++ b/code/modules/antagonists/fugitive/fugitive_ship.dm @@ -15,7 +15,7 @@ resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF var/locked = FALSE var/message_cooldown - var/breakout_time = 600 + var/breakout_time = 60 SECONDS /obj/machinery/fugitive_capture/power_change() ..() diff --git a/code/modules/antagonists/heretic/magic/manse_link.dm b/code/modules/antagonists/heretic/magic/manse_link.dm index 7663374451904..0e91856e83d35 100644 --- a/code/modules/antagonists/heretic/magic/manse_link.dm +++ b/code/modules/antagonists/heretic/magic/manse_link.dm @@ -23,7 +23,7 @@ to_chat(originator, "You begin linking [target]'s mind to yours...") to_chat(target, "You feel your mind being pulled... connected... intertwined with the very fabric of reality...") - if(!do_after(originator, 6 SECONDS, target = target)) + if(!do_after(originator, 6 SECONDS, target = target, show_to_target = TRUE)) return if(!originator.link_mob(target)) to_chat(originator, "You can't seem to link [target]'s mind...") diff --git a/code/modules/antagonists/heretic/structures/carving_knife.dm b/code/modules/antagonists/heretic/structures/carving_knife.dm index 75561fe8922e3..8a35f5b755347 100644 --- a/code/modules/antagonists/heretic/structures/carving_knife.dm +++ b/code/modules/antagonists/heretic/structures/carving_knife.dm @@ -113,7 +113,7 @@ target_turf.balloon_alert(user, "You begin carving the [picked_choice]") user.playsound_local(target_turf, 'sound/items/sheath.ogg', 50, TRUE) - if(!do_after(user, 5 SECONDS, target = target_turf)) + if(!do_after(user, 5 SECONDS, target = target_turf, add_item = src)) target_turf.balloon_alert(user, "Interrupted") return diff --git a/code/modules/antagonists/hivemind/hiveui.dm b/code/modules/antagonists/hivemind/hiveui.dm index ca3ee7ff58510..f8160bde1dafd 100644 --- a/code/modules/antagonists/hivemind/hiveui.dm +++ b/code/modules/antagonists/hivemind/hiveui.dm @@ -55,7 +55,7 @@ to_chat(ourhive, "We don't have any tracking charges!") return hivehost.searchcharge -= 1 - if(!do_after(ourhive, 5, ourhive, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(ourhive, 0.5 SECONDS, ourhive, timed_action_flags = IGNORE_HELD_ITEM)) to_chat(ourhive, "Our concentration has been broken!") else for(var/datum/antagonist/hivemind/hivehosts in GLOB.hivehosts) diff --git a/code/modules/antagonists/hivemind/spells/hivemind_heal.dm b/code/modules/antagonists/hivemind/spells/hivemind_heal.dm index 25858317d5bc2..cfcbb2522ebdf 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_heal.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_heal.dm @@ -26,7 +26,7 @@ to_chat(user, "We begin siphoning power from our many vessels!") while(iterations < 7) var/mob/living/carbon/target = pick(carbon_members) - if(!do_after(user, 15, user, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(user, 1.5 SECONDS, user, timed_action_flags = IGNORE_HELD_ITEM)) to_chat(user, "Our concentration has been broken!") break if(!target) diff --git a/code/modules/antagonists/hivemind/spells/hivemind_invasion.dm b/code/modules/antagonists/hivemind/spells/hivemind_invasion.dm index fbf095c82de9c..5dc0d7d34421a 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_invasion.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_invasion.dm @@ -22,10 +22,10 @@ var/list/enemies = list() to_chat(user, "We begin probing [target.name]'s mind!") - if(do_after(user, 50, target, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(user, 5 SECONDS, target, timed_action_flags = IGNORE_HELD_ITEM)) if(!in_hive) to_chat(user, "Their mind slowly opens up to us.") - if(!do_after(user, 75, target, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(user, 7.5 SECONDS, target, timed_action_flags = IGNORE_HELD_ITEM)) to_chat(user, "Our concentration has been broken!") revert_cast() return diff --git a/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm b/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm index d2851245c5e2e..562923381a928 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm @@ -19,7 +19,7 @@ to_chat(target, "Powerful mental attacks strike out against us, our training allows us to barely overcome it.") return if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) - if(!do_after(user,200, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(user, 20 SECONDS, timed_action_flags = IGNORE_HELD_ITEM)) for(var/obj/item/implant/mindshield/M in target.implants) to_chat(user, "We shatter their mental protections!") to_chat(target, "You feel a pang of pain course through your head!") diff --git a/code/modules/antagonists/hivemind/spells/hivemind_shock.dm b/code/modules/antagonists/hivemind/spells/hivemind_shock.dm index 8e30048387fc2..f64659c3f7b42 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_shock.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_shock.dm @@ -12,7 +12,7 @@ to_chat(user, "This is a bug. Error:HIVE1") return to_chat(user, "We begin increasing the psionic bandwidth between ourself and the vessel!") - if(do_after(user, 30, user, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(user, 3 SECONDS, user, timed_action_flags = IGNORE_HELD_ITEM)) if(target.mind.assigned_role in (GLOB.security_positions || GLOB.command_positions)) //Doesn't work on sec or command for balance reasons to_chat(user, "A subconsciously trained response barely protects [target.name]'s mind.") to_chat(target, "Powerful mental attacks strike out against us, our training allows us to barely overcome it.") diff --git a/code/modules/antagonists/morph/morph.dm b/code/modules/antagonists/morph/morph.dm index e905396df204f..2aa97da6db77f 100644 --- a/code/modules/antagonists/morph/morph.dm +++ b/code/modules/antagonists/morph/morph.dm @@ -243,7 +243,7 @@ if(L.stat) if(L.stat == DEAD) eat(L) - else if(do_after(src, 30, target = L)) //Don't Return after this, it's important that the morph can attack softcrit targets to bring them into hardcrit + else if(do_after(src, 3 SECONDS, target = L)) //Don't Return after this, it's important that the morph can attack softcrit targets to bring them into hardcrit eat(L) else if(isitem(target)) //Eat items for later use var/obj/item/I = target diff --git a/code/modules/antagonists/nukeop/equipment/borgchameleon.dm b/code/modules/antagonists/nukeop/equipment/borgchameleon.dm index 207e1c5f2eb8d..d4a1b60c70e53 100644 --- a/code/modules/antagonists/nukeop/equipment/borgchameleon.dm +++ b/code/modules/antagonists/nukeop/equipment/borgchameleon.dm @@ -65,7 +65,7 @@ to_chat(user, "You activate \the [src].") playsound(src, 'sound/effects/seedling_chargeup.ogg', 100, TRUE, -6) apply_wibbly_filters(user) - if (do_after(user, 50, target=user) && user.cell.use(activationCost)) + if (do_after(user, 5 SECONDS, target=user, add_item = src) && user.cell.use(activationCost)) playsound(src, 'sound/effects/bamf.ogg', 100, 1, -6) to_chat(user, "You are now disguised as the Nanotrasen engineering borg \"[friendlyName]\".") activate(user) diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm index 946ea478f5c5a..06534b9f3b37b 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm @@ -133,7 +133,7 @@ if(istype(I, /obj/item/nuke_core_container)) var/obj/item/nuke_core_container/core_box = I to_chat(user, "You start loading the plutonium core into [core_box]...") - if(do_after(user,50,target=src)) + if(do_after(user, 5 SECONDS, target=src, add_item = I)) if(core_box.load(core, user)) to_chat(user, "You load the plutonium core into [core_box].") deconstruction_state = NUKESTATE_CORE_REMOVED diff --git a/code/modules/antagonists/overthrow/overthrow_converter.dm b/code/modules/antagonists/overthrow/overthrow_converter.dm index acbdce11e49eb..a3aeb3bb9e2db 100644 --- a/code/modules/antagonists/overthrow/overthrow_converter.dm +++ b/code/modules/antagonists/overthrow/overthrow_converter.dm @@ -40,8 +40,11 @@ if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) to_chat(user, "This mind is too strong to convert, try to remove whatever is protecting it first!") return + if(M in user.do_afters) + to_chat(user, "You're already trying to implant [src]!") + return M.visible_message("[user] is attempting to implant [M].") - if(do_after(user, 5 SECONDS, M)) + if(do_after(user, 5 SECONDS, M, show_to_target = TRUE, add_item = src)) if(convert(M,user)) M.visible_message("[user] has implanted [M].", "[user] implants you.") uses-- diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 230014931f5f6..3daf2b1f3174a 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -80,7 +80,7 @@ draining = TRUE essence_drained += rand(15, 20) to_chat(src, "You search for the soul of [target].") - if(do_after(src, rand(10, 20), target, timed_action_flags = IGNORE_HELD_ITEM)) //did they get deleted in that second? + if(do_after(src, rand(1 SECONDS, 2 SECONDS), target, timed_action_flags = IGNORE_HELD_ITEM, show_to_target = TRUE)) //did they get deleted in that second? if(target.ckey) to_chat(src, "[target.p_their(TRUE)] soul burns with intelligence.") essence_drained += rand(20, 30) @@ -89,7 +89,7 @@ essence_drained += rand(40, 50) else to_chat(src, "[target.p_their(TRUE)] soul is weak and faltering.") - if(do_after(src, rand(15, 20), target, timed_action_flags = IGNORE_HELD_ITEM)) //did they get deleted NOW? + if(do_after(src, rand(1.5 SECONDS, 2 SECONDS), target, timed_action_flags = IGNORE_HELD_ITEM, show_to_target = TRUE)) //did they get deleted NOW? switch(essence_drained) if(1 to 30) to_chat(src, "[target] will not yield much essence. Still, every bit counts.") @@ -99,7 +99,7 @@ to_chat(src, "Such a feast! [target] will yield much essence to you.") if(90 to INFINITY) to_chat(src, "Ah, the perfect soul. [target] will yield massive amounts of essence to you.") - if(do_after(src, rand(15, 25), target, timed_action_flags = IGNORE_HELD_ITEM)) //how about now + if(do_after(src, rand(1.5 SECONDS, 2.5 SECONDS), target, timed_action_flags = IGNORE_HELD_ITEM, show_to_target = TRUE)) //how about now if(!target.stat && !target.stam_paralyzed) to_chat(src, "[target.p_theyre(TRUE)] now powerful enough to fight off your draining.") to_chat(target, "You feel something tugging across your body before subsiding.") @@ -121,7 +121,7 @@ draining = FALSE return var/datum/beam/B = Beam(target,icon_state="drain_life") - if(do_after(src, 46, target, timed_action_flags = IGNORE_HELD_ITEM)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining. + if(do_after(src, 4.6 SECONDS, target, timed_action_flags = IGNORE_HELD_ITEM, show_to_target = TRUE)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining. change_essence_amount(essence_drained, FALSE, target) if(essence_drained <= 90 && target.stat != DEAD) essence_regen_cap += 5 @@ -182,7 +182,7 @@ return to_chat(user, "You start to concentrate recalling yourself to the station.") - if(do_after(user, 30) && !user.revealed) + if(do_after(user, 3 SECONDS) && !user.revealed) if(QDELETED(src)) // it's bad when someone spams this... return var/turf/targetturf = get_random_station_turf() diff --git a/code/modules/antagonists/space_dragon/carp_rift.dm b/code/modules/antagonists/space_dragon/carp_rift.dm index b2213c0c32a01..d62f6194d469a 100644 --- a/code/modules/antagonists/space_dragon/carp_rift.dm +++ b/code/modules/antagonists/space_dragon/carp_rift.dm @@ -36,7 +36,7 @@ owner.balloon_alert(S, "needs stable ground!") return to_chat(S, "You begin to open a rift...") - if(do_after(S, 100, target = S)) + if(do_after(S, 10 SECONDS, target = S)) for(var/obj/structure/carp_rift/c in rift_spawn_turf.contents) return var/obj/structure/carp_rift/CR = new /obj/structure/carp_rift(rift_spawn_turf) diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm index 4a67870fee818..ab13d764218bc 100644 --- a/code/modules/antagonists/swarmer/swarmer.dm +++ b/code/modules/antagonists/swarmer/swarmer.dm @@ -480,10 +480,13 @@ if(!is_station_level(z) && !is_mining_level(z)) to_chat(src, "Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area.") return - + var/mob/user = src + if(target in user.do_afters) + to_chat(user, "Already attempting to remove [target] from our presence!") + return to_chat(src, "Attempting to remove this being from our presence.") - if(!do_after(src, 3 SECONDS, target)) + if(!do_after(src, 3 SECONDS, target, show_to_target = TRUE)) return var/turf/open/floor/F diff --git a/code/modules/aquarium/aquarium.dm b/code/modules/aquarium/aquarium.dm index 5884be2514680..e36dac5faf885 100644 --- a/code/modules/aquarium/aquarium.dm +++ b/code/modules/aquarium/aquarium.dm @@ -107,8 +107,11 @@ if(glass.get_amount() < 2) to_chat(user, "You need two glass sheets to fix the case!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to fix [src]!") + return to_chat(user, "You start fixing [src]...") - if(do_after(user, 2 SECONDS, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = I)) glass.use(2) broken = FALSE obj_integrity = max_integrity @@ -152,6 +155,9 @@ if(living_pulled.buckled || living_pulled.has_buckled_mobs()) to_chat(user, "[living_pulled] is attached to something!") return + if(living_pulled in user.do_afters) + to_chat(user, "You're already trying to put [living_pulled] into [src]!") + return user.visible_message("[user] starts to put [living_pulled] into [src]!") if(do_after(user, 10 SECONDS, target = src)) if(QDELETED(living_pulled) || user.pulling != living_pulled || living_pulled.buckled || living_pulled.has_buckled_mobs()) @@ -165,6 +171,9 @@ ///Apply mood bonus depending on aquarium status /obj/structure/aquarium/proc/admire(mob/user) + if(src in user.do_afters) + to_chat(user, "You're already admiring [src]!") + return to_chat(user,"You take a moment to watch [src].") if(do_after(user, 5 SECONDS, target = src)) //Check if there are live fish - good mood diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index d2bc97a1b7ee7..5fee87bb6ea70 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -762,9 +762,12 @@ if(cable.get_amount() < 5) to_chat(user, "You need five lengths of cable to wire the air alarm!") return + if(src in user.do_afters) + to_chat(user, "You're already wiring \the [src]!") + return user.visible_message("[user.name] wires the air alarm.", \ "You start wiring the air alarm.") - if (do_after(user, 20, target = src)) + if (do_after(user, 2 SECONDS, target = src, add_item = W)) if (cable.get_amount() >= 5 && buildstage == 1) cable.use(5) to_chat(user, "You wire the air alarm.") diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index 144e47293cd2a..2643d4418d7c7 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -205,7 +205,10 @@ return !welded /obj/machinery/atmospherics/components/binary/dp_vent_pump/attack_alien(mob/user) - if(!welded || !(do_after(user, 20, target = src))) + if(src in user.do_afters) + to_chat(user, "You're already clawing away at \the [src]!") + return + if(!welded || !(do_after(user, 2 SECONDS, target = src))) return user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the dual-port vent.", "You hear loud scraping noises.") welded = FALSE diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index b0b41bc67b8b9..a4f9daca7b263 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -36,7 +36,7 @@ var/escape_in_progress = FALSE var/message_cooldown - var/breakout_time = 300 + var/breakout_time = 30 SECONDS fair_market_price = 10 dept_req_for_free = ACCOUNT_MED_BITFLAG @@ -315,8 +315,11 @@ if(L.incapacitated()) close_machine(target) else + if(target in user.do_afters) + to_chat(user, "You're already trying to shove [target] inside [src]!") + return user.visible_message("[user] starts shoving [target] inside [src].", "You start shoving [target] inside [src].") - if (do_after(user, 25, target=target)) + if (do_after(user, 2.5 SECONDS, target=target, show_to_target = TRUE)) close_machine(target) /obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 2ca277711ec29..09926d8f3f55d 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -288,7 +288,10 @@ return !welded /obj/machinery/atmospherics/components/unary/vent_pump/attack_alien(mob/user) - if(!welded || !(do_after(user, 20, target = src))) + if(src in user.do_afters) + to_chat(user, "You're already clawing away at \the [src]!") + return + if(!welded || !(do_after(user, 2 SECONDS, target = src))) return user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent.", "You hear loud scraping noises.") welded = FALSE diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 3d52054cab9c0..19a752e7b8e56 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -259,7 +259,10 @@ return !welded /obj/machinery/atmospherics/components/unary/vent_scrubber/attack_alien(mob/user) - if(!welded || !(do_after(user, 20, target = src))) + if(src in user.do_afters) + to_chat(user, "You're already clawing away at \the [src]!") + return + if(!welded || !(do_after(user, 2 SECONDS, target = src))) return user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.") welded = FALSE diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index e602f3b17804b..929cbf1e9c960 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -711,7 +711,7 @@ capture(user) /obj/machinery/control_point/proc/capture(mob/user) - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src)) for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF.ctf_enabled && (user.ckey in CTF.team_members)) controlling = CTF diff --git a/code/modules/bluespace_anchor/bluespace_anchor.dm b/code/modules/bluespace_anchor/bluespace_anchor.dm index eaf308910f6bc..588ceeab3e9b3 100644 --- a/code/modules/bluespace_anchor/bluespace_anchor.dm +++ b/code/modules/bluespace_anchor/bluespace_anchor.dm @@ -37,6 +37,9 @@ GLOBAL_LIST_EMPTY(active_bluespace_anchors) icon_state = "anchor_active" /obj/machinery/bluespace_anchor/attack_hand(mob/living/user) + if(src in user.do_afters) + to_chat(user, "You're already trying to deactivate [src]!") + return user.visible_message("[user] starts deactivating [src].", "You begin deactivating [src]...") //Failing to deactivate it if(!do_after(user, 8 SECONDS, target = src)) diff --git a/code/modules/bluespace_anchor/bluespace_anchor_deployer.dm b/code/modules/bluespace_anchor/bluespace_anchor_deployer.dm index ff29cdc103989..f5f0c44cf4f18 100644 --- a/code/modules/bluespace_anchor/bluespace_anchor_deployer.dm +++ b/code/modules/bluespace_anchor/bluespace_anchor_deployer.dm @@ -39,6 +39,9 @@ set_cell(null) /obj/item/bluespace_anchor/attack_self(mob/user) + if(src in user.do_afters) + to_chat(user, "You're already attempting to deploy [src]!") + return user.visible_message("[user] begins deploying [src].", "You begin deploying [src]...") if(!do_after(user, 4 SECONDS, target = src)) return diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 2161a31b30e1f..4f84cf185e73c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -322,9 +322,12 @@ BLIND // can't see anything update_sensors(sensor_selection) else if(istype(src.loc, /mob)) var/mob/living/carbon/human/wearer = src.loc + if(wearer in user.do_afters) + to_chat(user, "You're already trying to set [wearer]'s sensors!") + return wearer.visible_message("[user] tries to set [wearer]'s sensors.", \ "[user] is trying to set your sensors.", null, COMBAT_MESSAGE_RANGE) - if(do_after(user, SENSOR_CHANGE_DELAY, wearer)) + if(do_after(user, SENSOR_CHANGE_DELAY, wearer, show_to_target = TRUE, add_item = src)) switch(sensor_selection) if(SENSORS_OFF) wearer.visible_message("[user] disables [wearer]'s remote sensing equipment.", \ diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index acd01cd5bb2fe..5b0de64d84a54 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -117,10 +117,13 @@ if(get_dist(A, user) <= 1 ) return FALSE if(user in viewers(range, A)) + if(A in user.do_afters) + to_chat(user, "You're already trying to manipulate [A]!") + return user.visible_message("[user] waves their hands at [A]", "You begin manipulating [A].") new /obj/effect/temp_visual/telegloves(A.loc) user.changeNext_move(CLICK_CD_MELEE) - if(do_after(user, 0.8 SECONDS, A)) + if(do_after(user, 0.8 SECONDS, A, add_item = src)) new /obj/effect/temp_visual/telekinesis(user.loc) playsound(user, 'sound/weapons/emitter2.ogg', 25, 1, -1) A.attack_hand(user) diff --git a/code/modules/clothing/shoes/color.dm b/code/modules/clothing/shoes/color.dm index 6fc4f00a6e3ef..1af344dab70c4 100644 --- a/code/modules/clothing/shoes/color.dm +++ b/code/modules/clothing/shoes/color.dm @@ -84,8 +84,11 @@ if(ishuman(user)) var/mob/living/carbon/human/hummie = user if(hummie.shoes == src && chained) + if(src in user.do_afters) + to_chat(user, "You're already trying to take off your [src]!") + return to_chat(hummie, "You start taking off your [src]!") - if(!do_after(hummie,15 SECONDS, src)) + if(!do_after(hummie, 15 SECONDS, src, add_item = src)) return FALSE return ..() @@ -94,7 +97,10 @@ if(ishuman(m)) var/mob/living/carbon/human/hummie = m if(hummie.shoes == src && chained) + if(src in hummie.do_afters) + to_chat(hummie, "You're already trying to take off your [src]!") + return to_chat(hummie, "You start taking off your [src]!") - if(!do_after(hummie,15 SECONDS, src)) + if(!do_after(hummie, 15 SECONDS, src, add_item = src)) return FALSE return ..() diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index fe02a0db8ef40..160ca95582098 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -116,9 +116,12 @@ if(smile) to_chat(user, "Seems like someone already drew something on the helmet's visor.") else + if(src in user.do_afters) + to_chat(user, "You're already trying to draw on \the [src]!") + return var/obj/item/toy/crayon/CR = item to_chat(user, "You start drawing a smiley face on the helmet's visor..") - if(do_after(user, 25, target = src)) + if(do_after(user, 2.5 SECONDS, target = src)) smile = TRUE smile_color = CR.paint_color to_chat(user, "You draw a smiley on the helmet visor.") diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm index cf47d13e89488..300d0b010b0be 100755 --- a/code/modules/clothing/under/accessories.dm +++ b/code/modules/clothing/under/accessories.dm @@ -139,7 +139,7 @@ if(M.w_uniform) var/obj/item/clothing/under/U = M.w_uniform - var/delay = 20 + var/delay = 2 SECONDS if(user == M) delay = 0 else @@ -148,7 +148,10 @@ var/input if(!commended && user != M) input = stripped_input(user,"Please input a reason for this commendation, it will be recorded by Nanotrasen.", ,"", 140) - if(do_after(user, delay, target = M)) + if(M in user.do_afters) + to_chat(user, "You're already trying to attatch [src] to [M]'s clothing!") + return + if(do_after(user, delay, target = M, show_to_target = TRUE, add_item = src)) if(U.attach_accessory(src, user, 0)) //Attach it, do not notify the user of the attachment if(user == M) to_chat(user, "You attach [src] to [U].") diff --git a/code/modules/detectivework/footprints_and_rag.dm b/code/modules/detectivework/footprints_and_rag.dm index 3757f5c985c79..e05740c90c6f5 100644 --- a/code/modules/detectivework/footprints_and_rag.dm +++ b/code/modules/detectivework/footprints_and_rag.dm @@ -43,8 +43,11 @@ log_combat(user, C, "touched", src, log_object) else if(istype(A) && (src in user)) + if(A in user.do_afters) + to_chat(user, "You're already trying to wipe down [A]!") + return user.visible_message("[user] starts to wipe down [A] with [src]!", "You start to wipe down [A] with [src]...") - if(do_after(user,30, target = A)) + if(do_after(user, 3 SECONDS, target = A, show_to_target = TRUE, add_item = src)) user.visible_message("[user] finishes wiping off [A]!", "You finish wiping off [A].") SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM) A.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) diff --git a/code/modules/exploration_crew/discovery_research/discovery_scanner.dm b/code/modules/exploration_crew/discovery_research/discovery_scanner.dm index d43b84f4db65c..69d04a0e952d4 100644 --- a/code/modules/exploration_crew/discovery_research/discovery_scanner.dm +++ b/code/modules/exploration_crew/discovery_research/discovery_scanner.dm @@ -33,6 +33,9 @@ . = ..() /obj/item/discovery_scanner/proc/begin_scanning(mob/user, datum/component/discoverable/discoverable) + if(discoverable.parent in user.do_afters) + to_chat(user, "You're already trying to scan [discoverable.parent]!") + return to_chat(user, "You begin scanning [discoverable.parent]...") - if(do_after(user, 50, target=get_turf(user))) + if(do_after(user, 5 SECONDS, target=get_turf(user), add_item = src)) discoverable.discovery_scan(linked_techweb, user) diff --git a/code/modules/exploration_crew/exploration_explosives.dm b/code/modules/exploration_crew/exploration_explosives.dm index 771fa0838862d..6c27819180020 100644 --- a/code/modules/exploration_crew/exploration_explosives.dm +++ b/code/modules/exploration_crew/exploration_explosives.dm @@ -48,7 +48,7 @@ to_chat(user, "You start planting [src].") - if(do_after(user, 30, target = AM)) + if(do_after(user, 3 SECONDS, target = AM)) if(!user.temporarilyRemoveItemFromInventory(src)) return target = AM diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 8c5c3a584cfcd..20873cf03c87a 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -38,7 +38,7 @@ beingChugged = TRUE user.visible_message("[user] starts chugging [src].", \ "You start chugging [src].") - if(!do_after(user, target = M)) + if(!do_after(user, target = M, add_item = src)) return if(!reagents || !reagents.total_volume) return @@ -53,12 +53,19 @@ M.changeNext_move(CLICK_CD_MELEE * 0.5) //chug! chug! chug! else + if(M in user.do_afters) + to_chat(user, "You're already trying to feed [M] [src]'s contents!") + return M.visible_message("[user] attempts to feed [M] the contents of [src].", \ "[user] attempts to feed you the contents of [src].") - if(!do_after(user, target = M)) + var/drinking_time = 3 SECONDS + if(COOLDOWN_TIMELEFT(M, faster_feeding)) + drinking_time = drinking_time / 3 + if(!do_after(user, delay = drinking_time, target = M, show_to_target = TRUE, add_item = src)) return if(!reagents || !reagents.total_volume) - return // The drink might be empty after the delay, such as by spam-feeding + return // The drink might be empty after the delay + COOLDOWN_START(M, faster_feeding, 5 SECONDS) M.visible_message("[user] fed [M] the contents of [src].", \ "[user] fed you the contents of [src].") log_combat(user, M, "fed", reagents.log_list()) diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index 169a1832828d2..369eb6b48c04a 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -82,15 +82,22 @@ user.visible_message("[user] swallows some of the contents of \the [src].", \ "You swallow some of the contents of \the [src].") else + if(M in user.do_afters) + to_chat(user, "You're already trying to feed [M] [src]'s contents!") + return M.visible_message("[user] attempts to feed [M] from [src].", \ "[user] attempts to feed you from [src].") - if(!do_after(user, target = M)) + var/time_to_eat = 3 SECONDS + if(COOLDOWN_TIMELEFT(M, faster_feeding)) + time_to_eat = time_to_eat / 3 + if(!do_after(user, delay = time_to_eat, target = M, show_to_target = TRUE, add_item = src)) return if(!reagents || !reagents.total_volume) return // The condiment might be empty after the delay. M.visible_message("[user] fed [M] from [src].", \ "[user] fed you from [src].") log_combat(user, M, "fed", reagents.log_list()) + COOLDOWN_START(M, faster_feeding, 5 SECONDS) var/fraction = min(10/reagents.total_volume, 1) reagents.reaction(M, INGEST, fraction) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index c652c9fec38e7..3936b35ba722c 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -127,6 +127,9 @@ All foods are distributed among various categories. Use common sense. M.changeNext_move(CLICK_CD_MELEE * 0.5) //nom nom nom else if(!isbrain(M)) //If you're feeding it to someone else. + if(src in user.do_afters) + to_chat(user, "You're already trying to feed [M] \the [src]!") + return FALSE if(fullness <= (600 * (1 + M.overeatduration / 1000))) M.visible_message("[user] attempts to feed [M] [src].", \ "[user] attempts to feed you [src].") @@ -134,10 +137,13 @@ All foods are distributed among various categories. Use common sense. M.visible_message("[user] cannot force any more of [src] down [M]'s throat!", \ "[user] cannot force any more of [src] down your throat!") return FALSE - - if(!do_after(user, target = M)) + var/time_to_eat = 3 SECONDS + if(COOLDOWN_TIMELEFT(M, faster_feeding)) + time_to_eat = time_to_eat / 3 + if(!do_after(user, delay = time_to_eat, target = M, show_to_target = TRUE, add_item = src)) return log_combat(user, M, "fed", reagents.log_list()) + COOLDOWN_START(M, faster_feeding, 5 SECONDS) M.visible_message("[user] forces [M] to eat [src]!", \ "[user] forces you to eat [src]!") diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 4ac915e0d52c1..8a39c1694b6c0 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -90,6 +90,10 @@ to_chat(user, "Subject may not have abiotic items on.") return + if(src in user.do_afters) + to_chat(user, "You're already trying to put something into \the [src]!") + return + user.visible_message("[user] starts to put [C] into the gibber!") add_fingerprint(user) diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 06b94e2fe9941..885e1d934cead 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -148,12 +148,15 @@ return TRUE if(istype(O, /obj/item/soap) || istype(O, /obj/item/reagent_containers/glass/rag)) - var/cleanspeed = 50 + if(src in user.do_afters) + to_chat(user, "You're already trying to clean [src]!") + return + var/cleanspeed = 5 SECONDS if(istype(O, /obj/item/soap)) var/obj/item/soap/used_soap = O cleanspeed = used_soap.cleanspeed user.visible_message("[user] starts to clean \the [src].", "You start to clean \the [src]...") - if(do_after(user, cleanspeed, target = src)) + if(do_after(user, cleanspeed, target = src, add_item = O)) user.visible_message("[user] has cleaned \the [src].", "You clean \the [src].") dirty = 0 update_icon() diff --git a/code/modules/holoparasite/abilities/lesser/teleport.dm b/code/modules/holoparasite/abilities/lesser/teleport.dm index f9cef5df1516e..1f8a91089bf00 100644 --- a/code/modules/holoparasite/abilities/lesser/teleport.dm +++ b/code/modules/holoparasite/abilities/lesser/teleport.dm @@ -138,7 +138,7 @@ owner.do_attack_animation(target) owner.balloon_alert(owner, "attempting to warp", show_in_chat = FALSE) - if(!do_after(owner, 6 SECONDS, target, extra_checks = CALLBACK(src, PROC_REF(extra_do_after_checks), beacon))) + if(!do_after(owner, 6 SECONDS, target, show_to_target = TRUE, extra_checks = CALLBACK(src, PROC_REF(extra_do_after_checks), beacon))) to_chat(owner, "The warping process was interrupted, both you and your target must stay still!") return owner.balloon_alert(owner, "warped successfully", show_in_chat = FALSE) diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 193cd5237fe70..3f81901cc40b4 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -151,13 +151,16 @@ ui_update() return TRUE //no afterattack else if (istype(O, /obj/item/disk/design_disk)) + if(src in user.do_afters) + to_chat(user, "You're already trying to load [O] into \the [src]!") + return user.visible_message("[user] begins to load \the [O] in \the [src]...", "You begin to load a design from \the [O]...", "You hear the chatter of a floppy drive.") processing = TRUE ui_update() var/obj/item/disk/design_disk/D = O - if(do_after(user, 10, target = src)) + if(do_after(user, 1 SECONDS, target = src, add_item = D)) for(var/B in D.blueprints) if(B) stored_research.add_design(B) diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index c3aa666ccc97f..f1bd0d39f4ea6 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -42,8 +42,11 @@ qdel(src) /obj/item/seeds/kudzu/attack_self(mob/user) + if(src in user.do_afters) + to_chat(user, "You're already trying to plant kudzu here!") + return user.visible_message("[user] begins throwing seeds on the ground...") - if(do_after(user, 50, target = user.drop_location(), progress = TRUE)) + if(do_after(user, 5 SECONDS, target = user.drop_location(), progress = TRUE, add_item = src)) plant(user) to_chat(user, "You plant the kudzu. You monster.") diff --git a/code/modules/library/lib_codex_gigas.dm b/code/modules/library/lib_codex_gigas.dm index a0c01f6416051..376e3464a66ec 100644 --- a/code/modules/library/lib_codex_gigas.dm +++ b/code/modules/library/lib_codex_gigas.dm @@ -39,16 +39,16 @@ user.visible_message("[user] closes [title] without looking anything up.") return inUse = TRUE - var/speed = 300 + var/speed = 30 SECONDS var/correctness = 85 if(ishuman(user)) var/mob/living/carbon/human/U = user if(U.job in list(JOB_NAME_CURATOR)) // the curator is both faster, and more accurate than normal crew members at research - speed = 100 + speed = 10 SECONDS correctness = 100 correctness -= U.getOrganLoss(ORGAN_SLOT_BRAIN) * 0.5 //Brain damage makes researching hard. speed += U.getOrganLoss(ORGAN_SLOT_BRAIN) * 3 - if(do_after(user, speed, user, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(user, speed, user, timed_action_flags = IGNORE_HELD_ITEM, add_item = src)) var/usedName = devilName if(!prob(correctness)) usedName += "x" diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 0b27fdfa1f532..5a598ced9e234 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -308,8 +308,11 @@ to_chat(user, "[I]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'") else if((istype(I, /obj/item/knife) || I.tool_behaviour == TOOL_WIRECUTTER) && !(flags_1 & HOLOGRAM_1)) + if(src in user.do_afters) + to_chat(user, "You're already trying to carve out [title]!") + return to_chat(user, "You begin to carve out [title]...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, add_item = I)) to_chat(user, "You carve out the pages from [title]! You didn't want to read it anyway.") var/obj/item/storage/book/B = new B.name = src.name diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm index e25c4ed5a24e9..81e40e2f97cfa 100644 --- a/code/modules/library/soapstone.dm +++ b/code/modules/library/soapstone.dm @@ -6,7 +6,7 @@ throw_speed = 3 throw_range = 5 w_class = WEIGHT_CLASS_TINY - var/tool_speed = 50 + var/tool_speed = 5 SECONDS var/remaining_uses = 3 /obj/item/soapstone/Initialize(mapload) @@ -35,9 +35,12 @@ return if(existing_message) + if(src in user.do_afters) + to_chat(user, "You're already trying to erase [existing_message]!") + return user.visible_message("[user] starts erasing [existing_message].", "You start erasing [existing_message].", "You hear a chipping sound.") playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) - if(do_after(user, tool_speed, target = existing_message)) + if(do_after(user, tool_speed, target = existing_message, add_item = src)) user.visible_message("[user] erases [existing_message].", "You erase [existing_message][existing_message.creator_key == user.ckey ? ", refunding a use" : ""].") existing_message.persists = FALSE qdel(existing_message) @@ -57,9 +60,12 @@ if(CHAT_FILTER_CHECK(message)) to_chat(user, "That message contains prohibited word(s)! Try again.") return + if(src in user.do_afters) + to_chat(user, "You're already engraving a message into [T]!") + playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) user.visible_message("[user] starts engraving a message into [T]...", "You start engraving a message into [T]...", "You hear a chipping sound.") - if(can_use() && do_after(user, tool_speed, target = T) && can_use()) //This looks messy but it's actually really clever! + if(can_use() && do_after(user, tool_speed, target = T, add_item = src) && can_use()) //This looks messy but it's actually really clever! if(!locate(/obj/structure/chisel_message) in T) user.visible_message("[user] leaves a message for future spacemen!", "You engrave a message into [T]!", "You hear a chipping sound.") playsound(loc, 'sound/items/gavel.ogg', 50, 1, -1) diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 031c27d016f8f..9a81c7af4df71 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -196,10 +196,9 @@ interface with the mining shuttle at the landing site if a mobile beacon is also /obj/item/assault_pod/mining/attack_self(mob/living/user) if(setting) return - to_chat(user, "You begin setting the landing zone parameters...") setting = TRUE - if(!do_after(user, 50, target = user)) //You get a few seconds to cancel if you do not want to drop there. + if(!do_after(user, 5 SECONDS, target = user, add_item = src)) //You get a few seconds to cancel if you do not want to drop there. setting = FALSE return setting = FALSE diff --git a/code/modules/mining/equipment/marker_beacons.dm b/code/modules/mining/equipment/marker_beacons.dm index 27e31ef0f290b..808e7eee7c80d 100644 --- a/code/modules/mining/equipment/marker_beacons.dm +++ b/code/modules/mining/equipment/marker_beacons.dm @@ -106,6 +106,9 @@ GLOBAL_LIST_INIT(marker_beacon_colors, sort_list(list( . = ..() if(.) return + if(src in user.do_afters) + to_chat(user, "You're already trying to pick up \the [src]!") + return to_chat(user, "You start picking [src] up...") if(do_after(user, remove_speed, target = src)) var/obj/item/stack/marker_beacon/M = new(loc) @@ -122,6 +125,9 @@ GLOBAL_LIST_INIT(marker_beacon_colors, sort_list(list( /obj/structure/marker_beacon/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/stack/marker_beacon)) + if(src in user.do_afters) + to_chat(user, "You're already trying to pick up [src]!") + return var/obj/item/stack/marker_beacon/M = I to_chat(user, "You start picking [src] up...") if(do_after(user, remove_speed, target = src) && M.amount + 1 <= M.max_amount) diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm index 1198114e63252..7349c382b9a7f 100644 --- a/code/modules/mining/equipment/regenerative_core.dm +++ b/code/modules/mining/equipment/regenerative_core.dm @@ -83,9 +83,12 @@ to_chat(user, "[src] is useless on the dead.") return if(H != user) + if(H in user.do_afters) + to_chat(user, "You're already trying to smear \the [src] on [H]!") + return to_chat(user, "You begin to rub the regenerative core on [H]...") to_chat(H, "[user] begins to smear the regenerative core all over you...") - if(do_after(user, 3 SECONDS, H)) + if(do_after(user, 3 SECONDS, H, show_to_target = TRUE, add_item = src)) H.visible_message("[user] forces [H] to apply [src]... [H.p_they()] quickly regenerates all injuries!") SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "other")) else diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 2f62f52412d6b..bfbd4694be14c 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -60,8 +60,11 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) return if(A.anchored || (A.move_resist > max_force_fulton)) return + if(A in user.do_afters) + to_chat(user, "You're already trying to attack the pack to [A]!") + return to_chat(user, "You start attaching the pack to [A]...") - if(do_after(user,50,target=A)) + if(do_after(user, 5 SECONDS, target=A, show_to_target = TRUE, add_item = src)) to_chat(user, "You attach the pack to [A] and activate it.") if(loc == user && istype(user.back, /obj/item/storage/backpack)) var/obj/item/storage/backpack/B = user.back @@ -145,8 +148,12 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) icon_state = "subspace_amplifier" /obj/item/fulton_core/attack_self(mob/user) - if(do_after(user,15,target = user) && !QDELETED(src)) + if(src in user.do_afters) + to_chat(user, "You're already trying to place a beacon here!") + return + if(do_after(user, 1.5 SECONDS,target = user) && !QDELETED(src)) new /obj/structure/extraction_point(get_turf(user)) + to_chat(user, "You successfuly deploy the fulton recovery beacon at [get_turf(user)].") qdel(src) /obj/structure/extraction_point diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm index 041389a26c9f2..23205ded87313 100644 --- a/code/modules/mining/lavaland/ash_flora.dm +++ b/code/modules/mining/lavaland/ash_flora.dm @@ -14,7 +14,7 @@ var/harvest = /obj/item/reagent_containers/food/snacks/grown/ash_flora/shavings var/harvest_amount_low = 1 var/harvest_amount_high = 3 - var/harvest_time = 60 + var/harvest_time = 6 SECONDS var/harvest_message_low = "You pick a mushroom, but fail to collect many shavings from its cap." var/harvest_message_med = "You pick a mushroom, carefully collecting the shavings from its cap." var/harvest_message_high = "You harvest and collect shavings from several mushroom caps." @@ -62,8 +62,11 @@ /obj/structure/flora/ash/attackby(obj/item/W, mob/user, params) if(!harvested && needs_sharp_harvest && W.is_sharp()) + if(src in user.do_afters) + to_chat(user, "You're already trying to harvest [src]!") + return user.visible_message("[user] starts to harvest from [src] with [W].","You begin to harvest from [src] with [W].") - if(do_after(user, harvest_time, target = src)) + if(do_after(user, harvest_time, target = src, add_item = W)) harvest(user) else return ..() @@ -73,6 +76,9 @@ if(.) return if(!harvested && !needs_sharp_harvest) + if(src in user.do_afters) + to_chat(user, "You're already trying to harvest [src]!") + return user.visible_message("[user] starts to harvest from [src].","You begin to harvest from [src].") if(do_after(user, harvest_time, target = src)) harvest(user) @@ -89,7 +95,7 @@ harvest = /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_leaf needs_sharp_harvest = FALSE harvest_amount_high = 4 - harvest_time = 20 + harvest_time = 2 SECONDS harvest_message_low = "You pluck a single, suitable leaf." harvest_message_med = "You pluck a number of leaves, leaving a few unsuitable ones." harvest_message_high = "You pluck quite a lot of suitable leaves." @@ -104,7 +110,7 @@ harvested_desc = "Several small mushrooms near the stumps of what likely were larger mushrooms." harvest = /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_cap harvest_amount_high = 4 - harvest_time = 50 + harvest_time = 5 SECONDS harvest_message_low = "You slice the cap off a mushroom." harvest_message_med = "You slice off a few conks from the larger mushrooms." harvest_message_high = "You slice off a number of caps and conks from these mushrooms." @@ -121,7 +127,7 @@ harvested_desc = "A few tiny mushrooms around larger stumps. You can already see them growing back." harvest = /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_stem harvest_amount_high = 4 - harvest_time = 40 + harvest_time = 4 SECONDS harvest_message_low = "You pick and slice the cap off a mushroom, leaving the stem." harvest_message_med = "You pick and decapitate several mushrooms for their stems." harvest_message_high = "You acquire a number of stems from these mushrooms." @@ -137,7 +143,7 @@ harvest = /obj/item/reagent_containers/food/snacks/grown/ash_flora/cactus_fruit needs_sharp_harvest = FALSE harvest_amount_high = 2 - harvest_time = 10 + harvest_time = 1 SECONDS harvest_message_low = "You pick a cactus fruit." harvest_message_med = "You pick several cactus fruit." //shouldn't show up, because you can't get more than two harvest_message_high = "You pick a pair of cactus fruit." @@ -152,7 +158,7 @@ harvest = /obj/item/reagent_containers/food/snacks/grown/random needs_sharp_harvest = FALSE harvest_amount_high = 2 - harvest_time = 10 + harvest_time = 1 SECONDS harvest_message_low = "You bravely pick a strange plant." harvest_message_high = "You bravely pick a pair of strange plant." light_range = 1.5 diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index cf9a7beac4f6b..359159fd68333 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -102,6 +102,9 @@ if(!iscarbon(user)) to_chat(user, "The snake carving seems to come alive, if only for a moment, before returning to its dormant state, almost as if it finds you incapable of holding its oath.") return + if(user in user.do_afters) + to_chat(user, "You're already swearing on the oath!") + return var/mob/living/carbon/itemUser = user usedHand = itemUser.get_held_index_of_item(src) if(itemUser.has_status_effect(STATUS_EFFECT_HIPPOCRATIC_OATH)) @@ -109,22 +112,22 @@ return var/failText = "The snake seems unsatisfied with your incomplete oath and returns to its previous place on the rod, returning to its dormant, wooden state. You must stand still while completing your oath!" to_chat(itemUser, "The wooden snake that was carved into the rod seems to suddenly come alive and begins to slither down your arm! The compulsion to help others grows abnormally strong...") - if(do_after(itemUser, 40, target = itemUser)) + if(do_after(itemUser, 4 SECONDS, target = itemUser)) itemUser.say("I swear to fulfill, to the best of my ability and judgment, this covenant:", forced = "hippocratic oath") else to_chat(itemUser, failText) return - if(do_after(itemUser, 20, target = itemUser)) + if(do_after(itemUser, 2 SECONDS, target = itemUser)) itemUser.say("I will apply, for the benefit of the sick, all measures that are required, avoiding those twin traps of overtreatment and therapeutic nihilism.", forced = "hippocratic oath") else to_chat(itemUser, failText) return - if(do_after(itemUser, 30, target = itemUser)) + if(do_after(itemUser, 3 SECONDS, target = itemUser)) itemUser.say("I will remember that I remain a member of society, with special obligations to all my fellow human beings, those sound of mind and body as well as the infirm.", forced = "hippocratic oath") else to_chat(itemUser, failText) return - if(do_after(itemUser, 30, target = itemUser)) + if(do_after(itemUser, 3 SECONDS, target = itemUser)) itemUser.say("If I do not violate this oath, may I enjoy life and art, respected while I live and remembered with affection thereafter. May I always act so as to preserve the finest traditions of my calling and may I long experience the joy of healing those who seek my help.", forced = "hippocratic oath") else to_chat(itemUser, failText) @@ -169,7 +172,7 @@ /obj/item/clothing/neck/necklace/memento_mori/proc/memento(mob/living/carbon/human/user) to_chat(user, "You feel your life being drained by the pendant...") - if(do_after(user, 40, target = user)) + if(do_after(user, 4 SECONDS, target = user)) to_chat(user, "Your lifeforce is now linked to the pendant! You feel like removing it would kill you, and yet you instinctively know that until then, you won't die.") ADD_TRAIT(user, TRAIT_NODEATH, "memento_mori") ADD_TRAIT(user, TRAIT_NOHARDCRIT, "memento_mori") @@ -198,7 +201,7 @@ MM.memento(owner) else to_chat(owner, "You try to free your lifeforce from the pendant...") - if(do_after(owner, 40, target = owner)) + if(do_after(owner, 4 SECONDS, target = owner)) MM.mori() //Wisp Lantern @@ -971,7 +974,7 @@ var/reset_turf_type = /turf/open/floor/plating/asteroid/basalt var/reset_string = "basalt" var/create_cooldown = 100 - var/create_delay = 30 + var/create_delay = 3 SECONDS var/reset_cooldown = 50 var/timer = 0 var/static/list/banned_turfs = typecacheof(list(/turf/closed)) @@ -1235,7 +1238,7 @@ "You start detaching the hierophant beacon...") timer = world.time + 51 INVOKE_ASYNC(src, PROC_REF(prepare_icon_update)) - if(do_after(user, 50, target = user) && !beacon) + if(do_after(user, 5 SECONDS, target = user) && !beacon) var/turf/T = get_turf(user) playsound(T,'sound/magic/blind.ogg', 200, 1, -4) new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, user) @@ -1268,7 +1271,7 @@ beacon.icon_state = "hierophant_tele_on" var/obj/effect/temp_visual/hierophant/telegraph/edge/TE1 = new /obj/effect/temp_visual/hierophant/telegraph/edge(user.loc) var/obj/effect/temp_visual/hierophant/telegraph/edge/TE2 = new /obj/effect/temp_visual/hierophant/telegraph/edge(beacon.loc) - if(do_after(user, 40, target = user) && user && beacon) + if(do_after(user, 4 SECONDS, target = user) && user && beacon) var/turf/T = get_turf(beacon) var/turf/source = get_turf(user) if(T.is_blocked_turf(TRUE)) @@ -1283,7 +1286,7 @@ new /obj/effect/temp_visual/hierophant/telegraph(source, user) playsound(T,'sound/magic/wand_teleport.ogg', 200, 1) playsound(source,'sound/machines/airlockopen.ogg', 200, 1) - if(!do_after(user, 3, target = user) || !user || !beacon || QDELETED(beacon)) //no walking away shitlord + if(!do_after(user, 0.3 SECONDS, target = user) || !user || !beacon || QDELETED(beacon)) //no walking away shitlord teleporting = FALSE if(user) user.update_action_buttons_icon() diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm index 28f8b39cbf6d0..491579e64e79a 100644 --- a/code/modules/mining/minebot.dm +++ b/code/modules/mining/minebot.dm @@ -193,13 +193,13 @@ if(user.a_intent != INTENT_HELP) return ..() // For smacking if(istype(item, /obj/item/minebot_upgrade)) - if(!do_after(user, 20, src)) + if(!do_after(user, 2 SECONDS, src, show_to_target = TRUE, add_item = item)) return TRUE var/obj/item/minebot_upgrade/upgrade = item upgrade.upgrade_bot(src, user) return TRUE if(istype(item, /obj/item/t_scanner/adv_mining_scanner)) - if(!do_after(user, 20, src)) + if(!do_after(user, 2 SECONDS, src, show_to_target = TRUE, add_item = item)) return TRUE stored_scanner.forceMove(get_turf(src)) UnregisterSignal(stored_scanner, COMSIG_PARENT_QDELETING) @@ -209,7 +209,7 @@ to_chat(user, "You install [item].") return TRUE if(istype(item, /obj/item/borg/upgrade/modkit)) - if(!do_after(user, 20, src)) + if(!do_after(user, 2 SECONDS, src, show_to_target = TRUE, add_item = item)) return TRUE item.melee_attack_chain(user, stored_pka, params) // This handles any install messages return TRUE @@ -220,7 +220,7 @@ if(istype(item, /obj/item/gun/energy/plasmacutter)) if(health != maxHealth) return // For repairs - if(!do_after(user, 20, src)) + if(!do_after(user, 2 SECONDS, src, show_to_target = TRUE, add_item = item)) return TRUE if(stored_cutter) stored_cutter.forceMove(get_turf(src)) @@ -233,7 +233,7 @@ to_chat(user, "You install [item].") return TRUE if(istype(item, /obj/item/pickaxe/drill)) - if(!do_after(user, 20, src)) + if(!do_after(user, 2 SECONDS, src, show_to_target = TRUE, add_item = item)) return TRUE if(stored_drill) stored_drill.forceMove(get_turf(src)) diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm index c0577c6a6dfb3..a4ffc3ecabecc 100644 --- a/code/modules/mob/living/bloodcrawl.dm +++ b/code/modules/mob/living/bloodcrawl.dm @@ -160,7 +160,7 @@ to_chat(src, "Finish eating first!") return 0 B.visible_message("[B] starts to bubble...") - if(!do_after(src, 20, target = B)) + if(!do_after(src, 2 SECONDS, target = B)) return if(!B) return diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index e9be3a75242ab..ccbea77b6877e 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -113,9 +113,11 @@ if(!O.reagents.has_reagent(/datum/reagent/medicine/mannitol, 10)) to_chat(user, "There's not enough mannitol in [O] to restore [src]!") return - + if(src in user.do_afters) + to_chat(user, "You're already pouring something on [O]!") + return user.visible_message("[user] starts to pour the contents of [O] onto [src].", "You start to slowly pour the contents of [O] onto [src].") - if(!do_after(user, 60, src)) + if(!do_after(user, 60, src, , show_to_target = TRUE, add_item = O)) to_chat(user, "You failed to pour [O] onto [src]!") return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 22784852973bd..49777b09fcd9f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -279,7 +279,7 @@ if(!cuff_break) visible_message("[src] attempts to remove [I]!") to_chat(src, "You attempt to remove [I]... (This will take around [DisplayTimeText(breakouttime)] and you need to stand still.)") - if(do_after(src, breakouttime, target = src, timed_action_flags = IGNORE_HELD_ITEM|IGNORE_RESTRAINED)) + if(do_after(src, breakouttime, target = src, timed_action_flags = IGNORE_HELD_ITEM|IGNORE_RESTRAINED, add_item = I)) clear_cuffs(I, cuff_break) else to_chat(src, "You fail to remove [I]!") @@ -288,7 +288,7 @@ breakouttime = 50 visible_message("[src] is trying to break [I]!") to_chat(src, "You attempt to break [I]... (This will take around 5 seconds and you need to stand still.)") - if(do_after(src, breakouttime, target = src, timed_action_flags = IGNORE_HELD_ITEM|IGNORE_RESTRAINED)) + if(do_after(src, breakouttime, target = src, timed_action_flags = IGNORE_HELD_ITEM|IGNORE_RESTRAINED, add_item = I)) clear_cuffs(I, cuff_break) else to_chat(src, "You fail to break [I]!") diff --git a/code/modules/mob/living/carbon/carbon_stripping.dm b/code/modules/mob/living/carbon/carbon_stripping.dm index a1841dd91812b..0eb375e4f9ab7 100644 --- a/code/modules/mob/living/carbon/carbon_stripping.dm +++ b/code/modules/mob/living/carbon/carbon_stripping.dm @@ -91,7 +91,10 @@ var/mob/mob_source = source - if(!do_after(user, equipping.equip_delay_other, source)) + if(source in user.do_afters) + return FALSE + + if(!do_after(user, equipping.equip_delay_other, source, add_item = equipping)) return FALSE if(!mob_source.can_put_in_hand(equipping, hand_index)) @@ -109,12 +112,12 @@ var/mob/mob_source = source mob_source.put_in_hand(equipping, hand_index) -/datum/strippable_item/hand/start_unequip(atom/source, mob/user) +/datum/strippable_item/hand/start_unequip(atom/source, mob/user, obscured = FALSE) . = ..() if(!.) return - return start_unequip_mob(get_item(source), source, user) + return start_unequip_mob(get_item(source), source, user, obscured) /datum/strippable_item/hand/finish_unequip(atom/source, mob/user) var/obj/item/item = get_item(source) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 2869e2cb35b20..b0419f9ce7359 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -558,24 +558,24 @@ return if(is_mouth_covered()) to_chat(src, "Remove your mask first!") - return 0 + return FALSE if(C.is_mouth_covered()) to_chat(src, "Remove [p_their()] mask first!") - return 0 + return FALSE - if(C.cpr_time < world.time + 30) + var/speed_mult = 1 + while(C.health <= C.crit_threshold) visible_message("[src] is trying to perform CPR on [C.name]!", \ "You try to perform CPR on [C.name]... Hold still!") - if(!do_after(src, target = C)) + if(!do_after(src, delay = 3 SECONDS * speed_mult, target = C, show_to_target = TRUE)) to_chat(src, "You fail to perform CPR on [C]!") - return 0 + return FALSE + if(speed_mult > 0.2) + speed_mult -= 0.1 var/they_breathe = !HAS_TRAIT(C, TRAIT_NOBREATH) var/they_lung = C.getorganslot(ORGAN_SLOT_LUNGS) - if(C.health > C.crit_threshold) - return - src.visible_message("[src] performs CPR on [C.name]!", "You perform CPR on [C.name].") SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "perform_cpr", /datum/mood_event/perform_cpr) C.cpr_time = world.time @@ -882,7 +882,7 @@ if(!src.is_busy && (src.zone_selected == BODY_ZONE_HEAD || src.zone_selected == BODY_ZONE_PRECISE_GROIN) && get_turf(src) == get_turf(T) && !(T.mobility_flags & MOBILITY_STAND) && src.a_intent != INTENT_HELP && !HAS_TRAIT(src, TRAIT_PACIFISM)) //all the stars align, time to curbstomp src.is_busy = TRUE - if (!do_after(src, 2.5 SECONDS, T) || get_turf(src) != get_turf(T) || (T.mobility_flags & MOBILITY_STAND) || src.a_intent == INTENT_HELP || src == T) //wait 30ds and make sure the stars still align (Body zone check removed after PR #958) + if (!do_after(src, 2.5 SECONDS, T, show_to_target = TRUE) || get_turf(src) != get_turf(T) || (T.mobility_flags & MOBILITY_STAND) || src.a_intent == INTENT_HELP || src == T) //wait 30ds and make sure the stars still align (Body zone check removed after PR #958) src.is_busy = FALSE return @@ -973,11 +973,14 @@ carrydelay = 40 skills_space = " quickly" if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE)) + if(target in do_afters) + to_chat(src, "You're already trying to lift [target] up!") + return visible_message("[src] starts[skills_space] lifting [target] onto their back..", //Joe Medic starts quickly/expertly lifting Grey Tider onto their back.. "[HAS_TRAIT(src, TRAIT_QUICKER_CARRY) ? "Using your gloves' nanochips, you" : "You"][skills_space] start to lift [target] onto your back[HAS_TRAIT(src, TRAIT_QUICK_CARRY) ? ", while assisted by the nanochips in your gloves..." : "..."]") //(Using your gloves' nanochips, you/You) ( /quickly/expertly) start to lift Grey Tider onto your back(, while assisted by the nanochips in your gloves../...) - if(do_after(src, carrydelay, target)) + if(do_after(src, carrydelay, target, show_to_target = TRUE)) //Second check to make sure they're still valid to be carried if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE) && !target.buckled) buckle_mob(target, TRUE, TRUE, 90, 1, 0) @@ -988,8 +991,11 @@ /mob/living/carbon/human/proc/piggyback(mob/living/carbon/target) if(can_piggyback(target)) + if(src in target.do_afters) + to_chat(target, "You're already trying to climb onto [src]!") + return visible_message("[target] starts to climb onto [src].") - if(do_after(target, 15, target = src)) + if(do_after(target, 1.5 SECONDS, target = src, show_to_target = TRUE)) if(can_piggyback(target)) if(target.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE)) target.visible_message("[target] can't hang onto [src]!") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 46103244cabed..1e2d78e3017f2 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -695,7 +695,7 @@ if(src == M) if(has_status_effect(STATUS_EFFECT_CHOKINGSTRAND)) to_chat(src, "You attempt to remove the durathread strand from around your neck.") - if(do_after(src, 35, src, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(src, 3.5 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM)) to_chat(src, "You succesfuly remove the durathread strand.") remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND) return diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 5f9e12c6d954f..4b5109893659e 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -170,7 +170,7 @@ GLOBAL_LIST_INIT(strippable_human_layout, list( if(!.) warn_owner(source) -/datum/strippable_item/mob_item_slot/needs_jumpsuit/pocket/start_unequip(atom/source, mob/user) +/datum/strippable_item/mob_item_slot/needs_jumpsuit/pocket/start_unequip(atom/source, mob/user, obscured = FALSE) var/obj/item/item = get_item(source) if(isnull(item)) return FALSE @@ -182,7 +182,7 @@ GLOBAL_LIST_INIT(strippable_human_layout, list( user.log_message(log_message, LOG_ATTACK, color="red", log_globally=FALSE) item.add_fingerprint(src) - var/result = start_unequip_mob(item, source, user, POCKET_STRIP_DELAY) + var/result = start_unequip_mob(item, source, user, POCKET_STRIP_DELAY, obscured) if(!result) warn_owner(source) @@ -225,6 +225,10 @@ GLOBAL_LIST_INIT(strippable_human_layout, list( if(!carbon_source.can_breathe_internals()) return + if(source in user.do_afters) + to_chat(user, "You're already trying to manipulate the valve of [source]'s [item]!") + return + carbon_source.visible_message( "[user] tries to [(carbon_source.internal != item) ? "open": "close"] the valve on [source]'s [item.name].", "[user] tries to [(carbon_source.internal != item) ? "open": "close"] the valve on your [item.name].", @@ -233,7 +237,7 @@ GLOBAL_LIST_INIT(strippable_human_layout, list( to_chat(user, "You try to [(carbon_source.internal != item) ? "open": "close"] the valve on [source]'s [item.name]...") - if(!do_after(user, INTERNALS_TOGGLE_DELAY, carbon_source)) + if(!do_after(user, INTERNALS_TOGGLE_DELAY, carbon_source, show_to_target = TRUE, add_item = item)) return if (carbon_source.internal == item) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 8bb0349378919..a17956cc444bc 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1249,8 +1249,11 @@ GLOBAL_LIST_EMPTY(features_by_species) /datum/species/proc/equip_delay_self_check(obj/item/I, mob/living/carbon/human/H, bypass_equip_delay_self) if(!I.equip_delay_self || bypass_equip_delay_self) return TRUE + if(H in H.do_afters) + to_chat(H, "You're already trying to put on [I]!") + return H.visible_message("[H] start putting on [I].", "You start putting on [I].") - return do_after(H, I.equip_delay_self, target = H) + return do_after(H, I.equip_delay_self, target = H, add_item = I) /datum/species/proc/before_equip_job(datum/job/J, mob/living/carbon/human/H, client/preference_source = null) return @@ -1505,10 +1508,13 @@ GLOBAL_LIST_EMPTY(features_by_species) if(HAS_TRAIT(target.shoes, TRAIT_NODROP)) target.grabbedby(user) return TRUE + if(target in user.do_afters) + to_chat(user, "You're already trying to steal [target]'s shoes!") + return FALSE user.visible_message("[user] starts stealing [target]'s shoes!", "You start stealing [target]'s shoes!") var/obj/item/I = target.shoes - if(do_after(user, I.strip_delay, target)) + if(do_after(user, I.strip_delay, target, show_to_target = TRUE, add_item = I)) target.dropItemToGround(I, TRUE) user.put_in_hands(I) user.visible_message("[user] stole your [I]!", diff --git a/code/modules/mob/living/carbon/human/species_types/IPC.dm b/code/modules/mob/living/carbon/human/species_types/IPC.dm index 726367170abca..c540a59a5c134 100644 --- a/code/modules/mob/living/carbon/human/species_types/IPC.dm +++ b/code/modules/mob/living/carbon/human/species_types/IPC.dm @@ -165,7 +165,10 @@ var/obj/machinery/power/apc/A = target if(!istype(A)) return - while(do_after(H, 10, target = A)) + if(A in H.do_afters) + to_chat(H, "You're already trying to recharge off [A]!") + return + while(do_after(H, 1 SECONDS, target = A, add_item = src)) if(!battery) to_chat(H, "You need a battery to recharge!") break @@ -192,8 +195,11 @@ var/obj/item/organ/stomach/battery/A = target if(!istype(A)) return + if(A.owner in H.do_afters) + to_chat(H, "You're trying to recharge off [A]!") + return var/charge_amt - while(do_after(H, 10, target = A.owner)) + while(do_after(H, 1 SECONDS, target = A.owner, add_item = src)) if(!battery) to_chat(H, "You need a battery to recharge!") break diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index bbfa06c663a51..f17b3a7a23fab 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -1030,8 +1030,11 @@ if(C.amount < 10) to_chat(H, "You do not have enough cardboard!") return FALSE + if(user in user.do_afters) + to_chat(user, "You're already attempting to create a new cardboard brother!") + return FALSE to_chat(H, "You attempt to create a new cardboard brother.") - if(do_after(user, 30, target = user)) + if(do_after(user, 3 SECONDS, target = user)) if(last_creation + brother_creation_cooldown > world.time) //no cheesing dork return if(!C.use(10)) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 11e111b41b446..2bfeeab8a82d3 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -109,7 +109,7 @@ H.notransform = TRUE - if(do_after(owner, delay=60, target=owner, progress=TRUE, timed_action_flags = IGNORE_HELD_ITEM)) + if(do_after(owner, delay = 6 SECONDS, target=owner, progress=TRUE, timed_action_flags = IGNORE_HELD_ITEM)) if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) make_dupe() else @@ -911,7 +911,7 @@ GLOBAL_LIST_EMPTY(slime_links_by_mind) to_chat(human_owner, "You begin linking [target]'[target.p_s()] mind to yours...", type = MESSAGE_TYPE_INFO) target.visible_message("[owner] gently places [owner.p_their()] hands on the sides of [target]'[target.p_s()] head, and begins to concentrate!", \ "[owner] gently places [owner.p_their()] hands on the sides of your head, and you feel a foreign, yet benign and non-invasive presence begin to enter your mind...") - if(!do_after(human_owner, 6 SECONDS, target)) + if(!do_after(human_owner, 6 SECONDS, target, show_to_target = TRUE)) to_chat(human_owner, "You were interrupted while linking [target]!", type = MESSAGE_TYPE_WARNING) to_chat(target, "The foreign presence entering your mind quickly fades away as [human_owner] is interrupted!", type = MESSAGE_TYPE_INFO) return diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index c436da3e406ad..2bb99c932cb52 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -97,6 +97,9 @@ if(H.nutrition < COCOON_NUTRITION_AMOUNT) to_chat(H, "You are too hungry to weave a cocoon!") return + if(H in H.do_afters) + to_chat(H, "You're already trying to weave a cocoon!") + return H.visible_message("[H] begins to hold still and concentrate on weaving a cocoon...", \ "You begin to focus on weaving a cocoon... (This will take [DisplayTimeText(COCOON_WEAVE_DELAY)] and you must hold still.)") H.adjustStaminaLoss(20, FALSE) //this is here to deter people from spamming it if they get interrupted diff --git a/code/modules/mob/living/carbon/human/species_types/oozelings.dm b/code/modules/mob/living/carbon/human/species_types/oozelings.dm index 2a69600c3be3d..c19c93659b7d1 100644 --- a/code/modules/mob/living/carbon/human/species_types/oozelings.dm +++ b/code/modules/mob/living/carbon/human/species_types/oozelings.dm @@ -140,9 +140,12 @@ if(!LAZYLEN(limbs_to_heal)) to_chat(H, "You feel intact enough as it is.") return + if(H in H.do_afters) + to_chat(H, "You're already focusing on healing your missing limbs!") + return to_chat(H, "You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]...") if(H.blood_volume >= 80*limbs_to_heal.len+BLOOD_VOLUME_OKAY) - if(do_after(H, 60, target = H)) + if(do_after(H, 6 SECONDS, target = H)) H.regenerate_limbs() H.blood_volume -= 80*limbs_to_heal.len H.nutrition -= 20*limbs_to_heal.len @@ -150,7 +153,7 @@ return if(H.blood_volume >= 80)//We can partially heal some limbs while(H.blood_volume >= BLOOD_VOLUME_OKAY+80 && LAZYLEN(limbs_to_heal)) - if(do_after(H, 30, target = H)) + if(do_after(H, 3 SECONDS, target = H)) var/healed_limb = pick(limbs_to_heal) H.regenerate_limb(healed_limb) limbs_to_heal -= healed_limb @@ -189,8 +192,11 @@ /datum/species/oozeling/help(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style) . = ..() if(. && target != user && target.on_fire) + if(target in user.do_afters) + to_chat(user, "You're already trying to extinguish [target]!") + return target.visible_message("[user] begins to closely hug [target]...", "[user] holds you closely in a tight hug!") - if(do_after(user, 1 SECONDS, target, IGNORE_HELD_ITEM)) + if(do_after(user, 1 SECONDS, target, IGNORE_HELD_ITEM, show_to_target = TRUE)) target.visible_message("[user] extingushes [target] with a hug!", "[user] extingushes you with a hug!", "You hear a fire sizzle out.") target.fire_stacks = max(target.fire_stacks - 5, 0) if(target.fire_stacks <= 0) diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm index 5a31613e1f91b..080b1f668150d 100644 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm @@ -149,7 +149,7 @@ if(H.pulling && iscarbon(H.pulling)) var/mob/living/carbon/victim = H.pulling if(H.blood_volume >= BLOOD_VOLUME_MAXIMUM) - to_chat(H, "You're already full!") + to_chat(H, "You're already full!") return if(victim.stat == DEAD) to_chat(H, "You need a living victim!") @@ -157,7 +157,7 @@ if(!victim.blood_volume || (victim.dna && ((NOBLOOD in victim.dna.species.species_traits) || victim.dna.species.exotic_blood))) to_chat(H, "[victim] doesn't have blood!") return - V.drain_cooldown = world.time + 30 + V.drain_cooldown = world.time + 3 SECONDS if(victim.anti_magic_check(FALSE, TRUE, FALSE)) to_chat(victim, "[H] tries to bite you, but stops before touching you!") to_chat(H, "[victim] is blessed! You stop just in time to avoid catching fire.") @@ -166,7 +166,7 @@ to_chat(victim, "[H] tries to bite you, but recoils in disgust!") to_chat(H, "[victim] reeks of garlic! you can't bring yourself to drain such tainted blood.") return - if(!do_after(H, 30, target = victim)) + if(!do_after(H, 3 SECONDS, target = victim, show_to_target = TRUE)) return var/blood_volume_difference = BLOOD_VOLUME_MAXIMUM - H.blood_volume //How much capacity we have left to absorb blood var/drained_blood = min(victim.blood_volume, VAMP_DRAIN_AMOUNT, blood_volume_difference) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3edee728a11aa..3042b2b5c9a42 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -491,7 +491,7 @@ if(!resting) set_resting(TRUE, FALSE) else - if(do_after(src, 10, target = src, timed_action_flags = IGNORE_RESTRAINED | IGNORE_HELD_ITEM)) + if(do_after(src, 1 SECONDS, target = src, timed_action_flags = IGNORE_RESTRAINED | IGNORE_HELD_ITEM)) set_resting(FALSE, FALSE) else to_chat(src, "You fail to get up.") @@ -894,10 +894,13 @@ if(!what.canStrip(who)) to_chat(src, "You can't remove [what.name], it appears to be stuck!") return + if(who in do_afters) + to_chat(src, "You're already stripping [who]!") + return who.visible_message("[src] tries to remove [who]'s [what.name].", \ "[src] tries to remove your [what.name].") what.add_fingerprint(src) - if(do_after(src, what.strip_delay, who)) + if(do_after(src, what.strip_delay, who, show_to_target = TRUE, add_item = what)) if(what && Adjacent(who)) if(islist(where)) var/list/L = where @@ -929,9 +932,13 @@ to_chat(src, "\The [what.name] doesn't fit in that place!") return + if(who in do_afters) + to_chat(src, "You're already trying to put something on [who]!") + return + who.visible_message("[src] tries to put [what] on [who].", \ "[src] tries to put [what] on you.") - if(do_after(src, what.equip_delay_other, who)) + if(do_after(src, what.equip_delay_other, who, show_to_target = TRUE, add_item = what)) if(what && Adjacent(who) && what.mob_can_equip(who, src, final_where, TRUE, TRUE)) if(temporarilyRemoveItemFromInventory(what)) if(where_list) @@ -1329,7 +1336,7 @@ to_chat(user, "[src] is buckled to something!") return FALSE user.visible_message("[user] starts trying to scoop up [src]!") - if(!do_after(user, 20, target = src)) + if(!do_after(user, 2 SECONDS, target = src, show_to_target = TRUE)) return FALSE mob_pickup(user) return TRUE diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 3388ed4d748f3..7246d059df0ba 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -190,7 +190,7 @@ if(user.grab_state) //only the first upgrade is instantaneous var/old_grab_state = user.grab_state - var/grab_upgrade_time = instant ? 0 : 30 + var/grab_upgrade_time = instant ? 0 : 3 SECONDS visible_message("[user] starts to tighten [user.p_their()] grip on [src]!", \ "[user] starts to tighten [user.p_their()] grip on you!") switch(user.grab_state) @@ -198,7 +198,7 @@ log_combat(user, src, "attempted to neck grab", addition="neck grab") if(GRAB_NECK) log_combat(user, src, "attempted to strangle", addition="kill grab") - if(!do_after(user, grab_upgrade_time, src)) + if(!do_after(user, grab_upgrade_time, src, show_to_target = TRUE)) return 0 if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state) return 0 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 10e104902d521..72cbd5528ac82 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -404,8 +404,11 @@ if(!(getFireLoss() || getToxLoss())) to_chat(user, "The wires seem fine, there's no need to fix them.") return + if(src in user.do_afters) + to_chat(user, "You're already trying to fix [src]'s burnt wires!") + return var/obj/item/stack/cable_coil/coil = W - while((getFireLoss() || getToxLoss()) && do_after(user, 30, target = src)) + while((getFireLoss() || getToxLoss()) && do_after(user, 3 SECONDS, target = src, show_to_target = TRUE, add_item = coil)) if(coil.use(1)) adjustFireLoss(-20) adjustToxLoss(-20) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index 4c89d6dd5d85c..a88885a5c991b 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -1,8 +1,11 @@ /mob/living/silicon/robot/attackby(obj/item/I, mob/living/user) if(I.slot_flags & ITEM_SLOT_HEAD && hat_offset != INFINITY && user.a_intent == INTENT_HELP && !is_type_in_typecache(I, blacklisted_hats)) + if(src in user.do_afters) + to_chat(user, "You're already trying to place [I] on [src]'s head!") + return to_chat(user, "You begin to place [I] on [src]'s head...") to_chat(src, "[user] is placing [I] on your head...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, show_to_target = TRUE, add_item = I)) if (user.temporarilyRemoveItemFromInventory(I, TRUE)) place_on_head(I) return diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 1d3fe678c2d54..3b3f2f89da194 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -347,8 +347,11 @@ if(open) to_chat(user, "Close the access panel before manipulating the personality slot!") else + if(src in user.do_afters) + to_chat(user, "You're already trying to pull [paicard] free!") + return to_chat(user, "You attempt to pull [paicard] free...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, show_to_target = TRUE, add_item = W)) if (paicard) user.visible_message("[user] uses [W] to pull [paicard] out of [bot_name]!","You pull [paicard] out of [bot_name] with [W].") ejectpai(user) diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index effb609e29453..2d19c119fcf08 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -164,8 +164,11 @@ if(coil.get_amount() < 1) to_chat(user, "You need one length of cable to wire the ED-209!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to add wires to [src]!") + return to_chat(user, "You start to wire [src]...") - if(do_after(user, 40, target = src)) + if(do_after(user, 4 SECONDS, target = src, add_item = W)) if(coil.get_amount() >= 1 && build_step == 6) coil.use(1) to_chat(user, "You wire [src].") diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 95ae8ca007059..0092cca3f2738 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -459,6 +459,10 @@ GLOBAL_VAR(medibot_unique_id_gen) /mob/living/simple_animal/bot/medbot/attack_hand(mob/living/carbon/human/H) if(H.a_intent == INTENT_DISARM && !tipped) + if(src in H.do_afters) + to_chat(H, "You're already trying to tip over [src]!") + return + H.visible_message("[H] begins tipping over [src].", "You begin tipping over [src]...") if(world.time > last_tipping_action_voice + 15 SECONDS) @@ -468,12 +472,15 @@ GLOBAL_VAR(medibot_unique_id_gen) speak(message) playsound(src, messagevoice[message], 70, FALSE) - if(do_after(H, 3 SECONDS, target=src)) + if(do_after(H, 3 SECONDS, target=src, show_to_target = TRUE)) tip_over(H) else if(H.a_intent == INTENT_HELP && tipped) + if(src in H.do_afters) + to_chat(H, "You're already trying to right [src]!") + return H.visible_message("[H] begins righting [src].", "You begin righting [src]...") - if(do_after(H, 3 SECONDS, target=src)) + if(do_after(H, 3 SECONDS, target=src, show_to_target = TRUE)) set_right(H) else ..() @@ -540,30 +547,38 @@ GLOBAL_VAR(medibot_unique_id_gen) bot_reset() tending = FALSE else if(patient) + if(patient in do_afters) + to_chat(src, "You're already trying to tend to the wounds of [patient]!") + return + C.visible_message("[src] is trying to tend the wounds of [patient]!", \ "[src] is trying to tend your wounds!") - if(do_after(src, 2 SECONDS, patient)) //Slightly faster than default tend wounds, but does less HPS - if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient)) - var/healies = heal_amount - var/obj/item/storage/firstaid/FA = firstaid - if(treatment_method == initial(FA.damagetype_healed)) //using the damage specific medkits give bonuses when healing this type of damage. - healies *= 1.5 - if(treatment_method == TOX && HAS_TRAIT(patient, TRAIT_TOXINLOVER)) - healies *= -1.5 - if(emagged == 2) - patient.reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 5) - patient.apply_damage_type((healies*1),treatment_method) - log_combat(src, patient, "pretended to tend wounds on", "internal tools", "([uppertext(treatment_method)]) (EMAGGED)") + var/speed_mult = 1 + while(tending) + if(do_after(src, 2 SECONDS * speed_mult, patient, show_to_target = TRUE)) //Slightly faster than default tend wounds, but does less HPS + if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient)) + var/healies = heal_amount + var/obj/item/storage/firstaid/FA = firstaid + if(treatment_method == initial(FA.damagetype_healed)) //using the damage specific medkits give bonuses when healing this type of damage. + healies *= 1.5 + if(treatment_method == TOX && HAS_TRAIT(patient, TRAIT_TOXINLOVER)) + healies *= -1.5 + if(emagged == 2) + patient.reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 5) + patient.apply_damage_type((healies*1),treatment_method) + log_combat(src, patient, "pretended to tend wounds on", "internal tools", "([uppertext(treatment_method)]) (EMAGGED)") + else + patient.apply_damage_type((healies*-1),treatment_method) //don't need to check treatment_method since we know by this point that they were actually damaged. + log_combat(src, patient, "tended the wounds of", "internal tools", "([uppertext(treatment_method)])") + C.visible_message("[src] tends the wounds of [patient]!", \ + "[src] tends your wounds!") else - patient.apply_damage_type((healies*-1),treatment_method) //don't need to check treatment_method since we know by this point that they were actually damaged. - log_combat(src, patient, "tended the wounds of", "internal tools", "([uppertext(treatment_method)])") - C.visible_message("[src] tends the wounds of [patient]!", \ - "[src] tends your wounds!") + tending = FALSE + if(speed_mult > 0.2) + speed_mult -= 0.1 else tending = FALSE - else - tending = FALSE update_icon() if(!tending) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index e56c81f0661b9..609fc7ca05614 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -276,8 +276,11 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list( if (nofur) to_chat(user, " You can't shave this corgi, it doesn't have a fur coat!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to shave [src]!") + return user.visible_message("[user] starts to shave [src] using \the [O].", "You start to shave [src] using \the [O]...") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, show_to_target = TRUE, add_item = O)) user.visible_message("[user] shaves [src]'s hair using \the [O].") playsound(loc, 'sound/items/welder2.ogg', 20, 1) shaved = TRUE diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm index 46fef614b5da9..08e2a4a4b5ca3 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm @@ -16,8 +16,11 @@ if("Cannibalize") if(D.health < D.maxHealth) + if(src in D.do_afters) + to_chat(D, "You're already trying to cannibalize on [src]!") + return D.visible_message("[D] begins to cannibalize parts from [src].", "You begin to cannibalize parts from [src]...") - if(do_after(D, 60, 0, target = src)) + if(do_after(D, 6 SECONDS, 0, target = src, show_to_target = TRUE)) D.visible_message("[D] repairs itself using [src]'s remains!", "You repair yourself using [src]'s remains.") D.adjustBruteLoss(-src.maxHealth) new /obj/effect/decal/cleanable/oil/streak(get_turf(src)) @@ -38,9 +41,12 @@ if(user.get_active_held_item()) to_chat(user, "Your hands are full!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to pick up [src]!") + return visible_message("[user] starts picking up [src].", \ "[user] starts picking you up!") - if(!do_after(user, 20, target = src)) + if(!do_after(user, 2 SECONDS, target = src, show_to_target = TRUE)) return visible_message("[user] picks up [src]!", \ "[user] picks you up!") @@ -67,8 +73,11 @@ to_chat(user, "You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)].") return + if(src in user.do_afters) + to_chat(user, "You're already trying to reactivate [src]!") + return user.visible_message("[user] begins to reactivate [src].", "You begin to reactivate [src]...") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, show_to_target = TRUE)) revive(full_heal = 1) user.visible_message("[user] reactivates [src]!", "You reactivate [src].") alert_drones(DRONE_NET_CONNECT) diff --git a/code/modules/mob/living/simple_animal/hostile/floor_cluwne.dm b/code/modules/mob/living/simple_animal/hostile/floor_cluwne.dm index a161cc058947d..d9227d8aef541 100644 --- a/code/modules/mob/living/simple_animal/hostile/floor_cluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floor_cluwne.dm @@ -351,7 +351,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0) /mob/living/simple_animal/hostile/floor_cluwne/proc/Grab(mob/living/carbon/human/H) to_chat(H, "You feel a cold, gloved hand clamp down on your ankle!") for(var/I in 1 to get_dist(src, H)) - if(do_after(src, 5, target = H)) + if(do_after(src, 0.5 SECONDS, target = H, show_to_target = TRUE)) step_towards(H, src) playsound(H, pick('sound/effects/bodyscrape-01.ogg', 'sound/effects/bodyscrape-02.ogg'), 20, 1, -4) if(prob(40)) @@ -362,7 +362,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0) if(get_dist(src,H) <= 1) visible_message("[src] begins dragging [H] under the floor!") - if(do_after(src, 50, target = H) && eating) + if(do_after(src, 5 SECONDS, target = H, show_to_target = TRUE) && eating) H.become_blind() H.invisibility = INVISIBILITY_SPIRIT H.density = FALSE @@ -390,7 +390,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0) animate(H.client,color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT) for(var/turf/open/T in RANGE_TURFS(4, H)) H.add_splatter_floor(T) - if(do_after(src, 50, target = H)) + if(do_after(src, 5 SECONDS, target = H, show_to_target = TRUE)) H.unequip_everything()//more runtime prevention if(prob(75)) H.gib(FALSE) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index da9b4466e37bf..66c4f2ac83ada 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -179,7 +179,11 @@ visible_message("[src] begins to secrete a sticky substance around [cocoon_target].","You begin wrapping [cocoon_target] into a cocoon.") stop_automated_movement = TRUE SSmove_manager.stop_looping(src) - if(do_after(src, 50, target = cocoon_target)) + var/atom/movable/fake_atom = new + var/atom/fake_structure = /obj/structure/spider/cocoon + fake_atom.icon = initial(fake_structure.icon) + fake_atom.icon_state = initial(fake_structure.icon_state) + if(do_after(src, 5 SECONDS, target = cocoon_target, show_to_target = TRUE, add_item = fake_atom)) if(busy == SPINNING_COCOON) var/obj/structure/spider/cocoon/C = new(cocoon_target.loc) if(isliving(cocoon_target)) @@ -289,7 +293,7 @@ else visible_message("[src] begins wrapping the wounds of [hurt_spider].","You begin wrapping the wounds of [hurt_spider].") is_busy = TRUE - if(do_after(src, 20, target = hurt_spider)) + if(do_after(src, 2 SECONDS, target = hurt_spider, show_to_target = TRUE)) hurt_spider.heal_overall_damage(20) new /obj/effect/temp_visual/heal(get_turf(hurt_spider), "#80F5FF") visible_message("[src] wraps the wounds of [hurt_spider].","You wrap the wounds of [hurt_spider].") @@ -485,7 +489,7 @@ spider.busy = SPINNING_WEB spider.visible_message("[spider] begins to secrete a sticky substance.","You begin to lay a web.") spider.stop_automated_movement = TRUE - if(do_after(spider, 40 * spider.web_speed, target = target_turf)) + if(do_after(spider, 4 SECONDS * spider.web_speed, target = target_turf)) new /obj/structure/spider/stickyweb(target_turf) spider.busy = SPIDER_IDLE spider.stop_automated_movement = FALSE @@ -586,7 +590,7 @@ spider.busy = SPINNING_WEB spider.visible_message("[spider] begins to secrete a sticky substance.","You begin to prepare a net from webbing.") spider.stop_automated_movement = TRUE - if(do_after(spider, 40 * spider.web_speed, spider)) + if(do_after(spider, 4 SECONDS * spider.web_speed, spider)) message = "You ready the completed net with your forelimbs. Left-click to throw it at a target!" add_ranged_ability(user, message, TRUE) spider.busy = SPIDER_IDLE @@ -652,7 +656,11 @@ spider.busy = LAYING_EGGS spider.visible_message("[spider] begins to lay a cluster of eggs.","You begin to lay a cluster of eggs.") spider.stop_automated_movement = TRUE - if(do_after(spider, 50, target = get_turf(spider))) + var/atom/movable/fake_atom = new + var/atom/fake_egg = /obj/structure/spider/eggcluster + fake_atom.icon = initial(fake_egg.icon) + fake_atom.icon_state = initial(fake_egg.icon_state) + if(do_after(spider, 5 SECONDS, target = get_turf(spider), add_item = fake_atom)) if(spider.busy == LAYING_EGGS) cluster = locate() in get_turf(spider) if(!cluster || !isturf(spider.loc)) diff --git a/code/modules/mob/living/simple_animal/hostile/macrophage.dm b/code/modules/mob/living/simple_animal/hostile/macrophage.dm index 350d999f2fad4..2580d7ea96306 100644 --- a/code/modules/mob/living/simple_animal/hostile/macrophage.dm +++ b/code/modules/mob/living/simple_animal/hostile/macrophage.dm @@ -64,9 +64,12 @@ if(M.ForceContractDisease(D)) //we already check spread type in the macrophage creation proc to_chat(src, "You infect [M] with [D]!") else if(aggressive) - M.visible_message("the [src] begins penetrating [M]' protection!", \ + if(target in do_afters) + to_chat(src, "You're already trying to penetrate [M]'s protection!") + return + M.visible_message("the [src] begins penetrating [M]'s protection!", \ "[src] begins penetrating your protection!") - if(do_after(src, 1.5 SECONDS, M)) + if(do_after(src, 1.5 SECONDS, M, show_to_target = TRUE)) for(var/datum/disease/D in infections) if(M.ForceContractDisease(D)) to_chat(src, "You infect [M] with [D]!") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index b021a5321b190..6de7239409b22 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -707,10 +707,13 @@ Difficulty: Hard if(H.timer > world.time) return if(H.beacon == src) + if(src in user.do_afters) + to_chat(user, "You're already trying to remove the beacon!") + return to_chat(user, "You start removing your hierophant beacon...") H.timer = world.time + 51 INVOKE_ASYNC(H, TYPE_PROC_REF(/obj/item/hierophant_club, prepare_icon_update)) - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src)) playsound(src,'sound/magic/blind.ogg', 200, 1, -4) new /obj/effect/temp_visual/hierophant/telegraph/teleport(get_turf(src), user) to_chat(user, "You collect [src], reattaching it to the club!") diff --git a/code/modules/mob/living/simple_animal/hostile/redgrub.dm b/code/modules/mob/living/simple_animal/hostile/redgrub.dm index 2a9b7fe48a84e..72596d082fe66 100644 --- a/code/modules/mob/living/simple_animal/hostile/redgrub.dm +++ b/code/modules/mob/living/simple_animal/hostile/redgrub.dm @@ -219,9 +219,12 @@ var/mob/living/carbon/human/M = target food += 10 if(growthstage >= 3) + if(M in do_afters) + to_chat(src, "You're already already trying to borrow into [M]!") + return M.visible_message("the [src] begins burrowing into [M]!", \ "[src] is trying to burrow into your cytoplasm!") - if(M.can_inject(src) && do_after(src, 15, M)) + if(M.can_inject(src) && do_after(src, 1.5 SECONDS, M, show_to_target = TRUE)) for(var/datum/disease/D in grub_diseases) if(D.spread_flags & DISEASE_SPREAD_FALTERED) continue diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index 46463b6a1677c..d6a87d7a09106 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -140,7 +140,7 @@ return to_chat(src, "You begin to swallow [L] whole...") is_swallowing = TRUE - if(do_after(src, 3 SECONDS, target = L)) + if(do_after(src, 3 SECONDS, target = L, show_to_target = TRUE)) RegisterSignal(L, COMSIG_LIVING_REVIVE, PROC_REF(living_revive)) if(eat(L)) adjustHealth(-L.maxHealth * 0.5) diff --git a/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm b/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm index 5abe515fe1365..ca68aae86f407 100644 --- a/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm +++ b/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm @@ -71,7 +71,7 @@ /datum/action/innate/fugu/expand/Activate() var/mob/living/simple_animal/hostile/asteroid/fugu/F = owner if(F.wumbo) - to_chat(F, "YOU'RE ALREADY WUMBO!") + to_chat(F, "You're already WUMBO!") return if(F.inflate_cooldown) to_chat(F, "You need time to gather your strength.") diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index e165d658cdd8c..ea984309d0932 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -257,7 +257,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(radio.translate_binary) parrot_source.available_channels.Add(MODE_TOKEN_BINARY) -/datum/strippable_item/parrot_headset/start_unequip(atom/source, mob/user) +/datum/strippable_item/parrot_headset/start_unequip(atom/source, mob/user, obscured = FALSE) . = ..() if(!.) return FALSE diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index f2ce9e75a0ef8..4aad24e5ddd6c 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -50,7 +50,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list( if(vent_found_parent && (vent_found_parent.members.len || vent_found_parent.other_atmosmch)) visible_message("[src] begins climbing into the ventilation system." ,"You begin climbing into the ventilation system.") - if(!do_after(src, 25, target = vent_found)) + if(!do_after(src, 2.5 SECONDS, target = vent_found)) return if(!client) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 6deecca18e823..fa2609cb6c007 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -232,3 +232,8 @@ var/thinking_indicator = FALSE /// User is thinking in character. Used to revert to thinking state after stop_typing var/thinking_IC = FALSE + + ///Used for speeding up the process of feeding someone if they were recently fed + COOLDOWN_DECLARE(faster_feeding) + ///used for speeding up the process of stripping someone if they were recently stripped + COOLDOWN_DECLARE(faster_stripping) diff --git a/code/modules/multiz/movement/mob/living_zmove.dm b/code/modules/multiz/movement/mob/living_zmove.dm index 4c8ddb00b9809..79bdd273e85dc 100644 --- a/code/modules/multiz/movement/mob/living_zmove.dm +++ b/code/modules/multiz/movement/mob/living_zmove.dm @@ -86,6 +86,9 @@ /// Actually starts a zMove, doing movement animations /mob/living/proc/start_travel_z(mob/user, upwards = TRUE, move_verb = "floating", delay = 3 SECONDS, allow_movement = TRUE) + if(get_turf(user) in user.do_afters) + to_chat(user, "You're already trying change your height!") + return user.visible_message("[user] begins [move_verb] [upwards ? "upwards" : "downwards"]!", "You begin [move_verb] [upwards ? "upwards" : "downwards"].") animate(user, delay, pixel_y = upwards ? 32 : -32, transform = matrix() * 0.8) var/list/bucklemobs_c = user.buckled_mobs?.Copy() diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index 9ee61a741305c..09c41f452a95f 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -28,9 +28,14 @@ They *could* go in their appropriate files, but this is supposed to be modular . = 0 if(cell && cell.charge) + if(src in H.do_afters) + to_chat(H, "You're already trying to drain \the [src]'s cell!") + return + var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, loc) + to_chat(S, "You start draining \the [src]'s cell with your [G] to recharge your suit!") while(G.candrain && cell.charge> 0 && !maxcapacity) drain = rand(G.mindrain, G.maxdrain) @@ -41,7 +46,7 @@ They *could* go in their appropriate files, but this is supposed to be modular drain = S.cell.maxcharge - S.cell.charge maxcapacity = 1//Reached maximum battery capacity. - if (do_after(H,10, target = src)) + if (do_after(H, 1 SECONDS, target = src, add_item = S.cell)) spark_system.start() playsound(loc, "sparks", 50, 1) cell.use(drain) @@ -72,9 +77,13 @@ They *could* go in their appropriate files, but this is supposed to be modular . = 0 if(charge) + if(src in H.do_afters) + to_chat(H, "You're already draining \the [src]'s power to recharge your suit!") + return + var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, loc) - + to_chat(H, "You start draining \the [src]'s power with your [G] to recharge your suit!") while(G.candrain && charge > 0 && !maxcapacity) drain = rand(G.mindrain, G.maxdrain) @@ -85,7 +94,7 @@ They *could* go in their appropriate files, but this is supposed to be modular drain = S.cell.maxcharge - S.cell.charge maxcapacity = 1 - if (do_after(H,10, target = src)) + if (do_after(H, 1 SECONDS, target = src, add_item = S.cell)) spark_system.start() playsound(loc, "sparks", 50, 1) charge -= drain @@ -102,9 +111,12 @@ They *could* go in their appropriate files, but this is supposed to be modular return INVALID_DRAIN . = 0 - + if(src in H.do_afters) + to_chat(H, "You're already draining the power from \the [src] to recharge your suit!") + return if(charge) - if(G.candrain && do_after(H,30, target = src)) + to_chat(H, "You start draining the power from \the [src] with your [G] to recharge your suit!") + if(G.candrain && do_after(H, 3 SECONDS, target = src, add_item = S.cell)) . = charge if(S.cell.charge + charge > S.cell.maxcharge) S.cell.charge = S.cell.maxcharge @@ -125,6 +137,10 @@ They *could* go in their appropriate files, but this is supposed to be modular if(!S || !H || !G) return INVALID_DRAIN + if(src in H.do_afters) + to_chat(H, "You're already trying to hack \the [src]!") + return + . = DRAIN_RD_HACK_FAILED to_chat(H, "Hacking \the [src]...") @@ -142,6 +158,10 @@ They *could* go in their appropriate files, but this is supposed to be modular if(!S || !H || !G) return INVALID_DRAIN + if(src in H.do_afters) + to_chat(H, "You're already trying to hack \the [src]!") + return + . = DRAIN_RD_HACK_FAILED to_chat(H, "Hacking \the [src]...") @@ -159,16 +179,21 @@ They *could* go in their appropriate files, but this is supposed to be modular if(!S || !H || !G) return INVALID_DRAIN + if(src in H.do_afters) + to_chat(H, "You're already trying to drain the power from [src] to recharge your suit!") + return + var/maxcapacity = 0 //Safety check var/drain = 0 //Drain amount . = 0 var/datum/powernet/PN = powernet + to_chat(H, "You start draining power from \the [src]'s powernet with your [G] to recharge your suit!") while(G.candrain && !maxcapacity && src) drain = (round((rand(G.mindrain, G.maxdrain))/2)) var/drained = 0 - if(PN && do_after(H,10, target = src)) + if(PN && do_after(H, 1 SECONDS, target = src, add_item = S.cell)) drained = min(drain, delayed_surplus()) add_delayedload(drained) if(drained < drain)//if no power on net, drain apcs @@ -195,11 +220,16 @@ They *could* go in their appropriate files, but this is supposed to be modular if(!S || !H || !G) return INVALID_DRAIN + if(src in H.do_afters) + to_chat(H, "You're already trying to drain power from \the [src]!") + return + var/maxcapacity = 0 //Safety check var/drain = 0 //Drain amount . = 0 occupant_message("Warning: Unauthorized access through sub-route 4, block H, detected.") + to_chat(H, "You're already swiping your card on [src]!") + return + var/maxcapacity = 0 //Safety check var/drain = 0 //Drain amount . = 0 to_chat(src, "Warning: Unauthorized access through sub-route 12, block C, detected.") - + to_chat(H, "You start draining power from \the [src] with your [G] to recharge your suit!") if(cell && cell.charge) while(G.candrain && cell.charge > 0 && !maxcapacity) drain = rand(G.mindrain,G.maxdrain) @@ -236,7 +270,7 @@ They *could* go in their appropriate files, but this is supposed to be modular if(S.cell.charge+drain > S.cell.maxcharge) drain = S.cell.maxcharge - S.cell.charge maxcapacity = 1 - if (do_after(H,10)) + if (do_after(H, 1 SECONDS, show_to_target = TRUE, add_item = S.cell)) spark_system.start() playsound(loc, "sparks", 50, 1) cell.use(drain) diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm index 0e70569dc52e2..8f32e9f3e8e30 100644 --- a/code/modules/ninja/suit/suit_attackby.dm +++ b/code/modules/ninja/suit/suit_attackby.dm @@ -21,7 +21,7 @@ var/obj/item/stock_parts/cell/CELL = I if(CELL.maxcharge > cell.maxcharge && n_gloves && n_gloves.candrain) to_chat(U, "Higher maximum capacity detected.\nUpgrading...") - if (n_gloves?.candrain && do_after(U,s_delay, target = src)) + if (n_gloves?.candrain && do_after(U,s_delay, target = src, add_item = I)) U.transferItemToLoc(CELL, src) CELL.charge = min(CELL.charge+cell.charge, CELL.maxcharge) var/obj/item/stock_parts/cell/old_cell = cell @@ -41,7 +41,7 @@ var/has_research = 0 if(has_research)//If it has something on it. to_chat(U, "Research information detected, processing...") - if(do_after(U,s_delay, target = src)) + if(do_after(U,s_delay, target = src, add_item = I)) TD.stored_research.copy_research_to(stored_research) to_chat(U, "Data analyzed and updated. Disk erased.") else diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 2fb3d6e28f87d..8e1088a572f0b 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -206,12 +206,15 @@ jammed = FALSE return TRUE if(istype(item, /obj/item/soap) || istype(item, /obj/item/reagent_containers/glass/rag)) - var/cleanspeed = 50 + if(src in user.do_afters) + to_chat(user, "You're already trying to clean \the [src]!") + return + var/cleanspeed = 5 SECONDS if(istype(item, /obj/item/soap)) var/obj/item/soap/used_soap = item cleanspeed = used_soap.cleanspeed user.visible_message("[user] starts to clean \the [src].", "You start to clean \the [src]...") - if(do_after(user, cleanspeed, target = src)) + if(do_after(user, cleanspeed, target = src, add_item = item)) user.visible_message("[user] cleans \the [src].", "You clean \the [src].") jammed = FALSE return TRUE diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 8afff2d9a863d..2c8cc5205b56f 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -202,7 +202,7 @@ if(reagents?.total_volume && M.reagents) // Obvious message to other people, so that they can call out suspicious activity. to_chat(user, "You prepare to engage the sleepy pen's internal mechanism!") - if (!do_after(user, 0.5 SECONDS, M) || !..()) + if (!do_after(user, 0.5 SECONDS, M, add_item = src) || !..()) to_chat(user, "You fail to engage the sleepy pen mechanism!") return reagents.trans_to(M, reagents.total_volume, transfered_by = user, method = INJECT) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 7fd4f6f9a98cb..3aceeff6e481b 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -454,7 +454,7 @@ else user.visible_message("[user] starts putting [target] onto the photocopier!", "You start putting [target] onto the photocopier...") - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src)) if(!target || QDELETED(target) || QDELETED(src) || !Adjacent(target)) //check if the photocopier/target still exists. return diff --git a/code/modules/plumbing/plumbers/_plumb_machinery.dm b/code/modules/plumbing/plumbers/_plumb_machinery.dm index 8e65d0b0712d1..03ae85da4ae5f 100644 --- a/code/modules/plumbing/plumbers/_plumb_machinery.dm +++ b/code/modules/plumbing/plumbers/_plumb_machinery.dm @@ -45,8 +45,11 @@ return TRUE /obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced) + if(src in user.do_afters) + to_chat(user, "You're already plunging away at [src]!") + return to_chat(user, "You start furiously plunging [name].") - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src)) to_chat(user, "You finish plunging the [name].") reagents.reaction(get_turf(src), TOUCH) //splash on the floor reagents.clear_reagents() diff --git a/code/modules/pool/components/swimming.dm b/code/modules/pool/components/swimming.dm index e2c77c299da72..1403195e22081 100644 --- a/code/modules/pool/components/swimming.dm +++ b/code/modules/pool/components/swimming.dm @@ -73,7 +73,7 @@ if(do_after(parent, 1 SECONDS, target=clicked_turf)) to_chat(parent, "You start to lift [L.pulling] out of the pool...") var/atom/movable/pulled_object = L.pulling - if(do_after(parent, 1 SECONDS, target=pulled_object)) + if(do_after(parent, 1 SECONDS, target=pulled_object, show_to_target = TRUE)) pulled_object.forceMove(clicked_turf) L.visible_message("[parent] pulls [pulled_object] out of the pool.") var/datum/component/swimming/swimming_comp = pulled_object.GetComponent(/datum/component/swimming) diff --git a/code/modules/power/apc/apc_attack.dm b/code/modules/power/apc/apc_attack.dm index 730d8e32d34d4..47f9886b62a7c 100644 --- a/code/modules/power/apc/apc_attack.dm +++ b/code/modules/power/apc/apc_attack.dm @@ -39,10 +39,15 @@ if(C.get_amount() < 10) to_chat(user, "You need ten lengths of cable for APC!") return + + if(src in user.do_afters) + to_chat(user, "You're already adding cables to \the [src]!") + return + user.visible_message("[user.name] adds cables to the APC frame.", \ "You start adding cables to the APC frame.") playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = W)) if (C.get_amount() < 10 || !C) return if (C.get_amount() >= 10 && !terminal && opened && has_electronics) @@ -63,10 +68,14 @@ to_chat(user, "You cannot put the board inside, the frame is damaged!") return + if(src in user.do_afters) + to_chat(user, "You're already inserting a power control board into [src]!") + return + user.visible_message("[user.name] inserts the power control board into [src].", \ "You start to insert the power control board into the frame.") playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) - if(do_after(user, 10, target = src)) + if(do_after(user, 1 SECONDS, target = src, add_item = W)) if(!has_electronics) has_electronics = APC_ELECTRONICS_INSTALLED locked = FALSE @@ -107,10 +116,13 @@ to_chat(user, "You find no reason for repairing this APC.") return if (!(machine_stat & BROKEN) && opened==APC_COVER_REMOVED) + if(src in user.do_afters) + to_chat(user, "You're already trying to replace the missing APC cover!") + return // Cover is the only thing broken, we do not need to remove elctronicks to replace cover user.visible_message("[user.name] replaces missing APC's cover.",\ "You begin to replace the APC's cover.") - if(do_after(user, 20, target = src)) // replacing cover is quicker than replacing whole frame + if(do_after(user, 2 SECONDS, target = src, add_item = W)) // replacing cover is quicker than replacing whole frame to_chat(user, "You replace the missing APC cover.") qdel(W) opened = APC_COVER_OPENED @@ -119,9 +131,12 @@ if (has_electronics) to_chat(user, "You cannot repair this APC until you remove the electronics still inside!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to replace the damaged APC with a new one!") + return user.visible_message("[user.name] replaces the damaged APC frame with a new one.",\ "You begin to replace the damaged APC frame.") - if(do_after(user, 50, target = src)) + if(do_after(user, 5 SECONDS, target = src, add_item = W)) to_chat(user, "You replace the damaged APC frame with a new one.") qdel(W) set_machine_stat(machine_stat & ~BROKEN) @@ -162,9 +177,10 @@ to_chat(H, "The APC doesn't have much power, you probably shouldn't drain anymore.") return - E.drain_time = world.time + 80 + E.drain_time = world.time + 8 SECONDS to_chat(H, "You start channeling some power through the APC into your body.") - while(do_after(user, 75, target = src)) + var/speed_mult = 1 + while(do_after(user, 7.5 SECONDS * speed_mult, target = src, add_item = cell)) if(!istype(stomach)) to_chat(H, "You can't receive charge!") return @@ -172,7 +188,9 @@ to_chat(H, "The APC doesn't have much power, you probably shouldn't drain anymore.") E.drain_time = 0 return - E.drain_time = world.time + 80 + E.drain_time = world.time + 8 SECONDS * speed_mult + if(speed_mult > 0.2) + speed_mult -= 0.1 if(cell.charge > cell.maxcharge/4 + 250) stomach.adjust_charge(250) cell.charge -= 250 @@ -194,13 +212,14 @@ if(!istype(stomach)) to_chat(H, "You can't transfer charge!") return - E.drain_time = world.time + 80 + E.drain_time = world.time + 8 SECONDS to_chat(H, "You start channeling power through your body into the APC.") - while(do_after(user, 75, target = src)) + var/speed_mult = 1 + while(do_after(user, 7.5 SECONDS * speed_mult, target = src, add_item = cell)) if(!istype(stomach)) to_chat(H, "You can't transfer charge!") return - E.drain_time = world.time + 80 + E.drain_time = world.time + 8 SECONDS * speed_mult if(stomach.charge > 250) to_chat(H, "You transfer some power to the APC.") stomach.adjust_charge(-250) @@ -215,6 +234,8 @@ to_chat(H, "The APC is now fully recharged.") E.drain_time = 0 return + if(speed_mult > 0.2) + speed_mult -= 0.1 to_chat(H, "You fail to transfer power to the APC!") E.drain_time = 0 return diff --git a/code/modules/power/apc/apc_malf.dm b/code/modules/power/apc/apc_malf.dm index 94a884e22189e..48f6a9d439a99 100644 --- a/code/modules/power/apc/apc_malf.dm +++ b/code/modules/power/apc/apc_malf.dm @@ -108,7 +108,7 @@ return to_chat(user, "AI accepted request. Transferring stored intelligence to [card].") to_chat(occupier, "Transfer starting. You will be moved to [card] shortly.") - if(!do_after(user, 50, target = src)) + if(!do_after(user, 5 SECONDS, target = src)) to_chat(occupier, "[user] was interrupted! Transfer canceled.") transfer_in_progress = FALSE return diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 8ef2392c1d1cb..02270124be839 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -175,12 +175,13 @@ return to_chat(H, "You clumsily channel power through the [src] and into your body, wasting some in the process.") - E.drain_time = world.time + 25 - while(do_after(user, 20, target = src)) + E.drain_time = world.time + 2.5 SECONDS + var/speed_mult = 1 + while(do_after(user, 2 SECONDS * speed_mult , target = src, add_item = src)) if(!istype(stomach)) to_chat(H, "You can't receive charge!") return - E.drain_time = world.time + 25 + E.drain_time = world.time + 2.5 SECONDS * speed_mult if(charge > 300) stomach.adjust_charge(75) charge -= 300 //you waste way more than you receive, so that ethereals cant just steal one cell and forget about hunger @@ -196,6 +197,8 @@ to_chat(H, "You are now fully charged.") E.drain_time = 0 return + if(speed_mult > 0.2) + speed_mult -= 0.1 to_chat(H, "You fail to receive charge from the [src]!") E.drain_time = 0 return diff --git a/code/modules/power/lighting/light.dm b/code/modules/power/lighting/light.dm index f21b559f6fd20..2bcdc69e85359 100644 --- a/code/modules/power/lighting/light.dm +++ b/code/modules/power/lighting/light.dm @@ -530,11 +530,11 @@ if(user.nutrition >= NUTRITION_LEVEL_ALMOST_FULL) to_chat(user, "You are already fully charged!") return - to_chat(user, "You start channeling some power through the [fitting] into your body.") - E.drain_time = world.time + 35 - while(do_after(user, 30, target = src)) - E.drain_time = world.time + 35 + E.drain_time = world.time + 3.5 SECONDS + var/speed_mult = 1 + while(do_after(user, 3 SECONDS * speed_mult, target = src, add_item = cell)) + E.drain_time = world.time + 3.5 SECONDS * speed_mult if(!istype(stomach)) to_chat(user, "You can't receive charge!") return @@ -545,6 +545,8 @@ to_chat(user, "You are now fully charged.") E.drain_time = 0 return + if(speed_mult > 0.2) + speed_mult -= 0.1 to_chat(user, "You fail to receive charge from the [fitting]!") E.drain_time = 0 return diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index b0469398d11e3..6c8fa3155e16c 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -130,10 +130,14 @@ to_chat(user, "You need more wires!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to build a power terminal for \the [src]!") + return + to_chat(user, "You start building the power terminal...") playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) - if(do_after(user, 20, target = src)) + if(do_after(user, 2 SECONDS, target = src, add_item = I)) if(C.get_amount() < 10 || !C) return var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 7950d03a53a7e..de7e96f4d74a0 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -684,7 +684,7 @@ semicd = TRUE - if(!bypass_timer && (!do_after(user, 12 SECONDS, target) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH)) + if(!bypass_timer && (!do_after(user, 12 SECONDS, target,show_to_target = TRUE, add_item = src) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH)) if(user) if(user == target) user.visible_message("[user] decided not to shoot.") diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index f887252fa16c6..b32ab294ffa0e 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -421,6 +421,11 @@ to_chat(user, "\The [src] is already shortened!") return user.changeNext_move(CLICK_CD_MELEE) + + if(src in user.do_afters) + to_chat(user, "You're already trying to shorten \the [src]!") + return + user.visible_message("[user] begins to shorten \the [src].", "You begin to shorten \the [src]...") //if there's any live ammo inside the gun, makes it go off @@ -428,7 +433,7 @@ user.visible_message("\The [src] goes off!", "\The [src] goes off in your face!") return - if(do_after(user, 30, target = src)) + if(do_after(user, 3 SECONDS, target = src, add_item = src)) if(sawn_off) return user.visible_message("[user] shortens \the [src]!", "You shorten \the [src].") diff --git a/code/modules/projectiles/guns/misc/syringe_gun.dm b/code/modules/projectiles/guns/misc/syringe_gun.dm index 781f520a48c7d..b132f22db98a0 100644 --- a/code/modules/projectiles/guns/misc/syringe_gun.dm +++ b/code/modules/projectiles/guns/misc/syringe_gun.dm @@ -138,7 +138,7 @@ /obj/item/gun/syringe/blowgun/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0) visible_message("[user] starts aiming with a blowgun!") - if(do_after(user, 25, target = src)) + if(do_after(user, 2.5 SECONDS, target = src)) user.adjustStaminaLoss(20) user.adjustOxyLoss(20) return ..() diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index bddd7878e4d8b..650148d97f298 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -427,7 +427,7 @@ . = ..() /obj/structure/closet/decay - breakout_time = 600 + breakout_time = 60 SECONDS icon_welded = null material_drop_amount = 0 var/magic_icon = "cursed" diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 2fed385be961f..45b13b51fcc76 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -37,12 +37,19 @@ reagents.clear_reagents() else if(M != user) + if(src in user.do_afters) + to_chat(user, "You're already swiping trying to feed [M] something!") + return M.visible_message("[user] attempts to feed [M] something from [src].", \ "[user] attempts to feed you something from [src].") - if(!do_after(user, target = M)) + var/feeding_time = 3 SECONDS + if(COOLDOWN_TIMELEFT(M, faster_feeding)) + feeding_time = feeding_time / 3 + if(!do_after(user, feeding_time, target = M, show_to_target = TRUE, add_item = src)) return if(!reagents || !reagents.total_volume) - return // The drink might be empty after the delay, such as by spam-feeding + return // The drink might be empty after the delay + COOLDOWN_START(M, faster_feeding, 5 SECONDS) M.visible_message("[user] feeds [M] something from [src].", \ "[user] feeds you something from [src].") log_combat(user, M, "fed", reagents.log_list()) @@ -445,8 +452,11 @@ if(user.getStaminaLoss() > 50) to_chat(user, "You are too tired to work!") return + if(src in user.do_afters) + to_chat(user, "You're already grinding \the [grinded]!") + return to_chat(user, "You start grinding...") - if((do_after(user, 25, target = src)) && grinded) + if((do_after(user, 2.5 SECONDS, target = src)) && grinded) user.adjustStaminaLoss(40) if(grinded.reagents) //food and pills grinded.reagents.trans_to(src, grinded.reagents.total_volume, transfered_by = user) diff --git a/code/modules/reagents/reagent_containers/medspray.dm b/code/modules/reagents/reagent_containers/medspray.dm index 7369017018af3..7ccab12d5950c 100644 --- a/code/modules/reagents/reagent_containers/medspray.dm +++ b/code/modules/reagents/reagent_containers/medspray.dm @@ -19,7 +19,7 @@ var/can_fill_from_container = TRUE var/apply_type = PATCH var/apply_method = "spray" - var/self_delay = 30 + var/self_delay = 3 SECONDS var/squirt_mode = 0 var/squirt_amount = 5 custom_price = 40 @@ -51,17 +51,23 @@ if(M == user) M.visible_message("[user] attempts to [apply_method] [src] on [user.p_them()]self.") if(self_delay) - if(!do_after(user, self_delay, M)) + if(M in user.do_afters) + to_chat(user, "You're already using \the [src] on yourself!!") + return + if(!do_after(user, self_delay, M, add_item = src)) return if(!reagents || !reagents.total_volume) return to_chat(M, "You [apply_method] yourself with [src].") else + if(M in user.do_afters) + to_chat(user, "You're already trying to use \the [src] on [M]!") + return log_combat(user, M, "attempted to apply", src, reagents.log_list()) M.visible_message("[user] attempts to [apply_method] [src] on [M].", \ "[user] attempts to [apply_method] [src] on [M].") - if(!do_after(user, target = M)) + if(!do_after(user, target = M, show_to_target = TRUE, add_item = src)) return if(!reagents || !reagents.total_volume) return diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index cbee1647f4e10..000bc7fa58a31 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -35,16 +35,22 @@ if(/datum/surgery/dental_implant in C.surgeries) return if(M == user) + if(M in user.do_afters) + to_chat(user, "You're already trying to use \the [src] on yourself!!") + return M.visible_message("[user] attempts to [apply_method] [src].") if(self_delay) - if(!do_after(user, self_delay, M)) + if(!do_after(user, self_delay, M, add_item = src)) return FALSE to_chat(M, "You [apply_method] [src].") else + if(M in user.do_afters) + to_chat(user, "You're already trying to use \the [src] on [M]!") + return M.visible_message("[user] attempts to force [M] to [apply_method] [src].", \ "[user] attempts to force you to [apply_method] [src].") - if(!do_after(user, target = M)) + if(!do_after(user, target = M, show_to_target = TRUE, add_item = src)) return FALSE M.visible_message("[user] forces [M] to [apply_method] [src].", \ "[user] forces you to [apply_method] [src].") diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 4e87c99db3e7d..6f0d7230e8c39 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -101,10 +101,13 @@ if(L) //living mob var/drawn_amount = reagents.maximum_volume - reagents.total_volume if(target != user) + if(target in user.do_afters) + to_chat(user, "You're already trying to take a blood sample from [target]!") + return target.visible_message("[user] is trying to take a blood sample from [target]!", \ "[user] is trying to take a blood sample from you!") busy = TRUE - if(!do_after(user, target = target, extra_checks=CALLBACK(L, TYPE_PROC_REF(/mob/living, can_inject), user, TRUE))) + if(!do_after(user, target = target, extra_checks=CALLBACK(L, TYPE_PROC_REF(/mob/living, can_inject), user, TRUE), show_to_target = TRUE, add_item = src)) busy = FALSE return if(reagents.total_volume >= reagents.maximum_volume) @@ -161,7 +164,7 @@ if(user.a_intent == INTENT_HARM && iscarbon(L) && iscarbon(user)) L.visible_message("[user] lines a syringe up to [L]!", \ "[user] rears their arm back, ready to stab you with [src]") - if(do_after(user, 1 SECONDS, L)) + if(do_after(user, 1 SECONDS, L, show_to_target = TRUE, add_item = src)) var/mob/living/carbon/C = L embed(C, 0.5) log_combat(user, C, "injected (embedding)", src, addition="which had [contained]") @@ -170,9 +173,12 @@ return return if(L != user) + if(src in user.do_afters) + to_chat(user, "You're already trying to inject [target] with \the [src]!") + return L.visible_message("[user] is trying to inject [L]!", \ "[user] is trying to inject you!") - if(!do_after(user, target = L, extra_checks=CALLBACK(L, TYPE_PROC_REF(/mob/living, can_inject), user, TRUE))) + if(!do_after(user, target = L, extra_checks=CALLBACK(L, TYPE_PROC_REF(/mob/living, can_inject), user, TRUE), show_to_target = TRUE, add_item = src)) return if(!reagents.total_volume) return diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 620ef6993d01d..d9ac68ada82bd 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -128,8 +128,11 @@ user.visible_message("[user] starts climbing into [src].", "You start climbing into [src]...") . = TRUE else + if(target in user.do_afters) + to_chat(user, "You're already trying to shove [target] into \the [src]!") + return target.visible_message("[user] starts putting [target] into [src].", "[user] starts putting you into [src]!") - if(do_after(user, 2 SECONDS, target)) + if(do_after(user, 2 SECONDS, target, show_to_target = TRUE)) if (!loc) return target.forceMove(src) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index daab2e02868ab..f4fd87e0f9825 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -72,7 +72,7 @@ AM.relay_container_resist(user, O) return to_chat(user, "You lean on the back of [O] and start pushing to rip the wrapping around it.") - if(do_after(user, 50, target = O)) + if(do_after(user, 5 SECONDS, target = O)) if(!user || user.stat != CONSCIOUS || user.loc != O || O.loc != src ) return to_chat(user, "You successfully removed [O]'s wrapping !") diff --git a/code/modules/religion/religion_structures.dm b/code/modules/religion/religion_structures.dm index 0c5ff0452d17c..115802a54e135 100644 --- a/code/modules/religion/religion_structures.dm +++ b/code/modules/religion/religion_structures.dm @@ -31,8 +31,11 @@ if(pushed_mob.buckled) to_chat(user, "[pushed_mob] is buckled to [pushed_mob.buckled]!") return ..() + if(pushed_mob in user.do_afters) + to_chat(user, "You're already trying to coax [pushed_mob]!") + return ..() to_chat(user,"The [chosen_clothing] transforms!") + user.visible_message("The [chosen_clothing] transforms!") chosen_clothing.obj_destruction() chosen_clothing = null new /obj/item/clothing/suit/space/hardsuit/carp/old(get_turf(religious_tool)) @@ -679,7 +679,7 @@ /datum/religion_rites/summon_animals/perform_rite(mob/living/user, atom/religious_tool) var/turf/altar_turf = get_turf(religious_tool) new /obj/effect/temp_visual/bluespace_fissure/long(altar_turf) - user.visible_message("A tear in reality appears above the altar!") + user.visible_message("A tear in reality appears above the altar!") return ..() /datum/religion_rites/summon_animals/invoke_effect(mob/living/user, atom/religious_tool) diff --git a/code/modules/research/nanites/nanite_chamber.dm b/code/modules/research/nanites/nanite_chamber.dm index 112b178a58aec..0fc32a0c0f614 100644 --- a/code/modules/research/nanites/nanite_chamber.dm +++ b/code/modules/research/nanites/nanite_chamber.dm @@ -14,7 +14,7 @@ var/nanite_coeff = 1 var/speed_coeff = 1 var/locked = FALSE - var/breakout_time = 1200 + var/breakout_time = 120 SECONDS var/scan_level var/busy = FALSE var/busy_icon_state diff --git a/code/modules/research/nanites/public_chamber.dm b/code/modules/research/nanites/public_chamber.dm index 527ca9c96339b..07102c27e78b5 100644 --- a/code/modules/research/nanites/public_chamber.dm +++ b/code/modules/research/nanites/public_chamber.dm @@ -13,7 +13,7 @@ var/cloud_id = 1 var/locked = FALSE - var/breakout_time = 1200 + var/breakout_time = 120 SECONDS var/busy = FALSE var/busy_icon_state var/message_cooldown = 0 diff --git a/code/modules/research/xenobiology/crossbreeding/_potions.dm b/code/modules/research/xenobiology/crossbreeding/_potions.dm index 618af07fc0c8b..86a212f48a08f 100644 --- a/code/modules/research/xenobiology/crossbreeding/_potions.dm +++ b/code/modules/research/xenobiology/crossbreeding/_potions.dm @@ -47,13 +47,19 @@ Slimecrossing Potions to_chat(user, "[src] does not work on beings of pure evil!") return ..() if(M != user) + if(M in user.do_afters) + to_chat(user, "You're already trying to feed [M] \the [src]!") + return M.visible_message("[user] starts to feed [M] a pacification potion!", "[user] starts to feed you a pacification!") else + if(M in user.do_afters) + to_chat(user, "You're already drinking \the [src]!") + return M.visible_message("[user] starts to drink [src]!", "You start to drink [src]!") - if(!do_after(user, 100, target = M)) + if(!do_after(user, 10 SECONDS, target = M, show_to_target = TRUE, add_item = src)) return if(M != user) to_chat(user, "You feed [M] [src]!") @@ -87,10 +93,14 @@ Slimecrossing Potions to_chat(user, "[M] is already lovestruck!") return ..() + if(M in user.do_afters) + to_chat(user, "You're already trying to feed [M] \the [src]!") + return + M.visible_message("[user] starts to feed [M] a love potion!", "[user] starts to feed you a love potion!") - if(!do_after(user, 50, target = M)) + if(!do_after(user, 5 SECONDS, target = M, show_to_target = TRUE, add_item = src)) return to_chat(user, "You feed [M] the love potion!") to_chat(M, "You develop feelings for [user], and anyone [user.p_they()] like.") diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm index 0e66d55d89e12..5503d9a3e07bb 100644 --- a/code/modules/research/xenobiology/crossbreeding/chilling.dm +++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm @@ -164,7 +164,7 @@ Chilling extracts: for(var/mob/living/M in allies) var/datum/status_effect/slimerecall/S = M.apply_status_effect(/datum/status_effect/slimerecall) S.target = user - if(do_after(user, 100, target=src)) + if(do_after(user, 10 SECONDS, target=src)) to_chat(user, "[src] shatters as it tears a hole in reality, snatching the linked individuals from the void!") log_game("[user] has activated [src] at [AREACOORD(user)]") message_admins("[ADMIN_LOOKUPFLW(user)] has activated [src] at [ADMIN_VERBOSEJMP(user)]") diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index 448efc4f539eb..c99fb2c75f7bf 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -65,8 +65,11 @@ Consuming extracts: M.visible_message("[user] eats [src]!", "You eat [src].") fed = TRUE else + if(M in user.do_afters) + to_chat(user, "You're already trying to feed [M] \the [src]!") + return M.visible_message("[user] tries to force [M] to eat [src]!", "[user] tries to force you to eat [src]!") - if(do_after(user, 20, target = M)) + if(do_after(user, 2 SECONDS, target = M, show_to_target = TRUE, add_item = src)) fed = TRUE M.visible_message("[user] forces [M] to eat [src]!", "[user] forces you to eat [src].") if(fed) diff --git a/code/modules/research/xenobiology/crossbreeding/regenerative.dm b/code/modules/research/xenobiology/crossbreeding/regenerative.dm index 643514632acb8..11dc6c9f1dfa6 100644 --- a/code/modules/research/xenobiology/crossbreeding/regenerative.dm +++ b/code/modules/research/xenobiology/crossbreeding/regenerative.dm @@ -25,7 +25,10 @@ Regenerative extracts: if(H.stat == DEAD) to_chat(user, "[src] will not work on the dead!") return - if(!do_after(user, 5 SECONDS, H)) + if(H in user.do_afters) + to_chat(user, "You're already trying to apply \the [src] to [H]!") + return + if(!do_after(user, 5 SECONDS, H, show_to_target = TRUE, add_item = src)) to_chat(user, "You need to hold still to apply [src]!") return if(H != user) diff --git a/code/modules/research/xenobiology/crossbreeding/warping.dm b/code/modules/research/xenobiology/crossbreeding/warping.dm index 745b6fd719c62..c7bbbae286c96 100644 --- a/code/modules/research/xenobiology/crossbreeding/warping.dm +++ b/code/modules/research/xenobiology/crossbreeding/warping.dm @@ -58,6 +58,9 @@ put up a rune with bluespace effects, lots of those runes are fluff or act as a return var/obj/item/stack/space_crystal = used_item + if(src in user.do_afters) + to_chat(user, "You're already trying to nullify the effects of the rune!") + return if(do_after(user, storing_time,target = src)) //the time it takes to nullify it depends on the rune too to_chat(user, "You nullify the effects of the rune with the bluespace crystal!") space_crystal.use(1) @@ -90,6 +93,9 @@ put up a rune with bluespace effects, lots of those runes are fluff or act as a return if(istype(target, runepath)) //checks if the target is a rune and then if you can store it + if(target in user.do_afters) + to_chat(user, "You're already trying to store \the [target]!") + return if(do_after(user, storing_time,target = target)) warping_crossbreed_absorb(target, user) return @@ -109,6 +115,10 @@ put up a rune with bluespace effects, lots of those runes are fluff or act as a if(!check_cd(user)) return + if(target in user.do_afters) + to_chat(user, "You're already trying to draw a rune here!") + return + if(do_after(user, drawing_time,target = target)) if(warp_charge >= 1 && (!locate(/obj/effect/warped_rune) in target) && check_cd(user)) //check one last time if a rune has been drawn during the do_after and if there's enough charges left warping_crossbreed_spawn(target,user) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 6c65f0717cf1c..93f3e9e4e4747 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -996,10 +996,14 @@ to_chat(user, "[src] can only be used on gendered things!") return + if(target in user.do_afters) + to_chat(user, "You're already trying to feed [target] \the [src]!") + return + target.visible_message("[user] starts to feed [target] [src]!", "[user] starts to feed you [src]!") - if(!do_after(user, 5 SECONDS, target = target)) + if(!do_after(user, 5 SECONDS, target = target, show_to_target = TRUE, add_item = src)) return to_chat(user, "You feed [target] [src]!") diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 7719b5bf30d12..201acc242ef09 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -178,7 +178,15 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if(!(src in user.mob_spell_list)) return FALSE - if(!do_after(user,invocation_time, target = user, progress = 1)) //checks if there is a invocation time set for this spell and cancels the spell if the user is interrupted. + if(user in user.do_afters) + to_chat(user, "You're already to cast something!") + return + + var/atom/movable/fake_atom = new + fake_atom.icon = action_icon + fake_atom.icon_state = action_icon_state + + if(!do_after(user,invocation_time, target = user, progress = 1, add_item = fake_atom)) //checks if there is a invocation time set for this spell and cancels the spell if the user is interrupted. to_chat(user, "You get interrupted.") return FALSE diff --git a/code/modules/spells/spell_types/devil.dm b/code/modules/spells/spell_types/devil.dm index ef876286c30c8..9ad5c5a230437 100644 --- a/code/modules/spells/spell_types/devil.dm +++ b/code/modules/spells/spell_types/devil.dm @@ -106,6 +106,9 @@ if(istype(user)) if(istype(user.loc, /obj/effect/dummy/phased_mob/slaughter/)) if(valid_location(user)) + if(user in user.do_afters) + to_chat(user, "You're already trying to phase in!") + return ..() to_chat(user, "You are now phasing in.") if(do_after(user, 15 SECONDS)) if(valid_location(user)) @@ -118,6 +121,9 @@ revert_cast() return ..() else + if(user in user.do_afters) + to_chat(user, "You're already trying to phase out!") + return user.notransform = TRUE user.fakefire() to_chat(src, "You begin to phase back into sinful flames.") diff --git a/code/modules/spells/spell_types/godhand.dm b/code/modules/spells/spell_types/godhand.dm index 11de3da023f0f..f436fb3aa3786 100644 --- a/code/modules/spells/spell_types/godhand.dm +++ b/code/modules/spells/spell_types/godhand.dm @@ -183,8 +183,15 @@ return var/mob/living/carbon/M = target + if(target in user.do_afters) + to_chat(user, "You're already trying to stuff [M] into \the [src]!") + return + user.visible_message("[user] is trying to stuff [M]\s body into \the [src]!") - if(do_after(user, 25 SECONDS, M)) + var/atom/movable/fake_atom = new + fake_atom.icon = icon + fake_atom.icon_state = icon_state + if(do_after(user, 25 SECONDS, M, show_to_target = TRUE, add_item = fake_atom)) var/name = M.real_name var/obj/item/reagent_containers/food/snacks/pie/cream/body/pie = new(get_turf(M)) pie.name = "\improper [name] [pie.name]" diff --git a/code/modules/spells/spell_types/lesserlichdom.dm b/code/modules/spells/spell_types/lesserlichdom.dm index 93cd0c16a9ce1..bc41e0c3a58b8 100644 --- a/code/modules/spells/spell_types/lesserlichdom.dm +++ b/code/modules/spells/spell_types/lesserlichdom.dm @@ -47,9 +47,13 @@ to_chat(M, "None of the items you hold are suitable for emplacement of your fragile soul.") return + if(marked_item in M.do_afters) + to_chat(M, "You're already trying to bind your soul to [marked_item]!") + return + playsound(user, 'sound/effects/pope_entry.ogg', 100) - if(!do_after(M, 50, target=marked_item, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(M, 5 SECONDS, target=marked_item, timed_action_flags = IGNORE_HELD_ITEM, add_item = marked_item)) to_chat(M, "Your soul snaps back to your body as you stop ensouling [marked_item]!") return diff --git a/code/modules/spells/spell_types/lichdom.dm b/code/modules/spells/spell_types/lichdom.dm index 65ceadb56e6a2..e314edb50ae87 100644 --- a/code/modules/spells/spell_types/lichdom.dm +++ b/code/modules/spells/spell_types/lichdom.dm @@ -47,9 +47,13 @@ to_chat(M, "None of the items you hold are suitable for emplacement of your fragile soul.") return + if(src in user.do_afters) + to_chat(user, "You're already trying to bind your soul to \the [marked_item]!") + return + playsound(user, 'sound/effects/pope_entry.ogg', 100) - if(!do_after(M, 50, target=marked_item, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(M, 5 SECONDS, target=marked_item, timed_action_flags = IGNORE_HELD_ITEM, add_item = marked_item)) to_chat(M, "Your soul snaps back to your body as you stop ensouling [marked_item]!") return diff --git a/code/modules/surgery/anesthetic_machine.dm b/code/modules/surgery/anesthetic_machine.dm index dbfb594cf514c..f00664432f673 100644 --- a/code/modules/surgery/anesthetic_machine.dm +++ b/code/modules/surgery/anesthetic_machine.dm @@ -72,14 +72,18 @@ return if(Adjacent(target) && usr.Adjacent(target)) if(attached_tank && !mask_out) - usr.visible_message("[usr] attempts to attach \the [src] to [target].", "You attempt to attach \the [src] to [target].") - if(!do_after(usr, target != usr ? (7 SECONDS) : (1 SECONDS), target)) + var/mob/user = usr + if(target in user.do_afters) + to_chat(user, "You're already trying attach \the [src] to [target]!") + return + user.visible_message("[user] attemps to attach the [src] to [target].", "You attempt to attach the [src] to [target].") + if(!do_after(user, target != usr ? (7 SECONDS) : (1 SECONDS), target, show_to_target = TRUE, add_item = attached_mask)) return if(!target.equip_to_appropriate_slot(attached_mask)) - to_chat(usr, "You are unable to attach \the [src] to [target]!") + to_chat(user, "You are unable to attach the [src] to [target]!") return else - usr.visible_message("[usr] attaches \the [src] to [target].", "You attach \the [src] to [target].") + user.visible_message("[user] attaches the [src] to [target].", "You attach the [src] to [target].") target.external = attached_tank mask_out = TRUE START_PROCESSING(SSmachines, src) @@ -119,8 +123,11 @@ to_chat(user, "You need to remove the anesthetic tank first!") return if(!mask_out) + if(src in user.do_afters) + to_chat(user, "You're already swiping to detach the breath mask!") + return visible_message("[user] attempts to detach the breath mask from [src].", "You attempt to detach the breath mask from [src].") - if(!do_after(user, 100, src, timed_action_flags = IGNORE_HELD_ITEM)) + if(!do_after(user, 10 SECONDS, src, timed_action_flags = IGNORE_HELD_ITEM, add_item = I)) to_chat(user, "You fail to dettach the breath mask from [src]!") return visible_message("[user] detaches the breath mask from [src].", "You detach the breath mask from [src].") diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 7cbce34559d80..405b6e0361e64 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -126,10 +126,13 @@ if(!contents.len) to_chat(user, "There is nothing left inside [src]!") return + if(src in user.do_afters) + to_chat(user, "You're already trying to cut open \the [src]!") + return playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1) user.visible_message("[user] begins to cut open [src].",\ "You begin to cut open [src]...") - if(do_after(user, 54, target = src)) + if(do_after(user, 5.4 SECONDS, target = src, add_item = W)) drop_organs(user, TRUE) else return ..() diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 9d4e6b4550e47..5affb88556d30 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -193,6 +193,9 @@ if(!new_surgeries) to_chat(owner, "No new surgical programs detected on \the [held_item] in your [hand_name].") continue + if(held_item in owner.do_afters) + to_chat(owner, "You're already trying to download surgical programs from \the [held_item]!") + return to_chat(owner, "[new_surgeries] new surgical program\s detected on \the [held_item] in your [hand_name]! Please hold still while the surgical program is being downloaded...") if(!do_after(owner, 5 SECONDS, held_item)) to_chat(owner, "Surgical program transfer interrupted!") diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 955e38046bf9d..d82fe9d257d14 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -124,7 +124,7 @@ to_chat(H, "[src] is already attuned to the same channel as your own.") H.visible_message("[H] holds [src] in their hands, and concentrates for a moment.", "You attempt to modify the attenuation of [src].") - if(do_after(H, delay=15, target=src)) + if(do_after(H, delay=1.5 SECONDS, target=src)) to_chat(H, "You attune [src] to your own channel.") mothership = T.mothership diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index 3f471cbc32ee5..94770e90fbbd2 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -89,6 +89,11 @@ var/fail_prob = 0//100 - fail_prob = success_prob var/advance = FALSE + if(target in user.do_afters) + to_chat(user, "You're already performing a surgery on [target]!") + surgery.step_in_progress = FALSE + return FALSE + if(preop(user, target, target_zone, tool, surgery) == -1) surgery.step_in_progress = FALSE return FALSE @@ -110,7 +115,7 @@ if(iscyborg(user))//any immunities to surgery slowdown should go in this check. modded_time = time - if(do_after(user, modded_time, target = target)) + if(do_after(user, modded_time, target = target, show_to_target = TRUE, add_item = tool)) if((prob(100 - fail_prob) || iscyborg(user)) && chem_check(target) && !try_to_fail) diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index a0b4eb823de22..1b24521e1ce5c 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -297,13 +297,13 @@ if(istype(O, /obj/item/disk/surgery)) to_chat(user, "You load the surgery protocol from [O] into [src].") var/obj/item/disk/surgery/D = O - if(do_after(user, 10, target = O)) + if(do_after(user, 1 SECONDS, target = O)) advanced_surgeries |= D.surgeries return TRUE if(istype(O, /obj/machinery/computer/operating)) to_chat(user, "You copy surgery protocols from [O] into [src].") var/obj/machinery/computer/operating/OC = O - if(do_after(user, 10, target = O)) + if(do_after(user, 1 SECONDS, target = O)) advanced_surgeries |= OC.advanced_surgeries return TRUE return diff --git a/code/modules/vehicles/cars/car.dm b/code/modules/vehicles/cars/car.dm index ea2d675daf265..05cbc4c29d161 100644 --- a/code/modules/vehicles/cars/car.dm +++ b/code/modules/vehicles/cars/car.dm @@ -84,7 +84,7 @@ if(occupants[user]) return to_chat(user, "You start opening [src]'s trunk.") - if(do_after(user, 30)) + if(do_after(user, 3 SECONDS)) if(return_amount_of_controllers_with_flag(VEHICLE_CONTROL_KIDNAPPED)) to_chat(user, "The people stuck in [src]'s trunk all come tumbling out.") DumpSpecificMobs(VEHICLE_CONTROL_KIDNAPPED) @@ -97,7 +97,7 @@ if(occupant_amount() >= max_occupants) return FALSE var/atom/old_loc = loc - if(do_after(forcer, get_enter_delay(M), M, extra_checks=CALLBACK(src, TYPE_PROC_REF(/obj/vehicle/sealed/car, is_car_stationary), old_loc))) + if(do_after(forcer, get_enter_delay(M), M, extra_checks=CALLBACK(src, TYPE_PROC_REF(/obj/vehicle/sealed/car, is_car_stationary), old_loc), show_to_target = TRUE)) mob_forced_enter(M, silent) return TRUE return FALSE diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 9030a1529144e..c8fa69b3b3b9a 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -629,8 +629,11 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C return if(tilted && !user.buckled && !isAI(user)) + if(src in user.do_afters) + to_chat(user, "You're already trying to right \the [src]!") + return to_chat(user, "You begin righting [src].") - if(do_after(user, 50, target=src)) + if(do_after(user, 5 SECONDS, target=src)) untilt(user) return diff --git a/code/modules/wiremod/components/action/mmi.dm b/code/modules/wiremod/components/action/mmi.dm index 9ce4ae48b413c..0425bd7c0dfa5 100644 --- a/code/modules/wiremod/components/action/mmi.dm +++ b/code/modules/wiremod/components/action/mmi.dm @@ -90,7 +90,7 @@ if(!target_mmi.brainmob) return add_mmi(item) - return COMPONENT_NO_AFTERATTACK + return /obj/item/circuit_component/mmi/proc/add_mmi(obj/item/mmi/to_add) remove_current_brain() diff --git a/code/modules/wiremod/shell/shell_items.dm b/code/modules/wiremod/shell/shell_items.dm index a2d6ffa578579..5fd7d24d1b86a 100644 --- a/code/modules/wiremod/shell/shell_items.dm +++ b/code/modules/wiremod/shell/shell_items.dm @@ -11,9 +11,12 @@ var/screw_delay = 3 SECONDS /obj/item/shell/screwdriver_act(mob/living/user, obj/item/tool) + if(src in user.do_afters) + to_chat(user, "You're already trying to finish [src]!") + return user.visible_message("[user] begins finishing [src].", "You begin finishing [src].") tool.play_tool_sound(src) - if(!do_after(user, screw_delay, target = src)) + if(!do_after(user, screw_delay, target = src, add_item = tool)) return user.visible_message("[user] finishes [src].", "You finish [src].") diff --git a/code/modules/xenoarchaeology/xenoartifact_labeler.dm b/code/modules/xenoarchaeology/xenoartifact_labeler.dm index 88f99a7d5c91a..a380e0f4a0235 100644 --- a/code/modules/xenoarchaeology/xenoartifact_labeler.dm +++ b/code/modules/xenoarchaeology/xenoartifact_labeler.dm @@ -180,9 +180,12 @@ /obj/item/xenoartifact_label/proc/attempt_attach(atom/target, mob/user, instant = FALSE) if(istype(target, /mob/living)) + if(target in user.do_afters) + to_chat(user, "You're already trying to stick \a [src] to [target]!") + return to_chat(target, "[user] attempts to stick a [src] to you!") to_chat(user, "You attempt to stick a [src] on [target]!") - if(!do_after(user, 30, target = target)) + if(!do_after(user, 3 SECONDS, target = target, show_to_target = TRUE, add_item = src)) if(instant) qdel(src) return diff --git a/icons/effects/64x64.dmi b/icons/effects/64x64.dmi index 154f5d938b57c..f3e84b3a08e31 100644 Binary files a/icons/effects/64x64.dmi and b/icons/effects/64x64.dmi differ