Skip to content

Commit

Permalink
Merge branch 'ss220club:master' into lavaland_base
Browse files Browse the repository at this point in the history
  • Loading branch information
Chorden523 authored Apr 26, 2024
2 parents d6f2e0b + 1f357e4 commit 83bb263
Show file tree
Hide file tree
Showing 733 changed files with 10,214 additions and 7,063 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
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
54 changes: 51 additions & 3 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 Expand Up @@ -586,6 +612,26 @@ SS13 has a lot of legacy code that's never been updated. Here are some examples

- Files and path accessed and referenced by code above simply being #included should be strictly lowercase to avoid issues on filesystems where case matters.

#### Modular Code in a File

Code should be modular where possible; if you are working on a new addition, then strongly consider putting it in its own file unless it makes sense to put it with similar ones (i.e. a new tool would go in the `tools.dm` file)

Our codebase also has support for checking files so that they only contain one specific typepath, including none of its subtypes. This can be done by adding a specific header at the beginning of the file, which the CI will look for when running. An example can be seen below. You can also run this test locally using `/tools/ci/restrict_file_types.py`

```dm
RESTRICT_TYPE(/datum/foo)
/datum/proc/do_thing() // Error: '/datum' proc found in a file restricted to '/datum/foo'
/datum/foo
/datum/foo/do_thing()
/datum/foo/bar // Error: '/datum/foo/bar' type definition found in a file restricted to '/datum/foo'
/datum/foo/bar/do_thing() // Error: '/datum/foo/bar' proc found in a file restricted to '/datum/foo'
```

### SQL

- Do not use the shorthand sql insert format (where no column names are specified) because it unnecessarily breaks all queries on minor column changes and prevents using these tables for tracking outside related info such as in a connected site/forum.
Expand Down Expand Up @@ -679,7 +725,6 @@ SS13 has a lot of legacy code that's never been updated. Here are some examples

### Other Notes

- Code should be modular where possible; if you are working on a new addition, then strongly consider putting it in its own file unless it makes sense to put it with similar ones (i.e. a new tool would go in the `tools.dm` file)
- Bloated code may be necessary to add a certain feature, which means there has to be a judgement over whether the feature is worth having or not. You can help make this decision easier by making sure your code is modular.

- You are expected to help maintain the code that you add, meaning that if there is a problem then you are likely to be approached in order to fix any issues, runtimes, or bugs.
Expand Down Expand Up @@ -815,8 +860,10 @@ Each role inherits the lower role's responsibilities (IE: Headcoders also have c
`Commit Access` members have write access to the repository and can merge your PRs. People included in this role are:

- [AffectedArc07](https://github.com/AffectedArc07)
- [Burzah](https://github.com/Burzah)
- [Charliminator](https://github.com/hal9000PR)
- [Contrabang](https://github.com/Contrabang)
- [DGamerL](https://github.com/DGamerL)
- [lewcc](https://github.com/lewcc)

---
Expand All @@ -827,6 +874,7 @@ Each role inherits the lower role's responsibilities (IE: Headcoders also have c
- [Charliminator](https://github.com/hal9000PR)
- [Contrabang](https://github.com/Contrabang)
- [DGamerL](https://github.com/DGamerL)
- [FunnyMan3595](https://github.com/FunnyMan3595)
- [Henri215](https://github.com/Henri215)
- [lewcc](https://github.com/lewcc)
- [Sirryan2002](https://github.com/Sirryan2002)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

on:
pull_request_target:
types: [opened, reopened, edited, labeled, unlabeled]
types: [opened, reopened, edited, labeled, unlabeled, ready_for_review]

jobs:
CheckCL:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
python tools/ci/unticked_files.py ${GITHUB_WORKSPACE}
python tools/ci/illegal_dme_files.py ${GITHUB_WORKSPACE}
python tools/ci/define_sanity.py
python tools/ci/restrict_file_types.py
python -m tools.ci.check_icon_conflicts
python -m tools.ci.check_icon_dupenames
python -m tools.maplint.source --github
Expand Down
1 change: 1 addition & 0 deletions SQL/paradise_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CREATE TABLE `characters` (
`real_name` varchar(55) COLLATE utf8mb4_unicode_ci NOT NULL,
`name_is_always_random` tinyint(1) NOT NULL,
`gender` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
`body_type` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
`age` smallint(4) NOT NULL,
`species` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`language` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion SQL/updates/53-54.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#Add a choice for what type of brain borgs want to have

ALTER TABLE `characters`
ADD COLUMN `cyborg_brain_type` VARCHAR(11) NOT NULL DEFAULT 'MMI' AFTER `height`;
ADD COLUMN `cyborg_brain_type` ENUM('MMI', 'Robobrain', 'Positronic') NOT NULL DEFAULT 'MMI' AFTER `height`;
9 changes: 9 additions & 0 deletions SQL/updates/54-55.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Updating DB from 54-55 - lewc
# Adds a new `body_type` (gender sprite) column to the `characters` table

# Add the new column next to the existing `gender` one
ALTER TABLE `characters`
ADD COLUMN `body_type` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL AFTER `gender`;

# Set the `body_type` column to whatever's already in `gender`, so that it doesn't change existing characters
UPDATE `characters` SET `body_type` = `gender` WHERE `gender` IS NOT NULL
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
3 changes: 1 addition & 2 deletions _maps/map_files/RandomRuins/SpaceRuins/listeningpost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,14 @@
info = "Nothing of interest to report.";
name = "november report"
},
/obj/item/pen,
/obj/item/tape,
/obj/item/radio/intercom{
freerange = 1;
pixel_y = -24;
name = "intercom"
},
/obj/item/paper_bin,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/effect/decal/cleanable/dirt,
/turf/simulated/floor/plasteel/dark,
/area/ruin/space/syndicate_listening_station)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
/obj/item/paper_bin{
pixel_x = -6
},
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/mineral/plastitanium,
/area/ruin/space/mech_transport)
"MA" = (
Expand Down
1 change: 1 addition & 0 deletions _maps/map_files/RandomRuins/SpaceRuins/moonoutpost19.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -5200,6 +5200,7 @@
},
/obj/item/coin/antagtoken/syndicate,
/obj/structure/table,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plating/asteroid/ancient,
/area/ruin/space/moonbase19)
"rk" = (
Expand Down
15 changes: 1 addition & 14 deletions _maps/map_files/RandomRuins/SpaceRuins/onehalf.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@
/area/ruin/space/onehalf/hallway)
"aM" = (
/obj/structure/disposalpipe/segment,
/obj/structure/disposalpipe/segment,
/obj/machinery/door/poddoor{
id_tag = "bayint1";
name = "mining drone bay blast door"
Expand Down Expand Up @@ -636,9 +635,6 @@
/area/ruin/space/onehalf/hallway)
"bA" = (
/obj/structure/disposalpipe/segment,
/obj/structure/disposalpipe/segment{
dir = 4
},
/obj/structure/disposalpipe/segment{
dir = 4
},
Expand All @@ -653,15 +649,6 @@
},
/turf/simulated/floor/plasteel,
/area/ruin/space/onehalf/drone_bay)
"bC" = (
/obj/structure/disposalpipe/segment{
dir = 4
},
/obj/structure/disposalpipe/segment{
dir = 4
},
/turf/simulated/floor/plasteel,
/area/ruin/space/onehalf/drone_bay)
"bD" = (
/obj/structure/disposalpipe/junction{
dir = 8
Expand Down Expand Up @@ -1643,7 +1630,7 @@ aD
aq
aX
bm
bC
bn
bT
aa
cn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
pixel_x = 4
},
/obj/item/paper/syndicate_druglab,
/obj/item/pen,
/obj/item/flashlight/lamp/green/off{
pixel_y = 12;
pixel_x = -6
},
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/carpet/black,
/area/ruin/space/syndicate_druglab)
"qa" = (
Expand Down
8 changes: 4 additions & 4 deletions _maps/map_files/RandomRuins/SpaceRuins/syndie_space_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@
dir = 8
},
/obj/item/hand_labeler,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
dir = 9;
icon_state = "darkgreen"
Expand Down Expand Up @@ -3423,7 +3423,7 @@
"th" = (
/obj/structure/table,
/obj/item/paper_bin,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/structure/extinguisher_cabinet{
name = "north bump";
pixel_y = 30
Expand Down Expand Up @@ -3760,7 +3760,7 @@
/area/ruin/unpowered/syndicate_space_base/service)
"vd" = (
/obj/structure/table,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/item/paper_bin,
/obj/item/stamp/syndicate,
/obj/machinery/light_switch{
Expand Down Expand Up @@ -8462,7 +8462,7 @@
dir = 8
},
/obj/item/hand_labeler,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
dir = 10;
icon_state = "darkgreen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@
/obj/machinery/light/small{
dir = 4
},
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/engine,
/area/ruin/space/unpowered)
"tX" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/syndiedepot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@
"bV" = (
/obj/structure/table,
/obj/item/folder/syndicate/yellow,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
icon_state = "dark"
},
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
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
/area/ruin/space/wreck_cargoship)
"jb" = (
/obj/structure/table,
/obj/structure/table,
/obj/item/paper{
name = "management's directive";
info = "Good day Captain Hardie. Your ship has been assigned to carry an extremely delicate cargo due to an unfortunate scheduling issue in behalf of our custormers. You will find the additional information on transporting procedure of this extremely delicate cargo attached to it. Management believes you will not mind this rather unconvenient last minute change after what happened last time. Make sure you and your crew doesn't mess it up this time as we hate to compensate the expenses from our esteemed already-in-debt employees. Pick the cargo from next destination and safely deliver it where it has to go."
Expand Down
2 changes: 0 additions & 2 deletions _maps/map_files/stations/boxstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -52972,7 +52972,6 @@
icon_state = "1-2"
},
/obj/structure/disposalpipe/segment,
/obj/structure/disposalpipe/segment,
/obj/structure/sign/securearea{
pixel_x = -32
},
Expand Down Expand Up @@ -74887,7 +74886,6 @@
/area/station/maintenance/apmaint)
"owP" = (
/obj/structure/disposalpipe/segment,
/obj/structure/disposalpipe/segment,
/turf/simulated/floor/plating/airless,
/area/station/maintenance/asmaint)
"oxe" = (
Expand Down
Loading

0 comments on commit 83bb263

Please sign in to comment.