Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 30dca83

Browse files
committed
almost set
1 parent c8b4ff6 commit 30dca83

File tree

30 files changed

+111
-110
lines changed

30 files changed

+111
-110
lines changed

code/__DEFINES/_helpers.dm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Stuff that is relatively "core" and is used in other defines/helpers
2+
3+
/**
4+
* The game's world.icon_size. \
5+
* Ideally divisible by 16. \
6+
* Ideally a number, but it
7+
* can be a string ("32x32"), so more exotic coders
8+
* will be sad if you use this in math.
9+
*/
10+
#define ICON_SIZE_ALL 32
11+
/// The X/Width dimension of ICON_SIZE. This will more than likely be the bigger axis.
12+
#define ICON_SIZE_X 32
13+
/// The Y/Height dimension of ICON_SIZE. This will more than likely be the smaller axis.
14+
#define ICON_SIZE_Y 32
15+
116
/// Takes a datum as input, returns its ref string
217
#define text_ref(datum) ref(datum)
318

code/__DEFINES/radio.dm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,20 @@
114114
#define REQ_DEP_TYPE_ASSISTANCE (1<<0)
115115
#define REQ_DEP_TYPE_SUPPLIES (1<<1)
116116
#define REQ_DEP_TYPE_INFORMATION (1<<2)
117+
118+
///give this to can_receive to specify that there is no restriction on what z level this signal is sent to
119+
#define RADIO_NO_Z_LEVEL_RESTRICTION 0
120+
121+
/// Radio frequency is unlocked and can be ajusted by anyone
122+
#define RADIO_FREQENCY_UNLOCKED 0
123+
/// Radio frequency is locked, unchangeable by players
124+
#define RADIO_FREQENCY_LOCKED 1
125+
/// Radio frequency is locked and unchangeable, but can be unlocked by an emag
126+
#define RADIO_FREQENCY_EMAGGABLE_LOCK 2
127+
128+
///Bitflag for if a headset can use the syndicate radio channel
129+
#define RADIO_SPECIAL_SYNDIE (1<<0)
130+
///Bitflag for if a headset can use the centcom radio channel
131+
#define RADIO_SPECIAL_CENTCOM (1<<1)
132+
///Bitflag for if a headset can use the binary radio channel
133+
#define RADIO_SPECIAL_BINARY (1<<2)

code/__HELPERS/_lists.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
#define LAZYINITLIST(L) if (!L) { L = list(); }
5353
///If the provided list is empty, set it to null
5454
#define UNSETEMPTY(L) if (L && !length(L)) L = null
55+
///If the provided key -> list is empty, remove it from the list
56+
#define ASSOC_UNSETEMPTY(L, K) if (!length(L[K])) L -= K;
5557
///Remove an item from the list, set the list to null if empty
5658
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } }
5759
///Add an item to the list, if the list is null it will initialize it

code/__HELPERS/game.dm

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@
2929

3030

3131

32-
//This is the new version of recursive_mob_check, used for say().
33-
//The other proc was left intact because morgue trays use it.
34-
//Sped this up again for real this time
35-
/proc/recursive_hear_check(O)
36-
var/list/processing_list = list(O)
37-
. = list()
38-
var/i = 0
39-
while(i < length(processing_list))
40-
var/atom/A = processing_list[++i]
41-
if(A.flags_1 & HEAR_1)
42-
. += A
43-
processing_list += A.contents
44-
4532
/** recursive_organ_check
4633
* inputs: O (object to start with)
4734
* outputs:
@@ -79,47 +66,12 @@
7966

8067
return
8168

82-
// Better recursive loop, technically sort of not actually recursive cause that shit is stupid, enjoy.
83-
//No need for a recursive limit either
84-
/proc/recursive_mob_check(atom/O,client_check=1,sight_check=1,include_radio=1)
85-
86-
var/list/processing_list = list(O)
87-
var/list/processed_list = list()
88-
var/list/found_mobs = list()
89-
90-
while(processing_list.len)
91-
92-
var/atom/A = processing_list[1]
93-
var/passed = 0
94-
95-
if(ismob(A))
96-
var/mob/A_tmp = A
97-
passed=1
98-
99-
if(client_check && !A_tmp.client)
100-
passed=0
101-
102-
if(sight_check && !isInSight(A_tmp, O))
103-
passed=0
104-
105-
else if(include_radio && istype(A, /obj/item/radio))
106-
passed=1
107-
108-
if(sight_check && !isInSight(A, O))
109-
passed=0
110-
111-
if(passed)
112-
found_mobs |= A
113-
114-
for(var/atom/B in A)
115-
if(!processed_list[B])
116-
processing_list |= B
117-
118-
processing_list.Cut(1, 2)
119-
processed_list[A] = A
120-
121-
return found_mobs
122-
69+
///Returns the name of the area the atom is in
70+
/proc/get_area_name(atom/checked_atom, format_text = FALSE)
71+
var/area/checked_area = isarea(checked_atom) ? checked_atom : get_area(checked_atom)
72+
if(!checked_area)
73+
return null
74+
return format_text ? format_text(checked_area.name) : checked_area.name
12375

12476
/proc/get_cardinal_step_away(atom/start, atom/finish) //returns the position of a step from start away from finish, in one of the cardinal directions
12577
//returns only NORTH, SOUTH, EAST, or WEST

code/__HELPERS/spatial_info.dm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@
295295
return atoms
296296

297297
///Returns the distance between two atoms
298-
/proc/get_dist_euclidean(atom/first_location, atom/second_location)
299-
var/dx = first_location.x - second_location.x
300-
var/dy = first_location.y - second_location.y
298+
/proc/get_dist_euclidian(atom/Loc1 as turf|mob|obj,atom/Loc2 as turf|mob|obj)
299+
var/dx = Loc1.x - Loc2.x
300+
var/dy = Loc1.y - Loc2.y
301301

302-
var/dist = sqrt(dx ** 2 + dy ** 2)
302+
var/dist = sqrt(dx**2 + dy**2)
303303

304304
return dist
305305

@@ -318,7 +318,7 @@
318318
return turfs
319319

320320
///Returns a list of turfs around a center based on view()
321-
/proc/circle_view_turfs(center=usr,radius=3) //Is there even a diffrence between this proc and circle_range_turfs()? // Yes
321+
/proc/circleviewturfs(center=usr,radius=3) //Is there even a diffrence between this proc and circle_range_turfs()? // Yes
322322
var/turf/center_turf = get_turf(center)
323323
var/list/turfs = new/list()
324324
var/rsq = radius * (radius + 0.5)
@@ -441,7 +441,7 @@
441441
get_area(get_ranged_target_turf(center, EAST, 1)),
442442
get_area(get_ranged_target_turf(center, WEST, 1))
443443
)
444-
list_clear_nulls(.)
444+
listclearnulls(.)
445445

446446
///Checks if the mob provided (must_be_alone) is alone in an area
447447
/proc/alone_in_area(area/the_area, mob/must_be_alone, check_type = /mob/living/carbon)
@@ -462,7 +462,7 @@
462462
* @params outer_range - The outer range of the cicle to pull from.
463463
* @params inner_range - The inner range of the circle to NOT pull from.
464464
* @params center - The center of the circle to pull from, can be an atom (we'll apply get_turf() to it within circle_x_turfs procs.)
465-
* @params view_based - If TRUE, we'll use circle_view_turfs instead of circle_range_turfs procs.
465+
* @params view_based - If TRUE, we'll use circleviewturfs instead of circle_range_turfs procs.
466466
*/
467467
/proc/turf_peel(outer_range, inner_range, center, view_based = FALSE)
468468
if(inner_range > outer_range) // If the inner range is larger than the outer range, you're using this wrong.
@@ -471,8 +471,8 @@
471471
var/list/outer
472472
var/list/inner
473473
if(view_based)
474-
outer = circle_view_turfs(center, outer_range)
475-
inner = circle_view_turfs(center, inner_range)
474+
outer = circleviewturfs(center, outer_range)
475+
inner = circleviewturfs(center, inner_range)
476476
else
477477
outer = circle_range_turfs(center, outer_range)
478478
inner = circle_range_turfs(center, inner_range)

code/game/area/areas.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,10 @@ GLOBAL_LIST_EMPTY(teleportlocs)
782782
set waitfor = FALSE
783783
SEND_SIGNAL(src, COMSIG_AREA_ENTERED, arrived, old_area)
784784

785-
if(!LAZYACCESS(arrived.important_recursive_contents, RECURSIVE_CONTENTS_AREA_SENSITIVE))
785+
if(!arrived.important_recursive_contents?[RECURSIVE_CONTENTS_AREA_SENSITIVE])
786786
return
787787
for(var/atom/movable/recipient as anything in arrived.important_recursive_contents[RECURSIVE_CONTENTS_AREA_SENSITIVE])
788-
SEND_SIGNAL(M, COMSIG_ENTER_AREA, src) //The atom that enters the area
788+
SEND_SIGNAL(recipient, COMSIG_ENTER_AREA, src)
789789

790790
/**
791791
* Called when an atom exits an area

code/game/machinery/sci_bombardment.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
lavaland = Z
5353
break
5454
radio = new /obj/item/radio/(src)
55-
radio.frequency = radio_freq
55+
radio.set_frequency(radio_freq)
5656
update_appearance()
5757

5858
/obj/machinery/sci_bombardment/Destroy()

code/game/machinery/telecomms/telecomunications.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ GLOBAL_LIST_EMPTY(telecomms_list)
4949
/// Is it a hidden machine?
5050
var/hide = FALSE
5151

52+
var/net_efective = 100 //yogs percentage of netspeed aplied
53+
var/generates_heat = TRUE //yogs turn off tcomms generating heat
54+
var/heatoutput = 2500 //yogs modify power output per trafic removed(usual heat capacity of the air in server room is 1600J/K)
55+
56+
var/on_icon = "" // used for special cases broadcaster/reciever
5257
///Looping sounds for any servers
5358
var/datum/looping_sound/server/soundloop
5459

code/game/objects/items/devices/radio/radio.dm

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ GLOBAL_LIST_INIT(channel_tokens, list(
107107
set_frequency(sanitize_frequency(frequency, freerange))
108108
set_on(on)
109109

110-
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
111110

112111
/obj/item/radio/Destroy()
113112
remove_radio_all(src) //Just to be sure
@@ -242,17 +241,17 @@ GLOBAL_LIST_INIT(channel_tokens, list(
242241
set_listening(FALSE, actual_setting = FALSE)
243242

244243
/obj/item/radio/talk_into(atom/movable/talking_movable, message, channel, list/spans, datum/language/language, list/message_mods)
245-
if(HAS_TRAIT(talking_movable, TRAIT_SIGN_LANG)) //Forces Sign Language users to wear the translation gloves to speak over radios
246-
var/mob/living/carbon/mute = talking_movable
247-
if(istype(mute))
248-
var/obj/item/clothing/gloves/radio/G = mute.get_item_by_slot(ITEM_SLOT_GLOVES)
249-
if(!istype(G))
250-
return FALSE
251-
switch(mute.check_signables_state())
252-
if(SIGN_ONE_HAND) // One hand full
253-
message = stars(message)
254-
if(SIGN_HANDS_FULL to SIGN_CUFFED)
255-
return FALSE
244+
// if(HAS_TRAIT(talking_movable, TRAIT_SIGN_LANG)) //Forces Sign Language users to wear the translation gloves to speak over radios / if implemented uncomment
245+
// var/mob/living/carbon/mute = talking_movable
246+
// if(istype(mute))
247+
// var/obj/item/clothing/gloves/radio/G = mute.get_item_by_slot(ITEM_SLOT_GLOVES)
248+
// if(!istype(G))
249+
// return FALSE
250+
// switch(mute.check_signables_state())
251+
// if(SIGN_ONE_HAND) // One hand full
252+
// message = stars(message)
253+
// if(SIGN_HANDS_FULL to SIGN_CUFFED)
254+
// return FALSE
256255
if(!spans)
257256
spans = list(talking_movable.speech_span)
258257
if(!language)

code/game/objects/items/implants/implant_biosig_ert.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
. = ..()
1010
radio = new(src)
1111
radio.keyslot = new/obj/item/encryptionkey/headset_cent // Should broadcast exclusively on the centcom channel.
12-
radio.listening = FALSE
12+
radio.set_listening(FALSE)
1313
radio.recalculateChannels()
1414

1515
/obj/item/implant/biosig_ert/activate(cause)

0 commit comments

Comments
 (0)