Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_chat replacer #11

Merged
merged 11 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ GLOBAL_LIST_INIT(surgery_tool_behaviors, list(
//Welder messages and other stuff
#define HEALPERWELD 15
#define WELDER_ATTEMPT_WELD_MESSAGE user.visible_message("<span class='notice'>[user] begins welding [src]...</span>", "<span class='notice'>You begin welding [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_WELD_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You finish welding [src]!</span>")
#define WELDER_WELD_SUCCESS_MESSAGE user.balloon_alert(user, "finished welding [src]!")
#define WELDER_ATTEMPT_REPAIR_MESSAGE user.visible_message("<span class='notice'>[user] begins repairing the damage on [src]...</span>", "<span class='notice'>You begin repairing [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_REPAIR_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You repair the damage on [src]!</span>")
#define WELDER_REPAIR_SUCCESS_MESSAGE user.balloon_alert(user, "repaired the damage on [src]!")
#define WELDER_ATTEMPT_SLICING_MESSAGE user.visible_message("<span class='notice'>[user] begins slicing through [src]...</span>", "<span class='notice'>You begin slicing through [src]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_SLICING_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You slice clean through [src]!</span>")
#define WELDER_SLICING_SUCCESS_MESSAGE user.balloon_alert(user, "sliced clean through [src]!")
#define WELDER_ATTEMPT_FLOOR_SLICE_MESSAGE user.visible_message("<span class='notice'>[user] begins slicing [src] free from [get_turf(src)]...</span>", "<span class='notice'>You begin slicing [src] free from [get_turf(src)]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_FLOOR_SLICE_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You slice [src] clear of [get_turf(src)]!</span>")
#define WELDER_FLOOR_SLICE_SUCCESS_MESSAGE user.balloon_alert(user, "sliced [src] clear of [get_turf(src)]!")
#define WELDER_ATTEMPT_FLOOR_WELD_MESSAGE user.visible_message("<span class='notice'>[user] begins welding [src] to [get_turf(src)]...</span>", "<span class='notice'>You begin welding [src] to [get_turf(src)]...</span>", "<span class='warning'>You hear welding.</span>")
#define WELDER_FLOOR_WELD_SUCCESS_MESSAGE to_chat(user, "<span class='notice'>You weld [src] to [get_turf(src)]!</span>")
#define WELDER_FLOOR_WELD_SUCCESS_MESSAGE user.balloon_alert(user, "welded [src] to [get_turf(src)]!")

//Wrench messages
#define WRENCH_ANCHOR_MESSAGE user.visible_message("<span class='notice'>[user] tightens the bolts on [src]!</span>", "<span class='notice'>You tighten the bolts on [src]!</span>", "<span class='warning'>You hear ratcheting.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@

/mob/living/silicon/pai/proc/reset_cooldown()
capa_is_cooldown = FALSE
to_chat(src, "<span class = 'notice'>Your ability to interact with airlocks has been restored.</span>")
src.balloon_alert(src, "Your ability to interact with airlocks has been restored.")
8 changes: 4 additions & 4 deletions code/datums/components/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
return
safety = !safety
if(user && !robotic)
to_chat(user, span_warning("You silently [safety ? "disable" : "enable"] [unit]'s safety protocols with the card."))
user.balloon_alert(user, "[safety ? "disable" : "enable"] it's safety protocols.")

/datum/component/defib/proc/set_cooldown(how_short)
on_cooldown = TRUE
Expand Down Expand Up @@ -138,17 +138,17 @@
return

if(on_cooldown)
to_chat(user, span_notice("[defib_ref] is recharging."))
user.balloon_alert(user, "[defib_ref] is recharging.")
return

if(application_result & COMPONENT_BLOCK_DEFIB_MISC)
return // the unit should handle this

if(!istype(target))
if(robotic)
to_chat(user, span_notice("This unit is only designed to work on humanoid lifeforms."))
user.balloon_alert(user, "can't defib robots.")
else
to_chat(user, span_notice("The instructions on [defib_ref] don't mention how to defibrillate that..."))
user.balloon_alert(user, "can't defib that.")
return

if(should_cause_harm && combat && heart_attack_chance == 100)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/components/ducttape.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


/datum/component/ducttape/proc/remove_tape(obj/item/I, mob/user)
to_chat(user, span_notice("You tear the tape off [I]!"))
user.balloon_alert(user, "teared the tape off [I]!")
playsound(I, 'sound/items/poster_ripped.ogg', 50, 1)
new /obj/item/trash/tapetrash(user.loc)
I.update_icon()
Expand All @@ -62,7 +62,7 @@
var/target_direction = get_dir(source_turf, target_turf)//The direction we clicked
// Snowflake diagonal handling
if(target_direction in GLOB.diagonals)
to_chat(user, span_warning("You can't reach [target_turf]."))
user.balloon_alert(user, "can't reach [target_turf].")
return
if(target_direction & EAST)
x_offset = 16
Expand All @@ -78,7 +78,7 @@
y_offset = -16
if(!user.drop_item_ground(I))
return
to_chat(user, span_notice("You stick [I] to [target_turf]."))
user.balloon_alert(user, "stick [I] to [target_turf].")
I.pixel_x = x_offset
I.pixel_y = y_offset

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/label.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

remove_label()
playsound(parent, 'sound/items/poster_ripped.ogg', 20, TRUE)
to_chat(user, "<span class='warning'>You remove the label from [parent].</span>")
user.balloon_alert(user, "removed the label from [parent].")
qdel(src) // Remove the component from the object.

/**
Expand Down
12 changes: 6 additions & 6 deletions code/datums/components/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,40 +180,40 @@
if(require_twohands)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("[parent] слишком тяжел и громоздок для Вас!"))
user.balloon_alert(user, "it's too heavy!")
user.drop_item_ground(parent, force = TRUE)
else
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("Ваши руки для этого не приспособлены."))
user.balloon_alert(user, "can't handle this.")
return

if(user.get_inactive_hand())
if(require_twohands)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("[parent] слишком громоздок, чтобы носить в одной руке!"))
user.balloon_alert(user, "it's too heavy to hold in one hand!")
user.drop_item_ground(parent, force = TRUE)
else
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("Вторая рука должна быть свободна!"))
user.balloon_alert(user, "inactive hand should be free!")
return

if(user.l_arm_broken() || user.r_arm_broken())
if(require_twohands)
user.drop_item_ground(parent, force = TRUE)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("Вы чувствуете как двигаются кости, когда пытаетесь взять [parent] в обе руки."))
user.balloon_alert(user, "You feel broken bones moving in your arms")
return

if(!user.has_left_hand() || !user.has_right_hand())
if(require_twohands)
user.drop_item_ground(parent, force = TRUE)
if(abstract_check && (world.time > antispam_timer + 0.1 SECONDS))
antispam_timer = world.time
to_chat(user, span_warning("У Вас отсутствует вторая рука!"))
user.balloon_alert(user, "second hand needed!")
return

// wield update status
Expand Down
6 changes: 3 additions & 3 deletions code/datums/multitool_menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

/datum/multitool_menu_host/proc/notify_if_no_access(mob/user)
if(!multitool.allowed(user))
to_chat(user, "<span class='warning'>Access denied.</span>")
user.balloon_alert(user, "Access denied.")
return TRUE
return FALSE

Expand Down Expand Up @@ -142,7 +142,7 @@
return
holder.add_fingerprint(user)
if(inoperable())
to_chat(user, "<span class='warning'>You attach [multitool] to [holder], but nothing happens. [holder] seems to be inoperable.</span>")
user.balloon_alert(user, "[holder] is inoperable!")
return
src.multitool = multitool
src.multitool.menu.interact(user, src)
Expand All @@ -161,7 +161,7 @@
Used to check if we still need to apply changes (returns true if we don't), e.g. after input() call.
*/
if(!multitool)
to_chat(user, "<span class='warning'>You are unable to reach [holder ? holder : "the thing"].</span>")
user.balloon_alert(user, "unable to reach [holder ? holder : "the thing"].")
return TRUE
return FALSE

Expand Down
10 changes: 5 additions & 5 deletions code/datums/spells/high_rp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/obj/item/organ/internal/high_rp_tumor/insert(mob/living/target, special = ORGAN_MANIPULATION_DEFAULT)
..(target, special)
if(target)
to_chat(target, "<span class='userdanger'>Я должен дышать, иначе просто задохнусь!</span>")
to_chat(target, "нужно дышать, иначе задохнусь!")

/mob/living/carbon/human/proc/curse_high_rp(delay = 300, oxyloss = 45)
var/mob/living/carbon/human/H = src
Expand All @@ -23,14 +23,14 @@

/obj/item/organ/internal/high_rp_tumor/on_life()
if(world.time > (last_pump + (pump_delay - pump_window)))
to_chat(owner, "Мне начинает не хватать воздуха.")
owner.balloon_alert(owner, "не хватает воздуха!")
warned = 1

if(world.time > (last_pump + pump_delay))
var/mob/living/carbon/human/H = owner
H.setOxyLoss(H.oxyloss + oxy_loss)
H.custom_emote(EMOTE_VISIBLE, "задыха%(ет,ют)%ся!")
to_chat(H, "<span class='userdanger'>Я должен дышать, иначе просто задохнусь!</span>")
H.balloon_alert(H, "нужно дышать, иначе задохнусь!")
last_pump = world.time
warned = 0

Expand All @@ -47,10 +47,10 @@
var/obj/item/organ/internal/high_rp_tumor/hrp_tumor = target

if(world.time < (hrp_tumor.last_pump + (hrp_tumor.pump_delay - hrp_tumor.pump_window))) //no spam
to_chat(owner, "<span class='userdanger'>Слишком рано!</span>")
owner.balloon_alert(owner, "слишком рано!")
hrp_tumor.owner.setOxyLoss(hrp_tumor.owner.oxyloss + hrp_tumor.oxy_loss/5)
return

hrp_tumor.last_pump = world.time
to_chat(owner, "<span class = 'notice'>Вы дышите.</span>")
owner.balloon_alert(owner, "вы дышите.")
owner.custom_emote(EMOTE_VISIBLE, "дыш%(ит,ат)%.")
2 changes: 1 addition & 1 deletion code/datums/spells/horsemask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/obj/effect/proc_holder/spell/horsemask/cast(list/targets, mob/user = usr)
if(!targets.len)
to_chat(user, "<span class='notice'>No target found in range.</span>")
user.balloon_alert(user, "no target found in range.")
return

var/mob/living/carbon/human/target = targets[1]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/spacetime_dist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
. = ..()
var/list/turf/to_switcharoo = targets
if(!length(to_switcharoo))
to_chat(user, "<span class='warning'>For whatever reason, the strings nearby aren't keen on being tangled.</span>")
user.balloon_alert(user, "The strings aren't keen on being tangled.")
return

ready = FALSE
Expand Down
6 changes: 3 additions & 3 deletions code/datums/supplypacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY

/datum/supply_packs/proc/can_approve(mob/user)
if(SSshuttle.points < cost)
to_chat(user, span_warning("There are insufficient supply points for this request."))
user.balloon_alert(user, "insufficient supply points!")
return FALSE
if(credits_cost && SSshuttle.cargo_money_account.money < credits_cost)
to_chat(user, span_warning("There are not enough money on cargo account for this request."))
user.balloon_alert(user, "not enough money on cargo account!")
return FALSE
if(!length(required_tech))
return TRUE
for(var/tech_id in required_tech)
if(!SSshuttle.techLevels[tech_id] || required_tech[tech_id] > SSshuttle.techLevels[tech_id])
to_chat(user, span_warning("You have not sent the necessary technological disks to Centcomm."))
user.balloon_alert(user, "haven't sent necessary technological disks!")
return FALSE
return TRUE

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@
if(!I.tool_start_check(src, user, 0))
return
if(I.use_tool(src, user, 20, volume = I.tool_volume))
to_chat(user, span_notice("You deconstruct the table."))
user.balloon_alert(user, "table deconstructed.")
new /obj/item/stack/sheet/plasteel(loc, 5)
qdel(src)

/obj/machinery/optable/proc/check_table()
update_patient()
if(patient != null)
to_chat(usr, span_notice("The table is already occupied!"))
balloon_alert(usr, span_notice("already occupied!"))
return FALSE
else
return TRUE
6 changes: 3 additions & 3 deletions code/game/machinery/gameboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
. = ..()
if(.)
return
if(src.in_use)
to_chat(user, "This gameboard is already in use!")
if(in_use)
balloon_alert(user, "already in use!")
return
if(!anchored)
to_chat(user, "The gameboard is not secured!")
balloon_alert(user, "gameboard is not secured!")
return
interact(user)

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/tcomms/relay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
if("network_id")
var/new_id = input(usr, "Please enter a new network ID", "Network ID", network_id)
log_action(usr, "renamed core with ID [network_id] to [new_id]")
to_chat(usr, span_notice("Device ID changed from <b>[network_id]</b> to <b>[new_id]</b>."))
balloon_alert(usr, span_notice("Device ID changed from <b>[network_id]</b> to <b>[new_id]</b>."))
network_id = new_id

// Only do these hrefs if we are linked to prevent bugs/exploits
Expand Down
16 changes: 8 additions & 8 deletions code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
if(!diode)
user.drop_transfer_item_to_loc(W, src)
diode = W
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
user.balloon_alert(user, "installed a [diode.name] in [src].")
else
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
user.balloon_alert(user, "[src] already has a cell")
return

return ..()

/obj/item/laser_pointer/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from the [src].</span>")
user.balloon_alert(user, "removed [diode.name] from the [src].")
diode.forceMove(get_turf(loc))
diode = null

Expand All @@ -78,16 +78,16 @@
if( !(user in (viewers(7,target))) )
return
if(!diode)
to_chat(user, "<span class='notice'>You point [src] at [target], but nothing happens!</span>")
user.balloon_alert(user, "nothing happens!")
return
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
user.balloon_alert(user, "You are too clumsy!")
return
add_fingerprint(user)

//nothing happens if the battery is drained
if(recharge_locked)
to_chat(user, "<span class='notice'>You point [src] at [target], but it's still charging.</span>")
user.balloon_alert(user, "it's still charging.")
return

var/outmsg
Expand Down Expand Up @@ -155,9 +155,9 @@
I.pixel_y = target.pixel_y + rand(-5,5)

if(outmsg)
to_chat(user, outmsg)
user.balloon_alert(user, outmsg)
else
to_chat(user, "<span class='info'>You point [src] at [target].</span>")
user.balloon_alert(user, "pointed at [target].")

energy -= 1
if(energy <= max_energy)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/voice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
active = !active
icon_state = "voice_changer_[active ? "on" : "off"]"
if(inform_about_toggle)
to_chat(user, span_notice("You toggle [src] [active ? "on" : "off"]."))
user.balloon_alert(user, "toggled [src] [active ? "on" : "off"].")

for(var/X in actions)
var/datum/action/A = X
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/cosmetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


/obj/item/lipstick/attack_self(mob/user)
to_chat(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
user.balloon_alert(user, "twisted [src] [open ? "closed" : "open"].")
open = !open
update_icon()

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/garrote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
var/mob/living/carbon/human/U = user

if(!wielded)
to_chat(user, "<span class = 'warning'>You must use both hands to garrote [M]!</span>")
user.balloon_alert(user, "need both hands to garrote [M]!")
return

if(!ishuman(M))
Expand All @@ -70,7 +70,7 @@
return

if(M.dir != U.dir)
to_chat(user, "<span class='warning'>You cannot use [src] on [M] from that angle!</span>")
user.balloon_alert(user, "bad angle!")
return

if(improvised && ((M.head && (M.head.flags_cover & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags_cover & MASKCOVERSMOUTH)))) // Improvised garrotes are blocked by mouth-covering items.
Expand Down
10 changes: 5 additions & 5 deletions code/game/objects/items/weapons/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,20 @@
if(!remove_item_from_storage(user))
user.temporarily_remove_item_from_inventory(src)
user.put_in_hands(W, ignore_anim = FALSE)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
to_chat(user, span_notice("You wrap the cable restraint around the top of the rod."))
qdel(src)
else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
to_chat(user, span_warning("You need at least six metal sheets to make good enough weights!"))
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
to_chat(user, span_warning("You need at least six metal sheets to make good enough weights!"))
return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
to_chat(user, span_notice("You begin to apply [I] to [src]..."))
if(do_after(user, 35 * M.toolspeed * gettoolspeedmod(user), target = src) && M.use(6))
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola(drop_location())
user.put_in_hands(S, ignore_anim = FALSE)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
to_chat(user, span_notice("You make some weights out of [I] and tie them to [src]."))
if(!remove_item_from_storage(user))
user.temporarily_remove_item_from_inventory(src)
qdel(src)
Expand Down
Loading
Loading