Skip to content

Commit

Permalink
Merge branch 'master' into fix_molotovs
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffyGhoster committed Sep 21, 2024
2 parents 59bf986 + 0974cb4 commit 49f1694
Show file tree
Hide file tree
Showing 237 changed files with 3,329 additions and 2,420 deletions.
3 changes: 0 additions & 3 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2385,9 +2385,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
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/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/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
4 changes: 2 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
41 changes: 22 additions & 19 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
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
10 changes: 5 additions & 5 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
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 49f1694

Please sign in to comment.