Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Aurorastation/Aurora.3 in…
Browse files Browse the repository at this point in the history
…to tcafremap
  • Loading branch information
hazelrat committed Sep 21, 2024
2 parents 3e0c58c + 0974cb4 commit c25afbc
Show file tree
Hide file tree
Showing 474 changed files with 5,143 additions and 4,186 deletions.
5 changes: 1 addition & 4 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "code\__DEFINES\background.dm"
#include "code\__DEFINES\battle_monsters.dm"
#include "code\__DEFINES\byond_compat.dm"
#include "code\__DEFINES\callback.dm"
#include "code\__DEFINES\callbacks.dm"
#include "code\__DEFINES\chemistry.dm"
#include "code\__DEFINES\circuitboard.dm"
#include "code\__DEFINES\color.dm"
Expand Down Expand Up @@ -2386,9 +2386,6 @@
#include "code\modules\integrated_electronics\~defines\~defines.dm"
#include "code\modules\item_worth\_helpers.dm"
#include "code\modules\item_worth\item_worth.dm"
#include "code\modules\item_worth\material_weapons.dm"
#include "code\modules\item_worth\materials.dm"
#include "code\modules\item_worth\reagents.dm"
#include "code\modules\item_worth\worths_list.dm"
#include "code\modules\item_worth\Value_procs\atoms.dm"
#include "code\modules\item_worth\Value_procs\mob.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/ZAS/Variable Settings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var/global/vs_control/vsc = new
vw = vars[ch]
if("[ch]_DESC" in vars) vw_desc = vars["[ch]_DESC"]
if("[ch]_NAME" in vars) vw_name = vars["[ch]_NAME"]
dat += "<b>[vw_name] = [vw]</b> <A href='?src=\ref[src];changevar=[ch]'>\[Change\]</A><br>"
dat += "<b>[vw_name] = [vw]</b> <A href='?src=[REF(src)];changevar=[ch]'>\[Change\]</A><br>"
dat += "<i>[vw_desc]</i><br><br>"
user << browse(dat,"window=settings")

Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/_common.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#define GLOBAL_PROC "some_magic_bullshit"
#define DESC_PARENT "You shouldn't be seeing this. Please make an issue report."
2 changes: 2 additions & 0 deletions code/__DEFINES/callback.dm → code/__DEFINES/callbacks.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define GLOBAL_PROC "some_magic_bullshit"
/// A shorthand for the callback datum, [documented here](datum/callback.html)
#define CALLBACK new /datum/callback

///Per the DM reference, spawn(-1) will execute the spawned code immediately until a block is met.
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ GLOBAL_PROTECT(admin_log)
GLOBAL_LIST_EMPTY(signal_log)
GLOBAL_PROTECT(signal_log)

GLOBAL_LIST_EMPTY(lastsignalers) // Keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]"
GLOBAL_LIST_EMPTY(lastsignalers) // Keeps last 100 signals here in format: "[src] used REF(src) @ location [src.loc]: [freq]/[code]"
GLOBAL_PROTECT(lastsignalers)

GLOBAL_LIST_EMPTY(lawchanges) // Stores who uploaded laws to which silicon-based lifeform, and what the law was.
Expand Down
6 changes: 1 addition & 5 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@

#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day

#define DEBUG_REF(D) (D ? "\ref[D]|[D] ([D.type])" : "NULL")
#define DEBUG_REF(D) (D ? "[REF(D)]|[D]] ([D.type])" : "NULL")

// MultiZAS directions.
#define NORTHUP (NORTH|UP)
Expand All @@ -283,10 +283,6 @@
#define NL_TEMPORARY_DISABLE 1
#define NL_PERMANENT_DISABLE 2

///Used for creating soft references to objects. A manner of storing an item reference
///DO NOT USE, USE `WEAKREF()`
#define SOFTREF(A) ref(A)

#define ADD_VERB_IN(the_atom,time,verb) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(add_verb), the_atom, verb), time, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_NO_HASH_WAIT)
#define ADD_VERB_IN_IF(the_atom,time,verb,callback) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(add_verb), the_atom, verb, callback), time, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_NO_HASH_WAIT)

Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ var/regex/filename_forbidden_chars = regex(@{""|[\\\n\t/?%*:|<>]|\.\."}, "g")

/// Removes everything enclose in < and > inclusive of the bracket, and limits the length of the message.
#define STRIP_HTML_FULL(text, limit) (html_tags.Replace(copytext(text, 1, limit), ""))

/// BYOND's string procs don't support being used on datum references (as in it doesn't look for a name for stringification)
/// We just use this macro to ensure that we will only pass strings to this BYOND-level function without developers needing to really worry about it.
#define LOWER_TEXT(thing) lowertext(UNLINT("[thing]"))
2 changes: 1 addition & 1 deletion code/__HELPERS/area_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

if(!A || !src) return

var/list/turfs_src = get_area_turfs("\ref[src]")
var/list/turfs_src = get_area_turfs("[REF(src)]")

if(!turfs_src.len)
return
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
// Same as above but for alien candidates.

/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
if(!isobj(O)) O = new /obj/screen/text()
if(!isobj(O)) O = new /atom/movable/screen/text()
O.maptext = maptext
O.maptext_height = maptext_height
O.maptext_width = maptext_width
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ lighting determines lighting capturing (optional), suppress_errors suppreses err

// Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with.
var/atom/A = thing
var/key = "[istype(A.icon, /icon) ? "[ref(A.icon)]" : A.icon]:[A.icon_state]"
var/key = "[istype(A.icon, /icon) ? "[REF(A.icon)]" : A.icon]:[A.icon_state]"


if (!bicon_cache[key]) // Doesn't exist, make it.
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/logging/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))

if(key)
if(include_link && C)
. += "<a href='?priv_msg=\ref[C];ticket=\ref[ticket]'>"
. += "<a href='?priv_msg=[REF(C)];ticket=[REF(ticket)]'>"

if(C && C.holder && C.holder.fakekey && !include_name)
. += "Administrator"
Expand Down Expand Up @@ -176,7 +176,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))

// Helper procs for building detailed log lines
/datum/proc/get_log_info_line()
return "[src] ([type]) (\ref[src])"
return "[src] ([type]) ([REF(src)])"

/area/get_log_info_line()
return "[..()] ([isnum(z) ? "[x],[y],[z]" : "0,0,0"])"
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/logging/talk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Arguments:
* * message - The message being logged
* * message_type - the type of log the message is(ATTACK, SAY, etc)
* * tag - tag that indicates the type of text(announcement, telepathy, etc)
* * tag - tag that indicates the type of text (announcement, telepathy, etc)
* * log_globally - boolean checking whether or not we write this log to the log file
* * forced_by - source that forced the dialogue if any
*/
Expand Down
14 changes: 12 additions & 2 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ Proc for attack log creation, because really why not

/proc/add_logs(mob/user, mob/target, what_done, var/admin=1, var/object=null, var/addition=null)
if(user && ismob(user))
user.attack_log += text("\[[time_stamp()]\] <span class='warning'>Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</span>")
user.attack_log += "\[[time_stamp()]\] <span class='warning'>Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</span>"
if(target && ismob(target))
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</font>")
target.attack_log += "\[[time_stamp()]\] <font color='orange'>Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]</font>"
if(admin)
log_attack(SPAN_WARNING("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]"))

Expand Down Expand Up @@ -321,3 +321,13 @@ Proc for attack log creation, because really why not
A.SetName(newname)

fully_replace_character_name(oldname,newname)

///Makes a call in the context of a different usr. Use sparingly
/world/proc/push_usr(mob/user_mob, datum/callback/invoked_callback, ...)
var/temp = usr
usr = user_mob
if (length(args) > 2)
. = invoked_callback.Invoke(arglist(args.Copy(3)))
else
. = invoked_callback.Invoke()
usr = temp
43 changes: 23 additions & 20 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
var/list/urls = list()
var/i = 1
while (url_find_lazy.Find_char(message))
urls["\ref[urls]-[i]"] = url_find_lazy.match
urls["[REF(urls)]-[i]"] = url_find_lazy.match
i++

for (var/ref in urls)
Expand Down Expand Up @@ -725,49 +725,52 @@

var/leng = length(string)

var/next_space = findtext_char(string, " ", next_backslash + 1)
var/next_space = findtext(string, " ", next_backslash + length(string[next_backslash]))
if(!next_space)
next_space = leng - next_backslash

if(!next_space) //trailing bs
if(!next_space) //trailing bs
return string

var/base = next_backslash == 1 ? "" : copytext(string, 1, next_backslash)
var/macro = lowertext(copytext(string, next_backslash + 1, next_space))
var/rest = next_backslash > leng ? "" : copytext(string, next_space + 1)
var/macro = LOWER_TEXT(copytext(string, next_backslash + length(string[next_backslash]), next_space))
var/rest = next_backslash > leng ? "" : copytext(string, next_space + length(string[next_space]))

//See http://www.byond.com/docs/ref/info.html#/DM/text/macros
//See https://secure.byond.com/docs/ref/info.html#/DM/text/macros
switch(macro)
//prefixes/agnostic
if("the")
rest = text("\the []", rest)
rest = "\the [rest]"
if("a")
rest = text("\a []", rest)
rest = "\a [rest]"
if("an")
rest = text("\an []", rest)
rest = "\an [rest]"
if("proper")
rest = text("\proper []", rest)
rest = "\proper [rest]"
if("improper")
rest = text("\improper []", rest)
rest = "\improper [rest]"
if("roman")
rest = text("\roman []", rest)
rest = "\roman [rest]"
//postfixes
if("th")
base = text("[]\th", rest)
base = "[rest]\th"
if("s")
base = text("[]\s", rest)
base = "[rest]\s"
if("he")
base = text("[]\he", rest)
base = "[rest]\he"
if("she")
base = text("[]\she", rest)
base = "[rest]\she"
if("his")
base = text("[]\his", rest)
base = "[rest]\his"
if("himself")
base = text("[]\himself", rest)
base = "[rest]\himself"
if("herself")
base = text("[]\herself", rest)
base = "[rest]\herself"
if("hers")
base = text("[]\hers", rest)
base = "[rest]\hers"
else // Someone fucked up, if you're not a macro just go home yeah?
// This does technically break parsing, but at least it's better then what it used to do
return base

. = base
if(rest)
Expand Down
16 changes: 8 additions & 8 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
textg = num2hex(255 - g, 0)
textb = num2hex(255 - b, 0)
if (length(textr) < 2)
textr = text("0[]", textr)
textr = "0[textr]"
if (length(textg) < 2)
textr = text("0[]", textg)
textr = "0[textg]"
if (length(textb) < 2)
textr = text("0[]", textb)
return text("#[][][]", textr, textg, textb)
textr = "0[textb]"
return "#[textr][textg][textb]"

//Returns the middle-most value
/proc/dd_range(var/low, var/high, var/num)
Expand Down Expand Up @@ -1116,7 +1116,7 @@ var/global/known_proc = /proc/get_type_ref_bytes
if(ispath(V))
return details && path_names ? "path([V])" : "path"
if(istext(V))
return details && text_lengths ? "text([length(V) ])" : "text"
return details && text_lengths ? "text ([length(V) ])" : "text"
if(isnum(V)) // Byond doesn't really differentiate between floats and ints, but we can sort of guess here
// also technically we could also say that 0 and 1 are boolean but that'd be quite silly
if(IsInteger(V) && V < 16777216 && V > -16777216)
Expand Down Expand Up @@ -1187,16 +1187,16 @@ var/global/known_proc = /proc/get_type_ref_bytes
return "appearance"
return "unknown-object([refType])" // If you see this you found a new undetectable type. Feel free to add it here.

/proc/get_type_ref_bytes(var/V) // returns first 4 bytes from \ref which denote the object type (for objects that is)
return lowertext(copytext(ref(V), 4, 6))
/proc/get_type_ref_bytes(var/V) // returns first 4 bytes from a ref which denote the object type (for objects that is)
return lowertext(copytext(ref(V), 4, 6)) //Only allowed to remain the builtin ref proc because this shit depends on it and wasn't updated yet

/proc/format_text(text)
return replacetext(replacetext(text,"\proper ",""),"\improper ","")

/proc/topic_link(var/datum/D, var/arglist, var/content)
if(istype(arglist,/list))
arglist = list2params(arglist)
return "<a href='?src=\ref[D];[arglist]'>[content]</a>"
return "<a href='?src=[REF(D)];[arglist]'>[content]</a>"

/proc/get_random_colour(var/simple, var/lower, var/upper)
var/colour
Expand Down
8 changes: 4 additions & 4 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -383,26 +383,26 @@

var/global/list/click_catchers

/obj/screen/click_catcher
/atom/movable/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = MOUSE_OPACITY_OPAQUE
screen_loc = "CENTER-7,CENTER-7"

/obj/screen/click_catcher/Destroy()
/atom/movable/screen/click_catcher/Destroy()
SHOULD_CALL_PARENT(FALSE)
return QDEL_HINT_LETMELIVE

/proc/create_click_catcher()
. = list()
for(var/i = 0, i<15, i++)
for(var/j = 0, j<15, j++)
var/obj/screen/click_catcher/CC = new()
var/atom/movable/screen/click_catcher/CC = new()
CC.screen_loc = "NORTH-[i],EAST-[j]"
. += CC

/obj/screen/click_catcher/Click(location, control, params)
/atom/movable/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
Expand Down
Loading

0 comments on commit c25afbc

Please sign in to comment.