diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index bfe7c5fcd9d..5516dadfa6d 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -180,4 +180,6 @@
#define TURF_DRY 0
#define TURF_WET_WATER 1
#define TURF_WET_LUBE 2
-#define TURF_WET_ICE 3
\ No newline at end of file
+#define TURF_WET_ICE 3
+
+#define APPEARANCE_UI_IGNORE_ALPHA RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA
\ No newline at end of file
diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index 001f2b148ce..f8980d61ddd 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -162,3 +162,97 @@ proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=nul
if(!admin) return
msg_admin_attack("[key_name_admin(user)] [what_done] [key_name_admin(target)][object ? " with [object]" : " "][addition]")
+/proc/do_mob(var/mob/user, var/mob/target, var/time = 30, var/uninterruptible = 0, progress = 1)
+ if(!user || !target)
+ return 0
+ var/user_loc = user.loc
+
+ var/drifting = 0
+ if(!user.Process_Spacemove(0) && user.inertia_dir)
+ drifting = 1
+
+ var/target_loc = target.loc
+
+ var/holding = user.get_active_hand()
+ var/datum/progressbar/progbar
+ if (progress)
+ progbar = new(user, time, target)
+
+ var/endtime = world.time+time
+ var/starttime = world.time
+ . = 1
+ while (world.time < endtime)
+ sleep(1)
+ if (progress)
+ progbar.update(world.time - starttime)
+ if(!user || !target)
+ . = 0
+ break
+ if(uninterruptible)
+ continue
+
+ if(drifting && !user.inertia_dir)
+ drifting = 0
+ user_loc = user.loc
+
+ if((!drifting && user.loc != user_loc) || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying )
+ . = 0
+ break
+ if (progress)
+ qdel(progbar)
+
+/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1)
+ if(!user)
+ return 0
+ var/atom/Tloc = null
+ if(target)
+ Tloc = target.loc
+
+ var/atom/Uloc = user.loc
+
+ var/drifting = 0
+ if(!user.Process_Spacemove(0) && user.inertia_dir)
+ drifting = 1
+
+ var/holding = user.get_active_hand()
+
+ var/holdingnull = 1 //User's hand started out empty, check for an empty hand
+ if(holding)
+ holdingnull = 0 //Users hand started holding something, check to see if it's still holding that
+
+ var/datum/progressbar/progbar
+ if (progress)
+ progbar = new(user, delay, target)
+
+ var/endtime = world.time + delay
+ var/starttime = world.time
+ . = 1
+ while (world.time < endtime)
+ sleep(1)
+ if (progress)
+ progbar.update(world.time - starttime)
+
+ if(drifting && !user.inertia_dir)
+ drifting = 0
+ Uloc = user.loc
+
+ if(!user || user.stat || user.weakened || user.stunned || (!drifting && user.loc != Uloc))
+ . = 0
+ break
+
+ if(Tloc && (!target || Tloc != target.loc))
+ . = 0
+ break
+
+ if(needhand)
+ //This might seem like an odd check, but you can still need a hand even when it's empty
+ //i.e the hand is used to pull some item/tool out of the construction
+ if(!holdingnull)
+ if(!holding)
+ . = 0
+ break
+ if(user.get_active_hand() != holding)
+ . = 0
+ break
+ if (progress)
+ qdel(progbar)
\ No newline at end of file
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 6d3ad3f365e..0c99ec12416 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -601,95 +601,6 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
else return get_step(ref, base_dir)
-/proc/do_mob(var/mob/user , var/mob/target, var/time = 30, numticks = 5, var/uninterruptible = 0) //This is quite an ugly solution but i refuse to use the old request system.
- if(!user || !target)
- return 0
- if(numticks == 0)
- return 0
- var/user_loc = user.loc
- var/target_loc = target.loc
- var/holding = user.get_active_hand()
- var/timefraction = round(time/numticks)
- var/image/progbar
- for(var/i = 1 to numticks)
- if(user.client)
- progbar = make_progress_bar(i, numticks, target)
- user.client.images |= progbar
- sleep(timefraction)
- if(!user || !target)
- if(user && user.client)
- user.client.images -= progbar
- return 0
- if (!uninterruptible && (user.loc != user_loc || target.loc != target_loc || user.get_active_hand() != holding || user.stat || user.stunned || user.weakened || user.paralysis || user.lying))
- if(user && user.client)
- user.client.images -= progbar
- return 0
- if(user && user.client)
- user.client.images -= progbar
- if(user && user.client)
- user.client.images -= progbar
- return 1
-
-/proc/make_progress_bar(var/current_number, var/goal_number, var/atom/target)
- if(current_number && goal_number && target)
- var/image/progbar
- progbar = image("icon" = 'icons/effects/doafter_icon.dmi', "loc" = target, "icon_state" = "prog_bar_0")
- progbar.icon_state = "prog_bar_[round(((current_number / goal_number) * 100), 10)]"
- progbar.pixel_y = 32
- return progbar
-
-/proc/do_after(mob/user, delay, numticks = 5, needhand = 1, atom/target = null)
- if(!user)
- return 0
-
- if(numticks == 0)
- return 0
-
- var/atom/Tloc = null
- if(target)
- Tloc = target.loc
-
- var/delayfraction = round(delay/numticks)
- var/atom/Uloc = user.loc
- var/holding = user.get_active_hand()
- var/holdingnull = 1 //User is not holding anything
- if(holding)
- holdingnull = 0 //User is holding a tool of some kind
- var/image/progbar
- for (var/i = 1 to numticks)
- if(user.client)
- progbar = make_progress_bar(i, numticks, target)
- user.client.images |= progbar
- sleep(delayfraction)
- if(!user || user.stat || user.weakened || user.stunned || !(user.loc == Uloc))
- if(user && user.client)
- user.client.images -= progbar
- return 0
-
- if(Tloc && (!target || Tloc != target.loc)) //Tloc not set when we don't want to track target
- if(user && user.client)
- user.client.images -= progbar
- return 0 // Target no longer exists or has moved
-
- if(needhand)
- //This might seem like an odd check, but you can still need a hand even when it's empty
- //i.e the hand is used to insert some item/tool into the construction
- if(!holdingnull)
- if(!holding)
- if(user && user.client)
- user.client.images -= progbar
- return 0
- if(user.get_active_hand() != holding)
- if(user && user.client)
- user.client.images -= progbar
- return 0
- if(user && user.client)
- user.client.images -= progbar
- if(user && user.client)
- user.client.images -= progbar
- if(user && user.client)
- user.client.images -= progbar
- return 1
//Takes: Anything that could possibly have variables and a varname to check.
//Returns: 1 if found, 0 if not.
/proc/hasvar(var/datum/A, var/varname)
diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm
new file mode 100644
index 00000000000..ebf7aa3938d
--- /dev/null
+++ b/code/datums/progressbar.dm
@@ -0,0 +1,42 @@
+/datum/progressbar
+ var/goal = 1
+ var/image/bar
+ var/shown = 0
+ var/mob/user
+ var/client/client
+
+/datum/progressbar/New(mob/User, goal_number, atom/target)
+ . = ..()
+ if (!istype(target))
+ EXCEPTION("Invalid target given")
+ if (goal_number)
+ goal = goal_number
+ bar = image('icons/effects/progessbar.dmi', target, "prog_bar_0")
+ bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
+ bar.pixel_y = 32
+ user = User
+ if(user)
+ client = user.client
+
+/datum/progressbar/proc/update(progress)
+ //world << "Update [progress] - [goal] - [(progress / goal)] - [((progress / goal) * 100)] - [round(((progress / goal) * 100), 5)]"
+ if (!user || !user.client)
+ shown = 0
+ return
+ if (user.client != client)
+ if (client)
+ client.images -= bar
+ if (user.client)
+ user.client.images += bar
+
+ progress = Clamp(progress, 0, goal)
+ bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
+ if (!shown)
+ user.client.images += bar
+ shown = 1
+
+/datum/progressbar/Destroy()
+ if (client)
+ client.images -= bar
+ qdel(bar)
+ . = ..()
\ No newline at end of file
diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm
index ba01a996b8c..784f96b9df2 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant.dm
@@ -129,7 +129,7 @@
draining = 1
essence_drained = rand(15, 20)
src << "You search for the soul of [target]."
- if(do_after(src, 10, 3, 0, target = target)) //did they get deleted in that second?
+ if(do_after(src, 10, 0, target = target)) //did they get deleted in that second?
if(target.ckey)
src << "Their soul burns with intelligence."
essence_drained += rand(20, 30)
@@ -138,7 +138,7 @@
essence_drained += rand(40, 50)
else
src << "Their soul is weak and faltering."
- if(do_after(src, 20, 6, 0, target = target)) //did they get deleted NOW?
+ if(do_after(src, 20, 0, target = target)) //did they get deleted NOW?
switch(essence_drained)
if(1 to 30)
src << "[target] will not yield much essence. Still, every bit counts."
@@ -148,7 +148,7 @@
src << "Such a feast! [target] will yield much essence to you."
if(90 to INFINITY)
src << "Ah, the perfect soul. [target] will yield massive amounts of essence to you."
- if(do_after(src, 20, 6, 0, target = target)) //how about now
+ if(do_after(src, 20, 0, target = target)) //how about now
if(!target.stat)
src << "They are now powerful enough to fight off your draining."
target << "You feel something tugging across your body before subsiding."
@@ -162,7 +162,7 @@
stun(27)
target.visible_message("[target] suddenly rises slightly into the air, their skin turning an ashy gray.")
target.Beam(src,icon_state="drain_life",icon='icons/effects/effects.dmi',time=26)
- if(do_after(src, 30, 9, 0, target)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining.
+ if(do_after(src, 30, 0, target)) //As one cannot prove the existance of ghosts, ghosts cannot prove the existance of the target they were draining.
change_essence_amount(essence_drained, 0, target)
if(essence_drained > 90)
essence_regen_cap += 25
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index cc73a42f0d0..b322a84de5b 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -82,7 +82,7 @@
if(open)
GM.visible_message("[user] starts to give [GM] a swirlie!", "[user] starts to give [GM] a swirlie...")
swirlie = GM
- if(do_after(user, 30, 5, 0, target = src))
+ if(do_after(user, 30, 0, target = src))
GM.visible_message("[user] gives [GM] a swirlie!", "[user] gives [GM] a swirlie!", "You hear a toilet flushing.")
if(iscarbon(GM))
var/mob/living/carbon/C = GM
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index daa0f9571fc..6f40c678432 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -430,7 +430,9 @@ proc/get_radio_key_from_channel(var/channel)
speech_bubble_recipients.Add(M.client)
spawn(0)
- flick_overlay(image('icons/mob/talk.dmi', src, "h[speech_bubble_test]",MOB_LAYER+1), speech_bubble_recipients, 30)
+ var/image/I = image('icons/mob/talk.dmi', src, "h[speech_bubble_test]", MOB_LAYER + 1)
+ I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
+ flick_overlay(I, speech_bubble_recipients, 30)
if(watching.len)
var/rendered = "[src.name] [not_heard]."
@@ -441,4 +443,6 @@ proc/get_radio_key_from_channel(var/channel)
return 1
/mob/living/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
- flick_overlay(image('icons/mob/talk.dmi', bubble_loc, bubble_state,MOB_LAYER+1), bubble_recipients, 30)
\ No newline at end of file
+ var/image/I = image('icons/mob/talk.dmi', bubble_loc, bubble_state, MOB_LAYER + 1)
+ I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
+ flick_overlay(, bubble_recipients, 30)
\ No newline at end of file
diff --git a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
index f07b2ed1794..2f477b45482 100644
--- a/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
+++ b/code/modules/mob/living/simple_animal/hostile/spaceworms.dm
@@ -165,7 +165,7 @@
src.visible_message("\the [src] starts to eat \the [noms]!","You start to eat \the [noms]. (This will take about [ufnomDelay] seconds.)","You hear gnashing.") //inform everyone what the fucking worm is doing.
- if(do_after(src, nomDelay,5,0, target = noms))
+ if(do_after(src, nomDelay, 0, target = noms))
if(noms && Adjacent(noms) && (currentlyEating == noms))//It exists, were next to it, and it's still the thing were eating
if(W)
W.ChangeTurf(/turf/simulated/floor/plating)
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index 98c50af7dad..635d8f1bd8e 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -131,7 +131,7 @@
else
user.visible_message("[user] begins to wipe [H]'s face clean with \the [src].", \
"You begin to wipe off [H]'s face.")
- if(do_after(user, 10, target = H) && do_after(H, 10, 5, 0)) //user needs to keep their active hand, H does not.
+ if(do_after(user, 10, target = H) && do_after(H, 10, 0)) //user needs to keep their active hand, H does not.
user.visible_message("[user] wipes [H]'s face clean with \the [src].", \
"You wipe off [H]'s face.")
H.lip_style = null
diff --git a/icons/effects/doafter_icon.dmi b/icons/effects/doafter_icon.dmi
deleted file mode 100644
index 9fce3af3353..00000000000
Binary files a/icons/effects/doafter_icon.dmi and /dev/null differ
diff --git a/icons/effects/progessbar.dmi b/icons/effects/progessbar.dmi
new file mode 100644
index 00000000000..99284060aa6
Binary files /dev/null and b/icons/effects/progessbar.dmi differ
diff --git a/paradise.dme b/paradise.dme
index 3b3535e57f6..4a673c9da4a 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -190,6 +190,7 @@
#include "code\datums\mixed.dm"
#include "code\datums\modules.dm"
#include "code\datums\periodic_news.dm"
+#include "code\datums\progressbar.dm"
#include "code\datums\recipe.dm"
#include "code\datums\spell.dm"
#include "code\datums\supplypacks.dm"