diff --git a/code/__DEFINES/mob.dm b/code/__DEFINES/mob.dm
index 88f1bc3eeda..0080658562b 100644
--- a/code/__DEFINES/mob.dm
+++ b/code/__DEFINES/mob.dm
@@ -78,3 +78,16 @@
// Reagent type flags, defines the types of mobs this reagent will affect
#define ORGANIC 1
#define SYNTHETIC 2
+
+// Appearance change flags
+#define APPEARANCE_UPDATE_DNA 1
+#define APPEARANCE_RACE 2|APPEARANCE_UPDATE_DNA
+#define APPEARANCE_GENDER 4|APPEARANCE_UPDATE_DNA
+#define APPEARANCE_SKIN 8
+#define APPEARANCE_HAIR 16
+#define APPEARANCE_HAIR_COLOR 32
+#define APPEARANCE_FACIAL_HAIR 64
+#define APPEARANCE_FACIAL_HAIR_COLOR 128
+#define APPEARANCE_EYE_COLOR 256
+#define APPEARANCE_ALL_HAIR APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR
+#define APPEARANCE_ALL 511
diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm
index 1c1639d676d..210e5ed891e 100644
--- a/code/__HELPERS/global_lists.dm
+++ b/code/__HELPERS/global_lists.dm
@@ -7,7 +7,7 @@
var/list/paths
//Hair - Initialise all /datum/sprite_accessory/hair into an list indexed by hair-style name
- paths = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
+ paths = subtypesof(/datum/sprite_accessory/hair)
for(var/path in paths)
var/datum/sprite_accessory/hair/H = new path()
hair_styles_list[H.name] = H
@@ -19,7 +19,7 @@
hair_styles_female_list += H.name
//Facial Hair - Initialise all /datum/sprite_accessory/facial_hair into an list indexed by facialhair-style name
- paths = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair
+ paths = subtypesof(/datum/sprite_accessory/facial_hair)
for(var/path in paths)
var/datum/sprite_accessory/facial_hair/H = new path()
facial_hair_styles_list[H.name] = H
@@ -31,30 +31,30 @@
facial_hair_styles_female_list += H.name
//Surgery Steps - Initialize all /datum/surgery_step into a list
- paths = typesof(/datum/surgery_step)-/datum/surgery_step
+ paths = subtypesof(/datum/surgery_step)
for(var/T in paths)
var/datum/surgery_step/S = new T
surgery_steps += S
sort_surgeries()
//List of job. I can't believe this was calculated multiple times per tick!
- paths = typesof(/datum/job) -list(/datum/job,/datum/job/ai,/datum/job/cyborg)
+ paths = subtypesof(/datum/job) -list(/datum/job/ai,/datum/job/cyborg)
for(var/T in paths)
var/datum/job/J = new T
joblist[J.title] = J
- paths = typesof(/datum/nations)-/datum/nations
+ paths = subtypesof(/datum/nations)
for(var/T in paths)
var/datum/nations/N = new T
all_nations[N.name] = N
- paths = typesof(/datum/superheroes)-/datum/superheroes
+ paths = subtypesof(/datum/superheroes)
for(var/T in paths)
var/datum/superheroes/S = new T
all_superheroes[S.name] = S
//Languages and species.
- paths = typesof(/datum/language)-/datum/language
+ paths = subtypesof(/datum/language)
for(var/T in paths)
var/datum/language/L = new T
all_languages[L.name] = L
@@ -67,7 +67,7 @@
language_keys["#[lowertext(L.key)]"] = L
var/rkey = 0
- paths = typesof(/datum/species)-/datum/species
+ paths = subtypesof(/datum/species)
for(var/T in paths)
rkey++
var/datum/species/S = new T
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 15a1bdcfb0f..e3d4d177dc5 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -407,7 +407,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
search_pda = 0
//Fixes renames not being reflected in objective text
- var/list/O = (typesof(/datum/objective) - /datum/objective)
+ var/list/O = subtypesof(/datum/objective)
var/length
var/pos
for(var/datum/objective/objective in O)
@@ -1708,4 +1708,40 @@ var/mob/dview/dview_mob = new
see_in_dark = 1e6
-/mob/dview/New() //For whatever reason, if this isn't called, then BYOND will throw a type mismatch runtime when attempting to add this to the mobs list. -Fox
\ No newline at end of file
+/mob/dview/New() //For whatever reason, if this isn't called, then BYOND will throw a type mismatch runtime when attempting to add this to the mobs list. -Fox
+
+
+//ORBITS
+/atom/movable/var/atom/orbiting = null
+//This is just so you can stop an orbit.
+//orbit() can run without it (swap orbiting for A)
+//but then you can never stop it and that's just silly.
+
+/atom/movable/proc/orbit(atom/A, radius = 10, clockwise = 1, angle_increment = 15)
+ if(!istype(A))
+ return
+ orbiting = A
+ var/angle = 0
+ var/matrix/initial_transform = matrix(transform)
+ spawn
+ while(orbiting)
+ loc = orbiting.loc
+
+ angle += angle_increment
+
+ var/matrix/shift = matrix(initial_transform)
+ shift.Translate(radius,0)
+ if(clockwise)
+ shift.Turn(angle)
+ else
+ shift.Turn(-angle)
+ animate(src,transform = shift,2)
+
+ sleep(0.6) //the effect breaks above 0.6 delay
+ animate(src,transform = initial_transform,2)
+
+
+/atom/movable/proc/stop_orbit()
+ if(orbiting)
+ loc = get_turf(orbiting)
+ orbiting = null
\ No newline at end of file
diff --git a/code/controllers/ProcessScheduler/core/processScheduler.dm b/code/controllers/ProcessScheduler/core/processScheduler.dm
index 1be24045938..8bb365b2a7f 100644
--- a/code/controllers/ProcessScheduler/core/processScheduler.dm
+++ b/code/controllers/ProcessScheduler/core/processScheduler.dm
@@ -57,7 +57,7 @@ var/global/datum/controller/processScheduler/processScheduler
var/process
// Add all the processes we can find, except for the ticker
- for (process in typesof(/datum/controller/process) - /datum/controller/process)
+ for (process in subtypesof(/datum/controller/process))
if (!(process in deferredSetupList))
addProcess(new process(src))
diff --git a/code/controllers/Processes/air.dm b/code/controllers/Processes/air.dm
index 23dc4f2be48..9dd9046fbc3 100644
--- a/code/controllers/Processes/air.dm
+++ b/code/controllers/Processes/air.dm
@@ -32,30 +32,32 @@ var/global/datum/controller/process/air_system/air_master
current_cycle++
process_active_turfs()
process_excited_groups()
- scheck()
process_high_pressure_delta()
process_hotspots()
process_super_conductivity()
- scheck()
return 1
/datum/controller/process/air_system/proc/process_hotspots()
for(var/obj/effect/hotspot/H in hotspots)
H.process()
+ scheck()
/datum/controller/process/air_system/proc/process_super_conductivity()
for(var/turf/simulated/T in active_super_conductivity)
T.super_conduct()
+ scheck()
/datum/controller/process/air_system/proc/process_high_pressure_delta()
for(var/turf/T in high_pressure_delta)
T.high_pressure_movements()
T.pressure_difference = 0
+ scheck()
high_pressure_delta.len = 0
/datum/controller/process/air_system/proc/process_active_turfs()
for(var/turf/simulated/T in active_turfs)
T.process_cell()
+ scheck()
/datum/controller/process/air_system/proc/remove_from_active(var/turf/simulated/T)
if(istype(T))
@@ -103,9 +105,11 @@ var/global/datum/controller/process/air_system/air_master
EG.breakdown_cooldown ++
if(EG.breakdown_cooldown == 10)
EG.self_breakdown()
+ scheck()
return
if(EG.breakdown_cooldown > 20)
EG.dismantle()
+ scheck()
/datum/controller/process/air_system/proc/setup_overlays()
plmaster = new /obj/effect/overlay()
diff --git a/code/controllers/Processes/event.dm b/code/controllers/Processes/event.dm
index 64cd6031c8e..f6592875c67 100644
--- a/code/controllers/Processes/event.dm
+++ b/code/controllers/Processes/event.dm
@@ -35,7 +35,7 @@ var/global/datum/controller/holiday/holiday_master //This has to be defined befo
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
- for(var/H in typesof(/datum/holiday) - /datum/holiday)
+ for(var/H in subtypesof(/datum/holiday))
var/datum/holiday/holiday = new H()
if(holiday.shouldCelebrate(DD, MM, YY))
holiday.celebrate()
diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm
index f589c641f5b..9686bcd42b3 100644
--- a/code/controllers/Processes/garbage.dm
+++ b/code/controllers/Processes/garbage.dm
@@ -6,5 +6,4 @@
garbageCollector = new
/datum/controller/process/garbage/doWork()
- garbageCollector.process()
- scheck()
\ No newline at end of file
+ garbageCollector.process()
\ No newline at end of file
diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm
index f2fbfd5d730..d84e866b224 100644
--- a/code/controllers/configuration.dm
+++ b/code/controllers/configuration.dm
@@ -161,7 +161,7 @@
var/list/overflow_whitelist = list() //whitelist for overflow
/datum/configuration/New()
- var/list/L = typesof(/datum/game_mode) - /datum/game_mode
+ var/list/L = subtypesof(/datum/game_mode)
for (var/T in L)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
@@ -688,7 +688,7 @@
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
- for (var/T in (typesof(/datum/game_mode) - /datum/game_mode))
+ for (var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
if (M.config_tag && M.config_tag == mode_name)
return M
@@ -697,7 +697,7 @@
/datum/configuration/proc/get_runnable_modes()
var/list/datum/game_mode/runnable_modes = new
- for (var/T in (typesof(/datum/game_mode) - /datum/game_mode))
+ for (var/T in subtypesof(/datum/game_mode))
var/datum/game_mode/M = new T()
//world << "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]"
if (!(M.config_tag in modes))
diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm
index e946c3c254e..43d8bffd0e0 100644
--- a/code/datums/ai_laws.dm
+++ b/code/datums/ai_laws.dm
@@ -125,7 +125,7 @@ datum/ai_laws/tyrant //This probably shouldn't be a default lawset.
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
if(2)
- var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
+ var/datum/ai_laws/lawtype = pick(subtypesof(/datum/ai_laws/default))
var/datum/ai_laws/templaws = new lawtype()
inherent = templaws.inherent
set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*´&110010")
diff --git a/code/datums/periodic_news.dm b/code/datums/periodic_news.dm
index cf4f218ee5c..cdf2d5b9ad8 100644
--- a/code/datums/periodic_news.dm
+++ b/code/datums/periodic_news.dm
@@ -122,7 +122,7 @@ proc/process_newscaster()
var/global/tmp/announced_news_types = list()
proc/check_for_newscaster_updates(type)
- for(var/subtype in typesof(type)-type)
+ for(var/subtype in subtypesof(type))
var/datum/news_announcement/news = new subtype()
if(news.round_time * 10 <= world.time && !(subtype in announced_news_types))
announced_news_types += subtype
diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm
index 5fc65bc9fc9..06db33eb9e5 100644
--- a/code/game/dna/genes/vg_powers.dm
+++ b/code/game/dna/genes/vg_powers.dm
@@ -154,7 +154,7 @@ Obviously, requires DNA2.
M.s_tone = -M.s_tone + 35
// hair
- var/list/all_hairs = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
+ var/list/all_hairs = subtypesof(/datum/sprite_accessory/hair)
var/list/hairs = list()
// loop through potential hairs
@@ -170,7 +170,7 @@ Obviously, requires DNA2.
M.h_style = new_style
// facial hair
- var/list/all_fhairs = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair
+ var/list/all_fhairs = subtypesof(/datum/sprite_accessory/facial_hair)
var/list/fhairs = list()
for(var/x in all_fhairs)
diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm
index 34f78bfdcd0..6726e0f1e68 100644
--- a/code/game/gamemodes/blob/overmind.dm
+++ b/code/game/gamemodes/blob/overmind.dm
@@ -25,7 +25,7 @@
real_name = new_name
last_attack = world.time
var/list/possible_reagents = list()
- for(var/type in (typesof(/datum/reagent/blob) - /datum/reagent/blob))
+ for(var/type in subtypesof(/datum/reagent/blob))
possible_reagents.Add(new type)
blob_reagent_datum = pick(possible_reagents)
if(blob_core)
diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm
index 446e324b486..52245bde71d 100644
--- a/code/game/gamemodes/blob/powers.dm
+++ b/code/game/gamemodes/blob/powers.dm
@@ -394,8 +394,7 @@
if(!can_buy(50))
return
- var/list/excluded = list(/datum/reagent/blob, blob_reagent_datum.type) //guaranteed new chemical
- var/datum/reagent/blob/B = pick((typesof(/datum/reagent/blob) - excluded))
+ var/datum/reagent/blob/B = pick((subtypesof(/datum/reagent/blob) - blob_reagent_datum.type))
blob_reagent_datum = new B
for(var/obj/effect/blob/BL in blobs)
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 3d816ee1715..05ce9b91f2f 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -160,8 +160,8 @@ var/global/datum/controller/gameticker/ticker
world << "
[holiday.greet()]
"
spawn(0) // Forking dynamic room selection
- var/list/area/dynamic/source/available_source_candidates = typesof(/area/dynamic/source) - /area/dynamic/source
- var/list/area/dynamic/destination/available_destination_candidates = typesof(/area/dynamic/destination) - /area/dynamic/destination
+ var/list/area/dynamic/source/available_source_candidates = subtypesof(/area/dynamic/source)
+ var/list/area/dynamic/destination/available_destination_candidates = subtypesof(/area/dynamic/destination)
for (var/area/dynamic/destination/current_destination_candidate in available_destination_candidates)
var/area/dynamic/destination/current_destination = locate(current_destination_candidate)
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 7266762eeb1..f32407a62af 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -393,7 +393,7 @@ rcd light flash thingy on matter drain
var/list/possible_modules = list()
/datum/module_picker/New()
- for(var/type in typesof(/datum/AI_Module))
+ for(var/type in subtypesof(/datum/AI_Module))
var/datum/AI_Module/AM = new type
if(AM.power_type != null)
src.possible_modules += AM
diff --git a/code/game/gamemodes/mutiny/mutiny.dm b/code/game/gamemodes/mutiny/mutiny.dm
index 6e63263c75b..150ff09f5fe 100644
--- a/code/game/gamemodes/mutiny/mutiny.dm
+++ b/code/game/gamemodes/mutiny/mutiny.dm
@@ -89,7 +89,7 @@ datum/game_mode/mutiny
proc/get_directive_candidates()
var/list/candidates[0]
- for(var/T in (typesof(/datum/directive) - /datum/directive))
+ for(var/T in subtypesof(/datum/directive))
var/datum/directive/D = new T(src)
// world << D.name
if (D.meets_prerequisites())
diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm
index caaf37f084c..9f183206633 100644
--- a/code/game/gamemodes/newobjective.dm
+++ b/code/game/gamemodes/newobjective.dm
@@ -12,11 +12,10 @@
/proc/GenerateTheft(var/job,var/datum/mind/traitor)
var/list/datum/objective/objectives = list()
- for(var/o in typesof(/datum/objective/steal))
- if(o != /datum/objective/steal) //Make sure not to get a blank steal objective.
- var/datum/objective/target = new o(null,job)
- objectives += target
- objectives[target] = target.weight
+ for(var/o in subtypesof(/datum/objective/steal))
+ var/datum/objective/target = new o(null,job)
+ objectives += target
+ objectives[target] = target.weight
return objectives
/proc/GenerateAssassinate(var/job,var/datum/mind/traitor)
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index a052fcda9c9..1420fc9c5ae 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -1,8 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
var/global/list/all_objectives = list()
-var/list/potential_theft_objectives=typesof(/datum/theft_objective) \
- - /datum/theft_objective \
+var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
- /datum/theft_objective/special \
- /datum/theft_objective/number \
- /datum/theft_objective/number/special \
@@ -722,7 +721,7 @@ datum/objective/destroy
survivecult
var/num_cult
var/cult_needed = 4 + round((num_players_started() / 10))
-
+
explanation_text = "Our knowledge must live on. Make sure at least [cult_needed] acolytes escape on the shuttle to spread their work on an another station."
check_completion()
@@ -747,11 +746,11 @@ datum/objective/destroy
proc/find_target() //I don't know how to make it work with the rune otherwise, so I'll do it via a global var, sacrifice_target, defined in rune15.dm
var/datum/game_mode/cult/C = ticker.mode
var/list/possible_targets = C.get_unconvertables()
-
+
if(!possible_targets.len)
for(var/mob/living/carbon/human/player in player_list)
if(player.mind && !(player.mind in cult))
- possible_targets += player.mind
+ possible_targets += player.mind
if(possible_targets.len > 0)
sacrifice_target = pick(possible_targets)
diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm
index 439befdc63a..ad25189e0db 100644
--- a/code/game/gamemodes/sandbox/h_sandbox.dm
+++ b/code/game/gamemodes/sandbox/h_sandbox.dm
@@ -107,7 +107,7 @@ datum/hSB
hsb.loc = usr.loc
usr << "Sandbox: Created an airlock."
if("hsbcanister")
- var/list/hsbcanisters = typesof(/obj/machinery/portable_atmospherics/canister/) - /obj/machinery/portable_atmospherics/canister/
+ var/list/hsbcanisters = subtypesof(/obj/machinery/portable_atmospherics/canister/)
var/hsbcanister = input(usr, "Choose a canister to spawn.", "Sandbox:") in hsbcanisters + "Cancel"
if(!(hsbcanister == "Cancel"))
new hsbcanister(usr.loc)
diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm
index 7d2e889c10e..969a8998cdb 100644
--- a/code/game/gamemodes/wizard/spellbook.dm
+++ b/code/game/gamemodes/wizard/spellbook.dm
@@ -366,7 +366,7 @@
/obj/item/weapon/spellbook/New()
..()
- var/entry_types = typesof(/datum/spellbook_entry) - /datum/spellbook_entry - /datum/spellbook_entry/item - /datum/spellbook_entry/summon
+ var/entry_types = subtypesof(/datum/spellbook_entry) - /datum/spellbook_entry/item - /datum/spellbook_entry/summon
for(var/T in entry_types)
var/datum/spellbook_entry/E = new T
if(E.IsAvailible())
diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm
index ed7e976e846..22edeb3702c 100644
--- a/code/game/jobs/access.dm
+++ b/code/game/jobs/access.dm
@@ -485,8 +485,8 @@
/proc/get_all_jobs()
var/list/all_jobs = list()
- var/list/all_datums = typesof(/datum/job)
- all_datums.Remove(list(/datum/job,/datum/job/ai,/datum/job/cyborg))
+ var/list/all_datums = subtypesof(/datum/job)
+ all_datums.Remove(list(/datum/job/ai,/datum/job/cyborg))
var/datum/job/jobdatum
for(var/jobtype in all_datums)
jobdatum = new jobtype
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index 0d43e6628e2..e80d9dfe889 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -16,7 +16,7 @@ var/global/datum/controller/occupations/job_master
proc/SetupOccupations(var/list/faction = list("Station"))
if(no_synthetic)
occupations = list()
- var/list/all_jobs = typesof(/datum/job) -list(/datum/job,/datum/job/ai,/datum/job/cyborg)
+ var/list/all_jobs = subtypesof(/datum/job) -list(/datum/job/ai,/datum/job/cyborg)
if(!all_jobs.len)
world << "\red \b Error setting up jobs, no job datums found"
return 0
@@ -27,7 +27,7 @@ var/global/datum/controller/occupations/job_master
occupations += job
else
occupations = list()
- var/list/all_jobs = typesof(/datum/job) -/datum/job
+ var/list/all_jobs = subtypesof(/datum/job)
if(!all_jobs.len)
world << "\red \b Error setting up jobs, no job datums found"
return 0
@@ -231,8 +231,8 @@ var/global/datum/controller/occupations/job_master
AssignRole(mAI.current, "AI")
ai_selected++
if(ai_selected) return 1
- return 0
-
+ return 0
+
for(var/i = job.total_positions, i > 0, i--)
for(var/level = 1 to 3)
var/list/candidates = list()
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index 55e5d8bc4db..8837f4f971c 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -57,7 +57,7 @@
/obj/machinery/computer/arcade/New()
..()
- var/choice = pick(typesof(/obj/machinery/computer/arcade) - /obj/machinery/computer/arcade)
+ var/choice = pick(subtypesof(/obj/machinery/computer/arcade))
new choice(loc)
qdel(src)
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index fef0ef7d66b..81ea94c6e12 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -11,7 +11,8 @@ obj/machinery/door/airlock
obj/machinery/door/airlock/process()
..()
if (arePowerSystemsOn())
- execute_current_command()
+ spawn()
+ execute_current_command()
obj/machinery/door/airlock/receive_signal(datum/signal/signal)
if (!arePowerSystemsOn()) return //no power
@@ -30,7 +31,7 @@ obj/machinery/door/airlock/proc/execute_current_command()
if (!cur_command)
return
-
+
do_command(cur_command)
if (command_completed(cur_command))
cur_command = null
@@ -63,7 +64,7 @@ obj/machinery/door/airlock/proc/do_command(var/command)
lock()
sleep(2)
-
+
send_status()
obj/machinery/door/airlock/proc/command_completed(var/command)
@@ -85,7 +86,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command)
if("secure_close")
return (locked && density)
-
+
return 1 //Unknown command. Just assume it's completed.
obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
@@ -97,7 +98,7 @@ obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
signal.data["door_status"] = density?("closed"):("open")
signal.data["lock_status"] = locked?("locked"):("unlocked")
-
+
if (bumped)
signal.data["bumped_with_access"] = 1
diff --git a/code/game/machinery/kitchen/kitchen_machine.dm b/code/game/machinery/kitchen/kitchen_machine.dm
index ad6ecb3f27b..34092be1636 100644
--- a/code/game/machinery/kitchen/kitchen_machine.dm
+++ b/code/game/machinery/kitchen/kitchen_machine.dm
@@ -38,7 +38,7 @@
available_recipes = new
acceptable_items = new
acceptable_reagents = new
- for (var/type in (typesof(recipe_type)-recipe_type))
+ for (var/type in subtypesof(recipe_type))
var/datum/recipe/recipe = new type
if(recipe.result) // Ignore recipe subtypes that lack a result
available_recipes += recipe
diff --git a/code/game/machinery/kitchen/processor.dm b/code/game/machinery/kitchen/processor.dm
index 835855df1e0..a331175c8c7 100644
--- a/code/game/machinery/kitchen/processor.dm
+++ b/code/game/machinery/kitchen/processor.dm
@@ -109,7 +109,7 @@
//END RECIPE DATUMS
/obj/machinery/processor/proc/select_recipe(var/X)
- for (var/Type in typesof(/datum/food_processor_process) - /datum/food_processor_process - /datum/food_processor_process/mob)
+ for (var/Type in subtypesof(/datum/food_processor_process) - /datum/food_processor_process/mob)
var/datum/food_processor_process/P = new Type()
if(istype(X, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = X
diff --git a/code/game/objects/items/random_items.dm b/code/game/objects/items/random_items.dm
index 5ad2f715f65..494353ee47a 100644
--- a/code/game/objects/items/random_items.dm
+++ b/code/game/objects/items/random_items.dm
@@ -5,7 +5,7 @@
name = "Random Toy"
New()
..()
- var/list/types = list(/obj/item/toy/crossbow,/obj/item/toy/balloon,/obj/item/toy/spinningtoy,/obj/item/weapon/reagent_containers/spray/waterflower) + typesof(/obj/item/toy/prize) - /obj/item/toy/prize
+ var/list/types = list(/obj/item/toy/crossbow,/obj/item/toy/balloon,/obj/item/toy/spinningtoy,/obj/item/weapon/reagent_containers/spray/waterflower) + subtypesof(/obj/item/toy/prize)
var/T = pick(types)
new T(loc)
spawn(1)
@@ -19,7 +19,7 @@
name = "Random Mess"
New()
..()
- var/list/list = typesof(/obj/effect/decal/cleanable) - list(/obj/effect/decal/cleanable,/obj/effect/decal/cleanable/random,/obj/effect/decal/cleanable/cobweb,/obj/effect/decal/cleanable/cobweb2)
+ var/list/list = subtypesof(/obj/effect/decal/cleanable) - list(/obj/effect/decal/cleanable/random,/obj/effect/decal/cleanable/cobweb,/obj/effect/decal/cleanable/cobweb2)
var/T = pick(list)
new T(loc)
spawn(0)
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 4f4d23b739d..49149671f56 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -91,34 +91,34 @@ var/last_chew = 0
/obj/item/weapon/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
- icon_state = "cuff_red"
+ icon_state = "cuff_white"
item_state = "coil_red"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/weapon/restraints/handcuffs/cable/red
- icon_state = "cuff_red"
+ color = COLOR_RED
/obj/item/weapon/restraints/handcuffs/cable/yellow
- icon_state = "cuff_yellow"
+ color = COLOR_YELLOW
/obj/item/weapon/restraints/handcuffs/cable/blue
- icon_state = "cuff_blue"
+ color = COLOR_BLUE
/obj/item/weapon/restraints/handcuffs/cable/green
- icon_state = "cuff_green"
+ color = COLOR_GREEN
/obj/item/weapon/restraints/handcuffs/cable/pink
- icon_state = "cuff_pink"
+ color = COLOR_PINK
/obj/item/weapon/restraints/handcuffs/cable/orange
- icon_state = "cuff_orange"
+ color = COLOR_ORANGE
/obj/item/weapon/restraints/handcuffs/cable/cyan
- icon_state = "cuff_cyan"
+ color = COLOR_CYAN
/obj/item/weapon/restraints/handcuffs/cable/white
- icon_state = "cuff_white"
+ color = COLOR_WHITE
/obj/item/weapon/restraints/handcuffs/pinkcuffs
name = "fluffy pink handcuffs"
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index 7146f547cbc..8957329c4a1 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -20,7 +20,7 @@
//filling the barsigns list
- for(var/bartype in typesof(/datum/barsign) - /datum/barsign)
+ for(var/bartype in subtypesof(/datum/barsign))
var/datum/barsign/signinfo = new bartype
if(!signinfo.hidden)
barsigns += signinfo
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index e32c879b304..955ce2756e1 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -7,52 +7,18 @@
density = 0
anchored = 1
var/shattered = 0
-
+ var/list/ui_users = list()
/obj/structure/mirror/attack_hand(mob/user as mob)
if(shattered) return
if(ishuman(user))
- var/mob/living/carbon/human/H = user
-
- var/userloc = H.loc
-
- //see code/modules/mob/new_player/preferences.dm at approx line 545 for comments!
- //this is largely copypasted from there.
-
- //handle facial hair (if necessary)
- if(H.gender == MALE)
- var/list/species_facial_hair = list()
- if(H.species)
- for(var/i in facial_hair_styles_list)
- var/datum/sprite_accessory/facial_hair/tmp_facial = facial_hair_styles_list[i]
- if(H.species.name in tmp_facial.species_allowed)
- species_facial_hair += i
- else
- species_facial_hair = facial_hair_styles_list
-
- var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in species_facial_hair
- if(userloc != H.loc) return //no tele-grooming
- if(new_style)
- H.f_style = new_style
-
- //handle normal hair
- var/list/species_hair = list()
- if(H.species)
- for(var/i in hair_styles_list)
- var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i]
- if(H.species.name in tmp_hair.species_allowed)
- species_hair += i
- else
- species_hair = hair_styles_list
-
- var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in species_hair
- if(userloc != H.loc) return //no tele-grooming
- if(new_style)
- H.h_style = new_style
-
- H.update_hair()
-
+ var/datum/nano_module/appearance_changer/AC = ui_users[user]
+ if(!AC)
+ AC = new(src, user)
+ AC.name = "SalonPro Nano-Mirror(TM)"
+ ui_users[user] = AC
+ AC.ui_interact(user)
/obj/structure/mirror/proc/shatter()
if(shattered) return
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index 80c114ec286..1abfa6cfb31 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -160,7 +160,7 @@ var/list/mechtoys = list(
//Supply shuttle ticker - handles supply point regeneration and shuttle travelling between centcomm and the station
proc/process()
- for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs))
+ for(var/typepath in subtypesof(/datum/supply_packs))
var/datum/supply_packs/P = new typepath()
if(P.name == "HEADER")
qdel(P)
diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm
index 077af478135..c173a85e305 100644
--- a/code/game/vehicles/spacepods/spacepod.dm
+++ b/code/game/vehicles/spacepods/spacepod.dm
@@ -638,7 +638,7 @@
/obj/machinery/door/poddoor/four_tile_hor, /obj/machinery/door/poddoor/four_tile_ver)
if(CheckIfOccupant2(usr)) return
- for(var/obj/machinery/door/poddoor/P in oview(3,src))
+ for(var/obj/machinery/door/poddoor/P in orange(3,src))
if(is_type_in_list(P,pod_door_types))
var/mob/living/carbon/human/L = usr
if(P.check_access(L.get_active_hand()) || P.check_access(L.wear_id))
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index cca7dcb27cc..d6f0608a216 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -66,7 +66,9 @@ var/list/admin_verbs_admin = list(
/client/proc/freeze,
/client/proc/freezemecha,
/client/proc/alt_check,
- /client/proc/secrets
+ /client/proc/secrets,
+ /client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
+ /client/proc/change_human_appearance_self /* Allows the human-based mob itself change its basic appearance */
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
@@ -543,6 +545,41 @@ var/list/admin_verbs_mentor = list(
if(holder)
src.holder.output_ai_laws()
+/client/proc/change_human_appearance_admin(mob/living/carbon/human/H in world)
+ set name = "Change Mob Appearance - Admin"
+ set desc = "Allows you to change the mob appearance"
+ set category = "Admin"
+
+ if(!istype(H))
+ return
+
+ if(holder)
+ admin_log_and_message_admins("is altering the appearance of [H].")
+ H.change_appearance(APPEARANCE_ALL, usr, usr, check_species_whitelist = 0)
+ feedback_add_details("admin_verb","CHAA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
+/client/proc/change_human_appearance_self(mob/living/carbon/human/H in world)
+ set name = "Change Mob Appearance - Self"
+ set desc = "Allows the mob to change its appearance"
+ set category = "Admin"
+
+ if(!istype(H))
+ return
+
+ if(!H.client)
+ usr << "Only mobs with clients can alter their own appearance."
+ return
+
+ if(holder)
+ switch(alert("Do you wish for [H] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel"))
+ if("Yes")
+ admin_log_and_message_admins("has allowed [H] to change \his appearance, without whitelisting of races.")
+ H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 0)
+ if("No")
+ admin_log_and_message_admins("has allowed [H] to change \his appearance, with whitelisting of races.")
+ H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 1)
+ feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
//---- bs12 verbs ----
diff --git a/code/modules/admin/buildmode.dm b/code/modules/admin/buildmode.dm
index eaf5fdb8818..cb2b79b9171 100644
--- a/code/modules/admin/buildmode.dm
+++ b/code/modules/admin/buildmode.dm
@@ -179,7 +179,7 @@
if("turf-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
if(AREA_BUILDMODE)
- var/list/gen_paths = typesof(/datum/mapGenerator) - /datum/mapGenerator
+ var/list/gen_paths = subtypesof(/datum/mapGenerator)
var/type = input(usr,"Select Generator Type","Type") as null|anything in gen_paths
if(!type) return
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 6c82fc63185..e9351eff538 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -395,8 +395,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
set name = "Del-All"
// to prevent REALLY stupid deletions
- var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/dead, /mob/dead/observer, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
- var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in typesof(/obj) + typesof(/mob) - blocked
+ var/blocked = list(/mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/dead, /mob/dead/observer, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
+ var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in subtypesof(/obj) + subtypesof(/mob) - blocked
if(hsbitem)
for(var/atom/O in world)
if(istype(O, hsbitem))
diff --git a/code/modules/atmos_automation/statements.dm b/code/modules/atmos_automation/statements.dm
index 5062de3f087..6cac14dc375 100644
--- a/code/modules/atmos_automation/statements.dm
+++ b/code/modules/atmos_automation/statements.dm
@@ -1,4 +1,4 @@
-var/global/automation_types=typesof(/datum/automation) - /datum/automation
+var/global/automation_types = subtypesof(/datum/automation)
#define AUTOM_RT_NULL 0
#define AUTOM_RT_NUM 1
diff --git a/code/modules/client/preferences_spawnpoints.dm b/code/modules/client/preferences_spawnpoints.dm
index ac0d5447e64..60d77b38873 100644
--- a/code/modules/client/preferences_spawnpoints.dm
+++ b/code/modules/client/preferences_spawnpoints.dm
@@ -2,7 +2,7 @@ var/list/spawntypes = list()
/proc/populate_spawn_points()
spawntypes = list()
- for(var/type in typesof(/datum/spawnpoint)-/datum/spawnpoint)
+ for(var/type in subtypesof(/datum/spawnpoint))
var/datum/spawnpoint/S = new type()
spawntypes[S.display_name] = S
diff --git a/code/modules/clothing/under/chameleon.dm b/code/modules/clothing/under/chameleon.dm
index 3e51b7b267e..0e67c973e54 100644
--- a/code/modules/clothing/under/chameleon.dm
+++ b/code/modules/clothing/under/chameleon.dm
@@ -11,11 +11,11 @@
New()
..()
- for(var/U in typesof(/obj/item/clothing/under/color)-(/obj/item/clothing/under/color))
+ for(var/U in subtypesof(/obj/item/clothing/under/color))
var/obj/item/clothing/under/V = new U
src.clothing_choices += V
- for(var/U in typesof(/obj/item/clothing/under/rank)-(/obj/item/clothing/under/rank))
+ for(var/U in subtypesof(/obj/item/clothing/under/rank))
var/obj/item/clothing/under/V = new U
src.clothing_choices += V
return
diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm
index f3da90cfe17..28045dfc1ab 100644
--- a/code/modules/clothing/under/color.dm
+++ b/code/modules/clothing/under/color.dm
@@ -3,8 +3,8 @@
/obj/item/clothing/under/color/random/New()
..()
- var/list/excluded = list(/obj/item/clothing/under/color/random, /obj/item/clothing/under/color, /obj/item/clothing/under/color/blackf, /obj/item/clothing/under/color/blue/dodgeball, /obj/item/clothing/under/color/orange/prison, /obj/item/clothing/under/color/red/dodgeball, /obj/item/clothing/under/color/red/jersey, /obj/item/clothing/under/color/blue/jersey)
- var/obj/item/clothing/under/color/C = pick(typesof(/obj/item/clothing/under/color) - excluded)
+ var/list/excluded = list(/obj/item/clothing/under/color/random, /obj/item/clothing/under/color/blackf, /obj/item/clothing/under/color/blue/dodgeball, /obj/item/clothing/under/color/orange/prison, /obj/item/clothing/under/color/red/dodgeball, /obj/item/clothing/under/color/red/jersey, /obj/item/clothing/under/color/blue/jersey)
+ var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color) - excluded)
name = initial(C.name)
icon_state = initial(C.icon_state)
item_state = initial(C.item_state)
diff --git a/code/modules/computer3/test_machines.dm b/code/modules/computer3/test_machines.dm
index 1be6f232d61..53a96d6c057 100644
--- a/code/modules/computer3/test_machines.dm
+++ b/code/modules/computer3/test_machines.dm
@@ -82,5 +82,5 @@
/obj/item/weapon/storage/box/testing_disks
New()
..()
- for(var/typekey in typesof(/obj/item/weapon/disk/file) - /obj/item/weapon/disk/file)
+ for(var/typekey in subtypesof(/obj/item/weapon/disk/file))
new typekey(src)
\ No newline at end of file
diff --git a/code/modules/economy/Economy.dm b/code/modules/economy/Economy.dm
index d2c463d647b..028c2810ae7 100644
--- a/code/modules/economy/Economy.dm
+++ b/code/modules/economy/Economy.dm
@@ -89,7 +89,7 @@ var/setup_economy = 0
newChannel.is_admin_channel = 1
news_network.network_channels += newChannel
- for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination)
+ for(var/loc_type in subtypesof(/datum/trade_destination))
var/datum/trade_destination/D = new loc_type
weighted_randomevent_locations[D] = D.viable_random_events.len
weighted_mundaneevent_locations[D] = D.viable_mundane_events.len
diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm
index ed0a1d98cb9..7982fc1debf 100644
--- a/code/modules/events/event_manager.dm
+++ b/code/modules/events/event_manager.dm
@@ -22,7 +22,7 @@
var/datum/event_meta/new_event = new
/datum/event_manager/New()
- allEvents = typesof(/datum/event) - /datum/event
+ allEvents = subtypesof(/datum/event)
/datum/event_manager/proc/process()
for(var/datum/event/E in event_manager.active_events)
diff --git a/code/modules/food/oven.dm b/code/modules/food/oven.dm
index fc081e8aa43..3ed9cb3888f 100644
--- a/code/modules/food/oven.dm
+++ b/code/modules/food/oven.dm
@@ -58,7 +58,7 @@
/obj/machinery/cooking/oven/updatefood()
for(var/U in food_choices)
food_choices.Remove(U)
- for(var/U in typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook))
+ for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook))
var/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/V = new U
src.food_choices += V
return
@@ -73,7 +73,7 @@
/obj/machinery/cooking/candy/updatefood()
for(var/U in food_choices)
food_choices.Remove(U)
- for(var/U in typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
+ for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
var/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/V = new U
src.food_choices += V
return
diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm
index c1f05caded2..a3153beaa59 100644
--- a/code/modules/genetics/side_effects.dm
+++ b/code/modules/genetics/side_effects.dm
@@ -77,7 +77,7 @@
proc/trigger_side_effect(mob/living/carbon/human/H)
spawn
if(!istype(H)) return
- var/tp = pick(typesof(/datum/genetics/side_effect) - /datum/genetics/side_effect)
+ var/tp = pick(subtypesof(/datum/genetics/side_effect))
var/datum/genetics/side_effect/S = new tp
S.start(H)
diff --git a/code/modules/genetics2/genetree.dm b/code/modules/genetics2/genetree.dm
index a7aa6ab756d..aa8d1ba7571 100644
--- a/code/modules/genetics2/genetree.dm
+++ b/code/modules/genetics2/genetree.dm
@@ -9,7 +9,7 @@
/datum/genetree/New(var/obj/machinery/networked/biomass_controller/holder)
biomass = holder
// Build list of all sectors
- for(var/typepath in typesof(/datum/genetic_sector) - /datum/genetic_sector)
+ for(var/typepath in subtypesof(/datum/genetic_sector))
var/datum/genetic_sector/sector = new typepath
sectors[sector.id]=sector
diff --git a/code/modules/holiday/holiday.dm b/code/modules/holiday/holiday.dm
index 727c899d2eb..43d7cf2a464 100644
--- a/code/modules/holiday/holiday.dm
+++ b/code/modules/holiday/holiday.dm
@@ -328,7 +328,7 @@
if(!check_rights(R_SERVER)) return
var/list/choice = list()
- for(var/H in typesof(/datum/holiday) - /datum/holiday)
+ for(var/H in subtypesof(/datum/holiday))
choice += "[H]"
choice += "--CANCEL--"
diff --git a/code/modules/hydroponics/seed_controller.dm b/code/modules/hydroponics/seed_controller.dm
index 6a2da055319..c8bbcc632bb 100644
--- a/code/modules/hydroponics/seed_controller.dm
+++ b/code/modules/hydroponics/seed_controller.dm
@@ -71,7 +71,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
plant_product_sprites |= copytext(icostate,1,split)
// Populate the global seed datum list.
- for(var/type in typesof(/datum/seed)-/datum/seed)
+ for(var/type in subtypesof(/datum/seed))
var/datum/seed/S = new type
seeds[S.name] = S
S.uid = "[seeds.len]"
diff --git a/code/modules/jungle/jungle_animals.dm b/code/modules/jungle/jungle_animals.dm
index 44391896c87..018b5a8e8f7 100644
--- a/code/modules/jungle/jungle_animals.dm
+++ b/code/modules/jungle/jungle_animals.dm
@@ -8,7 +8,7 @@
/obj/effect/landmark/animal_spawner/New()
if(!spawn_type)
- var/new_type = pick(typesof(/obj/effect/landmark/animal_spawner) - /obj/effect/landmark/animal_spawner)
+ var/new_type = pick(subtypesof(/obj/effect/landmark/animal_spawner))
new new_type(get_turf(src))
qdel(src)
diff --git a/code/modules/jungle/jungle_temple.dm b/code/modules/jungle/jungle_temple.dm
index 88be7ed4398..320b0fbe9f7 100644
--- a/code/modules/jungle/jungle_temple.dm
+++ b/code/modules/jungle/jungle_temple.dm
@@ -95,7 +95,7 @@
var/amount = rand(2,6)
var/quantity = rand(10,50)
var/list/possible_spawns = list()
- for(var/bar_type in typesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral - /obj/item/stack/sheet/mineral/enruranium)
+ for(var/bar_type in subtypesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral/enruranium)
possible_spawns += bar_type
var/bar_type = pick(possible_spawns)
diff --git a/code/modules/mining/materials.dm b/code/modules/mining/materials.dm
index 52c557ae61a..5c743bb4521 100644
--- a/code/modules/mining/materials.dm
+++ b/code/modules/mining/materials.dm
@@ -13,7 +13,7 @@
var/list/datum/material/storage[0]
/datum/materials/New()
- for(var/matdata in typesof(/datum/material) - /datum/material)
+ for(var/matdata in subtypesof(/datum/material))
var/datum/material/mat = new matdata
storage[mat.id]=mat
diff --git a/code/modules/mining/minerals.dm b/code/modules/mining/minerals.dm
index c8bfa32bace..0cd46917858 100644
--- a/code/modules/mining/minerals.dm
+++ b/code/modules/mining/minerals.dm
@@ -2,7 +2,7 @@ var/list/name_to_mineral
proc/SetupMinerals()
name_to_mineral = list()
- for(var/type in typesof(/mineral) - /mineral)
+ for(var/type in subtypesof(/mineral))
var/mineral/new_mineral = new type
if(!new_mineral.name)
continue
diff --git a/code/modules/mining/surprise.dm b/code/modules/mining/surprise.dm
index 244f6e5cf60..48ecbdd5356 100644
--- a/code/modules/mining/surprise.dm
+++ b/code/modules/mining/surprise.dm
@@ -3,7 +3,7 @@
#define TURF_FLOOR 0
#define TURF_WALL 1
-var/global/list/mining_surprises = typesof(/mining_surprise)-/mining_surprise
+var/global/list/mining_surprises = subtypesof(/mining_surprise)
/surprise_turf_info
var/list/types[0]
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
new file mode 100644
index 00000000000..ff2b98d430f
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -0,0 +1,185 @@
+/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = default_state)
+ var/datum/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist)
+ AC.flags = flags
+ AC.ui_interact(user, state = state)
+
+/mob/living/carbon/human/proc/change_species(var/new_species)
+ if(!new_species)
+ return
+
+ if(species == new_species)
+ return
+
+ if(!(new_species in all_species))
+ return
+
+ set_species(new_species)
+ reset_hair()
+ return 1
+
+/mob/living/carbon/human/proc/change_gender(var/gender)
+ if(src.gender == gender)
+ return
+
+ src.gender = gender
+ reset_hair()
+ update_body()
+ update_dna()
+ return 1
+
+/mob/living/carbon/human/proc/change_hair(var/hair_style)
+ if(!hair_style)
+ return
+
+ if(h_style == hair_style)
+ return
+
+ if(!(hair_style in hair_styles_list))
+ return
+
+ h_style = hair_style
+
+ update_hair()
+ return 1
+
+/mob/living/carbon/human/proc/change_facial_hair(var/facial_hair_style)
+ if(!facial_hair_style)
+ return
+
+ if(f_style == facial_hair_style)
+ return
+
+ if(!(facial_hair_style in facial_hair_styles_list))
+ return
+
+ f_style = facial_hair_style
+
+ update_hair()
+ return 1
+
+/mob/living/carbon/human/proc/reset_hair()
+ var/list/valid_hairstyles = generate_valid_hairstyles()
+ var/list/valid_facial_hairstyles = generate_valid_facial_hairstyles()
+
+ if(valid_hairstyles.len)
+ h_style = pick(valid_hairstyles)
+ else
+ //this shouldn't happen
+ h_style = "Bald"
+
+ if(valid_facial_hairstyles.len)
+ f_style = pick(valid_facial_hairstyles)
+ else
+ //this shouldn't happen
+ f_style = "Shaved"
+
+ update_hair()
+
+/mob/living/carbon/human/proc/change_eye_color(var/red, var/green, var/blue)
+ if(red == r_eyes && green == g_eyes && blue == b_eyes)
+ return
+
+ r_eyes = red
+ g_eyes = green
+ b_eyes = blue
+
+ update_eyes()
+ update_body()
+ return 1
+
+/mob/living/carbon/human/proc/change_hair_color(var/red, var/green, var/blue)
+ if(red == r_eyes && green == g_eyes && blue == b_eyes)
+ return
+
+ r_hair = red
+ g_hair = green
+ b_hair = blue
+
+ update_hair()
+ return 1
+
+/mob/living/carbon/human/proc/change_facial_hair_color(var/red, var/green, var/blue)
+ if(red == r_facial && green == g_facial && blue == b_facial)
+ return
+
+ r_facial = red
+ g_facial = green
+ b_facial = blue
+
+ update_hair()
+ return 1
+
+/mob/living/carbon/human/proc/change_skin_color(var/red, var/green, var/blue)
+ if(red == r_skin && green == g_skin && blue == b_skin || !(species.flags & HAS_SKIN_COLOR))
+ return
+
+ r_skin = red
+ g_skin = green
+ b_skin = blue
+
+ force_update_limbs()
+ update_body()
+ return 1
+
+/mob/living/carbon/human/proc/change_skin_tone(var/tone)
+ if(s_tone == tone || !(species.flags & HAS_SKIN_TONE))
+ return
+
+ s_tone = tone
+
+ force_update_limbs()
+ update_body()
+ return 1
+
+/mob/living/carbon/human/proc/update_dna()
+ check_dna()
+ dna.ready_dna(src)
+
+/mob/living/carbon/human/proc/generate_valid_species(var/check_whitelist = 1, var/list/whitelist = list(), var/list/blacklist = list())
+ var/list/valid_species = new()
+ for(var/current_species_name in all_species)
+ var/datum/species/current_species = all_species[current_species_name]
+
+ if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
+ if(whitelist.len && !(current_species_name in whitelist))
+ continue
+ if(blacklist.len && (current_species_name in blacklist))
+ continue
+ if((current_species.flags & IS_WHITELISTED) && !is_alien_whitelisted(src, current_species_name))
+ continue
+
+ valid_species += current_species_name
+
+ return valid_species
+
+/mob/living/carbon/human/proc/generate_valid_hairstyles()
+ var/list/valid_hairstyles = new()
+ for(var/hairstyle in hair_styles_list)
+ var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
+
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(!(species.name in S.species_allowed))
+ continue
+ valid_hairstyles += hairstyle
+
+ return valid_hairstyles
+
+/mob/living/carbon/human/proc/generate_valid_facial_hairstyles()
+ var/list/valid_facial_hairstyles = new()
+ for(var/facialhairstyle in facial_hair_styles_list)
+ var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
+
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(!(species.name in S.species_allowed))
+ continue
+
+ valid_facial_hairstyles += facialhairstyle
+
+ return valid_facial_hairstyles
+
\ No newline at end of file
diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm
index de1a8067b7e..4b657bb3181 100644
--- a/code/modules/mob/living/silicon/pai/software.dm
+++ b/code/modules/mob/living/silicon/pai/software.dm
@@ -15,7 +15,7 @@ var/global/list/pai_software_by_key = list()
var/global/list/default_pai_software = list()
/hook/startup/proc/populate_pai_software_list()
var/r = 1 // I would use ., but it'd sacrifice runtime detection
- for(var/type in typesof(/datum/pai_software) - /datum/pai_software)
+ for(var/type in subtypesof(/datum/pai_software))
var/datum/pai_software/P = new type()
if(pai_software_by_key[P.id])
var/datum/pai_software/O = pai_software_by_key[P.id]
diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm
index e0d7859a398..954b0dc7748 100644
--- a/code/modules/mob/living/silicon/robot/laws.dm
+++ b/code/modules/mob/living/silicon/robot/laws.dm
@@ -110,8 +110,8 @@
if(0) laws = new /datum/ai_laws/asimov()
if(1) laws = new /datum/ai_laws/custom()
if(2)
- var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
- laws = new lawtype()
+ var/datum/ai_laws/lawtype = pick(subtypesof(/datum/ai_laws/default))
+ laws = new lawtype()
/mob/living/silicon/robot/proc/statelaws() // -- TLE
// set category = "AI Commands"
@@ -200,4 +200,4 @@
list += {"
State Laws"}
- usr << browse(list, "window=laws")
\ No newline at end of file
+ usr << browse(list, "window=laws")
\ No newline at end of file
diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm
new file mode 100644
index 00000000000..f5bc0240bc5
--- /dev/null
+++ b/code/modules/nano/modules/human_appearance.dm
@@ -0,0 +1,159 @@
+/datum/nano_module/appearance_changer
+ name = "Appearance Editor"
+ var/flags = APPEARANCE_ALL_HAIR
+ var/mob/living/carbon/human/owner = null
+ var/list/valid_species = list()
+ var/list/valid_hairstyles = list()
+ var/list/valid_facial_hairstyles = list()
+
+ var/check_whitelist
+ var/list/whitelist
+ var/list/blacklist
+
+/datum/nano_module/appearance_changer/New(var/location, var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list())
+ ..()
+ owner = H
+ src.check_whitelist = check_species_whitelist
+ src.whitelist = species_whitelist
+ src.blacklist = species_blacklist
+
+/datum/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = default_state)
+ if(..())
+ return 1
+
+ if(href_list["race"])
+ if(can_change(APPEARANCE_RACE) && (href_list["race"] in valid_species))
+ if(owner.change_species(href_list["race"]))
+ cut_and_generate_data()
+ return 1
+ if(href_list["gender"])
+ if(can_change(APPEARANCE_GENDER))
+ if(owner.change_gender(href_list["gender"]))
+ cut_and_generate_data()
+ return 1
+ if(href_list["skin_tone"])
+ if(can_change_skin_tone())
+ var/new_s_tone = input(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", owner.s_tone) as num|null
+ if(isnum(new_s_tone) && can_still_topic(state))
+ new_s_tone = 35 - max(min( round(new_s_tone), 220),1)
+ return owner.change_skin_tone(new_s_tone)
+ if(href_list["skin_color"])
+ if(can_change_skin_color())
+ var/new_skin = input(usr, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin)) as color|null
+ if(new_skin && can_still_topic(state))
+ var/r_skin = hex2num(copytext(new_skin, 2, 4))
+ var/g_skin = hex2num(copytext(new_skin, 4, 6))
+ var/b_skin = hex2num(copytext(new_skin, 6, 8))
+ if(owner.change_skin_color(r_skin, g_skin, b_skin))
+ update_dna()
+ return 1
+ if(href_list["hair"])
+ if(can_change(APPEARANCE_HAIR) && (href_list["hair"] in valid_hairstyles))
+ if(owner.change_hair(href_list["hair"]))
+ update_dna()
+ return 1
+ if(href_list["hair_color"])
+ if(can_change(APPEARANCE_HAIR_COLOR))
+ var/new_hair = input("Please select hair color.", "Hair Color", rgb(owner.r_hair, owner.g_hair, owner.b_hair)) as color|null
+ if(new_hair && can_still_topic(state))
+ var/r_hair = hex2num(copytext(new_hair, 2, 4))
+ var/g_hair = hex2num(copytext(new_hair, 4, 6))
+ var/b_hair = hex2num(copytext(new_hair, 6, 8))
+ if(owner.change_hair_color(r_hair, g_hair, b_hair))
+ update_dna()
+ return 1
+ if(href_list["facial_hair"])
+ if(can_change(APPEARANCE_FACIAL_HAIR) && (href_list["facial_hair"] in valid_facial_hairstyles))
+ if(owner.change_facial_hair(href_list["facial_hair"]))
+ update_dna()
+ return 1
+ if(href_list["facial_hair_color"])
+ if(can_change(APPEARANCE_FACIAL_HAIR_COLOR))
+ var/new_facial = input("Please select facial hair color.", "Facial Hair Color", rgb(owner.r_facial, owner.g_facial, owner.b_facial)) as color|null
+ if(new_facial && can_still_topic(state))
+ var/r_facial = hex2num(copytext(new_facial, 2, 4))
+ var/g_facial = hex2num(copytext(new_facial, 4, 6))
+ var/b_facial = hex2num(copytext(new_facial, 6, 8))
+ if(owner.change_facial_hair_color(r_facial, g_facial, b_facial))
+ update_dna()
+ return 1
+ if(href_list["eye_color"])
+ if(can_change(APPEARANCE_EYE_COLOR))
+ var/new_eyes = input("Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)) as color|null
+ if(new_eyes && can_still_topic(state))
+ var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
+ var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
+ var/b_eyes = hex2num(copytext(new_eyes, 6, 8))
+ if(owner.change_eye_color(r_eyes, g_eyes, b_eyes))
+ update_dna()
+ return 1
+
+ return 0
+
+/datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
+ generate_data(check_whitelist, whitelist, blacklist)
+ var/data[0]
+
+ data["specimen"] = owner.species.name
+ data["gender"] = owner.gender
+ data["change_race"] = can_change(APPEARANCE_RACE)
+ if(data["change_race"])
+ var/species[0]
+ for(var/specimen in valid_species)
+ species[++species.len] = list("specimen" = specimen)
+ data["species"] = species
+
+ data["change_gender"] = can_change(APPEARANCE_GENDER)
+ data["change_skin_tone"] = can_change_skin_tone()
+ data["change_skin_color"] = can_change_skin_color()
+ data["change_eye_color"] = can_change(APPEARANCE_EYE_COLOR)
+ data["change_hair"] = can_change(APPEARANCE_HAIR)
+ if(data["change_hair"])
+ var/hair_styles[0]
+ for(var/hair_style in valid_hairstyles)
+ hair_styles[++hair_styles.len] = list("hairstyle" = hair_style)
+ data["hair_styles"] = hair_styles
+ data["hair_style"] = owner.h_style
+
+ data["change_facial_hair"] = can_change(APPEARANCE_FACIAL_HAIR)
+ if(data["change_facial_hair"])
+ var/facial_hair_styles[0]
+ for(var/facial_hair_style in valid_facial_hairstyles)
+ facial_hair_styles[++facial_hair_styles.len] = list("facialhairstyle" = facial_hair_style)
+ data["facial_hair_styles"] = facial_hair_styles
+ data["facial_hair_style"] = owner.f_style
+
+ data["change_hair_color"] = can_change(APPEARANCE_HAIR_COLOR)
+ data["change_facial_hair_color"] = can_change(APPEARANCE_FACIAL_HAIR_COLOR)
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if (!ui)
+ ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state)
+ ui.set_initial_data(data)
+ ui.open()
+ ui.set_auto_update(1)
+
+/datum/nano_module/appearance_changer/proc/update_dna()
+ if(owner && (flags & APPEARANCE_UPDATE_DNA))
+ owner.update_dna()
+
+/datum/nano_module/appearance_changer/proc/can_change(var/flag)
+ return owner && (flags & flag)
+
+/datum/nano_module/appearance_changer/proc/can_change_skin_tone()
+ return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_TONE
+
+/datum/nano_module/appearance_changer/proc/can_change_skin_color()
+ return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_COLOR
+
+/datum/nano_module/appearance_changer/proc/cut_and_generate_data()
+ // Making the assumption that the available species remain constant
+ valid_facial_hairstyles.Cut()
+ valid_facial_hairstyles.Cut()
+ generate_data()
+
+/datum/nano_module/appearance_changer/proc/generate_data()
+ if(!valid_species.len)
+ valid_species = owner.generate_valid_species(check_whitelist, whitelist, blacklist)
+ if(!valid_hairstyles.len || !valid_facial_hairstyles.len)
+ valid_hairstyles = owner.generate_valid_hairstyles()
+ valid_facial_hairstyles = owner.generate_valid_facial_hairstyles()
\ No newline at end of file
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 574a3445ce0..38a1c5e927e 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -560,14 +560,14 @@ obj/structure/cable/proc/cableColor(var/colorC)
if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned)
if(!istype(usr.loc,/turf)) return
if(src.amount <= 14)
- usr << "\red You need at least 15 lengths to make restraints!"
+ usr << "You need at least 15 lengths to make restraints!"
return
var/obj/item/weapon/restraints/handcuffs/cable/B = new /obj/item/weapon/restraints/handcuffs/cable(usr.loc)
- B.icon_state = "cuff_[color]"
- usr << "\blue You wind some cable together to make some restraints."
+ B.color = color
+ usr << "You wind some cable together to make some restraints."
src.use(15)
else
- usr << "\blue You cannot do that."
+ usr << "You cannot do that."
..()
// Items usable on a cable coil :
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 6935bd7777d..0fcd59cc009 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -303,11 +303,13 @@
..()
if(!powernet)
return
+ connect_to_network()
+ set_panels(cdir)
if(autostart)
src.search_for_connected()
if(connected_tracker && track == 2)
connected_tracker.set_angle(sun.angle)
- set_panels(cdir)
+ set_panels(cdir)
/obj/machinery/power/solar_control/Destroy()
for(var/obj/machinery/power/solar/M in connected_panels)
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 66cd750c022..9453212b48d 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -297,7 +297,7 @@
return //cannot shoot yourself
if(istype(A, /obj/item/projectile))
return
- if(istype(A, /mob/living))
+ if(istype(A, /mob/living) || istype(A, /obj/mecha) || istype(A, /obj/spacepod) || istype(A, /obj/vehicle))
result = 2 //We hit someone, return 1!
return
result = 1
diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm
index bd9cf955453..f8661d168e8 100644
--- a/code/modules/reagents/Chemistry-Holder.dm
+++ b/code/modules/reagents/Chemistry-Holder.dm
@@ -18,7 +18,7 @@ datum
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
- var/paths = typesof(/datum/reagent) - /datum/reagent
+ var/paths = subtypesof(/datum/reagent)
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
@@ -29,7 +29,7 @@ datum
// For example:
// chemical_reaction_list["plasma"] is a list of all reactions relating to plasma
- var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction
+ var/paths = subtypesof(/datum/chemical_reaction)
chemical_reactions_list = list()
for(var/path in paths)
diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm
index 9231a1c44a8..8fcd9e8117b 100644
--- a/code/modules/reagents/Chemistry-Recipes.dm
+++ b/code/modules/reagents/Chemistry-Recipes.dm
@@ -555,7 +555,7 @@ datum
required_other = 1
on_reaction(var/datum/reagents/holder)
- var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/snacks) - /obj/item/weapon/reagent_containers/food/snacks
+ var/list/borks = subtypesof(/obj/item/weapon/reagent_containers/food/snacks)
// BORK BORK BORK
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
@@ -582,7 +582,7 @@ datum
required_other = 1
on_reaction(var/datum/reagents/holder)
- var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/drinks) - /obj/item/weapon/reagent_containers/food/drinks
+ var/list/borks = subtypesof(/obj/item/weapon/reagent_containers/food/drinks)
// BORK BORK BORK
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
@@ -888,7 +888,7 @@ datum
required_other = 1
on_reaction(var/datum/reagents/holder)
feedback_add_details("slime_cores_used","[replacetext(name," ","_")]")
- var/list/paints = typesof(/obj/item/weapon/reagent_containers/glass/paint) - /obj/item/weapon/reagent_containers/glass/paint
+ var/list/paints = subtypesof(/obj/item/weapon/reagent_containers/glass/paint)
var/chosen = pick(paints)
var/obj/P = new chosen
if(P)
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 91915b6c1f8..25914feb81d 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -57,7 +57,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
/obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID.
var/datum/tech/check_tech
var/return_name = null
- for(var/T in typesof(/datum/tech) - /datum/tech)
+ for(var/T in subtypesof(/datum/tech))
check_tech = null
check_tech = new T()
if(check_tech.id == ID)
@@ -91,7 +91,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if("clown")
return_name = "Bananium"
else
- for(var/R in typesof(/datum/reagent) - /datum/reagent)
+ for(var/R in subtypesof(/datum/reagent))
temp_reagent = null
temp_reagent = new R()
if(temp_reagent.id == ID)
diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm
index b5f5beb05a8..274f02f27fc 100644
--- a/code/modules/research/research.dm
+++ b/code/modules/research/research.dm
@@ -53,9 +53,9 @@ research holder datum.
var/list/known_designs = list() //List of available designs (at base reliability).
/datum/research/New() //Insert techs into possible_tech here. Known_tech automatically updated.
- for(var/T in typesof(/datum/tech) - /datum/tech)
+ for(var/T in subtypesof(/datum/tech))
possible_tech += new T(src)
- for(var/D in typesof(/datum/design) - /datum/design)
+ for(var/D in subtypesof(/datum/design))
possible_designs += new D(src)
RefreshResearch()
@@ -140,7 +140,7 @@ research holder datum.
D.reliability = min(100, D.reliability + rand(1,3))
if(I.crit_fail)
D.reliability = min(100, D.reliability + rand(3, 5))
-
+
/datum/research/proc/FindDesignByID(var/id)
for(var/datum/design/D in known_designs)
if(D.id == id)
@@ -148,9 +148,9 @@ research holder datum.
//Autolathe files
/datum/research/autolathe/New()
- for(var/T in (typesof(/datum/tech) - /datum/tech))
+ for(var/T in subtypesof(/datum/tech))
possible_tech += new T(src)
- for(var/path in typesof(/datum/design) - /datum/design)
+ for(var/path in subtypesof(/datum/design))
var/datum/design/D = new path(src)
possible_designs += D
if((D.build_type & AUTOLATHE) && ("initial" in D.category)) //autolathe starts without hacked designs
@@ -278,7 +278,7 @@ datum/tech/robotics
/obj/item/weapon/disk/tech_disk/New()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
-
+
/obj/item/weapon/disk/design_disk
name = "Component Design Disk"
desc = "A disk for storing device design data for construction in lathes."
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
index aeecd5ff2b2..23f9f73afde 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
@@ -72,12 +72,12 @@ var/list/valid_secondary_effect_types = list(\
..()
//setup primary effect - these are the main ones (mixed)
- var/effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
+ var/effecttype = pick(subtypesof(/datum/artifact_effect))
my_effect = new effecttype(src)
//75% chance to have a secondary stealthy (and mostly bad) effect
if(prob(75))
- effecttype = pick(typesof(/datum/artifact_effect) - /datum/artifact_effect)
+ effecttype = pick(subtypesof(/datum/artifact_effect))
secondary_effect = new effecttype(src)
if(prob(75))
secondary_effect.ToggleActivate(0)
diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm
index 0f5475338ad..a3ab9612471 100644
--- a/code/modules/research/xenoarchaeology/finds/finds.dm
+++ b/code/modules/research/xenoarchaeology/finds/finds.dm
@@ -324,8 +324,7 @@
apply_image_decorations = 0
apply_material_decorations = 0
if(24)
- var/list/possible_spawns = typesof(/obj/item/weapon/stock_parts)
- possible_spawns -= /obj/item/weapon/stock_parts
+ var/list/possible_spawns = subtypesof(/obj/item/weapon/stock_parts)
possible_spawns -= /obj/item/weapon/stock_parts/subspace
var/new_type = pick(possible_spawns)
diff --git a/code/modules/store/store.dm b/code/modules/store/store.dm
index 41df9937fab..9f9ecc33919 100644
--- a/code/modules/store/store.dm
+++ b/code/modules/store/store.dm
@@ -25,7 +25,7 @@ var/global/datum/store/centcomm_store=new
var/obj/machinery/account_database/linked_db
/datum/store/New()
- for(var/itempath in typesof(/datum/storeitem) - /datum/storeitem/)
+ for(var/itempath in subtypesof(/datum/storeitem))
items += new itempath()
/datum/store/proc/charge(var/datum/mind/mind,var/amount,var/datum/storeitem/item)
diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm
index b3c7154ea79..5cb0986fb88 100644
--- a/code/modules/virus2/effect.dm
+++ b/code/modules/virus2/effect.dm
@@ -15,7 +15,7 @@
/datum/disease2/effectholder/proc/getrandomeffect(var/badness = 1)
var/list/datum/disease2/effect/list = list()
- for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
+ for(var/e in subtypesof(/datum/disease2/effect))
var/datum/disease2/effect/f = new e
if (f.badness > badness) //we don't want such strong effects
continue
diff --git a/nano/templates/appearance_changer.tmpl b/nano/templates/appearance_changer.tmpl
new file mode 100644
index 00000000000..19e7fd4759b
--- /dev/null
+++ b/nano/templates/appearance_changer.tmpl
@@ -0,0 +1,75 @@
+{{if data.change_race}}
+
+
+ Species:
+
+
+ {{for data.species}}
+ {{:helper.link(value.specimen, null, { 'race' : value.specimen}, null, data.specimen == value.specimen ? 'selected' : null)}}
+ {{/for}}
+
+
+{{/if}}
+
+{{if data.change_gender}}
+
+
+ Gender:
+
+
+ {{:helper.link('Male', null, { 'gender' : 'male'}, null, data.gender == 'male' ? 'selected' : null)}}
+ {{:helper.link('Female', null, { 'gender' : 'female'}, null, data.gender == 'female' ? 'selected' : null)}}
+
+
+{{/if}}
+
+{{if data.change_eye_color || data.change_skin_tone || data.change_skin_color || data.change_hair_color || data.change_facial_hair_color}}
+
+
+ Colors:
+
+
+ {{if data.change_eye_color}}
+ {{:helper.link('Change eye color', null, { 'eye_color' : 1})}}
+ {{/if}}
+ {{if data.change_skin_tone}}
+ {{:helper.link('Change skin tone', null, { 'skin_tone' : 1})}}
+ {{/if}}
+ {{if data.change_skin_color}}
+ {{:helper.link('Change skin color', null, { 'skin_color' : 1})}}
+ {{/if}}
+ {{if data.change_hair_color}}
+ {{:helper.link('Change hair color', null, { 'hair_color' : 1})}}
+ {{/if}}
+ {{if data.change_facial_hair_color}}
+ {{:helper.link('Change facial hair color', null, { 'facial_hair_color' : 1})}}
+ {{/if}}
+
+
+{{/if}}
+
+{{if data.change_hair}}
+
+
+ Hair styles:
+
+
+ {{for data.hair_styles}}
+ {{:helper.link(value.hairstyle, null, { 'hair' : value.hairstyle}, null, data.hair_style == value.hairstyle ? 'selected' : null)}}
+ {{/for}}
+
+
+{{/if}}
+
+{{if data.change_facial_hair}}
+
+
+ Facial hair styles:
+
+
+ {{for data.facial_hair_styles}}
+ {{:helper.link(value.facialhairstyle, null, { 'facial_hair' : value.facialhairstyle}, null, data.facial_hair_style == value.facialhairstyle ? 'selected' : null)}}
+ {{/for}}
+
+
+{{/if}}
diff --git a/paradise.dme b/paradise.dme
index af79eb0c41c..bb5c95972e0 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -1314,6 +1314,7 @@
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
#include "code\modules\mob\living\carbon\brain\say.dm"
+#include "code\modules\mob\living\carbon\human\appearance.dm"
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
@@ -1484,6 +1485,7 @@
#include "code\modules\nano\modules\alarm_monitor.dm"
#include "code\modules\nano\modules\atmos_control.dm"
#include "code\modules\nano\modules\crew_monitor.dm"
+#include "code\modules\nano\modules\human_appearance.dm"
#include "code\modules\nano\modules\nano_module.dm"
#include "code\modules\nano\modules\power_monitor.dm"
#include "code\modules\ninja\energy_katana.dm"