Merge pull request #13063 from Incoming5643/subtypesof

Adds subtypesof(path)
This commit is contained in:
Cheridan
2015-11-19 16:31:09 -06:00
46 changed files with 73 additions and 81 deletions
+4 -1
View File
@@ -287,4 +287,7 @@ var/list/bloody_footprints_cache = list()
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
#define DYNAMIC_LIGHTING_IFSTARLIGHT 2 //dynamic lighting enabled only if starlight is.
#define IS_DYNAMIC_LIGHTING(A) ( A.lighting_use_dynamic == DYNAMIC_LIGHTING_IFSTARLIGHT ? config.starlight : A.lighting_use_dynamic )
#define IS_DYNAMIC_LIGHTING(A) ( A.lighting_use_dynamic == DYNAMIC_LIGHTING_IFSTARLIGHT ? config.starlight : A.lighting_use_dynamic )
//subtypesof(), typesof() without the parent path
#define subtypesof(typepath) ( typesof(typepath) - typepath )
+4 -9
View File
@@ -28,16 +28,14 @@
//Species
for(var/spath in typesof(/datum/species))
if(spath == /datum/species)
continue
for(var/spath in subtypesof(/datum/species))
var/datum/species/S = new spath()
if(S.roundstart)
roundstart_species[S.name] = S.type
species_list[S.id] = S.type
//Surgeries
for(var/path in (typesof(/datum/surgery) - /datum/surgery))
for(var/path in (subtypesof(/datum/surgery)))
surgeries_list += new path()
init_subtypes(/datum/table_recipe, table_recipes)
@@ -58,8 +56,7 @@
//if no list/L is provided, one is created.
/proc/init_subtypes(prototype, list/L)
if(!istype(L)) L = list()
for(var/path in typesof(prototype))
if(path == prototype) continue
for(var/path in subtypesof(prototype))
L += new path()
return L
@@ -68,8 +65,6 @@
/proc/init_paths(prototype, list/L)
if(!istype(L))
L = list()
for(var/path in typesof(prototype))
if(path == prototype)
continue
for(var/path in subtypesof(prototype))
L+= path
return L
+1 -1
View File
@@ -1342,4 +1342,4 @@ B --><-- A
L += T.contents
c_dist++
return L
return L
+4 -4
View File
@@ -186,7 +186,7 @@
/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).
@@ -663,7 +663,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
@@ -672,7 +672,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))
@@ -688,7 +688,7 @@
/datum/configuration/proc/get_runnable_midround_modes(crew)
var/list/datum/game_mode/runnable_modes = new
for(var/T in (typesof(/datum/game_mode) - /datum/game_mode - ticker.mode.type))
for(var/T in (subtypesof(/datum/game_mode) - ticker.mode.type))
var/datum/game_mode/M = new T()
if(!(M.config_tag in modes))
qdel(M)
+1 -1
View File
@@ -178,7 +178,7 @@ var/datum/subsystem/events/SSevent
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()
+3 -3
View File
@@ -24,7 +24,7 @@ var/datum/subsystem/job/SSjob
/datum/subsystem/job/proc/SetupOccupations(faction = "Station")
occupations = list()
var/list/all_jobs = typesof(/datum/job)
var/list/all_jobs = subtypesof(/datum/job)
if(!all_jobs.len)
world << "<span class='boldannounce'>Error setting up jobs, no job datums found</span>"
return 0
@@ -342,10 +342,10 @@ var/datum/subsystem/job/SSjob
if(!joined_late)
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in start_landmarks_list)
if(sloc.name != rank)
if(sloc.name != rank)
S = sloc //so we can revert to spawning them on top of eachother if something goes wrong
continue
if(locate(/mob/living) in sloc.loc)
if(locate(/mob/living) in sloc.loc)
continue
S = sloc
break
+1 -3
View File
@@ -52,9 +52,7 @@ var/datum/subsystem/shuttle/SSshuttle
ordernum = rand(1,9000)
for(var/typepath in typesof(/datum/supply_packs))
if(typepath == /datum/supply_packs)
continue
for(var/typepath in subtypesof(/datum/supply_packs))
var/datum/supply_packs/P = new typepath()
if(P.name == "HEADER") continue // To filter out group headers
supply_packs["[P.type]"] = P
+1 -1
View File
@@ -100,7 +100,7 @@
WARNING("Invalid custom AI laws, check silicon_laws.txt")
return
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
+1 -1
View File
@@ -27,7 +27,7 @@
#define BIOHAZARD "BIOHAZARD THREAT!"
var/list/diseases = typesof(/datum/disease) - /datum/disease
var/list/diseases = subtypesof(/datum/disease)
/datum/disease
@@ -1,6 +1,6 @@
// Symptoms are the effects that engineered advanced diseases do.
var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom
var/list/list_symptoms = subtypesof(/datum/symptom)
var/list/dictionary_symptoms = list()
var/global/const/SYMPTOM_ACTIVATION_PROB = 3
+1 -1
View File
@@ -8,7 +8,7 @@ var/list/uplink_items = list()
// A keyed list, acting as categories, which are lists to the datum.
var/list/last = list()
for(var/item in typesof(/datum/uplink_item))
for(var/item in subtypesof(/datum/uplink_item))
var/datum/uplink_item/I = new item()
if(!I.item)
@@ -14,7 +14,7 @@
return rgb(rand(0,255),rand(0,255),rand(0,255))
/obj/machinery/abductor/gland_dispenser/New()
gland_types = typesof(/obj/item/organ/internal/gland) - /obj/item/organ/internal/gland
gland_types = subtypesof(/obj/item/organ/internal/gland)
gland_types = shuffle(gland_types)
gland_colors = new/list(gland_types.len)
amounts = new/list(gland_types.len)
@@ -155,7 +155,7 @@
H << "<span class='warning'>You feel intensely watched.</span>"
sleep(5)
H << "<span class='warning'><b>Your mind snaps!</b></span>"
var/objtype = pick(typesof(/datum/objective/abductee/) - /datum/objective/abductee/)
var/objtype = pick(subtypesof(/datum/objective/abductee/))
var/datum/objective/abductee/O = new objtype()
ticker.mode.abductees += H.mind
H.mind.objectives += O
+1 -1
View File
@@ -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)
+1 -2
View File
@@ -221,8 +221,7 @@
set desc = "Replaces your chemical with a different one"
if(!can_buy(50))
return
var/list/excluded = list(/datum/reagent/blob, blob_reagent_datum.type)
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)
BL.adjustcolors(blob_reagent_datum.color)
+1 -1
View File
@@ -80,7 +80,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas
//Decide if it's ok for the lings to have a team objective
//And then set it up to be handed out in forge_changeling_objectives
var/list/team_objectives = typesof(/datum/objective/changeling_team_objective) - /datum/objective/changeling_team_objective
var/list/team_objectives = subtypesof(/datum/objective/changeling_team_objective)
var/list/possible_team_objectives = list()
for(var/T in team_objectives)
var/datum/objective/changeling_team_objective/CTO = T
+1 -1
View File
@@ -247,7 +247,7 @@ It also contains rune words, which are soon to be removed.
var/rune_to_scribe
var/entered_rune_name
var/list/possible_runes = list()
for(var/T in typesof(/obj/effect/rune) - /obj/effect/rune/malformed - /obj/effect/rune)
for(var/T in subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed)
var/obj/effect/rune/R = T
if(initial(R.cultist_name))
possible_runes.Add(initial(R.cultist_name)) //This is to allow the menu to let cultists select runes by name rather than by object path. I don't know a better way to do this
+1 -1
View File
@@ -1,5 +1,5 @@
var/list/sacrificed = list()
var/list/non_revealed_runes = (typesof(/obj/effect/rune) - /obj/effect/rune/malformed - /obj/effect/rune )
var/list/non_revealed_runes = (subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed)
/*
+1 -1
View File
@@ -3,7 +3,7 @@
if(global_handofgod_traptypes.len && global_handofgod_structuretypes.len)
return
var/list/types = typesof(/obj/structure/divine) - /obj/structure/divine - /obj/structure/divine/trap
var/list/types = subtypesof(/obj/structure/divine) - /obj/structure/divine/trap
for(var/T in types)
var/obj/structure/divine/D = T
if(initial(D.constructable))
+3 -3
View File
@@ -230,7 +230,7 @@ var/hsboxspawn = 1
if(!clothinfo)
clothinfo = "<b>Clothing</b> <a href='?\ref[src];hsb=hsbreag'>(Reagent Containers)</a> <a href='?\ref[src];hsb=hsbobj'>(Other Items)</a><hr><br>"
var/list/all_items = typesof(/obj/item/clothing) - /obj/item/clothing
var/list/all_items = subtypesof(/obj/item/clothing)
for(var/typekey in spawn_forbidden)
all_items -= typesof(typekey)
for(var/O in reverseRange(all_items))
@@ -244,7 +244,7 @@ var/hsboxspawn = 1
if(!reaginfo)
reaginfo = "<b>Reagent Containers</b> <a href='?\ref[src];hsb=hsbcloth'>(Clothing)</a> <a href='?\ref[src];hsb=hsbobj'>(Other Items)</a><hr><br>"
var/list/all_items = typesof(/obj/item/weapon/reagent_containers) - /obj/item/weapon/reagent_containers
var/list/all_items = subtypesof(/obj/item/weapon/reagent_containers)
for(var/typekey in spawn_forbidden)
all_items -= typesof(typekey)
for(var/O in reverseRange(all_items))
@@ -258,7 +258,7 @@ var/hsboxspawn = 1
if(!objinfo)
objinfo = "<b>Other Items</b> <a href='?\ref[src];hsb=hsbcloth'>(Clothing)</a> <a href='?\ref[src];hsb=hsbreag'>(Reagent Containers)</a><hr><br>"
var/list/all_items = typesof(/obj/item/) - typesof(/obj/item/clothing) - typesof(/obj/item/weapon/reagent_containers) - /obj/item
var/list/all_items = subtypesof(/obj/item/) - typesof(/obj/item/clothing) - typesof(/obj/item/weapon/reagent_containers)
for(var/typekey in spawn_forbidden)
all_items -= typesof(typekey)
+1 -1
View File
@@ -3,7 +3,7 @@
for(var/i=1, i<=DNA_STRUC_ENZYMES_BLOCKS, i++)
avnums[i] = i
for(var/A in typesof(/datum/mutation/human) - /datum/mutation/human)
for(var/A in subtypesof(/datum/mutation/human))
var/datum/mutation/human/B = new A()
if(B.dna_block == NON_SCANNABLE)
continue
+1 -1
View File
@@ -290,7 +290,7 @@ var/global/list/multiverse = list()
M.faction = list("[usr.real_name]")
if(prob(50))
var/list/all_species = list()
for(var/speciestype in typesof(/datum/species) - /datum/species)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!S.dangerous_existence)
all_species += speciestype
+1 -1
View File
@@ -512,7 +512,7 @@
user << "It appears to have no author."
/obj/item/weapon/spellbook/proc/Initialize()
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())
+1 -1
View File
@@ -43,7 +43,7 @@
// If it's a generic arcade machine, pick a random arcade
// circuit board for it and make the new machine
if(!circuit)
var/choice = pick(typesof(/obj/item/weapon/circuitboard/arcade) - /obj/item/weapon/circuitboard/arcade)
var/choice = pick(subtypesof(/obj/item/weapon/circuitboard/arcade))
var/obj/item/weapon/circuitboard/CB = new choice()
new CB.build_path(loc, CB)
qdel(src)
+1 -1
View File
@@ -237,7 +237,7 @@
money = 0
for(var/i = 0, i < 5, i++)
var/cointype = pick(typesof(/obj/item/weapon/coin) - /obj/item/weapon/coin)
var/cointype = pick(subtypesof(/obj/item/weapon/coin))
var/obj/item/weapon/coin/C = new cointype(loc)
random_step(C, 2, 50)
@@ -60,8 +60,8 @@
/obj/item/clothing/suit/poncho/green,
/obj/item/clothing/suit/poncho/red)
gift_type_list += typesof(/obj/item/clothing/head/collectable) - /obj/item/clothing/head/collectable
gift_type_list += typesof(/obj/item/toy) - (((typesof(/obj/item/toy/cards) - /obj/item/toy/cards/deck) + /obj/item/toy/ammo) + /obj/item/toy) //All toys, except for abstract types and syndicate cards.
gift_type_list += subtypesof(/obj/item/clothing/head/collectable)
gift_type_list += subtypesof(/obj/item/toy) - (((typesof(/obj/item/toy/cards) - /obj/item/toy/cards/deck) + /obj/item/toy/ammo)) //All toys, except for abstract types and syndicate cards.
var/gift_type = pick(gift_type_list)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -131,7 +131,7 @@
/obj/structure/mirror/magic/New()
if(!choosable_races.len)
for(var/speciestype in typesof(/datum/species) - /datum/species)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!(S.id in races_blacklist))
choosable_races += S.id
@@ -142,7 +142,7 @@
..()
/obj/structure/mirror/magic/badmin/New()
for(var/speciestype in typesof(/datum/species) - /datum/species)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
choosable_races += S.id
..()
+1 -1
View File
@@ -185,7 +185,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
+2 -2
View File
@@ -419,7 +419,7 @@ var/list/TYPES_SHORTCUTS = list(
var/global/list/g_fancy_list_of_types = null
/proc/get_fancy_list_of_types()
if (isnull(g_fancy_list_of_types)) //init
var/list/temp = sortList(typesof(/atom) - typesof(/area) - /atom - /atom/movable)
var/list/temp = sortList(subtypesof(/atom) - typesof(/area) - /atom/movable)
g_fancy_list_of_types = new(temp.len)
for(var/type in temp)
var/typename = "[type]"
@@ -627,7 +627,7 @@ var/global/list/g_fancy_list_of_types = null
var/list/outfits = list("Naked","Custom","As Job...")
var/list/paths = typesof(/datum/outfit) - /datum/outfit - typesof(/datum/outfit/job)
var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job)
for(var/path in paths)
var/datum/outfit/O = path //not much to initalize here but whatever
outfits[initial(O.name)] = path
@@ -6,7 +6,7 @@
var/list/organs = list()
switch(operation)
if("add organ")
for(var/path in typesof(/obj/item/organ/internal) - /obj/item/organ/internal)
for(var/path in subtypesof(/obj/item/organ/internal))
var/dat = replacetext("[path]", "/obj/item/organ/internal/", ":")
organs[dat] = path
@@ -16,7 +16,7 @@
organ.Insert(C)
if("add implant")
for(var/path in typesof(/obj/item/weapon/implant) - /obj/item/weapon/implant)
for(var/path in subtypesof(/obj/item/weapon/implant))
var/dat = replacetext("[path]", "/obj/item/weapon/implant/", ":")
organs[dat] = path
+2 -2
View File
@@ -15,11 +15,11 @@
/obj/item/clothing/under/chameleon/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
+1 -2
View File
@@ -3,8 +3,7 @@
/obj/item/clothing/under/color/random/New()
..()
var/list/excluded = list(/obj/item/clothing/under/color/random, /obj/item/clothing/under/color)
var/obj/item/clothing/under/color/C = pick(typesof(/obj/item/clothing/under/color) - excluded)
var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color) - /obj/item/clothing/under/color/random)
name = initial(C.name)
icon_state = initial(C.icon_state)
item_state = initial(C.item_state)
+1 -1
View File
@@ -10,7 +10,7 @@
var/all_the_same = 0
var/all_species = list()
for(var/speciestype in typesof(/datum/species) - /datum/species)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!S.dangerous_existence)
all_species += speciestype
@@ -127,7 +127,7 @@
/datum/food_processor_process/mob/monkey/output = null
/obj/machinery/processor/proc/select_recipe(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, P.input))
continue
+1 -1
View File
@@ -69,7 +69,7 @@
/obj/machinery/computer/holodeck/initialize()
program_cache = list()
emag_programs = list()
for(var/typekey in typesof(program_type) - program_type)
for(var/typekey in subtypesof(program_type))
var/area/holodeck/A = locate(typekey)
if(!A || A == offline_program) continue
if(A.contents.len == 0) continue // not loaded
+2 -2
View File
@@ -1,6 +1,6 @@
/obj/item/weapon/book/manual/random/New()
var/static/banned_books = list(/obj/item/weapon/book/manual,/obj/item/weapon/book/manual/random,/obj/item/weapon/book/manual/nuclear,/obj/item/weapon/book/manual/wiki)
var/newtype = pick(typesof(/obj/item/weapon/book/manual) - banned_books)
var/static/banned_books = list(/obj/item/weapon/book/manual/random,/obj/item/weapon/book/manual/nuclear,/obj/item/weapon/book/manual/wiki)
var/newtype = pick(subtypesof(/obj/item/weapon/book/manual) - banned_books)
new newtype(loc)
qdel(src)
+2 -2
View File
@@ -63,7 +63,7 @@
if(53 to 54)
new /obj/item/toy/balloon(src)
if(55 to 56)
var/newitem = pick(typesof(/obj/item/toy/prize) - /obj/item/toy/prize)
var/newitem = pick(subtypesof(/obj/item/toy/prize))
new newitem(src)
if(57 to 58)
new /obj/item/toy/syndicateballoon(src)
@@ -85,7 +85,7 @@
if(67 to 68)
var/t = rand(4,7)
for(var/i = 0, i < t, ++i)
var /newitem = pick(typesof(/obj/item/weapon/stock_parts) - /obj/item/weapon/stock_parts - /obj/item/weapon/stock_parts/subspace)
var /newitem = pick(subtypesof(/obj/item/weapon/stock_parts) - /obj/item/weapon/stock_parts/subspace)
new newitem(src)
if(69 to 70)
for(var/i = 0, i < 5, ++i)
+1 -1
View File
@@ -45,7 +45,7 @@
if(0) laws = new /datum/ai_laws/default/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)
var/datum/ai_laws/lawtype = pick(subtypesof(/datum/ai_laws/default))
laws = new lawtype()
laws.associate(src)
+1 -1
View File
@@ -66,7 +66,7 @@ Contents:
//Research Init
stored_research = new()
for(var/T in typesof(/datum/tech) - /datum/tech)//Store up on research.
for(var/T in subtypesof(/datum/tech))//Store up on research.
stored_research += new T(src)
//Reagent Init
+1 -1
View File
@@ -225,7 +225,7 @@
var/mob/living/carbon/human/H = new_mob
if(prob(50))
var/list/all_species = list()
for(var/speciestype in typesof(/datum/species) - /datum/species)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!S.dangerous_existence)
all_species += speciestype
+2 -2
View File
@@ -24,7 +24,7 @@ var/const/INJECT = 5 //injection
//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()
@@ -35,7 +35,7 @@ var/const/INJECT = 5 //injection
// 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)
@@ -359,8 +359,8 @@
H.visible_message("<b>[H]</b> falls to the ground and screams as their skin bubbles and froths!") //'froths' sounds painful when used with SKIN.
H.Weaken(3)
sleep(30)
var/list/blacklisted_species = list(/datum/species/zombie, /datum/species/skeleton, /datum/species/human, /datum/species/golem, /datum/species/golem/adamantine, /datum/species/shadow, /datum/species/shadow/ling, /datum/species/plasmaman, /datum/species)
var/list/possible_morphs = typesof(/datum/species/) - blacklisted_species
var/list/blacklisted_species = list(/datum/species/zombie, /datum/species/skeleton, /datum/species/human, /datum/species/golem, /datum/species/golem/adamantine, /datum/species/shadow, /datum/species/shadow/ling, /datum/species/plasmaman)
var/list/possible_morphs = subtypesof(/datum/species/) - blacklisted_species
var/datum/species/mutation = pick(possible_morphs)
if(prob(90) && mutation && H.dna.species != /datum/species/golem && H.dna.species != /datum/species/golem/adamantine)
H << "<span class='danger'>The pain subsides. You feel... different.</span>"
@@ -202,9 +202,7 @@
/datum/chemical_reaction/slimebork2/on_reaction(datum/reagents/holder)
feedback_add_details("slime_cores_used","[type]")
var/list/blocked = list(/obj/item/weapon/reagent_containers/food/drinks)
var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/drinks) - blocked
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)
@@ -665,7 +663,7 @@
/datum/chemical_reaction/slimepaint/on_reaction(datum/reagents/holder)
feedback_add_details("slime_cores_used","[type]")
var/list/paints = typesof(/obj/item/weapon/paint) - /obj/item/weapon/paint
var/list/paints = subtypesof(/obj/item/weapon/paint)
var/chosen = pick(paints)
var/obj/P = new chosen
if(P)
+2 -2
View File
@@ -55,7 +55,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
/proc/CallTechName(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)
@@ -89,7 +89,7 @@ proc/CallMaterialName(ID)
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)
+4 -4
View File
@@ -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()
@@ -167,9 +167,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