Skip to content

Commit

Permalink
Merge branch 'TauCetiStation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BasiaBelov authored Feb 20, 2024
2 parents fe93bfb + a1d2d75 commit cbc0866
Show file tree
Hide file tree
Showing 134 changed files with 2,224 additions and 1,908 deletions.
22 changes: 22 additions & 0 deletions .github/wiki/MAP_LIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Smart Light

Умный свет - система цветного света для лампочек на станции, пресеты и моды позволяют настроить индивидуальное освещение для вашей карты.

### Как добавить новый набор-пресет для карты:

* Добавить новый ``/datum/smartlight_preset/вашеимя`` в [``/code/datums/lighting/smartlight_presets.dm``](/code/datums/lighting/smartlight_presets.dm) со своими настройками и уникальным ``.name``
* Добавить в json конфига карты параметр ``smartlight_preset`` с ``.name`` нового пресета. Конфиг тестовой карты как пример.

### Как добавить новый набор-пресет для зоны:
* Добавить новый ``/datum/smartlight_preset/вашеимя`` в [``/code/datums/lighting/smartlight_presets.dm``](/code/datums/lighting/smartlight_presets.dm) со своими настройками и уникальным ``.name``
* На карте прописать нужному APC в параметры ``custom_smartlight_preset`` с ``.name`` нового пресета. APC бара на боксе как пример.

### Как добавить новый световой мод:
* Смотреть [``/code/datums/lighting/light_modes.dm``](/code/datums/lighting/light_modes.dm), добавить новый datum. Поэкспериментировать с параметрами для света можно дебаг-вербом "Add Smartlight Preset".
* Рекомендую для ярких цветов уменьшать рейндж или силу, иначе оно начинает выглядеть как скучный цвето-фильтр на весь экран.
* Опционально - добавить новый тип ``/obj/item/weapon/disk/smartlight_programm`` в ``/code/game/machinery/computer/smartlight_console.dm``, добавить в карго заказы по подобию ``/datum/supply_pack/smartlight_standart``.

### Как добавить новые уникальные лампочки:
* Рекомендуется: добавить новый тип ``/obj/item/weapon/light/*`` со своим световым модом и прочими настройками, и соответствующую ему лампу ``/obj/machinery/light/*``.
* Старый вариант: в параметрах лампы (любой ``/obj/machinery/light/*``) на карте прописать параметры ``force_override_color``, ``force_override_power``, ``force_override_range``. *Не рекомендуется, потому что хардкод и игнорирует параметры вставленной лампочки.*

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [F.A.Q. по работе с картой](/.github/wiki/WORK_WITH_MAP.md)
- [Вводный курс (форум)](https://forum.taucetistation.org/t/gajd-na-maping-i-kak-etim-voobshhe-zanimatsya/32439)
- [Добавление своей станции](/.github/wiki/HOW_ADD_STATION.md)
- [Работа со светом](/.github/wiki/MAP_LIGHT.md)
* **Звуки:**
- [Общий гайд по работе со звуками в игре (wiki)](https://wiki.taucetistation.org/Soundmaking)
* **Спрайты:**
Expand Down
9 changes: 8 additions & 1 deletion code/__DEFINES/_planes_layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ What is the naming convention for planes or layers?
#define ANOMALY_PLANE -21
#define ANOMALY_RENDER_TARGET "*ANOM_RENDER_TARGET"

// underfloor, floor and game planes have common layout order
// in some cases object can be switched between these planes
// FLOOR plane disables ambitn occlusion, UNDERFLOOR exists for undertile component
#define UNDERFLOOR_PLANE -8
#define FLOOR_PLANE -7

#define GAME_PLANE -4
#define BELOW_TURF_LAYER 1.9
//efine TURF_LAYER 2 // For easy recordkeeping; this is a byond define
Expand All @@ -96,13 +99,17 @@ What is the naming convention for planes or layers?
#define GAS_PIPE_HIDDEN_SUPPLY_LAYER 2.33
#define GAS_PIPE_HIDDEN_SCRUBBER_LAYER 2.34
#define GAS_PIPE_HIDDEN_LAYER 2.35
#define POWER_CABLES_HEAVY 2.39
#define TURF_CAP_LAYER 2.4 // cap on grid_floor and possible other future floors who can do UNDERFLOOR_VISIBLE, should be above hidden pipes
#define POWER_CABLES 2.44
#define GAS_SCRUBBER_LAYER 2.46
#define GAS_PIPE_VISIBLE_LAYER 2.47
#define GAS_FILTER_LAYER 2.48
#define GAS_PUMP_LAYER 2.49
#define LOW_OBJ_LAYER 2.491 // Currently used only by unused machinery
#define SAFEDOOR_LAYER 2.5 // firedoors, poddoors, and someone used this for safe for some reason
#define ABOVE_SAFEDOOR_LAYER 2.51 // poddoors default, they should be around SAFEDOOR_LAYER (see SAFEDOOR_CLOSED_MOD_*) but little above firedoors
#define POWER_TERMINAL 2.6
#define BELOW_CONTAINERS_LAYER 2.7 // Below closets, crates...
#define CONTAINER_STRUCTURE_LAYER 2.8 // Layer for closets, crates, bags, racks, tables
#define DOOR_LAYER 2.82
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/_translation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,12 @@
|| atom.gender == FEMALE && w_female \
|| atom.gender == NEUTER && w_neuter \
|| w_plural

// Capitalize Case: тоже самое, что и CASE, только превращает первую букву в заглавную
#define C_CASE(atom, case) capitalize(CASE(atom, case))

// Часто встречаемые pluralize_russian(). Не забывайте про существование нецелых чисел и округления - они тоже влияют.
#define PLUR_UNITS(units) pluralize_russian(units, "юнит", "юнита", "юнитов")

#define PLUR_SECONDS_LEFT(seconds) pluralize_russian(seconds, "секунда", "секунды", "секунд") // "Осталась 1 секунда". Не путайте с нижним.
#define PLUR_SECONDS_IN(seconds) pluralize_russian(seconds, "секунду", "секунды", "секунд") // "Через 1 секунду". Не путайте с верхним.
5 changes: 4 additions & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,14 @@
#define COMSIG_INSTRUMENT_REPEAT "instrument_repeat"
///sent to the instrument when tempo changes, skipped on new: (datum/music_player)
#define COMSIG_INSTRUMENT_TEMPO_CHANGE "instrument_tempo_change"
// /obj

// /obj signals
/// from base of datum/religion_rites/reset_rite_wrapper(): ()
#define COMSIG_OBJ_RESET_RITE "obj_reset_rite"
/// from base of datum/religion_rites/start(): ()
#define COMSIG_OBJ_START_RITE "obj_start_rite"
///from base of /turf/proc/levelupdate(). (underfloor_accessibility)
#define COMSIG_OBJ_LEVELUPDATE "obj_levelupdate"

// /obj/item signals
/// from base of obj/item/attack(): (/mob/living/target, /mob/living/user, def_zone)
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define JOB_FLAG_NON_HUMAN 128
#define JOB_FLAG_HEAD_OF_STAFF 256
#define JOB_FLAG_BLUESHIELD_PROTEC 512
#define JOB_FLAG_IMPOSTER_PRIORITIZE 1024

//dir macros
///Returns true if the dir is diagonal, false otherwise
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/gamemodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define F_FAMILIES "Families"
#define F_HEIST "Vox Shoal"
#define F_HIVEMIND "Changeling Hivemind"
#define F_IMPOSTERS "Imposters"
#define F_PROPS "Props"
#define F_REVOLUTION "Revolution"
#define F_SYNDIOPS "Syndicate Operatives"
Expand Down Expand Up @@ -44,7 +43,6 @@
#define GANGSTER_LEADER "Gangster Leader"
#define GANGSTER_DEALER "Gangster Dealer"
#define HEADREV "Head Revolutionary"
#define IMPOSTER "Imposter"
#define MALF "Malf AI"
#define MALFBOT "Malf-Slaved Cyborg"
#define NUKE_OP "Nuclear Operative"
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@

#define istraitor(H) isrole(TRAITOR, H)

#define isimposter(H) isrole(IMPOSTER, H)

#define iselitesyndie(H) isrole(SYNDIESQUADIE, H)

#define ismalf(H) isrole(MALF, H)
Expand Down
24 changes: 24 additions & 0 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,27 @@
#define FLASH_LIGHT_DURATION 2
#define FLASH_LIGHT_POWER 3
#define FLASH_LIGHT_RANGE 3.8

/// Returns the red part of a #RRGGBB hex sequence as number
#define GETREDPART(hexa) hex2num(copytext(hexa, 2, 4))

/// Returns the green part of a #RRGGBB hex sequence as number
#define GETGREENPART(hexa) hex2num(copytext(hexa, 4, 6))

/// Returns the blue part of a #RRGGBB hex sequence as number
#define GETBLUEPART(hexa) hex2num(copytext(hexa, 6, 8))

/// Parse the hexadecimal color into lumcounts of each perspective.
#define PARSE_LIGHT_COLOR(source) \
do { \
if (source.light_color) { \
var/__light_color = source.light_color; \
source.lum_r = GETREDPART(__light_color) / 255; \
source.lum_g = GETGREENPART(__light_color) / 255; \
source.lum_b = GETBLUEPART(__light_color) / 255; \
} else { \
source.lum_r = 1; \
source.lum_g = 1; \
source.lum_b = 1; \
}; \
} while (FALSE)
2 changes: 0 additions & 2 deletions code/__DEFINES/role_preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define ROLE_ABDUCTOR "Abductor"
#define ROLE_FAMILIES "Families"
#define ROLE_GHOSTLY "Ghostly Roles"
#define ROLE_IMPOSTER "Imposter"
#define ROLE_REPLICATOR "Replicator"

#define ROLE_ERT "Emergency Response Team"
Expand Down Expand Up @@ -50,7 +49,6 @@ var/global/list/special_roles_ignore_question = list(
ROLE_SHADOWLING = null,
ROLE_FAMILIES = null,
ROLE_REPLICATOR = null,
ROLE_IMPOSTER = null,
ROLE_GHOSTLY = list(IGNORE_PAI, IGNORE_TSTAFF, IGNORE_SURVIVOR, IGNORE_POSBRAIN, IGNORE_DRONE),
)

Expand Down
7 changes: 7 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
: FALSE)
#define HAS_TRAIT_NOT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (length(target.status_traits[trait] - source) > 0) : FALSE) : FALSE)

/// Trait applied by element
#define ELEMENT_TRAIT(source) "element_trait_[source]"

//mob traits
/// Forces user to be unmovable
Expand Down Expand Up @@ -206,6 +208,9 @@
// item trait
#define TRAIT_NO_SACRIFICE "religion_no_sacrifice"

/// Visible on t-ray scanners if the atom is under tile
#define TRAIT_T_RAY_VISIBLE "t-ray-visible"

// idk why this exists on TG
#define GENERIC_TRAIT "generic"
// common trait sources
Expand All @@ -226,6 +231,8 @@

// atom traits
#define TRAIT_XENO_FUR "xeno_fur"
// Trait from being under the floor in some manner
#define TRAIT_UNDERFLOOR "underfloor"

// trait sources
#define EYE_DAMAGE_TRAIT "eye_damage"
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/turfs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// The pipes, disposals, and wires are hidden
#define UNDERFLOOR_HIDDEN 0
/// The pipes, disposals, and wires are visible but cannot be interacted with
#define UNDERFLOOR_VISIBLE 1
/// The pipes, disposals, and wires are visible and can be interacted with
#define UNDERFLOOR_INTERACTABLE 2
22 changes: 3 additions & 19 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,32 +426,16 @@

return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)

/proc/GetRedPart(const/hexa)
return hex2num(copytext(hexa,2,4))

/proc/GetGreenPart(const/hexa)
return hex2num(copytext(hexa,4,6))

/proc/GetBluePart(const/hexa)
return hex2num(copytext(hexa,6,8))

/proc/GetHexColors(const/hexa)
return list(
GetRedPart(hexa),
GetGreenPart(hexa),
GetBluePart(hexa)
)

/proc/MixColors(const/list/colors)
var/list/reds = list()
var/list/blues = list()
var/list/greens = list()
var/list/weights = list()

for (var/i = 0, ++i <= colors.len)
reds.Add(GetRedPart(colors[i]))
blues.Add(GetBluePart(colors[i]))
greens.Add(GetGreenPart(colors[i]))
reds.Add(GETREDPART(colors[i]))
blues.Add(GETBLUEPART(colors[i]))
greens.Add(GETGREENPART(colors[i]))
weights.Add(1)

var/r = mixOneColor(weights, reds)
Expand Down
18 changes: 18 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,21 @@
return pick(user.neuter_gender_voice == MALE ? male_sounds : female_sounds)

return pick(male_sounds)

/proc/get_germ_level_name(germ_level)
switch(germ_level)
if(INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE_PLUS)
return "Лёгкая инфекция"
if(INFECTION_LEVEL_ONE_PLUS to INFECTION_LEVEL_ONE_PLUS_PLUS)
return "Лёгкая инфекция+"
if(INFECTION_LEVEL_ONE_PLUS_PLUS to INFECTION_LEVEL_TWO)
return "Лёгкая инфекция++"
if(INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO_PLUS)
return "Острая инфекция"
if(INFECTION_LEVEL_TWO_PLUS to INFECTION_LEVEL_TWO_PLUS_PLUS)
return "Острая инфекция+"
if(INFECTION_LEVEL_TWO_PLUS_PLUS to INFECTION_LEVEL_THREE)
return "Острая инфекция++"
if(INFECTION_LEVEL_THREE to INFINITY)
return "Сепсис"
return
25 changes: 25 additions & 0 deletions code/__HELPERS/wrappers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,28 @@

/proc/_step(ref, dir)
step(ref, dir)

// used in hotkeys so that we can call proc instead of winset(src, null, "command=say")
/mob/proc/say_wrapper()
set_typing_indicator(TRUE)
var/message = input("","say (text)") as text|null
if(message)
say_verb(message)
set_typing_indicator(FALSE)

/mob/proc/me_wrapper()
set_typing_indicator(TRUE)
var/message = input("","me (text)") as text|null
if(message)
me_verb(message)
set_typing_indicator(FALSE)

/client/proc/ooc_wrapper()
var/message = input("","ooc (text)") as text|null
if(message)
ooc(message)

/client/proc/looc_wrapper()
var/message = input("","looc (text)") as text|null
if(message)
looc(message)
1 change: 0 additions & 1 deletion code/_globalvars/lists/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var/global/list/roles_ingame_minute_unlock = list(
ROLE_SHADOWLING = 4320,
ROLE_FAMILIES = 2160,
ROLE_REPLICATOR = 2880,
ROLE_IMPOSTER = 720,
ROLE_GHOSTLY = 360,
)

Expand Down
8 changes: 8 additions & 0 deletions code/_onclick/hud/rendering/plane_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
/atom/movable/screen/plane_master/proc/apply_effects(mob/mymob)
return

///Level below the floor, for undertile component
/atom/movable/screen/plane_master/underfloor
name = "underfloor plane master"
plane = UNDERFLOOR_PLANE
appearance_flags = PLANE_MASTER
blend_mode = BLEND_OVERLAY
render_relay_plane = RENDER_PLANE_GAME

///Contains just the floor
/atom/movable/screen/plane_master/floor
name = "floor plane master"
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/hud/rendering/plane_master_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/atom/movable/plane_master_controller/game
name = PLANE_MASTERS_GAME
controlled_planes = list(
UNDERFLOOR_PLANE,
FLOOR_PLANE,
GAME_PLANE,
ABOVE_GAME_PLANE,
Expand Down
30 changes: 15 additions & 15 deletions code/controllers/subsystem/lighting.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var/global/list/lighting_update_lights = list() // List of lighting sources queued for update.
var/global/list/lighting_update_corners = list() // List of lighting corners queued for update.
var/global/list/lighting_update_objects = list() // List of lighting objects queued for update.

SUBSYSTEM_DEF(lighting)
name = "Lighting"

Expand All @@ -11,8 +7,12 @@ SUBSYSTEM_DEF(lighting)
flags = SS_TICKER
msg_lobby = "Включаем свет..."

var/static/list/sources_queue = list() // List of lighting sources queued for update.
var/static/list/corners_queue = list() // List of lighting corners queued for update.
var/static/list/objects_queue = list() // List of lighting objects queued for update.

/datum/controller/subsystem/lighting/stat_entry()
..("L:[global.lighting_update_lights.len]|C:[global.lighting_update_corners.len]|O:[global.lighting_update_objects.len]")
..("L:[sources_queue.len]|C:[corners_queue.len]|O:[objects_queue.len]")

/datum/controller/subsystem/lighting/Initialize(timeofday)
if(!initialized)
Expand Down Expand Up @@ -48,9 +48,9 @@ SUBSYSTEM_DEF(lighting)
if(!init_fire)
MC_SPLIT_TICK

while (global.lighting_update_lights.len)
var/datum/light_source/L = global.lighting_update_lights[global.lighting_update_lights.len]
global.lighting_update_lights.len--
while (sources_queue.len)
var/datum/light_source/L = sources_queue[sources_queue.len]
sources_queue.len--

L.update_corners()

Expand All @@ -67,25 +67,25 @@ SUBSYSTEM_DEF(lighting)

var/i = 0

for (i in 1 to global.lighting_update_corners.len)
var/datum/lighting_corner/C = global.lighting_update_corners[i]
for (i in 1 to corners_queue.len)
var/datum/lighting_corner/C = corners_queue[i]

C.update_objects()
C.needs_update = FALSE
C.update_objects()
if(init_fire)
CHECK_TICK
else if (MC_TICK_CHECK)
break
if (i)
global.lighting_update_corners.Cut(1, i+1)
corners_queue.Cut(1, i+1)
i = 0


if(!init_fire)
MC_SPLIT_TICK

for (i in 1 to global.lighting_update_objects.len)
var/atom/movable/lighting_object/O = global.lighting_update_objects[i]
for (i in 1 to objects_queue.len)
var/atom/movable/lighting_object/O = objects_queue[i]

if (QDELETED(O))
continue
Expand All @@ -97,7 +97,7 @@ SUBSYSTEM_DEF(lighting)
else if (MC_TICK_CHECK)
break
if (i)
global.lighting_update_objects.Cut(1, i+1)
objects_queue.Cut(1, i+1)

/datum/controller/subsystem/lighting/Recover()
initialized = SSlighting.initialized
Expand Down
Loading

0 comments on commit cbc0866

Please sign in to comment.