[PORT] Adds TG "busy" cogbar animation for players (#27932)

* looks like it works

* move to PREFTOGGLE_3 and add sneaky do_after

* linter

* param doc and some cleanup

* autodoc and comment signal

* fix wrong type in link_processing

* fix wrong var in preferences

* cover do_mob and do_after_once

* fix toggles total

* replace indent with space

* offset and helpers procs

* fix conditional statement

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Mira <42539014+MiraHell@users.noreply.github.com>

* Update code/__HELPERS/mob_helpers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Mira <42539014+MiraHell@users.noreply.github.com>

* use SECONDS

* Update code/game/objects/items/weapons/weaponry.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Mira <42539014+MiraHell@users.noreply.github.com>

---------

Signed-off-by: Mira <42539014+MiraHell@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Mira
2025-03-06 19:04:51 +03:00
committed by GitHub
parent c550db4e65
commit a6e8f69c55
40 changed files with 357 additions and 41 deletions
@@ -27,7 +27,7 @@
is_operating = FALSE
return FALSE
user.visible_message("<span class='danger'>[user] begins vomiting an arachnid!</span>")
if(do_after(user, 4 SECONDS, FALSE, target = user)) // Takes 4 seconds to spawn a spider
if(do_after(user, 4 SECONDS, FALSE, target = user, hidden = TRUE)) // Takes 4 seconds to spawn a spider
spider_counter++
user.visible_message("<span class='danger'>[user] vomits up an arachnid!</span>")
var/mob/living/simple_animal/hostile/poison/giant_spider/hunter/infestation_spider/S = new(user.loc)
@@ -134,7 +134,7 @@
"<span class='sinister'>We begin our harvest on [H].</span>",
"<span class='notice'>You hear the hum of electricity.</span>"
)
if(!do_mob(owner.current, H, time = 2 SECONDS))
if(!do_mob(owner.current, H, time = 2 SECONDS, hidden = TRUE))
send_swarm_message("Our connection was incomplete.")
harvesting = null
return
@@ -201,7 +201,7 @@
to_chat(user, "<span class='notice'>Your override attempt fails before it can even begin.</span>")
qdel(src)
return
if(!do_mob(user, borg, conversion_time))
if(!do_mob(user, borg, conversion_time, hidden = TRUE))
to_chat(user, "<span class='notice'>Your concentration breaks.</span>")
qdel(src)
return
@@ -253,7 +253,7 @@
M.visible_message("<span class='notice'>[M] starts entering a cryptic series of characters on [U].</span>",\
"<span class='notice'>You start entering an extraction signal to your handlers on [U]...</span>")
if(do_after(M, EXTRACTION_PHASE_PREPARE, target = M))
if(do_after(M, EXTRACTION_PHASE_PREPARE, target = M, hidden = TRUE))
if(!U.Adjacent(M) || extraction_deadline > world.time)
return
var/obj/effect/contractor_flare/F = new(get_turf(M))
@@ -113,7 +113,7 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
H.LAssailant = null
else
H.LAssailant = owner
while(do_mob(owner.current, H, suck_rate))
while(do_mob(owner.current, H, suck_rate, hidden = TRUE))
owner.current.do_attack_animation(H, ATTACK_EFFECT_BITE)
if(unique_suck_id in drained_humans)
if(drained_humans[unique_suck_id] >= BLOOD_DRAIN_LIMIT)
@@ -28,7 +28,7 @@
var/mob/living/target = targets[1]
user.visible_message("<span class='warning'>[user] bites [target]'s neck!</span>", "<span class='warning'>You bite [target]'s neck and begin the flow of power.</span>")
to_chat(target, "<span class='warning'>You feel the tendrils of evil invade your mind.</span>")
if(do_mob(user, target, 15 SECONDS))
if(do_mob(user, target, 15 SECONDS, hidden = TRUE))
if(can_enthrall(user, target))
handle_enthrall(user, target)
var/datum/spell_handler/vampire/V = custom_handler
@@ -140,7 +140,7 @@
if(!making_anchor && !anchor) // first cast, setup the anchor
var/turf/anchor_turf = get_turf(user)
making_anchor = TRUE
if(do_mob(user, user, 5 SECONDS, only_use_extra_checks = TRUE)) // no checks, cant fail
if(do_mob(user, user, 5 SECONDS, only_use_extra_checks = TRUE, hidden = TRUE)) // no checks, cant fail
make_anchor(user, anchor_turf)
making_anchor = FALSE
return
@@ -1011,6 +1011,12 @@
var/atom/movable/screen/plane_master/point/PM = locate(/atom/movable/screen/plane_master/point) in parent.screen
PM.backdrop(parent.mob)
if("cogbar")
toggles3 ^= PREFTOGGLE_3_COGBAR_ANIMATIONS
if(length(parent?.screen))
var/atom/movable/screen/plane_master/cogbar/PM = locate(/atom/movable/screen/plane_master/cogbar) in parent.screen
PM.backdrop(parent.mob)
if("be_special")
var/r = href_list["role"]
if(r in GLOB.special_roles)
@@ -481,6 +481,7 @@ GLOBAL_LIST_INIT(special_role_times, list(
dat += "<b>Set screentip mode:</b> <a href='byond://?_src_=prefs;preference=screentip_mode'>[(screentip_mode == 0) ? "Disabled" : "[screentip_mode]px"]</a><br>"
dat += "<b>Screentip color:</b> <span style='border: 1px solid #161616; background-color: [screentip_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='byond://?_src_=prefs;preference=screentip_color'><b>Change</b></a><br>"
dat += "<b>Thought Bubble when pointing:</b> <a href='byond://?_src_=prefs;preference=thought_bubble'>[(toggles2 & PREFTOGGLE_2_THOUGHT_BUBBLE) ? "Yes" : "No"]</a><br>"
dat += "<b>Cogbar indicators:</b> <a href='byond://?_src_=prefs;preference=cogbar'>[(toggles3 & PREFTOGGLE_3_COGBAR_ANIMATIONS) ? "Yes" : "No"]</a><br>"
dat += "<b>Custom UI settings:</b><br>"
dat += " - <b>Alpha (transparency):</b> <a href='byond://?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
dat += " - <b>Color:</b> <a href='byond://?_src_=prefs;preference=UIcolor'><b>[UI_style_color]</b></a> <span style='border: 1px solid #161616; background-color: [UI_style_color];'>&nbsp;&nbsp;&nbsp;</span><br>"
+1 -1
View File
@@ -882,7 +882,7 @@
user.visible_message("<span class='warning'>[user] attempts to [break_restraints ? "break" : "remove"] [src]!</span>", "<span class='notice'>You attempt to [break_restraints ? "break" : "remove"] [src]...</span>")
to_chat(user, "<span class='notice'>(This will take around [DisplayTimeText(effective_breakout_time)] and you need to stand still.)</span>")
if(!do_after(user, effective_breakout_time, FALSE, user))
if(!do_after(user, effective_breakout_time, FALSE, user, hidden = TRUE))
user.remove_status_effect(STATUS_EFFECT_REMOVE_CUFFS)
to_chat(user, "<span class='warning'>You fail to [break_restraints ? "break" : "remove"] [src]!</span>")
return
+1 -1
View File
@@ -68,7 +68,7 @@
add_attack_logs(A, D, "Put into a chokehold with martial-art [src]", ATKLOG_ALL)
chokehold_active = TRUE
var/damage_multiplier = 1 + D.getStaminaLoss() / 100 //The chokehold is more effective the more tired the target is.
while(do_mob(A, D, 2 SECONDS) && chokehold_active)
while(do_mob(A, D, 2 SECONDS, hidden = TRUE) && chokehold_active)
D.apply_damage(10 * damage_multiplier, OXY)
D.LoseBreath(3 SECONDS)
if(D.getOxyLoss() >= 50 || D.health <= 20)
@@ -865,7 +865,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
visible_message("<span class='warning'>[src] attempts to unbuckle [p_themselves()]!</span>",
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [breakout_time / 10] seconds and you need to stay still.)</span>")
if(!do_after(src, breakout_time, FALSE, src, allow_moving = TRUE, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check))), allow_moving_target = TRUE))
if(!do_after(src, breakout_time, FALSE, src, allow_moving = TRUE, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check))), allow_moving_target = TRUE, hidden = TRUE))
if(src && buckled)
to_chat(src, "<span class='warning'>You fail to unbuckle yourself!</span>")
else
@@ -931,7 +931,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
apply_status_effect(STATUS_EFFECT_REMOVE_MUZZLE)
visible_message("<span class='warning'>[src] gnaws on [I], trying to remove it!</span>")
to_chat(src, "<span class='notice'>You attempt to remove [I]... (This will take around [time/10] seconds and you need to stand still.)</span>")
if(do_after(src, time, FALSE, src, extra_checks = list(CALLBACK(src, PROC_REF(muzzle_check)))))
if(do_after(src, time, FALSE, src, extra_checks = list(CALLBACK(src, PROC_REF(muzzle_check))), hidden = TRUE))
visible_message("<span class='warning'>[src] removes [I]!</span>")
to_chat(src, "<span class='notice'>You get rid of [I]!</span>")
if(I.security_lock)
@@ -91,7 +91,7 @@ STATUS EFFECTS
if(stat == DEAD && !work_when_dead)
return
if(!instant && !do_mob(src, src, 1 SECONDS, extra_checks = list(CALLBACK(src, TYPE_PROC_REF(/mob/living, cannot_stand))), only_use_extra_checks = TRUE))
if(!instant && !do_mob(src, src, 1 SECONDS, extra_checks = list(CALLBACK(src, TYPE_PROC_REF(/mob/living, cannot_stand))), only_use_extra_checks = TRUE, hidden = TRUE))
return
if(resting || body_position == STANDING_UP || HAS_TRAIT(src, TRAIT_FLOORED))
return
@@ -48,7 +48,7 @@
/mob/living/simple_animal/hostile/headslug/AltClickOn(mob/living/carbon/carbon_target)
if(egg_layed || !istype(carbon_target) || !Adjacent(carbon_target) || ismachineperson(carbon_target))
return ..()
if(carbon_target.stat != DEAD && !do_mob(src, carbon_target, 5 SECONDS))
if(carbon_target.stat != DEAD && !do_mob(src, carbon_target, 5 SECONDS, hidden = TRUE))
return
if(HAS_TRAIT(carbon_target, TRAIT_XENO_HOST))
to_chat(src, "<span class='userdanger'>A foreign presence repels us from this body. Perhaps we should try to infest another?</span>")
+1 -1
View File
@@ -524,7 +524,7 @@
else
to_chat(src, "<span class='notice'>You are now trying to get up.</span>")
if(!do_mob(src, src, 1 SECONDS, extra_checks = list(CALLBACK(src, TYPE_PROC_REF(/mob/living, cannot_stand))), only_use_extra_checks = TRUE))
if(!do_mob(src, src, 1 SECONDS, extra_checks = list(CALLBACK(src, TYPE_PROC_REF(/mob/living, cannot_stand))), only_use_extra_checks = TRUE, hidden = TRUE))
return
if(resting)