Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed Apr 25, 2024
2 parents 700047b + 1377fd1 commit dbc3c68
Show file tree
Hide file tree
Showing 66 changed files with 1,807 additions and 741 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ _build_dependencies.sh @AffectedArc07
dreamchecker.exe @AffectedArc07
rust_g.dll @AffectedArc07
librust_g.so @AffectedArc07

### S34NW

# TGUI stuff
/tgui/bin @S34NW
30 changes: 28 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ if(thing == TRUE)
return "bleh"
var/other_thing = pick(TRUE, FALSE)
if(other_thing == FALSE)
return "meh"
return "meh"
// Good
var/thing = pick(TRUE, FALSE)
if(thing)
return "bleh"
var/other_thing = pick(TRUE, FALSE)
if(!other_thing)
return "meh"
return "meh"
```

### Use `pick(x, y, z)`, not `pick(list(x, y, z))`
Expand Down Expand Up @@ -452,6 +452,32 @@ Look for code examples on how to properly use it.
addtimer(CALLBACK(target, PROC_REF(dothing), arg1, arg2, arg3), 5 SECONDS)
```

### Signals

Signals are a slightly more advanced topic, but are often useful for attaching external behavior to objects that should be triggered when a specific event occurs.

When defining procs that should be called by signals, you must include `SIGNAL_HANDLER` after the proc header. This ensures that no sleeping code can be called from within a signal handler, as that can cause problems with the signal system.

Since callbacks can be connected to many signals with `RegisterSignal`, it can be difficult to pin down the source that a callback is invoked from. Any new `SIGNAL_HANDLER` should be followed by a comment listing the signals that the proc is expected to be invoked for. If there are multiple signals to be handled, separate them with a `+`.

```dm
/atom/movable/proc/when_moved(atom/movable/A)
SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED
do_something()
/datum/component/foo/proc/on_enter(datum/source, atom/enterer)
SIGNAL_HANDLER // COMSIG_ATOM_ENTERED + COMSIG_ATOM_INITIALIZED_ON
do_something_else()
```

If your proc does have something that needs to sleep (such as a `do_after()`), do not simply omit the `SIGNAL_HANDLER`. Instead, call the sleeping code with `INVOKE_ASYNC` from within the signal handling function.

```dm
/atom/movable/proc/when_moved(atom/movable/A)
SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED
INVOKE_ASYNC(src, PROC_REF(thing_that_sleeps), arg1)
```

### Operators

#### Spacing of operators
Expand Down
7 changes: 6 additions & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/intactemptyship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
/obj/structure/bed,
/turf/simulated/floor/mineral/titanium/purple,
/area/ruin/space/powered)
"Q" = (
/obj/structure/table/wood,
/obj/item/blank_tarot_card,
/turf/simulated/floor/mineral/titanium/purple,
/area/ruin/space/powered)

(1,1,1) = {"
a
Expand Down Expand Up @@ -277,7 +282,7 @@ b
j
r
w
n
Q
j
b
a
Expand Down
1 change: 1 addition & 0 deletions _maps/map_files/RandomRuins/SpaceRuins/wizardcrash.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
/area/ruin/space/unpowered)
"aF" = (
/obj/structure/table/wood,
/obj/item/blank_tarot_card,
/turf/simulated/floor/wood{
icon_state = "wood-broken6"
},
Expand Down
4 changes: 0 additions & 4 deletions code/__DEFINES/dcs/dcs_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
/// Every proc you pass to RegisterSignal must have this.
#define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE)

/// Signifies that this proc is used to handle signals, but also sleeps.
/// Do not use this for new work.
#define SIGNAL_HANDLER_DOES_SLEEP

/// A wrapper for _AddElement that allows us to pretend we're using normal named arguments
#define AddElement(arguments...) _AddElement(list(##arguments))
/// A wrapper for _RemoveElement that allows us to pretend we're using normal named arguments
Expand Down
18 changes: 17 additions & 1 deletion code/__DEFINES/preferences_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define PREFTOGGLE_CHAT_DEAD (1<<1)
#define PREFTOGGLE_CHAT_GHOSTEARS (1<<2)
#define PREFTOGGLE_CHAT_GHOSTSIGHT (1<<3)
#define PREFTOGGLE_CHAT_PRAYER (1<<4)
#define PREFTOGGLE_CHAT_PRAYER (1<<4) // Defunct
#define PREFTOGGLE_CHAT_RADIO (1<<5)
// #define PREFTOGGLE_AZERTY (1<<6) // obsolete
#define PREFTOGGLE_CHAT_DEBUGLOGS (1<<7)
Expand Down Expand Up @@ -81,6 +81,21 @@
#error toggles_2 bitflag over 16777215. Please make an issue report and postpone the feature you are working on.
#endif

// This is a list index. Required to start at 1 instead of 0 so it's properly placed in the list
#define PREFTOGGLE_CATEGORY_GENERAL 1
#define PREFTOGGLE_CATEGORY_LIVING 2
#define PREFTOGGLE_CATEGORY_GHOST 3
#define PREFTOGGLE_CATEGORY_ADMIN 4

// Preftoggle type defines
/// Special toggles, stuff that just overrides set_toggles entirely
#define PREFTOGGLE_SPECIAL 0
/// Interacts with the sound bitflag
#define PREFTOGGLE_SOUND 1
/// Interacts with the toggles bitflag
#define PREFTOGGLE_TOGGLE1 2
/// Interacts with the toggles2 bitflag
#define PREFTOGGLE_TOGGLE2 3


// Admin attack logs filter system, see /proc/add_attack_logs and /proc/msg_admin_attack
Expand Down Expand Up @@ -133,6 +148,7 @@
#define TAB_ANTAG 2
#define TAB_GEAR 3
#define TAB_KEYS 4
#define TAB_TOGGLES 5

// Colourblind modes
#define COLOURBLIND_MODE_NONE "None"
Expand Down
12 changes: 12 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#define STATUS_EFFECT_SHADOW_MEND /datum/status_effect/shadow_mend //Quick, powerful heal that deals damage afterwards. Heals 15 brute/burn every second for 3 seconds.
#define STATUS_EFFECT_VOID_PRICE /datum/status_effect/void_price //The price of healing yourself with void energy. Deals 3 brute damage every 3 seconds for 30 seconds.

#define STATUS_EFFECT_SHADOW_MEND_DEVIL /datum/status_effect/shadow_mend/devil //Tarot version, hurts others over self

#define STATUS_EFFECT_HIPPOCRATIC_OATH /datum/status_effect/hippocraticOath //Gives you an aura of healing as well as regrowing the Rod of Asclepius if lost

#define STATUS_EFFECT_REGENERATIVE_CORE /datum/status_effect/regenerative_core
Expand All @@ -37,6 +39,8 @@

#define STATUS_EFFECT_BLOODDRUNK /datum/status_effect/blooddrunk //Stun immunity and greatly reduced damage taken

#define STATUS_EFFECT_BLOODDRUNK_CHARIOT /datum/status_effect/blooddrunk/chariot //adds pacifism

#define STATUS_EFFECT_DASH /datum/status_effect/dash // Grants the ability to dash, expiring after a few secodns

/// Rapid burn/brute/oxy/blood healing from the cling ability
Expand All @@ -62,6 +66,12 @@

#define STATUS_EFFECT_BEARSERKER_RAGE /datum/status_effect/bearserker_rage

#define STATUS_EFFECT_XRAY /datum/status_effect/xray // Xray vision for 2 minutes

#define STATUS_EFFECT_BADASS /datum/status_effect/badass // Badass trait for 2 minutes.

#define STATUS_EFFECT_REVERSED_SUN /datum/status_effect/reversed_sun // Weaker eternal darkness, nightvision, but nearsight

/////////////
// DEBUFFS //
/////////////
Expand Down Expand Up @@ -114,6 +124,8 @@

#define STATUS_EFFECT_PEPPERSPRAYED /datum/status_effect/pepper_spray

#define STATUS_EFFECT_REVERSED_HIGH_PRIESTESS /datum/status_effect/reversed_high_priestess //Bubblegum will chase the person hit by the effect, grabbing people at random. This can and WILL include the caster.

//#define STATUS_EFFECT_NECROPOLIS_CURSE /datum/status_effect/necropolis_curse
//#define CURSE_BLINDING 1 //makes the edges of the target's screen obscured
//#define CURSE_SPAWNING 2 //spawns creatures that attack the target only
Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
if(initial(D.name))
GLOB.keybindings += new path()

for(var/path in subtypesof(/datum/preference_toggle))
var/datum/preference_toggle/pref_toggle = path
if(initial(pref_toggle.name))
GLOB.preference_toggles += new path()

for(var/path in subtypesof(/datum/objective))
var/datum/objective/O = path
if(isnull(initial(O.name)))
Expand Down
8 changes: 8 additions & 0 deletions code/_globalvars/lists/preference_toggle_lists.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
GLOBAL_LIST_EMPTY(preference_toggles)

GLOBAL_LIST_INIT(preference_toggle_groups, list(
"General Preferences" = PREFTOGGLE_CATEGORY_GENERAL,
"In-Round Preferences" = PREFTOGGLE_CATEGORY_LIVING,
"Ghost Preferences" = PREFTOGGLE_CATEGORY_GHOST,
"Admin Preferences" = PREFTOGGLE_CATEGORY_ADMIN,
))
13 changes: 0 additions & 13 deletions code/_onclick/hud/human_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,3 @@
H.r_hand.screen_loc = null
if(H.l_hand)
H.l_hand.screen_loc = null


/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
set name = "Toggle Hotkey Buttons"
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."

if(hud_used.hotkey_ui_hidden)
client.screen += hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = FALSE
else
client.screen -= hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
CONFIG_LOAD_BOOL(guest_ban, data["guest_ban"])
CONFIG_LOAD_BOOL(allow_antag_hud, data["allow_antag_hud"])
CONFIG_LOAD_BOOL(restrict_antag_hud_rejoin, data["restrict_antag_hud_rejoin"])
CONFIG_LOAD_BOOL(respawn_enabled, data["respawn_enabled"])
CONFIG_LOAD_BOOL(enabled_cid_randomiser_buster, data["enable_cid_randomiser_buster"])
CONFIG_LOAD_BOOL(forbid_singulo_possession, data["prevent_admin_singlo_possession"])
CONFIG_LOAD_BOOL(popup_admin_pm, data["popup_admin_pm"])
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/non_firing/SSchangelog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SUBSYSTEM_DEF(changelog)
/client/verb/changes()
set name = "Changelog"
set desc = "View the changelog."
set category = "OOC"
set category = null
// Just invoke the actual CL thing
SSchangelog.OpenChangelog(src)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
// Make a holder for the charge text
var/image/count_down_holder = image('icons/effects/effects.dmi', icon_state = "nothing")
count_down_holder.plane = FLOAT_PLANE + 1.1
var/text = S.cooldown_handler.statpanel_info()
var/text = S.cooldown_handler.cooldown_info()
count_down_holder.maptext = "<div style=\"font-size:6pt;color:[recharge_text_color];font:'Small Fonts';text-align:center;\" valign=\"bottom\">[text]</div>"
button.add_overlay(count_down_holder)

Expand Down
5 changes: 4 additions & 1 deletion code/datums/datumvars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@

/client/proc/view_var_Topic(href, href_list, hsrc)
//This should all be moved over to datum/admins/Topic() or something ~Carn
if(!check_rights(R_ADMIN|R_MOD, FALSE) && !((href_list["datumrefresh"] || href_list["Vars"] || href_list["VarsList"]) && check_rights(R_VIEWRUNTIMES, FALSE)))
if(!check_rights(R_ADMIN|R_MOD, FALSE) \
&& !((href_list["datumrefresh"] || href_list["Vars"] || href_list["VarsList"]) && check_rights(R_VIEWRUNTIMES, FALSE)) \
&& !((href_list["proc_call"]) && check_rights(R_PROCCALL, FALSE)) \
)
return // clients with R_VIEWRUNTIMES can still refresh the window/view references/view lists. they cannot edit anything else however.

if(view_var_Topic_list(href, href_list, hsrc)) // done because you can't use UIDs with lists and I don't want to snowflake into the below check to supress warnings
Expand Down
2 changes: 0 additions & 2 deletions code/datums/spell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ GLOBAL_LIST_INIT(spells, typesof(/datum/spell))
/datum/spell
var/name = "Spell" // Only rename this if the spell you're making is not abstract
var/desc = "A wizard spell"
var/panel = "Spells"//What panel the proc holder needs to go on.

var/school = "evocation" //not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit?
///recharge time in deciseconds
var/base_cooldown = 10 SECONDS
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_cooldown/spell_charges.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
..()
charge_time = world.time

/datum/spell_cooldown/charges/statpanel_info()
/datum/spell_cooldown/charges/cooldown_info()
var/charge_string = charge_duration != 0 ? round(min(1, (charge_duration - (charge_time - world.time)) / charge_duration), 0.01) * 100 : 100 // need this for possible 0 charge duration
var/recharge_string = recharge_duration != 0 ? round(min(1, (recharge_duration - (recharge_time - world.time)) / recharge_duration), 0.01) * 100 : 100
return "[charge_string != 100 ? "[charge_string]%\n" : ""][recharge_string != 100 ? "[recharge_string]%\n" : ""][current_charges]/[max_charges]"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spell_cooldown/spell_cooldown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@
/datum/spell_cooldown/proc/revert_cast()
recharge_time = world.time

/datum/spell_cooldown/proc/statpanel_info()
/datum/spell_cooldown/proc/cooldown_info()
return "[round(get_availability_percentage(), 0.01) * 100]%"
1 change: 0 additions & 1 deletion code/datums/spells/bloodcrawl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
overlay = null
action_icon_state = "bloodcrawl"
action_background_icon_state = "bg_demon"
panel = "Demon"
var/allowed_type = /obj/effect/decal/cleanable
var/phased = FALSE

Expand Down
4 changes: 0 additions & 4 deletions code/datums/spells/mime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "Invisible Wall"
desc = "The mime's performance transmutates into physical reality."
school = "mime"
panel = "Mime"
summon_type = list(/obj/structure/forcefield/mime)
invocation_type = "emote"
invocation_emote_self = "<span class='notice'>You form a wall in front of yourself.</span>"
Expand Down Expand Up @@ -32,7 +31,6 @@
name = "Speech"
desc = "Make or break a vow of silence."
school = "mime"
panel = "Mime"
clothes_req = FALSE
base_cooldown = 5 MINUTES
human_req = TRUE
Expand Down Expand Up @@ -66,7 +64,6 @@
name = "Invisible Greater Wall"
desc = "Form an invisible three tile wide blockade."
school = "mime"
panel = "Mime"
wall_type = /obj/effect/forcefield/mime/advanced
invocation_type = "emote"
invocation_emote_self = "<span class='notice'>You form a blockade in front of yourself.</span>"
Expand All @@ -91,7 +88,6 @@
name = "Finger Gun"
desc = "Shoot lethal, silencing bullets out of your fingers! 3 bullets available per cast. Use your fingers to holster them manually."
school = "mime"
panel = "Mime"
clothes_req = FALSE
base_cooldown = 30 SECONDS
human_req = TRUE
Expand Down
Loading

0 comments on commit dbc3c68

Please sign in to comment.