mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
[MIRROR] refactors most spans (#9139)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
@@ -152,7 +152,7 @@ vorestation edit end */
|
||||
if(!locked)
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>The crate is locked with a Deca-code lock.</span>")
|
||||
to_chat(user, span_notice("The crate is locked with a Deca-code lock."))
|
||||
var/input = tgui_input_text(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "")
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
@@ -166,23 +166,23 @@ vorestation edit end */
|
||||
sanitycheck = null //if a digit is repeated, reject the input
|
||||
|
||||
if(input == null || sanitycheck == null || length(input) != codelen)
|
||||
to_chat(user, "<span class='notice'>You leave the crate alone.</span>")
|
||||
to_chat(user, span_notice("You leave the crate alone."))
|
||||
else if(check_input(input))
|
||||
to_chat(user, "<span class='notice'>The crate unlocks!</span>")
|
||||
to_chat(user, span_notice("The crate unlocks!"))
|
||||
playsound(src, 'sound/machines/lockreset.ogg', 50, 1)
|
||||
set_locked(0)
|
||||
else
|
||||
visible_message("<span class='warning'>A red light on \the [src]'s control panel flashes briefly.</span>")
|
||||
visible_message(span_warning("A red light on \the [src]'s control panel flashes briefly."))
|
||||
attempts--
|
||||
if (attempts == 0)
|
||||
to_chat(user, "<span class='danger'>The crate's anti-tamper system activates!</span>")
|
||||
to_chat(user, span_danger("The crate's anti-tamper system activates!"))
|
||||
var/turf/T = get_turf(src.loc)
|
||||
explosion(T, 0, 0, 1, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (locked)
|
||||
to_chat(user, "<span class='notice'>The crate unlocks!</span>")
|
||||
to_chat(user, span_notice("The crate unlocks!"))
|
||||
locked = 0
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/proc/check_input(var/input)
|
||||
@@ -200,11 +200,11 @@ vorestation edit end */
|
||||
/obj/structure/closet/crate/secure/loot/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(locked)
|
||||
if (istype(W, /obj/item/multitool)) // Greetings Urist McProfessor, how about a nice game of cows and bulls?
|
||||
to_chat(user, "<span class='notice'>DECA-CODE LOCK ANALYSIS:</span>")
|
||||
to_chat(user, span_notice("DECA-CODE LOCK ANALYSIS:"))
|
||||
if (attempts == 1)
|
||||
to_chat(user, "<span class='warning'>* Anti-Tamper system will activate on the next failed access attempt.</span>")
|
||||
to_chat(user, span_warning("* Anti-Tamper system will activate on the next failed access attempt."))
|
||||
else
|
||||
to_chat(user, "<span class='notice'>* Anti-Tamper system will activate after [src.attempts] failed access attempts.</span>")
|
||||
to_chat(user, span_notice("* Anti-Tamper system will activate after [src.attempts] failed access attempts."))
|
||||
if(lastattempt.len)
|
||||
var/bulls = 0
|
||||
var/cows = 0
|
||||
@@ -219,6 +219,6 @@ vorestation edit end */
|
||||
var/previousattempt = null //convert back to string for readback
|
||||
for(var/i in 1 to codelen)
|
||||
previousattempt = addtext(previousattempt, lastattempt[i])
|
||||
to_chat(user, "<span class='notice'>Last code attempt, [previousattempt], had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>")
|
||||
to_chat(user, span_notice("Last code attempt, [previousattempt], had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions."))
|
||||
return
|
||||
..()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user