Revert "Singletons + refactor of /datum/observ (#15487)" (#15515)

This commit is contained in:
Matt Atlas
2023-01-05 19:21:22 +01:00
committed by GitHub
parent 34b1bcd055
commit b1869884c1
506 changed files with 7214 additions and 7561 deletions

View File

@@ -67,7 +67,6 @@
#include "code\__defines\rust_g.dm"
#include "code\__defines\ship_weapons.dm"
#include "code\__defines\shuttle.dm"
#include "code\__defines\singletons.dm"
#include "code\__defines\space_sectors.dm"
#include "code\__defines\spaceman_dmm.dm"
#include "code\__defines\spatial_gridmap.dm"
@@ -255,7 +254,6 @@
#include "code\controllers\subsystems\processing\psi.dm"
#include "code\controllers\subsystems\processing\shuttle.dm"
#include "code\controllers\subsystems\processing\vueui.dm"
#include "code\core\datum\IsAbstract.dm"
#include "code\datums\ai_law_sets.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\beam.dm"
@@ -338,8 +336,8 @@
#include "code\datums\radio\signal.dm"
#include "code\datums\repositories\cameras.dm"
#include "code\datums\repositories\crew.dm"
#include "code\datums\repositories\decls.dm"
#include "code\datums\repositories\repository.dm"
#include "code\datums\repositories\singletons.dm"
#include "code\datums\repositories\unique.dm"
#include "code\datums\trading\_trading_defines.dm"
#include "code\datums\trading\ai.dm"

View File

@@ -111,7 +111,7 @@ Contains helper procs for airflow, handled in /connection_group.
/mob/living/carbon/human/airflow_hit(atom/A)
// for(var/mob/M in hearers(src))
// M.show_message("<span class='danger'>[src] slams into [A]!</span>",1,"<span class='danger'>You hear a loud slam!</span>",2)
playsound(src.loc, /singleton/sound_category/punch_sound, 25, 1, -1)
playsound(src.loc, /decl/sound_category/punch_sound, 25, 1, -1)
if (prob(33))
loc:add_blood(src)
bloody_body(src)

View File

@@ -1,23 +0,0 @@
/*
* Performance behaviors for avoiding calling procs unecessarily on the Singletons global.
*/
/// Get a singleton instance according to path P. Creates it if necessary. Null if abstract or not a singleton.
#define GET_SINGLETON(P)\
(ispath(P, /singleton) ? (Singletons.resolved_instances[P] ? Singletons.instances[P] : Singletons.GetInstanceOf(P)) : Singletons.GetInstance(P))
/// Get a (path = instance) map of valid singletons according to typesof(P).
#define GET_SINGLETON_TYPE_MAP(P)\
(ispath(P, /singleton) ? (Singletons.resolved_type_maps[P] ? Singletons.type_maps[P] : Singletons.GetTypeMap(P)) : list())
/// Get a (path = instance) map of valid singletons according to subtypesof(P).
#define GET_SINGLETON_SUBTYPE_MAP(P)\
(ispath(P, /singleton) ? (Singletons.resolved_subtype_maps[P] ? Singletons.subtype_maps[P] : Singletons.GetSubtypeMap(P)) : list())
/// Get a list of valid singletons according to typesof(path).
#define GET_SINGLETON_TYPE_LIST(P)\
(ispath(P, /singleton) ? (Singletons.resolved_type_lists[P] ? Singletons.type_lists[P] : Singletons.GetTypeList(P)) : list())
/// Get a list of valid singletons according to subtypesof(path).
#define GET_SINGLETON_SUBTYPE_LIST(P)\
(ispath(P, /singleton) ? (Singletons.resolved_subtype_lists[P] ? Singletons.subtype_lists[P] : Singletons.GetSubtypeListOf(P)) : Singletons.GetSubtypeList(P))

View File

@@ -1,59 +1,59 @@
/singleton/proteinbar_flavor
/decl/proteinbar_flavor
var/name = "flavorless"
var/list/reagents
/singleton/proteinbar_flavor/applenpear
/decl/proteinbar_flavor/applenpear
name = "apple 'n pear"
reagents = list(/singleton/reagent/drink/applejuice, /singleton/reagent/drink/pearjuice)
reagents = list(/decl/reagent/drink/applejuice, /decl/reagent/drink/pearjuice)
/singleton/proteinbar_flavor/banananut
/decl/proteinbar_flavor/banananut
name = "banana nut"
reagents = list(/singleton/reagent/drink/banana)
reagents = list(/decl/reagent/drink/banana)
/singleton/proteinbar_flavor/cappuccino
/decl/proteinbar_flavor/cappuccino
name = "cappuccino"
reagents = list(/singleton/reagent/drink/coffee, /singleton/reagent/drink/milk)
reagents = list(/decl/reagent/drink/coffee, /decl/reagent/drink/milk)
/singleton/proteinbar_flavor/casualcupcake
/decl/proteinbar_flavor/casualcupcake
name = "casual cupcake"
reagents = list(/singleton/reagent/nutriment/sprinkles, /singleton/reagent/nutriment/coating/batter)
reagents = list(/decl/reagent/nutriment/sprinkles, /decl/reagent/nutriment/coating/batter)
/singleton/proteinbar_flavor/chippercherry
/decl/proteinbar_flavor/chippercherry
name = "chipper cherry"
reagents = list(/singleton/reagent/nutriment/cherryjelly)
reagents = list(/decl/reagent/nutriment/cherryjelly)
/singleton/proteinbar_flavor/chocolite
/decl/proteinbar_flavor/chocolite
name = "choco-lite"
reagents = list(/singleton/reagent/nutriment/coco)
reagents = list(/decl/reagent/nutriment/coco)
/singleton/proteinbar_flavor/citrusblast
/decl/proteinbar_flavor/citrusblast
name = "citrus blast"
reagents = list(/singleton/reagent/drink/lemonjuice, /singleton/reagent/drink/limejuice, /singleton/reagent/drink/orangejuice)
reagents = list(/decl/reagent/drink/lemonjuice, /decl/reagent/drink/limejuice, /decl/reagent/drink/orangejuice)
/singleton/proteinbar_flavor/classiccaramel
/decl/proteinbar_flavor/classiccaramel
name = "classic caramel"
reagents = list(/singleton/reagent/nutriment/caramel)
reagents = list(/decl/reagent/nutriment/caramel)
/singleton/proteinbar_flavor/delicatedenton
/decl/proteinbar_flavor/delicatedenton
name = "delicate denton"
reagents = list(/singleton/reagent/drink/milk/soymilk)
reagents = list(/decl/reagent/drink/milk/soymilk)
/singleton/proteinbar_flavor/heartyherbal
/decl/proteinbar_flavor/heartyherbal
name = "hearty herbal"
reagents = list(/singleton/reagent/drink/garlicjuice, /singleton/reagent/drink/onionjuice)
reagents = list(/decl/reagent/drink/garlicjuice, /decl/reagent/drink/onionjuice)
/singleton/proteinbar_flavor/honeybuns
/decl/proteinbar_flavor/honeybuns
name = "honey buns"
reagents = list(/singleton/reagent/nutriment/honey, /singleton/reagent/drink/grapejuice)
reagents = list(/decl/reagent/nutriment/honey, /decl/reagent/drink/grapejuice)
/singleton/proteinbar_flavor/powerfulpeppermint
/decl/proteinbar_flavor/powerfulpeppermint
name = "powerful peppermint"
reagents = list(/singleton/reagent/nutriment/mint)
reagents = list(/decl/reagent/nutriment/mint)
/singleton/proteinbar_flavor/magicalmelons
/decl/proteinbar_flavor/magicalmelons
name = "magical melons"
reagents = list(/singleton/reagent/drink/watermelonjuice)
reagents = list(/decl/reagent/drink/watermelonjuice)
/singleton/proteinbar_flavor/mixedberry
/decl/proteinbar_flavor/mixedberry
name = "mixed berry"
reagents = list(/singleton/reagent/drink/berryjuice)
reagents = list(/decl/reagent/drink/berryjuice)

View File

@@ -75,7 +75,7 @@
/proc/cmp_rcon_bbox(obj/machinery/power/breakerbox/BR1, obj/machinery/power/breakerbox/BR2)
return sorttext(BR2.RCon_tag, BR1.RCon_tag)
/proc/cmp_recipe_complexity_dsc(singleton/recipe/A, singleton/recipe/B)
/proc/cmp_recipe_complexity_dsc(decl/recipe/A, decl/recipe/B)
var/a_score = LAZYLEN(A.items) + LAZYLEN(A.reagents) + LAZYLEN(A.fruit)
var/b_score = LAZYLEN(B.items) + LAZYLEN(B.reagents) + LAZYLEN(B.fruit)
return b_score - a_score

View File

@@ -983,8 +983,8 @@ var/global/known_proc = new /proc/get_type_ref_bytes
return details && show_useless_subtypes ? "regex([D.type])" : "regex"
if(istype(D, /sound))
return details ? "sound([D.type])" : "sound"
if(istype(D, /singleton))
return details ? "singleton([D.type])" : "singleton"
if(istype(D, /decl))
return details ? "decl([D.type])" : "decl"
if(isdatum(D))
return details ? "datum([D.type])" : "datum"
if(istype(D)) // let's future proof ourselves

View File

@@ -12,10 +12,10 @@ var/datum/controller/subsystem/chemistry/SSchemistry
var/tmp/list/processing_holders = list()
var/list/codex_data = list()
var/list/codex_ignored_reaction_path = list(/datum/chemical_reaction/slime)
var/list/codex_ignored_result_path = list(/singleton/reagent/drink, /singleton/reagent/alcohol)
var/list/codex_ignored_result_path = list(/decl/reagent/drink, /decl/reagent/alcohol)
/datum/controller/subsystem/chemistry/proc/has_valid_specific_heat(var/_R) //Used for unit tests. Same as check_specific_heat but returns a boolean instead.
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
if(R.specific_heat > 0)
return TRUE
@@ -35,7 +35,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
return FALSE
/datum/controller/subsystem/chemistry/proc/check_specific_heat(var/_R)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
if(R.specific_heat > 0)
return R.specific_heat
@@ -73,7 +73,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
return CR
/datum/controller/subsystem/chemistry/proc/initialize_specific_heats()
for(var/_R in subtypesof(/singleton/reagent/))
for(var/_R in subtypesof(/decl/reagent/))
check_specific_heat(_R)
/datum/controller/subsystem/chemistry/stat_entry()
@@ -140,7 +140,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
cc.id = chemconfig[chemical]["id"]
cc.result = text2path(chemconfig[chemical]["result"])
cc.result_amount = chemconfig[chemical]["resultamount"]
if(!ispath(cc.result, /singleton/reagent))
if(!ispath(cc.result, /decl/reagent))
log_debug("SSchemistry: Warning: Invalid result [cc.result] in [cc.name] reactions list.")
qdel(cc)
break
@@ -148,7 +148,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
for(var/key in chemconfig[chemical]["required_reagents"])
var/result_chem = text2path(key)
LAZYSET(cc.required_reagents, result_chem, chemconfig[chemical]["required_reagents"][key])
if(!ispath(result_chem, /singleton/reagent))
if(!ispath(result_chem, /decl/reagent))
log_debug("SSchemistry: Warning: Invalid chemical [key] in [cc.name] required reagents list.")
qdel(cc)
break
@@ -162,7 +162,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list
// It is filtered into multiple lists within a list.
// For example:
// chemical_reaction_list[/singleton/reagent/toxin/phoron] is a list of all reactions relating to phoron
// chemical_reaction_list[/decl/reagent/toxin/phoron] is a list of all reactions relating to phoron
// Note that entries in the list are NOT duplicated. So if a reaction pertains to
// more than one chemical it will still only appear in only one of the sublists.
/datum/controller/subsystem/chemistry/proc/initialize_chemical_reactions()
@@ -190,7 +190,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
continue
if(codex_ignored_result_path && is_path_in_list(CR.result, codex_ignored_result_path))
continue
var/singleton/reagent/R = GET_SINGLETON(CR.result)
var/decl/reagent/R = decls_repository.get_decl(CR.result)
var/reactionData = list(id = CR.id)
reactionData["result"] = list(
name = R.name,
@@ -200,7 +200,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
reactionData["reagents"] = list()
for(var/reagent in CR.required_reagents)
var/singleton/reagent/required_reagent = reagent
var/decl/reagent/required_reagent = reagent
reactionData["reagents"] += list(list(
name = initial(required_reagent.name),
amount = CR.required_reagents[reagent]
@@ -208,7 +208,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
reactionData["catalysts"] = list()
for(var/reagent_path in CR.catalysts)
var/singleton/reagent/required_reagent = reagent_path
var/decl/reagent/required_reagent = reagent_path
reactionData["catalysts"] += list(list(
name = initial(required_reagent.name),
amount = CR.catalysts[reagent_path]
@@ -216,7 +216,7 @@ var/datum/controller/subsystem/chemistry/SSchemistry
reactionData["inhibitors"] = list()
for(var/reagent_path in CR.inhibitors)
var/singleton/reagent/required_reagent = reagent_path
var/decl/reagent/required_reagent = reagent_path
var/inhibitor_amount = CR.inhibitors[reagent_path] ? CR.inhibitors[reagent_path] : "Any"
reactionData["inhibitors"] += list(list(
name = initial(required_reagent.name),

View File

@@ -166,10 +166,10 @@ var/datum/controller/subsystem/explosives/SSexplosives
// If inside the blast radius + world.view - 2
if (dist <= closedist)
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a nearby explosion coming from \the [explosion_dir].")))
M.playsound_simple(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
M.playsound_simple(epicenter, get_sfx(/decl/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
else if (dist > closedist && dist <= extendeddist) // People with sensitive hearing get a better idea of how far it is
to_chat(M, FONT_LARGE(SPAN_WARNING("You hear the sound of a semi-close explosion coming from \the [explosion_dir].")))
M.playsound_simple(epicenter, get_sfx(/singleton/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
M.playsound_simple(epicenter, get_sfx(/decl/sound_category/explosion_sound), min(100, volume), use_random_freq = TRUE, falloff = 5)
else //You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
volume = M.playsound_simple(epicenter, 'sound/effects/explosionfar.ogg', volume, use_random_freq = TRUE, falloff = 1000, use_pressure = TRUE)
if(volume)
@@ -333,7 +333,7 @@ var/datum/controller/subsystem/explosives/SSexplosives
var/close_dist = round(power + world.view - 2, 1)
var/sound/explosion_sound = sound(get_sfx(/singleton/sound_category/explosion_sound))
var/sound/explosion_sound = sound(get_sfx(/decl/sound_category/explosion_sound))
for (var/thing in player_list)
var/mob/M = thing

View File

@@ -832,9 +832,9 @@
var/permitted = !G.allowed_roles || (rank.title in G.allowed_roles)
permitted = permitted && G.check_species_whitelist(H)
permitted = permitted && (!G.faction || (G.faction == H.employer_faction || H.employer_faction == "Stellar Corporate Conglomerate"))
var/singleton/origin_item/culture/our_culture = GET_SINGLETON(text2path(prefs.culture))
var/decl/origin_item/culture/our_culture = decls_repository.get_decl(text2path(prefs.culture))
permitted = permitted && (!G.culture_restriction || (our_culture in G.culture_restriction))
var/singleton/origin_item/origin/our_origin = GET_SINGLETON(text2path(prefs.origin))
var/decl/origin_item/origin/our_origin = decls_repository.get_decl(text2path(prefs.origin))
permitted = permitted && (!G.origin_restriction || (our_origin in G.origin_restriction))
if(!permitted)

View File

@@ -18,7 +18,7 @@ var/datum/controller/subsystem/mapping/SSmapping
/datum/controller/subsystem/mapping/Initialize(timeofday)
// Load templates and build away sites.
preloadTemplates()
for(var/atype in subtypesof(/singleton/submap_archetype))
for(var/atype in subtypesof(/decl/submap_archetype))
submap_archetypes[atype] = new atype
current_map.build_away_sites()

View File

@@ -67,10 +67,10 @@
while(gene_mask in used_masks)
gene_mask = "[uppertext(num2hex(rand(0,255), 0))]"
var/singleton/plantgene/G
var/decl/plantgene/G
for(var/D in gene_datums)
var/singleton/plantgene/P = gene_datums[D]
var/decl/plantgene/P = gene_datums[D]
if(gene_tag == P.gene_tag)
G = P
gene_datums -=D
@@ -129,8 +129,8 @@
if(seed.consume_gasses)
seed.consume_gasses[GAS_PHORON] = null
seed.consume_gasses[GAS_CO2] = null
if(seed.chems && !isnull(seed.chems[/singleton/reagent/acid/polyacid]))
seed.chems[/singleton/reagent/acid/polyacid] = null // Eating through the hull will make these plants completely inviable, albeit very dangerous.
if(seed.chems && !isnull(seed.chems[/decl/reagent/acid/polyacid]))
seed.chems[/decl/reagent/acid/polyacid] = null // Eating through the hull will make these plants completely inviable, albeit very dangerous.
seed.chems -= null // Setting to null does not actually remove the entry, which is weird.
seed.set_trait(TRAIT_IDEAL_HEAT,293)
seed.set_trait(TRAIT_HEAT_TOLERANCE,20)

View File

@@ -1,23 +0,0 @@
/**
* Abstract-ness is a meta-property of a class that is used to indicate
* that the class is intended to be used as a base class for others, and
* should not (or cannot) be instantiated.
* We have no such language concept in DM, and so we provide a datum member
* that can be used to hint at abstractness for circumstances where we would
* like that to be the case, such as base behavior providers.
*/
/// If set, a path at/above this one that expects not to be instantiated.
/datum/var/abstract_type
/// If true, this datum is an instance of an abstract type. Oops.
/datum/proc/IsAbstract()
SHOULD_NOT_OVERRIDE(TRUE)
return type == abstract_type
/// Passed a path or instance, returns whether it is abstract. Otherwise null.
/proc/is_abstract(datum/thing)
if (ispath(thing))
return thing == initial(thing.abstract_type)
if (istype(thing))
return thing.IsAbstract()

View File

@@ -1,4 +1,11 @@
/****************
* Debug Support *
****************/
var/list/all_observable_events = list()
var/datum/all_observable_events/all_observable_events = new()
/datum/all_observable_events
var/list/events
/datum/all_observable_events/New()
events = list()
..()

View File

@@ -6,9 +6,9 @@
// Arguments that the called proc should expect:
// /mob/dead: The mob that was added to the dead_mob_list
var/singleton/observ/death/death_event = new()
var/datum/observ/death/death_event = new()
/singleton/observ/death
/datum/observ/death
name = "Death"
expected_type = /mob

View File

@@ -1,4 +1,4 @@
var/singleton/observ/destroyed/destroyed_event = new()
var/datum/observ/destroyed/destroyed_event = new()
/singleton/observ/destroyed
/datum/observ/destroyed
name = "Destroyed"

View File

@@ -8,13 +8,13 @@
// /old_dir: The dir before the change.
// /new_dir: The dir after the change.
var/singleton/observ/dir_set/dir_set_event = new()
var/datum/observ/dir_set/dir_set_event = new()
/singleton/observ/dir_set
/datum/observ/dir_set
name = "Direction Set"
expected_type = /atom
/singleton/observ/dir_set/register(var/atom/dir_changer, var/datum/listener, var/proc_call)
/datum/observ/dir_set/register(var/atom/dir_changer, var/datum/listener, var/proc_call)
. = ..()
// Listen to the parent if possible.

View File

@@ -9,9 +9,9 @@
// /atom/old_loc: The atom the enterer came from
//
var/singleton/observ/entered/entered_event = new()
var/datum/observ/entered/entered_event = new()
/singleton/observ/entered
/datum/observ/entered
name = "Entered"
expected_type = /atom

View File

@@ -8,9 +8,9 @@
// /obj/item/item: The equipped item.
// slot: The slot equipped to.
var/singleton/observ/mob_equipped/mob_equipped_event = new()
var/datum/observ/mob_equipped/mob_equipped_event = new()
/singleton/observ/mob_equipped
/datum/observ/mob_equipped
name = "Mob Equipped"
expected_type = /mob
@@ -24,9 +24,9 @@ var/singleton/observ/mob_equipped/mob_equipped_event = new()
// /mob/equipper: The mob that equipped the item.
// slot: The slot equipped to.
var/singleton/observ/item_equipped/item_equipped_event = new()
var/datum/observ/item_equipped/item_equipped_event = new()
/singleton/observ/item_equipped
/datum/observ/item_equipped
name = "Item Equipped"
expected_type = /obj/item

View File

@@ -9,9 +9,9 @@
// /atom/new_loc: The atom the exitee is now residing in
//
var/singleton/observ/exited/exited_event = new()
var/datum/observ/exited/exited_event = new()
/singleton/observ/exited
/datum/observ/exited
name = "Exited"
expected_type = /atom

View File

@@ -1,10 +1,10 @@
var/singleton/observ/moved/moved_event = new()
var/datum/observ/moved/moved_event = new()
/singleton/observ/moved
/datum/observ/moved
name = "Moved"
expected_type = /atom/movable
/singleton/observ/moved/register(var/eventSource, var/datum/procOwner, var/proc_call)
/datum/observ/moved/register(var/eventSource, var/datum/procOwner, var/proc_call)
. = ..()
var/atom/movable/child = eventSource
if(.)

View File

@@ -1,239 +1,60 @@
//
// Observer Pattern Implementation
//
// Implements a basic observer pattern with the following main procs:
//
// /singleton/observ/proc/is_listening(var/event_source, var/datum/listener, var/proc_call)
// event_source: The instance which is generating events.
// listener: The instance which may be listening to events by event_source
// proc_call: Optional. The specific proc to call when the event is raised.
//
// Returns true if listener is listening for events by event_source, and proc_call supplied is either null or one of the proc that will be called when an event is raised.
//
// /singleton/observ/proc/has_listeners(var/event_source)
// event_source: The instance which is generating events.
//
// Returns true if the given event_source has any listeners at all, globally or to specific event sources.
//
// /singleton/observ/proc/register(var/event_source, var/datum/listener, var/proc_call)
// event_source: The instance you wish to receive events from.
// listener: The instance/owner of the proc to call when an event is raised by the event_source.
// proc_call: The proc to call when an event is raised.
//
// It is possible to register the same listener to the same event_source multiple times as long as it is using different proc_calls.
// Registering again using the same event_source, listener, and proc_call that has been registered previously will have no additional effect.
// I.e.: The proc_call will still only be called once per raised event. That particular proc_call will only have to be unregistered once.
//
// When proc_call is called the first argument is always the source of the event (event_source).
// Additional arguments may or may not be supplied, see individual event definition files (destroyed.dm, moved.dm, etc.) for details.
//
// The instance making the register() call is also responsible for calling unregister(), see below for additonal details, including when event_source is destroyed.
// This can be handled by listening to the event_source's destroyed event, unregistering in the listener's Destroy() proc, etc.
//
// /singleton/observ/proc/unregister(var/event_source, var/datum/listener, var/proc_call)
// event_source: The instance you wish to stop receiving events from.
// listener: The instance which will no longer receive the events.
// proc_call: Optional: The proc_call to unregister.
//
// Unregisters the listener from the event_source.
// If a proc_call has been supplied only that particular proc_call will be unregistered. If the proc_call isn't currently registered there will be no effect.
// If no proc_call has been supplied, the listener will have all registrations made to the given event_source undone.
//
// /singleton/observ/proc/register_global(var/datum/listener, var/proc_call)
// listener: The instance/owner of the proc to call when an event is raised by any and all sources.
// proc_call: The proc to call when an event is raised.
//
// Works very much the same as register(), only the listener/proc_call will receive all relevant events from all event sources.
// Global registrations can overlap with registrations made to specific event sources and these will not affect each other.
//
// /singleton/observ/proc/unregister_global(var/datum/listener, var/proc_call)
// listener: The instance/owner of the proc which will no longer receive the events.
// proc_call: Optional: The proc_call to unregister.
//
// Works very much the same as unregister(), only it undoes global registrations instead.
//
// /singleton/observ/proc/raise_event(src, ...)
// Should never be called unless implementing a new event type.
// The first argument shall always be the event_source belonging to the event. Beyond that there are no restrictions.
/datum/observ
var/name = "Unnamed Event"
var/expected_type = /datum
var/list/listeners_assoc
/singleton/observ
var/name = "Unnamed Event" // The name of this event, used mainly for debug/VV purposes. The list of event managers can be reached through the "Debug Controller" verb, selecting the "Observation" entry.
var/expected_type = /datum // The expected event source for this event. register() will CRASH() if it receives an unexpected type.
var/list/event_sources = list() // Associative list of event sources, each with their own associative list. This associative list contains an instance/list of procs to call when the event is raised.
var/list/global_listeners = list() // Associative list of instances that listen to all events of this type (as opposed to events belonging to a specific source) and the proc to call.
/singleton/observ/New()
all_observable_events += src
/datum/observ/New()
all_observable_events.events += src
listeners_assoc = list()
..()
/singleton/observ/proc/is_listening(event_source, datum/listener, proc_call)
// Return whether there are global listeners unless the event source is given.
if (!event_source)
return !!global_listeners.len
// Return whether anything is listening to a source, if no listener is given.
if (!listener)
return global_listeners.len || event_sources[event_source]
// Return false if nothing is associated with that source.
if (!event_sources[event_source])
return FALSE
// Get and check the listeners for the reuqested event.
var/listeners = event_sources[event_source]
if (!listeners[listener])
return FALSE
// Return true unless a specific callback needs checked.
if (!proc_call)
return TRUE
// Check if the specific callback exists.
var/list/callback = listeners[listener]
if (!callback)
return FALSE
return (proc_call in callback)
/singleton/observ/proc/has_listeners(event_source)
return is_listening(event_source)
/singleton/observ/proc/register(datum/event_source, datum/listener, proc_call)
// Sanity checking.
if (!(event_source && listener && proc_call))
return FALSE
if (istype(event_source, /singleton/observ))
return FALSE
// Crash if the event source is the wrong type.
if (!istype(event_source, expected_type))
CRASH("Unexpected type. Expected [expected_type], was [event_source.type]")
// Setup the listeners for this source if needed.
var/list/listeners = event_sources[event_source]
if (!listeners)
listeners = list()
event_sources[event_source] = listeners
// Make sure the callbacks are a list.
var/list/callbacks = listeners[listener]
if (!callbacks)
callbacks = list()
listeners[listener] = callbacks
// If the proc_call is already registered skip
if(proc_call in callbacks)
return FALSE
// Add the callback, and return true.
callbacks += proc_call
return TRUE
/singleton/observ/proc/unregister(event_source, datum/listener, proc_call)
// Sanity.
if (!event_source || !listener || !event_sources[event_source])
return FALSE
// Return false if nothing is listening for this event.
var/list/listeners = event_sources[event_source]
/datum/observ/proc/is_listening(var/eventSource, var/datum/procOwner, var/proc_call)
var/listeners = listeners_assoc[eventSource]
if(!listeners)
return FALSE
// Remove all callbacks if no specific one is given.
if (!proc_call)
if(listeners.Remove(listener))
// Perform some cleanup and return true.
var/stored_proc_call = listeners[procOwner]
return stored_proc_call && (!proc_call || stored_proc_call == proc_call)
/datum/observ/proc/has_listeners(var/eventSource)
var/list/listeners = listeners_assoc[eventSource]
return LAZYLEN(listeners)
/datum/observ/proc/register(var/eventSource, var/datum/procOwner, var/proc_call)
if(!(eventSource && procOwner && procOwner))
return FALSE
if(istype(eventSource, /datum/observ))
return FALSE
if(!istype(eventSource, expected_type))
CRASH("Unexpected type. Expected [expected_type], was [eventSource]")
LAZYINITLIST(listeners_assoc[eventSource])
listeners_assoc[eventSource][procOwner] = proc_call
destroyed_event.register(procOwner, src, /datum/observ/proc/unregister)
return TRUE
/datum/observ/proc/unregister(var/eventSource, var/datum/procOwner)
if(!(eventSource && procOwner))
return FALSE
if(istype(eventSource, /datum/observ))
return FALSE
var/list/listeners = listeners_assoc[eventSource]
if(!listeners)
return FALSE
listeners -= procOwner
if (!listeners.len)
event_sources -= event_source
return TRUE
return FALSE
// See if the listener is registered.
var/list/callbacks = listeners[listener]
if (!callbacks)
return FALSE
// See if the callback exists.
if(!callbacks.Remove(proc_call))
return FALSE
if (!callbacks.len)
listeners -= listener
if (!listeners.len)
event_sources -= event_source
listeners_assoc -= eventSource
destroyed_event.unregister(procOwner, src)
return TRUE
/singleton/observ/proc/register_global(datum/listener, proc_call)
// Sanity.
if (!(listener && proc_call))
return FALSE
// Make sure the callbacks are setup.
var/list/callbacks = global_listeners[listener]
if (!callbacks)
callbacks = list()
global_listeners[listener] = callbacks
// Add the callback and return true.
callbacks |= proc_call
return TRUE
/singleton/observ/proc/unregister_global(datum/listener, proc_call)
// Return false unless the listener is set as a global listener.
if (!(listener && global_listeners[listener]))
return FALSE
// Remove all callbacks if no specific one is given.
if (!proc_call)
global_listeners -= listener
return TRUE
// See if the listener is registered.
var/list/callbacks = global_listeners[listener]
if (!callbacks)
return FALSE
// See if the callback exists.
if(!callbacks.Remove(proc_call))
return FALSE
if (!callbacks.len)
global_listeners -= listener
return TRUE
/singleton/observ/proc/raise_event()
// Sanity
/datum/observ/proc/raise_event(...)
if(!args.len)
return FALSE
if (global_listeners.len)
// Call the global listeners.
for (var/listener in global_listeners)
var/list/callbacks = global_listeners[listener]
for (var/proc_call in callbacks)
// If the callback crashes, record the error and remove it.
try
call(listener, proc_call)(arglist(args))
catch (var/exception/e)
error("[e.name] - [e.file] - [e.line]")
error(e.desc)
unregister_global(listener, proc_call)
// Call the listeners for this specific event source, if they exist.
var/source = args[1]
if (source && event_sources[source])
var/list/listeners = event_sources[source]
return
var/listeners = listeners_assoc[args[1]]
if(!listeners)
return
for(var/listener in listeners)
var/list/callbacks = listeners[listener]
for (var/proc_call in callbacks)
// If the callback crashes, record the error and remove it.
try
call(listener, proc_call)(arglist(args))
catch (var/exception/e)
error("[e.name] - [e.file] - [e.line]")
error(e.desc)
unregister(source, listener, proc_call)
return TRUE
call(listener, listeners[listener])(arglist(args))

View File

@@ -8,9 +8,9 @@
// /old_see_in_dark: see_in_dark before the change
// /new_see_in_dark: see_in_dark after the change
var/singleton/observ/see_in_dark_set/see_in_dark_set_event = new()
var/datum/observ/see_in_dark_set/see_in_dark_set_event = new()
/singleton/observ/see_in_dark_set
/datum/observ/see_in_dark_set
name = "See In Dark Set"
expected_type = /mob

View File

@@ -8,9 +8,9 @@
// /old_see_invisible: see_invisible before the change
// /new_see_invisible: see_invisible after the change
var/singleton/observ/see_invisible_set/see_invisible_set_event = new()
var/datum/observ/see_invisible_set/see_invisible_set_event = new()
/singleton/observ/see_invisible_set
/datum/observ/see_invisible_set
name = "See Invisible Set"
expected_type = /mob

View File

@@ -18,15 +18,15 @@
// /obj/effect/shuttle_landmark/old_location: the old location's shuttle landmark
// /obj/effect/shuttle_landmark/new_location: the new location's shuttle landmark
var/singleton/observ/shuttle_moved/shuttle_moved_event = new()
var/datum/observ/shuttle_moved/shuttle_moved_event = new()
/singleton/observ/shuttle_moved
/datum/observ/shuttle_moved
name = "Shuttle Moved"
expected_type = /datum/shuttle
var/singleton/observ/shuttle_pre_move/shuttle_pre_move_event = new()
var/datum/observ/shuttle_pre_move/shuttle_pre_move_event = new()
/singleton/observ/shuttle_pre_move
/datum/observ/shuttle_pre_move
name = "Shuttle Pre Move"
expected_type = /datum/shuttle

View File

@@ -8,9 +8,9 @@
// /old_sight: sight before the change
// /new_sight: sight after the change
var/singleton/observ/sight_set/sight_set_event = new()
var/datum/observ/sight_set/sight_set_event = new()
/singleton/observ/sight_set
/datum/observ/sight_set
name = "Sight Set"
expected_type = /mob

View File

@@ -0,0 +1,51 @@
/var/repository/decls/decls_repository = new()
/repository/decls
var/list/fetched_decls
var/list/fetched_decl_types
var/list/fetched_decl_subtypes
/repository/decls/New()
..()
fetched_decls = list()
fetched_decl_types = list()
fetched_decl_subtypes = list()
/repository/decls/proc/get_decl(var/decl_type)
. = fetched_decls[decl_type]
if(!.)
. = new decl_type()
fetched_decls[decl_type] = .
var/decl/decl = .
if(istype(decl))
decl.Initialize()
/repository/decls/proc/get_decls(var/list/decl_types)
. = list()
for(var/decl_type in decl_types)
.[decl_type] = get_decl(decl_type)
/repository/decls/proc/get_decls_unassociated(var/list/decl_types)
. = list()
for(var/decl_type in decl_types)
. += get_decl(decl_type)
/repository/decls/proc/get_decls_of_type(var/decl_prototype)
. = fetched_decl_types[decl_prototype]
if(!.)
. = get_decls(typesof(decl_prototype))
fetched_decl_types[decl_prototype] = .
/repository/decls/proc/get_decls_of_subtype(var/decl_prototype)
. = fetched_decl_subtypes[decl_prototype]
if(!.)
. = get_decls(subtypesof(decl_prototype))
fetched_decl_subtypes[decl_prototype] = .
/decl/proc/Initialize()
return
/decl/Destroy()
SHOULD_CALL_PARENT(FALSE)
return QDEL_HINT_LETMELIVE // Prevents Decl destruction

View File

@@ -1,178 +0,0 @@
var/global/repository/singletons/Singletons = new
/repository/singletons
/// A cache of individual singletons as (/singleton/path = Instance, ...)
var/static/list/instances = list()
/// A map of (/singleton/path = TRUE, ...). Indicates whether a path has been tried for instances.
var/static/list/resolved_instances = list()
/// A cache of singleton types according to a parent type as (/singleton/path = list(/singleton/path = Instance, /singleton/path/foo = Instance, ...))
var/static/list/type_maps = list()
/// A map of (/singleton/path = TRUE, ...). Indicates whether a path has been tried for type_maps.
var/static/list/resolved_type_maps = list()
/// A cache of singleton subtypes according to a parent type as (/singleton/path = list(/singleton/path/foo = Instance, ...))
var/static/list/subtype_maps = list()
/// A map of (/singleton/path = TRUE, ...). Indicates whether a path has been tried for subtype_maps.
var/static/list/resolved_subtype_maps = list()
/// A cache of singleton types according to a parent type as (/singleton/path = list(Parent Instance, Subtype Instance, ...))
var/static/list/type_lists = list()
/// A map of (/singleton/path = TRUE, ...). Indicates whether a path has been tried for type_lists.
var/static/list/resolved_type_lists = list()
/// A cache of singleton subtypes according to a parent type as (/singleton/path = list(Subtype Instance, Subtype Instance, ...))
var/static/list/subtype_lists = list()
/// A map of (/singleton/path = TRUE, ...). Indicates whether a path has been tried for subtype_lists.
var/static/list/resolved_subtype_lists = list()
/**
* Get a singleton instance according to path. Creates it if necessary. Null if abstract or not a singleton.
* Prefer the GET_SINGLETON macro to minimize proc calls.
*/
/repository/singletons/proc/GetInstanceOf(singleton/path)
if (!ispath(path, /singleton))
return
if (resolved_instances[path])
return instances[path]
resolved_instances[path] = TRUE
if (is_abstract(path))
return
var/singleton/result = new path
instances[path] = result
result.Initialize()
return result
/**
* Get a singleton instance according to object. Creates it if necessary. Null if abstract or not a singleton.
* Prefer the GET_SINGLETON macro to minimize proc calls.
* WARNING: this is NOT the one from Bay, use GetInstanceOf for that!
*/
/repository/singletons/proc/GetInstance(singleton/decl_type)
if (resolved_instances[decl_type.type])
return instances[decl_type.type]
resolved_instances[decl_type.type] = TRUE
var/singleton/result = instances[decl_type.type]
if(!result)
result = new decl_type()
instances[decl_type.type] = result
var/singleton/decl = result
if(istype(decl))
decl.Initialize()
return result
/// Get a (path = instance) map of valid singletons according to paths.
/repository/singletons/proc/GetMap(list/singleton/paths)
var/list/result = list()
for (var/path in paths)
var/singleton/instance = GetInstanceOf(path)
if (!instance)
continue
result[path] = instance
return result
/// Get a list of valid singletons according to paths.
/repository/singletons/proc/GetList(list/singleton/paths)
var/list/result = list()
for (var/path in paths)
var/singleton/instance = GetInstanceOf(path)
if (!instance)
continue
result += instance
return result
/**
* Get a (path = instance) map of valid singletons according to typesof(path).
* Prefer the GET_SINGLETON_TYPE_MAP macro to minimize proc calls.
*/
/repository/singletons/proc/GetTypeMap(singleton/path)
if (resolved_type_maps[path])
return type_maps[path] || list()
resolved_type_maps[path] = TRUE
var/result = GetMap(typesof(path))
type_maps[path] = result
return result
/**
* Get a (path = instance) map of valid singletons according to subtypesof(path).
* Prefer the GET_SINGLETON_TYPE_MAP macro to minimize proc calls.
*/
/repository/singletons/proc/GetSubtypeMap(singleton/path)
if (resolved_subtype_maps[path])
return subtype_maps[path] || list()
resolved_subtype_maps[path] = TRUE
var/result = GetMap(subtypesof(path))
subtype_maps[path] = result
return result
/**
* Get a list of valid singletons according to typesof(path).
* Prefer the GET_SINGLETON_TYPE_LIST macro to minimize proc calls.
*/
/repository/singletons/proc/GetTypeList(singleton/path)
if (resolved_type_lists[path])
return type_lists[path] || list()
resolved_type_lists[path] = TRUE
var/result = GetList(typesof(path))
type_lists[path] = result
return result
/**
* Get a list of valid singletons according to subtypesof(path).
* Prefer the GET_SINGLETON_SUBTYPE_MAP macro to minimize proc calls.
*/
/repository/singletons/proc/GetSubtypeListOf(singleton/path)
if (resolved_subtype_lists[path])
return subtype_lists[path] || list()
resolved_subtype_lists[path] = TRUE
var/result = GetList(subtypesof(path))
subtype_lists[path] = result
return result
/**
* Get a list of valid singletons according to subtypesof(type).
* Prefer the GET_SINGLETON_SUBTYPE_MAP macro to minimize proc calls.
* WARNING: this is NOT the one from Bay, use GetSubtypeListOf for that!
*/
/repository/singletons/proc/GetSubtypeList(singleton/decl_prototype)
if (resolved_subtype_lists[decl_prototype.type])
return subtype_lists[decl_prototype.type] || list()
resolved_subtype_lists[decl_prototype.type] = TRUE
var/singleton/result = subtype_lists[decl_prototype.type]
if(!result)
result = GetList(subtypesof(decl_prototype.type))
subtype_lists[decl_prototype.type] = result
return result
/singleton
abstract_type = /singleton
/singleton/proc/Initialize()
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
/singleton/Destroy()
SHOULD_CALL_PARENT(FALSE)
crash_with("Prevented attempt to delete a singleton instance: [log_info_line(src)]")
return QDEL_HINT_LETMELIVE

View File

@@ -1,4 +1,4 @@
/singleton/xgm_gas/oxygen
/decl/xgm_gas/oxygen
id = GAS_OXYGEN
name = "Oxygen"
specific_heat = 20 // J/(mol*K)
@@ -6,19 +6,19 @@
flags = XGM_GAS_OXIDIZER
/singleton/xgm_gas/nitrogen
/decl/xgm_gas/nitrogen
id = GAS_NITROGEN
name = "Nitrogen"
specific_heat = 20 // J/(mol*K)
molar_mass = 0.028 // kg/mol
/singleton/xgm_gas/carbon_dioxide
/decl/xgm_gas/carbon_dioxide
id = GAS_CO2
name = "Carbon Dioxide"
specific_heat = 30 // J/(mol*K)
molar_mass = 0.044 // kg/mol
/singleton/xgm_gas/phoron
/decl/xgm_gas/phoron
id = GAS_PHORON
name = "Phoron"
@@ -35,14 +35,14 @@
overlay_limit = 0.7
flags = XGM_GAS_FUEL | XGM_GAS_CONTAMINANT
/singleton/xgm_gas/hydrogen
/decl/xgm_gas/hydrogen
id = GAS_HYDROGEN
name = "Hydrogen"
specific_heat = 100
molar_mass = 0.002
flags = XGM_GAS_FUEL
/singleton/xgm_gas/sleeping_agent
/decl/xgm_gas/sleeping_agent
id = GAS_N2O
name = "Nitrous Oxide"
specific_heat = 40 // J/(mol*K)
@@ -51,11 +51,11 @@
overlay_limit = 1
flags = XGM_GAS_OXIDIZER
/singleton/xgm_gas/alium
/decl/xgm_gas/alium
id = GAS_ALIEN
name = "Aliether"
/singleton/xgm_gas/alium/New()
/decl/xgm_gas/alium/New()
var/num = rand(100,999)
name = "Compound #[num]"
specific_heat = rand(1, 400) // J/(mol*K)
@@ -71,7 +71,7 @@
tile_color = RANDOM_RGB
overlay_limit = 0.5
/singleton/xgm_gas/vapor
/decl/xgm_gas/vapor
id = GAS_STEAM
name = "Steam"
tile_overlay = "generic"

View File

@@ -517,14 +517,14 @@
var/obj/effect/decal/cleanable/vomit/this = new /obj/effect/decal/cleanable/vomit(src)
if(istype(inject_reagents) && inject_reagents.total_volume)
inject_reagents.trans_to_obj(this, min(15, inject_reagents.total_volume))
this.reagents.add_reagent(/singleton/reagent/acid/stomach, 5)
this.reagents.add_reagent(/decl/reagent/acid/stomach, 5)
// Make toxins related vomit look different.
if(toxvomit)
this.icon_state = "vomittox_[pick(1,4)]"
/mob/living/proc/handle_additional_vomit_reagents(var/obj/effect/decal/cleanable/vomit/vomit)
vomit.reagents.add_reagent(/singleton/reagent/acid/stomach, 5)
vomit.reagents.add_reagent(/decl/reagent/acid/stomach, 5)
/atom/proc/clean_blood()
if(!simulated)

View File

@@ -336,7 +336,7 @@
. = ..()
if (.)
// Events.
if (moved_event.global_listeners[src])
if (moved_event.listeners_assoc[src])
moved_event.raise_event(src, old_loc, loc)
// Lighting.

View File

@@ -262,9 +262,9 @@
C.SetStunned(0)
C.SetWeakened(0)
C.lying = FALSE
C.reagents.add_reagent(/singleton/reagent/hyperzine, 0.10) //Certainly this can't be abused. - Geeves
C.reagents.add_reagent(/singleton/reagent/oxycomorphine, 0.10)
C.reagents.add_reagent(/singleton/reagent/synaptizine, 0.5) //To counter oxycomorphine's side-effects.
C.reagents.add_reagent(/decl/reagent/hyperzine, 0.10) //Certainly this can't be abused. - Geeves
C.reagents.add_reagent(/decl/reagent/oxycomorphine, 0.10)
C.reagents.add_reagent(/decl/reagent/synaptizine, 0.5) //To counter oxycomorphine's side-effects.
C.update_canmove()
src.verbs -= /mob/proc/changeling_unstun

View File

@@ -85,7 +85,7 @@
/datum/changeling_sting/hallucinate/do_sting(mob/living/target)
..()
if(target.reagents)
addtimer(target.reagents.add_reagent(/singleton/reagent/mindbreaker, 3), rand(5 SECONDS, 15 SECONDS))
addtimer(target.reagents.add_reagent(/decl/reagent/mindbreaker, 3), rand(5 SECONDS, 15 SECONDS))
/mob/proc/changeling_silence_sting()
set category = "Changeling"
@@ -228,7 +228,7 @@
target.Paralyse(10)
target.make_jittery(1000)
if(target.reagents)
target.reagents.add_reagent(/singleton/reagent/toxin/cyanide, 5)
target.reagents.add_reagent(/decl/reagent/toxin/cyanide, 5)
/mob/proc/changeling_extract_dna_sting()
set category = "Changeling"

View File

@@ -44,7 +44,7 @@
pixel_y = 0
if(istype(src,/turf/simulated/floor))
var/turf/simulated/floor/F = src
F.set_flooring(GET_SINGLETON(/singleton/flooring/reinforced/cult))
F.set_flooring(decls_repository.get_decl(/decl/flooring/reinforced/cult))
/turf/proc/cultify_wall()
ChangeTurf(/turf/unsimulated/wall/cult)

View File

@@ -15,8 +15,8 @@
sharp = TRUE
hitsound = 'sound/weapons/bladeslice.ogg'
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
equip_sound = /singleton/sound_category/sword_equip_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
var/does_cult_check = TRUE
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")

View File

@@ -33,7 +33,7 @@
if(target && length(lambs) && (get_turf(target) == get_turf(parent)))
for(var/mob/living/carbon/human/H in lambs)
if(get_turf(H) == get_turf(parent))
if(REAGENT_VOLUME(target.vessel, /singleton/reagent/blood) + 10 > H.species.blood_volume)
if(REAGENT_VOLUME(target.vessel, /decl/reagent/blood) + 10 > H.species.blood_volume)
to_chat(target, SPAN_CULT("You feel refreshed!"))
interrupt()
target.whisper("Sa'ii, ble-nii...")

View File

@@ -429,7 +429,7 @@
/obj/structure/cult/pylon/proc/shatter()
visible_message(SPAN_DANGER("The pylon shatters into shards of crystal!"), SPAN_WARNING("You hear a tinkle of crystal shards."))
playsound(get_turf(src), /singleton/sound_category/glass_break_sound, 75, 1)
playsound(get_turf(src), /decl/sound_category/glass_break_sound, 75, 1)
isbroken = TRUE
if(pylonmode == PYLON_TURRET)
//If the pylon had a soul in it then it plays a creepy evil sound as the soul is released

View File

@@ -1081,7 +1081,7 @@ datum
return 0
drugs
steal_target = /singleton/reagent/space_drugs
steal_target = /decl/reagent/space_drugs
explanation_text = "Steal some space drugs."
weight = 40
@@ -1110,7 +1110,7 @@ datum
pacid
steal_target = /singleton/reagent/acid/polyacid
steal_target = /decl/reagent/acid/polyacid
explanation_text = "Steal some polytrinic acid."
weight = 40
@@ -1149,25 +1149,25 @@ datum
target_name = pick(items)
switch(target_name)
if("Sulphuric acid")
steal_target = /singleton/reagent/acid
steal_target = /decl/reagent/acid
if("Polytrinic acid")
steal_target = /singleton/reagent/acid/polyacid
steal_target = /decl/reagent/acid/polyacid
if("Space Lube")
steal_target = /singleton/reagent/lube
steal_target = /decl/reagent/lube
if("Unstable mutagen")
steal_target = /singleton/reagent/mutagen
steal_target = /decl/reagent/mutagen
if("Leporazine")
steal_target = /singleton/reagent/leporazine
steal_target = /decl/reagent/leporazine
if("Cryptobiolin")
steal_target =/singleton/reagent/cryptobiolin
steal_target =/decl/reagent/cryptobiolin
if("Lexorin")
steal_target = /singleton/reagent/lexorin
steal_target = /decl/reagent/lexorin
if("Kelotane")
steal_target = /singleton/reagent/kelotane
steal_target = /decl/reagent/kelotane
if("Dexalin")
steal_target = /singleton/reagent/dexalin
steal_target = /decl/reagent/dexalin
if("Tricordrazine")
steal_target = /singleton/reagent/tricordrazine
steal_target = /decl/reagent/tricordrazine
explanation_text = "Steal a container filled with [target_name]."

View File

@@ -27,7 +27,7 @@
if(desired_turf) // This shouldn't fail but...
var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(T))
W.create_reagents(60)
W.reagents.add_reagent(/singleton/reagent/water, 60, safety = TRUE)
W.reagents.add_reagent(/decl/reagent/water, 60, safety = TRUE)
W.set_color()
W.set_up(desired_turf)
flick(initial(icon_state),W) // Otherwise pooling causes the animation to stay stuck at the end.
@@ -40,5 +40,5 @@
else
log_and_message_admins("has wetted the floor with [src] at [T.x],[T.y],[T.z].")
else if(hit_atom.reagents && !ismob(hit_atom)) //TODO: Something for the scepter
hit_atom.reagents.add_reagent(/singleton/reagent/water, 60, safety = FALSE)
hit_atom.reagents.add_reagent(/decl/reagent/water, 60, safety = FALSE)
adjust_instability(5)

View File

@@ -92,7 +92,7 @@
blood_total = vampire.blood_total
blood_usable = vampire.blood_usable
if (!REAGENT_VOLUME(T.vessel, /singleton/reagent/blood))
if (!REAGENT_VOLUME(T.vessel, /decl/reagent/blood))
to_chat(src, SPAN_DANGER("[T] has no more blood left to give."))
break
@@ -103,7 +103,7 @@
// Alive and not of empty mind.
if (check_drain_target_state(T))
blood = min(15, REAGENT_VOLUME(T.vessel, /singleton/reagent/blood))
blood = min(15, REAGENT_VOLUME(T.vessel, /decl/reagent/blood))
vampire.blood_total += blood
vampire.blood_usable += blood
@@ -121,7 +121,7 @@
frenzy_lower_chance = 0
// SSD/protohuman or dead.
else
blood = min(5, REAGENT_VOLUME(T.vessel, /singleton/reagent/blood))
blood = min(5, REAGENT_VOLUME(T.vessel, /decl/reagent/blood))
vampire.blood_usable += blood
frenzy_lower_chance = 40
@@ -137,7 +137,7 @@
to_chat(src, SPAN_NOTICE(update_msg))
check_vampire_upgrade()
T.vessel.remove_reagent(/singleton/reagent/blood, 5)
T.vessel.remove_reagent(/decl/reagent/blood, 5)
vampire.status &= ~VAMP_DRAINING
@@ -620,10 +620,10 @@
heal_organ_damage(50, 50, FALSE)
blood_used += 3
var/missing_blood = species.blood_volume - REAGENT_VOLUME(vessel, /singleton/reagent/blood)
var/missing_blood = species.blood_volume - REAGENT_VOLUME(vessel, /decl/reagent/blood)
if(missing_blood)
to_heal = min(20, missing_blood)
vessel.add_reagent(/singleton/reagent/blood, to_heal)
vessel.add_reagent(/decl/reagent/blood, to_heal)
blood_used += round(to_heal * 0.1) // gonna need to regen a shitton of blood, since human mobs have around 560 normally
for(var/A in organs)
@@ -837,8 +837,8 @@
to_chat(T, SPAN_NOTICE("You feel pure bliss as [src] touches you."))
vampire.use_blood(50)
T.reagents.add_reagent(/singleton/reagent/rezadone, 3)
T.reagents.add_reagent(/singleton/reagent/oxycomorphine, 0.15) //enough to get back onto their feet
T.reagents.add_reagent(/decl/reagent/rezadone, 3)
T.reagents.add_reagent(/decl/reagent/oxycomorphine, 0.15) //enough to get back onto their feet
// Convert a human into a vampire.
/mob/living/carbon/human/proc/vampire_embrace()
@@ -910,12 +910,12 @@
if(!vampire)
to_chat(src, SPAN_WARNING("Your fangs have disappeared!"))
return
if (!REAGENT_VOLUME(T.vessel, /singleton/reagent/blood))
if (!REAGENT_VOLUME(T.vessel, /decl/reagent/blood))
to_chat(src, SPAN_NOTICE("[T] is now drained of blood. You begin forcing your own blood into their body, spreading the corruption of the Veil to their body."))
drained_all_blood = TRUE
break
T.vessel.remove_reagent(/singleton/reagent/blood, 50)
T.vessel.remove_reagent(/decl/reagent/blood, 50)
if(!drained_all_blood)
vampire.status &= ~VAMP_DRAINING

View File

@@ -71,7 +71,7 @@
suppressing = !suppressing
user.visible_message(SPAN_NOTICE("\The [user] switches [suppressing ? "on" : "off"] \the [src]'s neural suppressor."), intent_message = BUTTON_FLICK)
playsound(loc, /singleton/sound_category/switch_sound, 50, 1)
playsound(loc, /decl/sound_category/switch_sound, 50, 1)
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height = 0, air_group = 0)
if(air_group || (height == 0))

View File

@@ -20,11 +20,11 @@
var/mob/living/carbon/human/occupant = null
var/list/available_chemicals = list(
/singleton/reagent/inaprovaline,
/singleton/reagent/soporific,
/singleton/reagent/perconol,
/singleton/reagent/dylovene,
/singleton/reagent/dexalin
/decl/reagent/inaprovaline,
/decl/reagent/soporific,
/decl/reagent/perconol,
/decl/reagent/dylovene,
/decl/reagent/dexalin
)
var/obj/item/reagent_containers/glass/beaker = null
var/filtering = FALSE
@@ -135,7 +135,7 @@
var/list/list/blood_reagents
for(var/_R in occupant.reagents.reagent_volumes)
var/list/blood_reagent = list()
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
blood_reagent["name"] = R.name
blood_reagent["amount"] = round(REAGENT_VOLUME(occupant.reagents, _R), 0.1)
LAZYADD(blood_reagents, list(blood_reagent))
@@ -149,7 +149,7 @@
var/list/list/stomach_reagents
for(var/_R in S.ingested.reagent_volumes)
var/list/stomach_reagent = list()
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
stomach_reagent["name"] = R.name
stomach_reagent["amount"] = round(REAGENT_VOLUME(S.ingested, _R), 0.1)
LAZYADD(stomach_reagents, list(stomach_reagent))
@@ -163,7 +163,7 @@
for(var/T in available_chemicals)
var/list/reagent = list()
reagent["type"] = T
var/singleton/reagent/C = T
var/decl/reagent/C = T
reagent["name"] = initial(C.name)
reagents += list(reagent)
data["reagents"] = reagents.Copy()
@@ -371,12 +371,12 @@
if(occupant?.reagents)
var/chemical_amount = REAGENT_VOLUME(occupant.reagents, chemical)
var/is_dylo = ispath(chemical, /singleton/reagent/dylovene)
var/is_inaprov = ispath(chemical, /singleton/reagent/inaprovaline)
var/is_dylo = ispath(chemical, /decl/reagent/dylovene)
var/is_inaprov = ispath(chemical, /decl/reagent/inaprovaline)
if(is_dylo || is_inaprov)
var/dylo_amount = REAGENT_VOLUME(occupant.reagents, /singleton/reagent/dylovene)
var/inaprov_amount = REAGENT_VOLUME(occupant.reagents, /singleton/reagent/inaprovaline)
var/tricord_amount = REAGENT_VOLUME(occupant.reagents, /singleton/reagent/tricordrazine)
var/dylo_amount = REAGENT_VOLUME(occupant.reagents, /decl/reagent/dylovene)
var/inaprov_amount = REAGENT_VOLUME(occupant.reagents, /decl/reagent/inaprovaline)
var/tricord_amount = REAGENT_VOLUME(occupant.reagents, /decl/reagent/tricordrazine)
if(tricord_amount > 20)
if(is_dylo && inaprov_amount)
to_chat(user, SPAN_WARNING("The subject has too much tricordrazine."))

View File

@@ -41,7 +41,7 @@
active_power_usage = 1500 //For heating/cooling rooms. 1000 joules equates to about 1 degree every 2 seconds for a single tile of air.
power_channel = ENVIRON
req_one_access = list(access_atmospherics, access_engine_equip)
clicksound = /singleton/sound_category/button_sound
clicksound = /decl/sound_category/button_sound
clickvol = 30
var/alarm_id = null

View File

@@ -35,7 +35,7 @@ var/global/list/bluespace_inhibitors
/obj/machinery/anti_bluespace/emag_act()
spark(src, 3)
playsound(src, /singleton/sound_category/spark_sound, 50, 1)
playsound(src, /decl/sound_category/spark_sound, 50, 1)
emp_act(1)
return TRUE

View File

@@ -7,7 +7,7 @@
use_power = POWER_USE_IDLE
idle_power_usage = 10
active_power_usage = 2000
clicksound = /singleton/sound_category/keyboard_sound
clicksound = /decl/sound_category/keyboard_sound
clickvol = 30
var/print_loc

View File

@@ -28,7 +28,7 @@
#define BIOGEN_MEDICAL "Medical"
#define BIOGEN_ILLEGAL "!@#$%^&*()"
/singleton/biorecipe
/decl/biorecipe
var/name = "fixme"
var/class = BIOGEN_ITEMS
var/object
@@ -36,46 +36,46 @@
var/amount = list(1, 2, 3, 4, 5)
var/emag = FALSE
/singleton/biorecipe/food
/decl/biorecipe/food
name = "Meat Substitute"
class = BIOGEN_FOOD
object = /obj/item/reagent_containers/food/snacks/meat/biogenerated
cost = 50
/singleton/biorecipe/food/fishfillet
/decl/biorecipe/food/fishfillet
name = "Fish Fillet"
object = /obj/item/reagent_containers/food/snacks/fish/fishfillet
/singleton/biorecipe/food/syntiflesh
/decl/biorecipe/food/syntiflesh
name = "Synthetic Meat"
object = /obj/item/reagent_containers/food/snacks/meat/syntiflesh
/singleton/biorecipe/food/soywafers
/decl/biorecipe/food/soywafers
name = "Soy Wafers"
object = /obj/item/reagent_containers/food/snacks/soywafers
cost = 150
/singleton/biorecipe/food/bio_vitamin
/decl/biorecipe/food/bio_vitamin
name = "Flavored Vitamin"
object = /obj/item/reagent_containers/pill/bio_vitamin
amount = list(1,5,10,25,50)
/singleton/biorecipe/food/liquidfood
/decl/biorecipe/food/liquidfood
name = "Food Ration"
object = /obj/item/reagent_containers/food/snacks/liquidfood
cost = 30
/singleton/biorecipe/food/milk
/decl/biorecipe/food/milk
name = "Space Milk (50u)"
object = /obj/item/reagent_containers/food/drinks/milk
cost = 100
/singleton/biorecipe/food/nutrispread
/decl/biorecipe/food/nutrispread
name = "Nutri-spread"
object = /obj/item/reagent_containers/food/snacks/spreads
cost = 80
/singleton/biorecipe/food/enzyme
/decl/biorecipe/food/enzyme
name = "Universal Enzyme (50u)"
object = /obj/item/reagent_containers/food/condiment/enzyme
@@ -83,18 +83,18 @@
FERTILIZER
*/
/singleton/biorecipe/fertilizer
/decl/biorecipe/fertilizer
name = "E-Z-Nutrient (60u)"
class = BIOGEN_FERTILIZER
object = /obj/item/reagent_containers/glass/fertilizer/ez
cost = 60
/singleton/biorecipe/fertilizer/l4z
/decl/biorecipe/fertilizer/l4z
name = "Left 4 Zed (60u)"
object = /obj/item/reagent_containers/glass/fertilizer/l4z
cost = 120
/singleton/biorecipe/fertilizer/rh
/decl/biorecipe/fertilizer/rh
name = "Robust Harvest (60u)"
object = /obj/item/reagent_containers/glass/fertilizer/rh
cost = 180
@@ -102,66 +102,66 @@
/*
ITEMS
*/
/singleton/biorecipe/item
/decl/biorecipe/item
name = "Towel"
class = BIOGEN_ITEMS
object = /obj/item/towel/random
cost = 300
/singleton/biorecipe/item/jug
/decl/biorecipe/item/jug
name = "Empty Jug"
object = /obj/item/reagent_containers/glass/fertilizer
cost = 100
/singleton/biorecipe/item/custom_cigarettes
/decl/biorecipe/item/custom_cigarettes
name = "Empty Cigarettes (x6)"
object = /obj/item/storage/box/fancy/cigarettes/blank
cost = 500
/singleton/biorecipe/item/tape_roll
/decl/biorecipe/item/tape_roll
name = "Tape Roll"
object = /obj/item/tape_roll
cost = 250
/singleton/biorecipe/item/botanic_leather
/decl/biorecipe/item/botanic_leather
name = "Botanical Gloves"
object = /obj/item/clothing/gloves/botanic_leather
cost = 250
/singleton/biorecipe/item/utility
/decl/biorecipe/item/utility
name = "Utility Belt"
object = /obj/item/storage/belt/utility
/singleton/biorecipe/item/hydrobelt
/decl/biorecipe/item/hydrobelt
name = "Hydroponic Belt"
object = /obj/item/storage/belt/hydro
/singleton/biorecipe/item/plantbag
/decl/biorecipe/item/plantbag
name = "Plant Bag"
object = /obj/item/storage/bag/plants
cost = 500
/singleton/biorecipe/item/wallet
/decl/biorecipe/item/wallet
name = "Leather Wallet"
object = /obj/item/storage/wallet
cost = 100
/singleton/biorecipe/item/satchel
/decl/biorecipe/item/satchel
name = "Leather Satchel"
object = /obj/item/storage/backpack/satchel/leather
cost = 400
/singleton/biorecipe/item/cash
/decl/biorecipe/item/cash
name = "Money Bag"
object = /obj/item/storage/bag/money
cost = 400
/singleton/biorecipe/item/soap
/decl/biorecipe/item/soap
name = "Soap"
object = /obj/item/soap/plant
cost = 200
/singleton/biorecipe/item/crayon_box
/decl/biorecipe/item/crayon_box
name = "Crayon Box"
object = /obj/item/storage/box/fancy/crayons
cost = 600
@@ -170,32 +170,32 @@
CONSTRUCTION
*/
/singleton/biorecipe/construction
/decl/biorecipe/construction
name = "Animal Hide"
class = BIOGEN_CONSTRUCTION
object = /obj/item/stack/material/animalhide
cost = 100
amount = list(1,5,10,25,50)
/singleton/biorecipe/construction/leather
/decl/biorecipe/construction/leather
name = "Leather"
object = /obj/item/stack/material/leather
/singleton/biorecipe/construction/cloth
/decl/biorecipe/construction/cloth
name = "Cloth"
object = /obj/item/stack/material/cloth
cost = 50
/singleton/biorecipe/construction/cardboard
/decl/biorecipe/construction/cardboard
name = "Cardboard"
object = /obj/item/stack/material/cardboard
cost = 50
/singleton/biorecipe/construction/wax
/decl/biorecipe/construction/wax
name = "Wax"
object = /obj/item/stack/wax
/singleton/biorecipe/construction/plastic
/decl/biorecipe/construction/plastic
name = "Plastic"
object = /obj/item/stack/material/plastic
@@ -203,79 +203,79 @@
SPECIAL
*/
/singleton/biorecipe/mushroom
/decl/biorecipe/mushroom
name = "Pet Mushroom"
class = BIOGEN_SPECIAL
object = /mob/living/simple_animal/mushroom
cost = 1000
/singleton/biorecipe/cube
/decl/biorecipe/cube
name = "Monkey Cube"
class = BIOGEN_SPECIAL
object = /obj/item/reagent_containers/food/snacks/monkeycube/wrapped
/singleton/biorecipe/cube/stok
/decl/biorecipe/cube/stok
name = "Stok Cube"
object = /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/stokcube
/singleton/biorecipe/cube/farwa
/decl/biorecipe/cube/farwa
name = "Farwa Cube"
object = /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/farwacube
/singleton/biorecipe/cube/neaera
/decl/biorecipe/cube/neaera
name = "Neaera Cube"
object = /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/neaeracube
/singleton/biorecipe/cube/cazador
/decl/biorecipe/cube/cazador
name = "V'krexi Cube"
object = /obj/item/reagent_containers/food/snacks/monkeycube/wrapped/vkrexicube
cost = 500
/singleton/biorecipe/medical
/decl/biorecipe/medical
name = "Bruise Pack"
class = BIOGEN_MEDICAL
object = /obj/item/stack/medical/bruise_pack
cost = 400
/singleton/biorecipe/medical/ointment
/decl/biorecipe/medical/ointment
name = "Burn Ointment"
object = /obj/item/stack/medical/ointment
/singleton/biorecipe/medical/perconol_pill
/decl/biorecipe/medical/perconol_pill
name = "Perconol Pill"
object = /obj/item/reagent_containers/pill/perconol
cost = 250
amount = list(1,2,3,5,7)
/singleton/biorecipe/illegal
/decl/biorecipe/illegal
name = "Advanced Trauma Kit"
class = BIOGEN_ILLEGAL
object = /obj/item/stack/medical/advanced/bruise_pack
cost = 600
emag = TRUE
/singleton/biorecipe/illegal/adv_burn_kit
/decl/biorecipe/illegal/adv_burn_kit
name = "Advanced Burn Kit"
object = /obj/item/stack/medical/advanced/ointment
// Antag Items (Emag)
/singleton/biorecipe/illegal/humanhide
/decl/biorecipe/illegal/humanhide
name = "Human Hide"
object = /obj/item/stack/material/animalhide/human
cost = 50
amount = list(1,5,10,25,50)
/singleton/biorecipe/illegal/syndie
/decl/biorecipe/illegal/syndie
name = "Red Soap"
object = /obj/item/soap/syndie
cost = 200
/singleton/biorecipe/illegal/buckler
/decl/biorecipe/illegal/buckler
name = "Buckler"
object = /obj/item/shield/buckler
cost = 500
/singleton/biorecipe/illegal/tree
/decl/biorecipe/illegal/tree
name = "Tree"
object = /mob/living/simple_animal/hostile/tree
cost = 1000
@@ -380,8 +380,8 @@
dat += "<tr><td colspan='2'>Name</td><td colspan='2'>Cost</td><td colspan='4'>Production Amount</td></tr>"
var/lastclass = "Commands"
for (var/k in GET_SINGLETON_SUBTYPE_MAP(/singleton/biorecipe))
var/singleton/biorecipe/current_recipe = GET_SINGLETON(k)
for (var/k in decls_repository.get_decls_of_subtype(/decl/biorecipe))
var/decl/biorecipe/current_recipe = decls_repository.get_decl(k)
if(emagged || !current_recipe.emag)
if(lastclass != current_recipe.class)
@@ -434,9 +434,9 @@
var/S = 0
for(var/obj/item/reagent_containers/food/snacks/grown/I in contents)
S += 5
if(REAGENT_VOLUME(I.reagents, /singleton/reagent/nutriment) < 0.1)
if(REAGENT_VOLUME(I.reagents, /decl/reagent/nutriment) < 0.1)
points += 1
else points += REAGENT_VOLUME(I.reagents, /singleton/reagent/nutriment) * 10 * eat_eff
else points += REAGENT_VOLUME(I.reagents, /decl/reagent/nutriment) * 10 * eat_eff
qdel(I)
CHECK_TICK
if(S)
@@ -454,12 +454,12 @@
return
/obj/machinery/biogenerator/proc/create_product(var/itemtype, var/count)
if (!ispath(itemtype, /singleton/biorecipe))
if (!ispath(itemtype, /decl/biorecipe))
return FALSE
var/singleton/biorecipe/recipe = GET_SINGLETON(itemtype)
var/decl/biorecipe/recipe = decls_repository.get_decl(itemtype)
if (!ispath(recipe.object)) // this shouldn't happen unless someone tries to create /singleton/biorecipe with href hacking
if (!ispath(recipe.object)) // this shouldn't happen unless someone tries to create /decl/biorecipe with href hacking
return FALSE
if (recipe.emag && !emagged)
@@ -489,7 +489,7 @@
else
points -= totake
use_power_oneoff(totake * 0.25)
playsound(src.loc, /singleton/sound_category/switch_sound, 50, 1)
playsound(src.loc, /decl/sound_category/switch_sound, 50, 1)
intent_message(PING_SOUND)
if(ispath(recipe.object, /obj/item/reagent_containers/pill))
if(!made_container)

View File

@@ -61,8 +61,8 @@
// DNA sample from syringe.
if(!prints_prosthetics && istype(W,/obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = W
if(REAGENT_DATA(S.reagents, /singleton/reagent/blood))
loaded_dna = REAGENT_DATA(S.reagents, /singleton/reagent/blood)
if(REAGENT_DATA(S.reagents, /decl/reagent/blood))
loaded_dna = REAGENT_DATA(S.reagents, /decl/reagent/blood)
S.reagents.clear_reagents()
to_chat(user, "<span class='info'>You inject the blood sample into the bioprinter.</span>")
return TRUE

View File

@@ -448,12 +448,12 @@
VUEUI_SET_CHECK(data["paralysis"], occupant.paralysis, ., data)
VUEUI_SET_CHECK(data["bodytemp"], occupant.bodytemperature, ., data)
VUEUI_SET_CHECK(data["occupant"], !!occupant, ., data)
VUEUI_SET_CHECK(data["norepiAmt"], REAGENT_VOLUME(R, /singleton/reagent/inaprovaline), ., data)
VUEUI_SET_CHECK(data["soporAmt"], REAGENT_VOLUME(R, /singleton/reagent/soporific), ., data)
VUEUI_SET_CHECK(data["bicardAmt"], REAGENT_VOLUME(R, /singleton/reagent/bicaridine), ., data)
VUEUI_SET_CHECK(data["dexAmt"], REAGENT_VOLUME(R, /singleton/reagent/dexalin), ., data)
VUEUI_SET_CHECK(data["dermAmt"], REAGENT_VOLUME(R, /singleton/reagent/dermaline), ., data)
VUEUI_SET_CHECK(data["thetaAmt"], REAGENT_VOLUME(R, /singleton/reagent/thetamycin), ., data)
VUEUI_SET_CHECK(data["norepiAmt"], REAGENT_VOLUME(R, /decl/reagent/inaprovaline), ., data)
VUEUI_SET_CHECK(data["soporAmt"], REAGENT_VOLUME(R, /decl/reagent/soporific), ., data)
VUEUI_SET_CHECK(data["bicardAmt"], REAGENT_VOLUME(R, /decl/reagent/bicaridine), ., data)
VUEUI_SET_CHECK(data["dexAmt"], REAGENT_VOLUME(R, /decl/reagent/dexalin), ., data)
VUEUI_SET_CHECK(data["dermAmt"], REAGENT_VOLUME(R, /decl/reagent/dermaline), ., data)
VUEUI_SET_CHECK(data["thetaAmt"], REAGENT_VOLUME(R, /decl/reagent/thetamycin), ., data)
VUEUI_SET_CHECK(data["otherAmt"], R.total_volume - (data["soporAmt"] + data["dexAmt"] + data["bicardAmt"] + data["norepiAmt"] + data["dermAmt"] + data["thetaAmt"]), ., data)
has_internal_injuries = FALSE
has_external_injuries = FALSE
@@ -662,13 +662,13 @@
"paralysis" = H.paralysis,
"bodytemp" = H.bodytemperature,
"borer_present" = H.has_brain_worms(),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /singleton/reagent/blood),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /decl/reagent/blood),
"disabilities" = H.sdisabilities,
"lung_ruptured" = H.is_lung_ruptured(),
"lung_rescued" = H.is_lung_rescued(),

View File

@@ -66,7 +66,7 @@
icon_state = "light[active]"
/obj/machinery/button/switch/attack_hand()
playsound(src, /singleton/sound_category/switch_sound, 30)
playsound(src, /decl/sound_category/switch_sound, 30)
intent_message(BUTTON_FLICK, 5)
//alternate button with the same functionality, except has a door control sprite instead

View File

@@ -260,7 +260,7 @@
//sparks
spark(loc, 5)
playsound(loc, /singleton/sound_category/spark_sound, 50, 1)
playsound(loc, /decl/sound_category/spark_sound, 50, 1)
/obj/machinery/camera/proc/set_status(var/newstatus)
if (status != newstatus)

View File

@@ -194,8 +194,8 @@
occupant.adjustCloneLoss(-2 * heal_rate)
//So clones don't die of oxyloss in a running pod.
if(REAGENT_VOLUME(occupant.reagents, /singleton/reagent/inaprovaline) < 30)
occupant.reagents.add_reagent(/singleton/reagent/inaprovaline, 60)
if(REAGENT_VOLUME(occupant.reagents, /decl/reagent/inaprovaline) < 30)
occupant.reagents.add_reagent(/decl/reagent/inaprovaline, 60)
occupant.Sleeping(30)
//Also heal some oxyloss ourselves because inaprovaline is so bad at preventing it!!
occupant.adjustOxyLoss(-4)

View File

@@ -234,13 +234,13 @@
"paralysis" = H.paralysis,
"bodytemp" = H.bodytemperature,
"borer_present" = H.has_brain_worms(),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /singleton/reagent/blood),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /decl/reagent/blood),
"disabilities" = H.sdisabilities,
"lung_ruptured" = H.is_lung_ruptured(),
"lung_rescued" = H.is_lung_rescued(),

View File

@@ -6,7 +6,7 @@
anchored = 1.0
idle_power_usage = 300
active_power_usage = 300
clicksound = /singleton/sound_category/keyboard_sound
clicksound = /decl/sound_category/keyboard_sound
var/circuit = null //The path to the circuit board type. If circuit==null, the computer can't be disassembled.
var/processing = 0

View File

@@ -129,7 +129,7 @@
if(!emagged)
emmaged = TRUE
spark(src, 3)
playsound(src, /singleton/sound_category/spark_sound, 50, 1)
playsound(src, /decl/sound_category/spark_sound, 50, 1)
return TRUE
/obj/machinery/computer/slot_machine/ui_interact(mob/living/user)
@@ -172,7 +172,7 @@
spin(usr)
else if(href_list["refund"])
playsound(src, /singleton/sound_category/button_sound, clickvol)
playsound(src, /decl/sound_category/button_sound, clickvol)
if(balance > 0)
give_payout(balance, usr)
balance = 0

View File

@@ -288,8 +288,8 @@
occupant.heal_organ_damage(heal_brute,heal_fire)
else
occupant.adjustFireLoss(3)//Cryopods kill diona. This damage combines with the normal cold temp damage, and their disabled regen
var/has_cryo = REAGENT_VOLUME(occupant.reagents, /singleton/reagent/cryoxadone) >= 1
var/has_clonexa = REAGENT_VOLUME(occupant.reagents, /singleton/reagent/clonexadone) >= 1
var/has_cryo = REAGENT_VOLUME(occupant.reagents, /decl/reagent/cryoxadone) >= 1
var/has_clonexa = REAGENT_VOLUME(occupant.reagents, /decl/reagent/clonexadone) >= 1
var/has_cryo_medicine = has_cryo || has_clonexa
if(beaker && !has_cryo_medicine)
beaker.reagents.trans_to_mob(occupant, 1, CHEM_BLOOD)

View File

@@ -33,7 +33,7 @@
if(req_access.len || req_one_access.len)
req_access = list()
req_one_access = list()
playsound(src.loc, /singleton/sound_category/spark_sound, 100, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 100, 1)
return 1
/obj/machinery/button/remote/attack_hand(mob/user as mob)

View File

@@ -1054,7 +1054,7 @@ About the new airlock wires panel:
cutting = TRUE
else if(istype(tool,/obj/item/melee/energy/blade) || istype(tool,/obj/item/melee/energy/sword))
cut_verb = "slicing"
cut_sound = /singleton/sound_category/spark_sound
cut_sound = /decl/sound_category/spark_sound
cut_delay *= 1
cutting = TRUE
else if(istype(tool,/obj/item/surgery/circular_saw))

View File

@@ -38,7 +38,7 @@
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(loc)
CC.amount = 2
src.density = FALSE
playsound(src, /singleton/sound_category/glass_break_sound, 70, 1)
playsound(src, /decl/sound_category/glass_break_sound, 70, 1)
if(display_message)
visible_message("[src] shatters!")
qdel(src)
@@ -160,7 +160,7 @@
if (istype(I, /obj/item/melee/energy/blade))
if(emag_act(10, user))
spark(src.loc, 5)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
visible_message("<span class='warning'>The glass door was sliced open by [user]!</span>")
return TRUE

View File

@@ -67,7 +67,7 @@ var/list/floor_light_cache = list()
if(user.a_intent == I_HURT && !issmall(user))
if(!isnull(damaged) && !(stat & BROKEN))
visible_message("<span class='danger'>\The [user] smashes \the [src]!</span>")
playsound(src, /singleton/sound_category/glass_break_sound, 70, 1)
playsound(src, /decl/sound_category/glass_break_sound, 70, 1)
update_icon()
stat |= BROKEN
else

View File

@@ -97,7 +97,7 @@
/obj/machinery/gumballmachine/proc/smashgumball()
icon_state = "[initialicon]_broken"
playsound(get_turf(src), /singleton/sound_category/glass_break_sound, 75, 1)
playsound(get_turf(src), /decl/sound_category/glass_break_sound, 75, 1)
if(amountleft)
var/amountleftinside = amountleft
for(var/i = 1;i<=amountleftinside,i++)

View File

@@ -255,7 +255,7 @@
beaker.reagents.trans_to_mob(attached, transfer_amount, CHEM_BLOOD)
update_icon()
if(toggle_stop) // Automatically detaches if the blood volume is at 100%
if((beaker.reagents.has_reagent(/singleton/reagent/blood) || beaker.reagents.has_reagent(/singleton/reagent/saline)) && attached.get_blood_volume() >= 100)
if((beaker.reagents.has_reagent(/decl/reagent/blood) || beaker.reagents.has_reagent(/decl/reagent/saline)) && attached.get_blood_volume() >= 100)
visible_message("\The <b>[src]</b> flashes a warning light, disengaging from [attached]'s [vein.name] automatically!")
playsound(src, 'sound/machines/buzz-two.ogg', 100)
vein = null

View File

@@ -41,7 +41,7 @@
to_chat(user, "A light switch. It is [on? "on" : "off"].")
/obj/machinery/light_switch/attack_hand(mob/user)
playsound(src, /singleton/sound_category/switch_sound, 30)
playsound(src, /decl/sound_category/switch_sound, 30)
on = !on
sync_lights()
intent_message(BUTTON_FLICK, 5)

View File

@@ -442,7 +442,7 @@ Class Procs:
return 1
/obj/machinery/proc/dismantle()
playsound(loc, /singleton/sound_category/crowbar_sound, 50, 1)
playsound(loc, /decl/sound_category/crowbar_sound, 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(loc)
M.set_dir(src.dir)
M.state = 3

View File

@@ -758,7 +758,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
for (var/mob/O in hearers(5, src.loc))
O.show_message("[user.name] smashes the [src.name]!" )
src.isbroken=1
playsound(src.loc, /singleton/sound_category/glass_break_sound, 100, 1)
playsound(src.loc, /decl/sound_category/glass_break_sound, 100, 1)
else
for (var/mob/O in hearers(5, src.loc))
O.show_message("[user.name] forcefully slams the [src.name] with the [I.name]!" )
@@ -937,7 +937,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(curr_page == 0) //We're at the start, get to the middle
src.screen=1
src.curr_page++
playsound(src.loc, /singleton/sound_category/page_sound, 50, 1)
playsound(src.loc, /decl/sound_category/page_sound, 50, 1)
else if(href_list["prev_page"])
if(curr_page == 0)
@@ -949,7 +949,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(curr_page == src.pages+1) //we're at the end, let's go back to the middle.
src.screen = 1
src.curr_page--
playsound(src.loc, /singleton/sound_category/page_sound, 50, 1)
playsound(src.loc, /decl/sound_category/page_sound, 50, 1)
if (istype(src.loc, /mob))
src.attack_self(src.loc)

View File

@@ -430,7 +430,7 @@ var/bomb_set
/obj/machinery/nuclearbomb/station/LateInitialize()
for(var/turf/simulated/floor/T in RANGE_TURFS(1, src))
T.set_flooring(GET_SINGLETON(/singleton/flooring/reinforced/circuit/red))
T.set_flooring(decls_repository.get_decl(/decl/flooring/reinforced/circuit/red))
flash_tiles += T
update_icon()
@@ -459,7 +459,7 @@ var/bomb_set
if(!last_turf_state || target_icon_state != last_turf_state)
for(var/thing in flash_tiles)
var/turf/simulated/floor/T = thing
if(!istype(T.flooring, /singleton/flooring/reinforced/circuit/red))
if(!istype(T.flooring, /decl/flooring/reinforced/circuit/red))
flash_tiles -= T
continue
T.icon_state = target_icon_state

View File

@@ -6,7 +6,7 @@
anchored = FALSE
density = TRUE
use_power = POWER_USE_OFF
clicksound = /singleton/sound_category/switch_sound
clicksound = /decl/sound_category/switch_sound
var/on = FALSE
var/active = 0
var/heating_power = 40 KILOWATTS

View File

@@ -226,7 +226,7 @@
protected = 1
if(!protected)
playsound(src.loc, /singleton/sound_category/spark_sound, 75, 1, -1)
playsound(src.loc, /decl/sound_category/spark_sound, 75, 1, -1)
to_chat(user, "<span class='warning'>You try to touch the controls but you get zapped. There must be a short circuit somewhere.</span>")
return*/
else //welp, the guy is protected, we can continue
@@ -252,7 +252,7 @@
protected = 1
if(!protected)
playsound(src.loc, /singleton/sound_category/spark_sound, 75, 1, -1)
playsound(src.loc, /decl/sound_category/spark_sound, 75, 1, -1)
to_chat(user, "<span class='warning'>You try to touch the controls but you get zapped. There must be a short circuit somewhere.</span>")
return*/
else

View File

@@ -47,7 +47,7 @@
layer = 2.9
anchored = 1
density = 1
clicksound = /singleton/sound_category/button_sound
clicksound = /decl/sound_category/button_sound
var/icon_vend //Icon_state when vending
var/deny_time // How long the physical icon state lasts, used cut the deny overlay

View File

@@ -5,7 +5,7 @@
icon_state = "wm_10"
density = 1
anchored = 1.0
clicksound = /singleton/sound_category/button_sound
clicksound = /decl/sound_category/button_sound
clickvol = 40
var/state = 1

View File

@@ -127,7 +127,7 @@
for(var/id in carried_reagents)
F.reagents.add_reagent(id, 1, safety = 1) //makes a safety call because all reagents should have already reacted anyway
else
F.reagents.add_reagent(/singleton/reagent/water, 1, safety = 1)
F.reagents.add_reagent(/decl/reagent/water, 1, safety = 1)
// wall formed by metal foams, dense and opaque, but easy to break

View File

@@ -10,7 +10,7 @@
var/health
var/burn_point
var/burning
var/hitsound = /singleton/sound_category/swing_hit_sound//generic hit sound.
var/hitsound = /decl/sound_category/swing_hit_sound//generic hit sound.
var/storage_cost
var/slot_flags = 0 //This is used to determine on which slots an item can fit.
var/no_attack_log = 0 //If it's an item we don't want to log attack_logs with, set this to 1
@@ -54,9 +54,9 @@
///Sound used when equipping the item into a valid slot
var/equip_sound = null
///Sound uses when picking the item up (into your hands)
var/pickup_sound = /singleton/sound_category/generic_pickup_sound
var/pickup_sound = /decl/sound_category/generic_pickup_sound
///Sound uses when dropping the item, or when its thrown.
var/drop_sound = /singleton/sound_category/generic_drop_sound // drop sound - this is the default
var/drop_sound = /decl/sound_category/generic_drop_sound // drop sound - this is the default
var/list/armor
var/armor_degradation_speed //How fast armor will degrade, multiplier to blocked damage to get armor damage value.

View File

@@ -30,9 +30,9 @@
icon_state = "honeycomb"
desc = "Dripping with sugary sweetness."
reagents_to_add = list(
/singleton/reagent/nutriment/honey = 10,
/singleton/reagent/nutriment = 0.5,
/singleton/reagent/sugar = 2
/decl/reagent/nutriment/honey = 10,
/decl/reagent/nutriment = 0.5,
/decl/reagent/sugar = 2
)
bitesize = 2

View File

@@ -23,19 +23,19 @@
/obj/item/reagent_containers/glass/beaker/vial/random
flags = 0
var/list/random_reagent_list = list(list(/singleton/reagent/water = 15) = 1, list(/singleton/reagent/spacecleaner = 15) = 1)
var/list/random_reagent_list = list(list(/decl/reagent/water = 15) = 1, list(/decl/reagent/spacecleaner = 15) = 1)
/obj/item/reagent_containers/glass/beaker/vial/random/toxin
random_reagent_list = list(
list(/singleton/reagent/mindbreaker = 10, /singleton/reagent/space_drugs = 20) = 3,
list(/singleton/reagent/mercury = 15) = 3,
list(/singleton/reagent/toxin/carpotoxin = 15) = 2,
list(/singleton/reagent/impedrezene = 15) = 2,
list(/singleton/reagent/toxin/dextrotoxin = 10) = 1,
list(/singleton/reagent/toxin/spectrocybin = 15) = 1,
list(/singleton/reagent/joy = 10, /singleton/reagent/water = 20) = 1,
list(/singleton/reagent/toxin/berserk = 10) = 1,
list(/singleton/reagent/ammonia = 15) = 3)
list(/decl/reagent/mindbreaker = 10, /decl/reagent/space_drugs = 20) = 3,
list(/decl/reagent/mercury = 15) = 3,
list(/decl/reagent/toxin/carpotoxin = 15) = 2,
list(/decl/reagent/impedrezene = 15) = 2,
list(/decl/reagent/toxin/dextrotoxin = 10) = 1,
list(/decl/reagent/toxin/spectrocybin = 15) = 1,
list(/decl/reagent/joy = 10, /decl/reagent/water = 20) = 1,
list(/decl/reagent/toxin/berserk = 10) = 1,
list(/decl/reagent/ammonia = 15) = 3)
/obj/item/reagent_containers/glass/beaker/vial/random/Initialize()
. = ..()
@@ -48,7 +48,7 @@
var/list/names = new
for(var/_R in reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
names += R.name
desc = "Contains [english_list(names)]."
@@ -62,6 +62,6 @@
. = ..()
if(is_open_container())
flags ^= OPENCONTAINER
reagents.add_reagent(/singleton/reagent/venenum,volume)
reagents.add_reagent(/decl/reagent/venenum,volume)
desc = "Contains venenum."
update_icon()

View File

@@ -3,42 +3,42 @@
colour = "#DA0000"
shadeColour = "#810C0C"
colourName = "red"
reagents_to_add = list(/singleton/reagent/crayon_dust/red = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/red = 10)
/obj/item/pen/crayon/orange
icon_state = "crayonorange"
colour = "#FF9300"
shadeColour = "#A55403"
colourName = "orange"
reagents_to_add = list(/singleton/reagent/crayon_dust/orange = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/orange = 10)
/obj/item/pen/crayon/yellow
icon_state = "crayonyellow"
colour = "#FFF200"
shadeColour = "#886422"
colourName = "yellow"
reagents_to_add = list(/singleton/reagent/crayon_dust/yellow = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/yellow = 10)
/obj/item/pen/crayon/green
icon_state = "crayongreen"
colour = "#A8E61D"
shadeColour = "#61840F"
colourName = "green"
reagents_to_add = list(/singleton/reagent/crayon_dust/green = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/green = 10)
/obj/item/pen/crayon/blue
icon_state = "crayonblue"
colour = "#00B7EF"
shadeColour = "#0082A8"
colourName = "blue"
reagents_to_add = list(/singleton/reagent/crayon_dust/blue = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/blue = 10)
/obj/item/pen/crayon/purple
icon_state = "crayonpurple"
colour = "#DA00FF"
shadeColour = "#810CFF"
colourName = "purple"
reagents_to_add = list(/singleton/reagent/crayon_dust/purple = 10)
reagents_to_add = list(/decl/reagent/crayon_dust/purple = 10)
/obj/item/pen/crayon/mime
icon_state = "crayonmime"
@@ -46,7 +46,7 @@
colour = "#FFFFFF"
shadeColour = "#000000"
colourName = "mime"
reagents_to_add = list(/singleton/reagent/crayon_dust/grey = 15)
reagents_to_add = list(/decl/reagent/crayon_dust/grey = 15)
/obj/item/pen/crayon/mime/attack_self(mob/living/user as mob) //inversion
if(colour != "#FFFFFF" && shadeColour != "#000000")
@@ -64,7 +64,7 @@
colour = "#FFF000"
shadeColour = "#000FFF"
colourName = "rainbow"
reagents_to_add = list(/singleton/reagent/crayon_dust/brown = 20)
reagents_to_add = list(/decl/reagent/crayon_dust/brown = 20)
/obj/item/pen/crayon/rainbow/attack_self(mob/living/user as mob)
colour = input(user, "Please select the main colour.", "Crayon colour") as color
@@ -126,7 +126,7 @@
to_chat(user, "You finish drawing.")
target.add_fingerprint(user) // Adds their fingerprints to the floor the crayon is drawn on.
if(reagents && LAZYLEN(reagents_to_add))
for(var/singleton/reagent/R in reagents_to_add)
for(var/decl/reagent/R in reagents_to_add)
reagents.remove_reagent(R,0.5/LAZYLEN(reagents_to_add)) //using crayons reduces crayon dust in it.
if(!reagents.has_all_reagents(reagents_to_add))
to_chat(user, "<span class='warning'>You used up your crayon!</span>")

View File

@@ -116,8 +116,8 @@
if(M.getBrainLoss() > 15)
to_chat(user, SPAN_NOTICE("There's visible lag between left and right pupils' reactions."))
var/list/pinpoint = list(/singleton/reagent/oxycomorphine=1,/singleton/reagent/mortaphenyl=5)
var/list/dilating = list(/singleton/reagent/space_drugs=5,/singleton/reagent/mindbreaker=1)
var/list/pinpoint = list(/decl/reagent/oxycomorphine=1,/decl/reagent/mortaphenyl=5)
var/list/dilating = list(/decl/reagent/space_drugs=5,/decl/reagent/mindbreaker=1)
var/datum/reagents/ingested = H.get_ingested_reagents()
if(H.reagents.has_any_reagent(pinpoint) || ingested.has_any_reagent(pinpoint))
to_chat(user, SPAN_NOTICE("\The [M]'s pupils are already pinpoint and cannot narrow any more."))

View File

@@ -246,7 +246,7 @@
/obj/item/device/lightreplacer/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged
playsound(src.loc, /singleton/sound_category/spark_sound, 100, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 100, 1)
update_icon()
return 1

View File

@@ -71,7 +71,7 @@
if(attached)
to_chat(user, SPAN_NOTICE("You initialize the memory wipe protocols. This procedure will take approximately 30 seconds."))
to_chat(attached, SPAN_WARNING("The computer hums to life and you feel your memories bleed away into nothingness."))
playsound(src.loc, /singleton/sound_category/keyboard_sound, 30, TRUE)
playsound(src.loc, /decl/sound_category/keyboard_sound, 30, TRUE)
wiping = TRUE
update_icon()
if(wipe_bar)

View File

@@ -42,7 +42,7 @@ var/global/list/default_medbay_channels = list(
var/radio_desc = ""
var/const/FREQ_LISTENING = TRUE
var/list/internal_channels
var/clicksound = /singleton/sound_category/button_sound //played sound on usage
var/clicksound = /decl/sound_category/button_sound //played sound on usage
var/clickvol = 10 //volume
var/obj/item/cell/cell = /obj/item/cell/device

View File

@@ -305,7 +305,7 @@ BREATH ANALYZER
var/unknown = 0
var/reagentdata[0]
for(var/_R in H.reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
if(R.scannable)
print_reagent_default_message = FALSE
reagentdata["[_R]"] = "<span class='notice'> [round(REAGENT_VOLUME(H.reagents, _R), 1)]u [R.name]</span>"
@@ -324,7 +324,7 @@ BREATH ANALYZER
if(ingested && ingested.total_volume)
var/unknown = 0
for(var/_R in ingested.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
if(R.scannable)
print_reagent_default_message = FALSE
dat += "<span class='notice'>[R.name] found in subject's stomach.</span>"
@@ -438,13 +438,13 @@ BREATH ANALYZER
if(LAZYLEN(reagents.reagent_volumes) > 1)
to_chat(user, SPAN_WARNING("There isn't enough blood in the sample!"))
return
if(!REAGENT_DATA(reagents, /singleton/reagent/blood))
if(!REAGENT_DATA(reagents, /decl/reagent/blood))
to_chat(user, SPAN_WARNING("The sample was contaminated with non-blood reagents!"))
return
var/list/blood_traces = reagents.reagent_data[/singleton/reagent/blood]["trace_chem"]
var/list/blood_traces = reagents.reagent_data[/decl/reagent/blood]["trace_chem"]
var/list/output_text = list("Trace Chemicals Found:")
for(var/_C in blood_traces)
var/singleton/reagent/C = GET_SINGLETON(_C)
var/decl/reagent/C = decls_repository.get_decl(_C)
if(C.spectro_hidden && !details)
continue
if(details)
@@ -498,7 +498,7 @@ BREATH ANALYZER
var/dat = ""
var/one_percent = O.reagents.total_volume / 100
for (var/_R in O.reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
dat += "\n \t [R][details ? ": [O.reagents.reagent_volumes[_R] / one_percent]%" : ""]"
to_chat(user, SPAN_NOTICE("Chemicals found: [dat]"))
@@ -669,7 +669,7 @@ BREATH ANALYZER
if(H.breathing && H.breathing.total_volume)
var/unknown = 0
for(var/_R in H.breathing.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
var/decl/reagent/R = decls_repository.get_decl(_R)
if(R.scannable)
to_chat(user,"<span class='notice'>[R.name] found in subject's respiratory system.</span>")
else
@@ -739,13 +739,13 @@ BREATH ANALYZER
"paralysis" = H.paralysis,
"bodytemp" = H.bodytemperature,
"borer_present" = H.has_brain_worms(),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /singleton/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /singleton/reagent/blood),
"inaprovaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/inaprovaline),
"dexalin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dexalin),
"stoxin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/soporific),
"bicaridine_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/bicaridine),
"dermaline_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/dermaline),
"thetamycin_amount" = REAGENT_VOLUME(H.reagents, /decl/reagent/thetamycin),
"blood_amount" = REAGENT_VOLUME(H.vessel, /decl/reagent/blood),
"disabilities" = H.sdisabilities,
"lung_ruptured" = H.is_lung_ruptured(),
"lung_rescued" = H.is_lung_rescued(),

View File

@@ -68,7 +68,7 @@
if(O.reagents.total_volume < 1)
to_chat(user, "The [O] is empty.")
else if(O.reagents.total_volume >= 1)
if(O.reagents.has_reagent(/singleton/reagent/acid/polyacid, 1))
if(O.reagents.has_reagent(/decl/reagent/acid/polyacid, 1))
to_chat(user, "The acid chews through the balloon!")
O.reagents.splash(user, reagents.total_volume)
qdel(src)
@@ -555,8 +555,8 @@
icon_state = "katana"
item_state = "katana"
drop_sound = 'sound/items/drop/gun.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
equip_sound = /singleton/sound_category/sword_equip_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
flags = CONDUCT
slot_flags = SLOT_BELT | SLOT_BACK
force = 5
@@ -1240,7 +1240,7 @@
/obj/item/toy/desk
var/on = FALSE
var/activation_sound = /singleton/sound_category/switch_sound
var/activation_sound = /decl/sound_category/switch_sound
/obj/item/toy/desk/update_icon()
if(on)

View File

@@ -55,7 +55,7 @@
/obj/item/trash/waffles
name = "square tray"
icon_state = "waffles"
drop_sound = /singleton/sound_category/tray_hit_sound
drop_sound = /decl/sound_category/tray_hit_sound
/obj/item/trash/plate
name = "plate"
@@ -83,7 +83,7 @@
/obj/item/trash/tray
name = "tray"
icon_state = "tray"
drop_sound = /singleton/sound_category/tray_hit_sound
drop_sound = /decl/sound_category/tray_hit_sound
/obj/item/trash/candle
name = "candle"
@@ -119,7 +119,7 @@
/obj/item/trash/brownies
name = "square tray"
icon_state = "brownies"
drop_sound = /singleton/sound_category/tray_hit_sound
drop_sound = /decl/sound_category/tray_hit_sound
/obj/item/trash/snacktray
name = "snacktray"
@@ -166,7 +166,7 @@
/obj/item/trash/grease //used for generic plattered food. example is lasagna.
name = "square tray"
icon_state = "grease"
drop_sound = /singleton/sound_category/tray_hit_sound
drop_sound = /decl/sound_category/tray_hit_sound
/obj/item/trash/cookiesnack
name = "\improper Carps Ahoy! miniature cookies"

View File

@@ -474,8 +474,8 @@ var/const/NO_EMAG_ACT = -50
desc = "An ID straight from CentCom. Internal Affairs."
icon_state = "ccia"
overlay_state = "ccia"
drop_sound = /singleton/sound_category/generic_drop_sound
pickup_sound = /singleton/sound_category/generic_pickup_sound
drop_sound = /decl/sound_category/generic_drop_sound
pickup_sound = /decl/sound_category/generic_pickup_sound
/obj/item/card/id/ccia/id_flash(var/mob/user)
var/add_text = "Done with prejudice and professionalism, [user.get_pronoun("he")] means business."

View File

@@ -126,22 +126,22 @@ obj/item/clothing/mask/chewable/Destroy()
/obj/item/clothing/mask/chewable/tobacco/bad
name = "chewing tobacco"
desc = "A chewy wad of cheap tobacco. Cut in long strands and treated with syrup so it tastes less like an ash-tray when you stuff it into your face."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/fake = 2)
reagents_to_add = list(/decl/reagent/toxin/tobacco/fake = 2)
/obj/item/clothing/mask/chewable/tobacco/generic
name = "chewing tobacco"
desc = "A chewy wad of tobacco. Cut in long strands and treated with syrup so it doesn't taste like an ash-tray when you stuff it into your face."
reagents_to_add = list(/singleton/reagent/toxin/tobacco = 2)
reagents_to_add = list(/decl/reagent/toxin/tobacco = 2)
/obj/item/clothing/mask/chewable/tobacco/fine
name = "chewing tobacco"
desc = "A chewy wad of fine tobacco. Cut in long strands and treated with syrup so it doesn't taste like an ash-tray when you stuff it into your face."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/rich = 2)
reagents_to_add = list(/decl/reagent/toxin/tobacco/rich = 2)
/obj/item/clothing/mask/chewable/tobacco/nico
name = "nicotine gum"
desc = "A chewy wad of synthetic rubber, laced with nicotine. Possibly the least disgusting method of nicotine delivery."
reagents_to_add = list(/singleton/reagent/mental/nicotine = 2)
reagents_to_add = list(/decl/reagent/mental/nicotine = 2)
icon_state = "nic_gum"
type_butt = /obj/item/trash/spitgum
wrapped = TRUE
@@ -156,7 +156,7 @@ obj/item/clothing/mask/chewable/Destroy()
slot_flags = SLOT_EARS | SLOT_MASK
chem_volume = 50
chewtime = 300
reagents_to_add = list(/singleton/reagent/sugar = 2)
reagents_to_add = list(/decl/reagent/sugar = 2)
/obj/item/trash/spitgum
name = "old gum"
@@ -176,7 +176,7 @@ obj/item/clothing/mask/chewable/Destroy()
/obj/item/clothing/mask/chewable/candy/gum/Initialize()
. = ..()
reagents.add_reagent(pick(/singleton/reagent/drink/banana,/singleton/reagent/drink/berryjuice,/singleton/reagent/drink/grapejuice,/singleton/reagent/drink/lemonjuice,/singleton/reagent/drink/limejuice,/singleton/reagent/drink/orangejuice,/singleton/reagent/drink/watermelonjuice),10)
reagents.add_reagent(pick(/decl/reagent/drink/banana,/decl/reagent/drink/berryjuice,/decl/reagent/drink/grapejuice,/decl/reagent/drink/lemonjuice,/decl/reagent/drink/limejuice,/decl/reagent/drink/orangejuice,/decl/reagent/drink/watermelonjuice),10)
color = reagents.get_color()
update_icon()
@@ -188,7 +188,7 @@ obj/item/clothing/mask/chewable/Destroy()
wrapped = FALSE
/obj/item/clothing/mask/chewable/candy/gum/gumball/medical
reagents_to_add = list(/singleton/reagent/tricordrazine = 5)
reagents_to_add = list(/decl/reagent/tricordrazine = 5)
/obj/item/storage/box/fancy/gum
@@ -243,7 +243,7 @@ obj/item/clothing/mask/chewable/Destroy()
/obj/item/clothing/mask/chewable/candy/lolli/Initialize()
. = ..()
reagents.add_reagent(pick(/singleton/reagent/drink/banana,/singleton/reagent/drink/berryjuice,/singleton/reagent/drink/grapejuice,/singleton/reagent/drink/lemonjuice,/singleton/reagent/drink/limejuice,/singleton/reagent/drink/orangejuice,/singleton/reagent/drink/watermelonjuice),20)
reagents.add_reagent(pick(/decl/reagent/drink/banana,/decl/reagent/drink/berryjuice,/decl/reagent/drink/grapejuice,/decl/reagent/drink/lemonjuice,/decl/reagent/drink/limejuice,/decl/reagent/drink/orangejuice,/decl/reagent/drink/watermelonjuice),20)
color = reagents.get_color()
update_icon()
@@ -255,10 +255,10 @@ obj/item/clothing/mask/chewable/Destroy()
/obj/item/clothing/mask/chewable/candy/lolli/meds/Initialize()
. = ..()
var/singleton/reagent/payload = pick(list(
/singleton/reagent/perconol,
/singleton/reagent/mortaphenyl,
/singleton/reagent/dylovene))
var/decl/reagent/payload = pick(list(
/decl/reagent/perconol,
/decl/reagent/mortaphenyl,
/decl/reagent/dylovene))
reagents.add_reagent(payload, 15)
color = reagents.get_color()
desc = "[desc] This one is labeled '[initial(payload.name)]'."
@@ -266,13 +266,13 @@ obj/item/clothing/mask/chewable/Destroy()
/obj/item/clothing/mask/chewable/candy/lolli/weak_meds
name = "medicine lollipop"
desc = "A sucrose sphere on a small handle, it has been infused with medication."
reagents_to_add = list(/singleton/reagent/sugar = 6)
reagents_to_add = list(/decl/reagent/sugar = 6)
/obj/item/clothing/mask/chewable/candy/lolli/weak_meds/Initialize()
. = ..()
var/singleton/reagent/payload = pick(list(
/singleton/reagent/dylovene,
/singleton/reagent/inaprovaline))
var/decl/reagent/payload = pick(list(
/decl/reagent/dylovene,
/decl/reagent/inaprovaline))
reagents.add_reagent(payload, 15)
color = reagents.get_color()
desc = "[desc] This one is labeled '[initial(payload.name)]'."

View File

@@ -200,15 +200,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM
playsound(src, 'sound/items/cigs_lighters/cig_light.ogg', 75, 1, -1)
src.reagents.set_temperature(T0C + 45)
damtype = "fire"
if(REAGENT_VOLUME(reagents, /singleton/reagent/toxin/phoron)) // the phoron explodes when exposed to fire
if(REAGENT_VOLUME(reagents, /decl/reagent/toxin/phoron)) // the phoron explodes when exposed to fire
var/datum/effect/effect/system/reagents_explosion/e = new()
e.set_up(round(REAGENT_VOLUME(reagents, /singleton/reagent/toxin/phoron) / 2.5, 1), get_turf(src), 0, 0)
e.set_up(round(REAGENT_VOLUME(reagents, /decl/reagent/toxin/phoron) / 2.5, 1), get_turf(src), 0, 0)
e.start()
qdel(src)
return
if(REAGENT_VOLUME(reagents, /singleton/reagent/fuel)) // the fuel explodes, too, but much less violently
if(REAGENT_VOLUME(reagents, /decl/reagent/fuel)) // the fuel explodes, too, but much less violently
var/datum/effect/effect/system/reagents_explosion/e = new()
e.set_up(round(REAGENT_VOLUME(reagents, /singleton/reagent/fuel) / 5, 1), get_turf(src), 0, 0)
e.set_up(round(REAGENT_VOLUME(reagents, /decl/reagent/fuel) / 5, 1), get_turf(src), 0, 0)
e.start()
qdel(src)
return
@@ -312,8 +312,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
weldermes = "<span class='notice'>USER casually lights the NAME with FLAME.</span>"
ignitermes = "<span class='notice'>USER fiddles with FLAME, and manages to light their NAME.</span>"
reagents_to_add = list(
/singleton/reagent/toxin/tobacco = 10,
/singleton/reagent/mental/nicotine = 5
/decl/reagent/toxin/tobacco = 10,
/decl/reagent/mental/nicotine = 5
)
/obj/item/clothing/mask/smokable/cigarette/attackby(obj/item/W as obj, mob/user as mob)
@@ -373,15 +373,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/cigarette/vanilla
burn_rate = 0.015
reagents_to_add = list(/singleton/reagent/toxin/tobacco = 15)
reagents_to_add = list(/decl/reagent/toxin/tobacco = 15)
/obj/item/clothing/mask/smokable/cigarette/acmeco
burn_rate = 0.015
reagents_to_add = list(
/singleton/reagent/toxin/tobacco = 5,
/singleton/reagent/mental/nicotine = 5,
/singleton/reagent/lexorin = 2,
/singleton/reagent/serotrotium = 3
/decl/reagent/toxin/tobacco = 5,
/decl/reagent/mental/nicotine = 5,
/decl/reagent/lexorin = 2,
/decl/reagent/serotrotium = 3
)
/obj/item/clothing/mask/smokable/cigarette/blank
@@ -391,28 +391,28 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/cigarette/dromedaryco
reagents_to_add = list(
/singleton/reagent/toxin/tobacco = 5,
/singleton/reagent/mental/nicotine = 10
/decl/reagent/toxin/tobacco = 5,
/decl/reagent/mental/nicotine = 10
)
/obj/item/clothing/mask/smokable/cigarette/nicotine
reagents_to_add = list(
/singleton/reagent/toxin/tobacco/rich = 5,
/singleton/reagent/mental/nicotine = 10
/decl/reagent/toxin/tobacco/rich = 5,
/decl/reagent/mental/nicotine = 10
)
/obj/item/clothing/mask/smokable/cigarette/rugged
reagents_to_add = list(
/singleton/reagent/toxin/tobacco/fake = 10,
/singleton/reagent/mental/nicotine = 5
/decl/reagent/toxin/tobacco/fake = 10,
/decl/reagent/mental/nicotine = 5
)
/obj/item/clothing/mask/smokable/cigarette/adhomai
name = "adhomian cigarette"
desc = "An adhomian cigarette made from processed S'rendarr's Hand."
reagents_to_add = list(
/singleton/reagent/toxin/tobacco = 5,
/singleton/reagent/mental/nicotine = 5
/decl/reagent/toxin/tobacco = 5,
/decl/reagent/mental/nicotine = 5
)
////////////
@@ -437,8 +437,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
drop_sound = 'sound/items/drop/gloves.ogg'
pickup_sound = 'sound/items/pickup/gloves.ogg'
reagents_to_add = list(
/singleton/reagent/toxin/tobacco/rich = 25,
/singleton/reagent/mental/nicotine = 5
/decl/reagent/toxin/tobacco/rich = 25,
/decl/reagent/mental/nicotine = 5
)
/obj/item/clothing/mask/smokable/cigarette/cigar/havana
@@ -451,9 +451,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
type_butt = /obj/item/trash/cigbutt/cigarbutt/alt
chem_volume = 60
reagents_to_add = list(
/singleton/reagent/toxin/tobacco/rich = 15,
/singleton/reagent/mental/nicotine = 5,
/singleton/reagent/tricordrazine = 10
/decl/reagent/toxin/tobacco/rich = 15,
/decl/reagent/mental/nicotine = 5,
/decl/reagent/tricordrazine = 10
)
/obj/item/clothing/mask/smokable/cigarette/cigar/cohiba
@@ -466,9 +466,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
type_butt = /obj/item/trash/cigbutt/cigarbutt/alt
chem_volume = 120
reagents_to_add = list(
/singleton/reagent/toxin/tobacco/rich = 30,
/singleton/reagent/mental/nicotine = 10,
/singleton/reagent/tricordrazine = 20
/decl/reagent/toxin/tobacco/rich = 30,
/decl/reagent/mental/nicotine = 10,
/decl/reagent/tricordrazine = 20
)
/obj/item/trash/cigbutt
@@ -511,7 +511,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_off = "sausageoff"
type_butt = /obj/item/trash/cigbutt/sausagebutt
chem_volume = 6
reagents_to_add = list(/singleton/reagent/nutriment/protein = 6)
reagents_to_add = list(/decl/reagent/nutriment/protein = 6)
/obj/item/trash/cigbutt/sausagebutt
name = "sausage butt"

View File

@@ -263,39 +263,39 @@ obj/item/clothing/mask/smokable/ecig/util/examine(mob/user)
/obj/item/reagent_containers/ecig_cartridge/blanknico
name = "flavorless nicotine cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says you can add whatever flavoring agents you want."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 5, /singleton/reagent/water = 10)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 5, /decl/reagent/water = 10)
/obj/item/reagent_containers/ecig_cartridge/med_nicotine
name = "tobacco flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its tobacco flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 5, /singleton/reagent/water = 15)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 5, /decl/reagent/water = 15)
/obj/item/reagent_containers/ecig_cartridge/high_nicotine
name = "high nicotine tobacco flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its tobacco flavored, with extra nicotine."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 10, /singleton/reagent/water = 10)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 10, /decl/reagent/water = 10)
/obj/item/reagent_containers/ecig_cartridge/orange
name = "orange flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its orange flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 5, /singleton/reagent/water = 10, /singleton/reagent/drink/orangejuice = 5)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 5, /decl/reagent/water = 10, /decl/reagent/drink/orangejuice = 5)
/obj/item/reagent_containers/ecig_cartridge/watermelon
name = "watermelon flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its watermelon flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 10, /singleton/reagent/water = 10, /singleton/reagent/drink/watermelonjuice = 5)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 10, /decl/reagent/water = 10, /decl/reagent/drink/watermelonjuice = 5)
/obj/item/reagent_containers/ecig_cartridge/grape
name = "grape flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its grape flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 10, /singleton/reagent/water = 10, /singleton/reagent/drink/grapejuice = 5)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 10, /decl/reagent/water = 10, /decl/reagent/drink/grapejuice = 5)
/obj/item/reagent_containers/ecig_cartridge/lemonlime
name = "lemon-lime flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its lemon-lime flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 10, /singleton/reagent/water = 10, /singleton/reagent/drink/lemon_lime = 5)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 10, /decl/reagent/water = 10, /decl/reagent/drink/lemon_lime = 5)
/obj/item/reagent_containers/ecig_cartridge/coffee
name = "coffee flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its coffee flavored."
reagents_to_add = list(/singleton/reagent/toxin/tobacco/liquid = 10, /singleton/reagent/water = 10, /singleton/reagent/drink/coffee = 5)
reagents_to_add = list(/decl/reagent/toxin/tobacco/liquid = 10, /decl/reagent/water = 10, /decl/reagent/drink/coffee = 5)

View File

@@ -76,7 +76,7 @@
/obj/item/reagent_containers/extinguisher_refill/filled/Initialize()
. = ..()
reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, volume)
reagents.add_reagent(/decl/reagent/toxin/fertilizer/monoammoniumphosphate, volume)
flags &= ~OPENCONTAINER
/obj/item/extinguisher
@@ -123,7 +123,7 @@
/obj/item/extinguisher/New()
create_reagents(max_water)
reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, max_water)
reagents.add_reagent(/decl/reagent/toxin/fertilizer/monoammoniumphosphate, max_water)
..()
/obj/item/extinguisher/examine(mob/user)

View File

@@ -201,9 +201,9 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/aluminum, 30)
B2.reagents.add_reagent(/singleton/reagent/foaming_agent, 10)
B2.reagents.add_reagent(/singleton/reagent/acid/polyacid, 10)
B1.reagents.add_reagent(/decl/reagent/aluminum, 30)
B2.reagents.add_reagent(/decl/reagent/foaming_agent, 10)
B2.reagents.add_reagent(/decl/reagent/acid/polyacid, 10)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -222,11 +222,11 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/aluminum, 15)
B1.reagents.add_reagent(/singleton/reagent/fuel,20)
B2.reagents.add_reagent(/singleton/reagent/toxin/phoron, 15)
B2.reagents.add_reagent(/singleton/reagent/acid, 15)
B1.reagents.add_reagent(/singleton/reagent/fuel,20)
B1.reagents.add_reagent(/decl/reagent/aluminum, 15)
B1.reagents.add_reagent(/decl/reagent/fuel,20)
B2.reagents.add_reagent(/decl/reagent/toxin/phoron, 15)
B2.reagents.add_reagent(/decl/reagent/acid, 15)
B1.reagents.add_reagent(/decl/reagent/fuel,20)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -245,10 +245,10 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/toxin/plantbgone, 25)
B1.reagents.add_reagent(/singleton/reagent/potassium, 25)
B2.reagents.add_reagent(/singleton/reagent/phosphorus, 25)
B2.reagents.add_reagent(/singleton/reagent/sugar, 25)
B1.reagents.add_reagent(/decl/reagent/toxin/plantbgone, 25)
B1.reagents.add_reagent(/decl/reagent/potassium, 25)
B2.reagents.add_reagent(/decl/reagent/phosphorus, 25)
B2.reagents.add_reagent(/decl/reagent/sugar, 25)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -267,12 +267,12 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/sugar, 20)
B1.reagents.add_reagent(/singleton/reagent/potassium,20)
B1.reagents.add_reagent(/singleton/reagent/soporific, 10)
B1.reagents.add_reagent(/singleton/reagent/dylovene, 10)
B2.reagents.add_reagent(/singleton/reagent/polysomnine,40)
B2.reagents.add_reagent(/singleton/reagent/phosphorus,20)
B1.reagents.add_reagent(/decl/reagent/sugar, 20)
B1.reagents.add_reagent(/decl/reagent/potassium,20)
B1.reagents.add_reagent(/decl/reagent/soporific, 10)
B1.reagents.add_reagent(/decl/reagent/dylovene, 10)
B2.reagents.add_reagent(/decl/reagent/polysomnine,40)
B2.reagents.add_reagent(/decl/reagent/phosphorus,20)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -291,9 +291,9 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/surfactant, 40)
B2.reagents.add_reagent(/singleton/reagent/water, 40)
B2.reagents.add_reagent(/singleton/reagent/spacecleaner, 10)
B1.reagents.add_reagent(/decl/reagent/surfactant, 40)
B2.reagents.add_reagent(/decl/reagent/water, 40)
B2.reagents.add_reagent(/decl/reagent/spacecleaner, 10)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -312,9 +312,9 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/surfactant, 40)
B2.reagents.add_reagent(/singleton/reagent/water, 40)
B2.reagents.add_reagent(/singleton/reagent/antifuel, 10)
B1.reagents.add_reagent(/decl/reagent/surfactant, 40)
B2.reagents.add_reagent(/decl/reagent/water, 40)
B2.reagents.add_reagent(/decl/reagent/antifuel, 10)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -333,10 +333,10 @@
var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/toxin/cardox, 40)
B1.reagents.add_reagent(/singleton/reagent/potassium, 40)
B2.reagents.add_reagent(/singleton/reagent/phosphorus, 40)
B2.reagents.add_reagent(/singleton/reagent/sugar, 40)
B1.reagents.add_reagent(/decl/reagent/toxin/cardox, 40)
B1.reagents.add_reagent(/decl/reagent/potassium, 40)
B2.reagents.add_reagent(/decl/reagent/phosphorus, 40)
B2.reagents.add_reagent(/decl/reagent/sugar, 40)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -356,11 +356,11 @@
var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/phosphorus, 40)
B1.reagents.add_reagent(/singleton/reagent/potassium, 40)
B1.reagents.add_reagent(/singleton/reagent/capsaicin/condensed, 40)
B2.reagents.add_reagent(/singleton/reagent/sugar, 40)
B2.reagents.add_reagent(/singleton/reagent/capsaicin/condensed, 80)
B1.reagents.add_reagent(/decl/reagent/phosphorus, 40)
B1.reagents.add_reagent(/decl/reagent/potassium, 40)
B1.reagents.add_reagent(/decl/reagent/capsaicin/condensed, 40)
B2.reagents.add_reagent(/decl/reagent/sugar, 40)
B2.reagents.add_reagent(/decl/reagent/capsaicin/condensed, 80)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
@@ -379,10 +379,10 @@
var/obj/item/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent(/singleton/reagent/surfactant, 40)
B1.reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, 20)
B2.reagents.add_reagent(/singleton/reagent/water, 40)
B2.reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, 20)
B1.reagents.add_reagent(/decl/reagent/surfactant, 40)
B1.reagents.add_reagent(/decl/reagent/toxin/fertilizer/monoammoniumphosphate, 20)
B2.reagents.add_reagent(/decl/reagent/water, 40)
B2.reagents.add_reagent(/decl/reagent/toxin/fertilizer/monoammoniumphosphate, 20)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)

View File

@@ -6,5 +6,5 @@
/obj/item/grenade/fake/prime()
active = 0
playsound(src.loc, get_sfx(/singleton/sound_category/explosion_sound), 50, 1, 30)
playsound(src.loc, get_sfx(/decl/sound_category/explosion_sound), 50, 1, 30)
icon_state = "frag"

View File

@@ -17,8 +17,8 @@
can_embed = 0
var/parry_chance = 40
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
equip_sound = /singleton/sound_category/sword_equip_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
/obj/item/material/sword/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
var/parry_bonus = 1

View File

@@ -21,7 +21,7 @@
var/wielded = 0
var/force_wielded = 0
var/force_unwielded
var/wield_sound = /singleton/sound_category/generic_wield_sound
var/wield_sound = /decl/sound_category/generic_wield_sound
var/unwield_sound = null
var/base_name
var/unwielded_force_divisor = 0.25
@@ -33,8 +33,8 @@
slot_r_hand_str = 'icons/mob/items/weapons/righthand_twohanded.dmi'
)
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
equip_sound = /singleton/sound_category/sword_equip_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
hitsound = 'sound/weapons/bladeslice.ogg'
/obj/item/material/twohanded/proc/wield()
@@ -92,7 +92,7 @@
/obj/item/material/twohanded/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(wielded && default_parry_check(user, attacker, damage_source) && prob(parry_chance))
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
playsound(user.loc, /singleton/sound_category/punchmiss_sound, 50, 1)
playsound(user.loc, /decl/sound_category/punchmiss_sound, 50, 1)
return PROJECTILE_STOPPED
return FALSE
@@ -352,7 +352,7 @@
applies_material_colour = FALSE
default_material = "steel"
parry_chance = 5
var/fuel_type = /singleton/reagent/fuel
var/fuel_type = /decl/reagent/fuel
var/opendelay = 30 // How long it takes to perform a door opening action with this chainsaw, in seconds.
var/max_fuel = 300 // The maximum amount of fuel the chainsaw stores.
var/fuel_cost = 1 // Multiplier for fuel cost.
@@ -498,7 +498,7 @@
PowerDown(user)
else if(!wielded)
to_chat(user, SPAN_WARNING("You need to hold this with two hands to turn this on."))
else if(REAGENT_VOLUME(reagents, /singleton/reagent/fuel) <= 0)
else if(REAGENT_VOLUME(reagents, /decl/reagent/fuel) <= 0)
user.visible_message(SPAN_WARNING("[user] pulls the cord on \the [src], but nothing happens."), SPAN_WARNING("You pull the cord on \the [src], but nothing happens."), SPAN_NOTICE("You hear a cord being pulled."))
else
var/max = rand(3,6)

View File

@@ -345,8 +345,8 @@
active_w_class = ITEMSIZE_NORMAL
w_class = ITEMSIZE_NORMAL
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = /singleton/sound_category/sword_pickup_sound
equip_sound = /singleton/sound_category/sword_equip_sound
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
/obj/item/melee/energy/sword/powersword/activate(mob/living/user)
..()

View File

@@ -77,7 +77,7 @@
cleantime = 15
var/refill_enabled = TRUE //Self-refill toggle for when a janitor decides to mop with something other than water.
var/refill_rate = 0.5 //Rate per process() tick mop refills itself
var/refill_reagent = /singleton/reagent/water //Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING
var/refill_reagent = /decl/reagent/water //Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING
/obj/item/mop/advanced/New()
..()

View File

@@ -17,11 +17,11 @@
fragile = 0
var/paint_reagent = null //name of the reagent responsible for colouring the paint
var/paint_type = null //used for colouring detective technicolor coat and hat
reagents_to_add = list(/singleton/reagent/paint = 4/5)
reagents_to_add = list(/decl/reagent/paint = 4/5)
/obj/item/reagent_containers/glass/paint/Initialize()
reagents_to_add[paint_reagent] = 1/5
for(var/singleton/reagent/R in reagents_to_add)
for(var/decl/reagent/R in reagents_to_add)
reagents_to_add[R] *= volume
. = ..()
reagents.handle_reactions()
@@ -54,29 +54,29 @@
update_icon()
/obj/item/reagent_containers/glass/paint/red
paint_reagent = /singleton/reagent/crayon_dust/red
paint_reagent = /decl/reagent/crayon_dust/red
paint_type = "red"
/obj/item/reagent_containers/glass/paint/yellow
paint_reagent = /singleton/reagent/crayon_dust/yellow
paint_reagent = /decl/reagent/crayon_dust/yellow
paint_type = "yellow"
/obj/item/reagent_containers/glass/paint/green
paint_reagent = /singleton/reagent/crayon_dust/green
paint_reagent = /decl/reagent/crayon_dust/green
paint_type = "green"
/obj/item/reagent_containers/glass/paint/blue
paint_reagent = /singleton/reagent/crayon_dust/blue
paint_reagent = /decl/reagent/crayon_dust/blue
paint_type = "blue"
/obj/item/reagent_containers/glass/paint/purple
paint_reagent = /singleton/reagent/crayon_dust/purple
paint_reagent = /decl/reagent/crayon_dust/purple
paint_type = "purple"
/obj/item/reagent_containers/glass/paint/black
paint_reagent = /singleton/reagent/carbon
paint_reagent = /decl/reagent/carbon
paint_type = "black"
/obj/item/reagent_containers/glass/paint/white
paint_reagent = /singleton/reagent/aluminum
paint_reagent = /decl/reagent/aluminum
paint_type = "white"

View File

@@ -29,7 +29,7 @@
/obj/item/soap/proc/wet()
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
reagents.add_reagent(/singleton/reagent/spacecleaner, capacity)
reagents.add_reagent(/decl/reagent/spacecleaner, capacity)
/obj/item/soap/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/key))

View File

@@ -28,14 +28,14 @@
if(!proximity)
return
if(user.mind && (user.mind.assigned_role == "Chaplain"))
if(A.reagents && A.reagents.has_reagent(/singleton/reagent/water)) //blesses all the water in the holder
if(REAGENT_VOLUME(A.reagents, /singleton/reagent/water) > 60)
if(A.reagents && A.reagents.has_reagent(/decl/reagent/water)) //blesses all the water in the holder
if(REAGENT_VOLUME(A.reagents, /decl/reagent/water) > 60)
to_chat(user, SPAN_NOTICE("There's too much water for you to bless at once!"))
else
to_chat(user, SPAN_NOTICE("You bless the water in [A], turning it into holy water."))
var/water2holy = REAGENT_VOLUME(A.reagents, /singleton/reagent/water)
A.reagents.del_reagent(/singleton/reagent/water)
A.reagents.add_reagent(/singleton/reagent/water/holywater, water2holy)
var/water2holy = REAGENT_VOLUME(A.reagents, /decl/reagent/water)
A.reagents.del_reagent(/decl/reagent/water)
A.reagents.add_reagent(/decl/reagent/water/holywater, water2holy)
/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob)
if(src.use_sound)

View File

@@ -42,7 +42,7 @@
var/obj/item/melee/energy/blade/blade = W
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
if(!locked)
..()
else

View File

@@ -3,7 +3,7 @@
desc = "It's a small container with dice inside."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
use_sound = /singleton/sound_category/rustle_sound
use_sound = /decl/sound_category/rustle_sound
drop_sound = 'sound/items/drop/hat.ogg'
pickup_sound = 'sound/items/pickup/hat.ogg'
starts_with = list(

View File

@@ -38,7 +38,7 @@
var/obj/item/melee/energy/blade/blade = W
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, /singleton/sound_category/spark_sound, 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
return
if (W.isscrewdriver())

View File

@@ -40,7 +40,7 @@
var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
var/collection_mode = 1 //0 = pick one at a time, 1 = pick all on tile
var/use_sound = /singleton/sound_category/rustle_sound //sound played when used. null for no sound.
var/use_sound = /decl/sound_category/rustle_sound //sound played when used. null for no sound.
var/list/starts_with // for pre-filled items
var/empty_delay = 0 SECOND // time it takes to empty bag. this is multiplies by number of objects stored

View File

@@ -137,7 +137,7 @@
if (..())
if (contents.len)
spill(3, get_turf(M))
playsound(M, /singleton/sound_category/tray_hit_sound, 100, 1) //sound playin' again
playsound(M, /decl/sound_category/tray_hit_sound, 100, 1) //sound playin' again
update_force()
user.visible_message(SPAN_DANGER("[user] smashes the [src] into [M], causing it to break open and strew its contents across the area"))

View File

@@ -118,31 +118,31 @@
..()
var/obj/item/storage/box/fancy/cigarettes/pack
pack = new /obj/item/storage/box/fancy/cigarettes(src)
fill_cigarre_package(pack, list(/singleton/reagent/aluminum = 5, /singleton/reagent/potassium = 5, /singleton/reagent/sulfur = 5))
fill_cigarre_package(pack, list(/decl/reagent/aluminum = 5, /decl/reagent/potassium = 5, /decl/reagent/sulfur = 5))
pack.desc += " 'F' has been scribbled on it."
pack = new /obj/item/storage/box/fancy/cigarettes(src)
fill_cigarre_package(pack, list(/singleton/reagent/aluminum = 5, /singleton/reagent/potassium = 5, /singleton/reagent/sulfur = 5))
fill_cigarre_package(pack, list(/decl/reagent/aluminum = 5, /decl/reagent/potassium = 5, /decl/reagent/sulfur = 5))
pack.desc += " 'F' has been scribbled on it."
pack = new /obj/item/storage/box/fancy/cigarettes(src)
fill_cigarre_package(pack, list(/singleton/reagent/potassium = 5, /singleton/reagent/sugar = 5, /singleton/reagent/phosphorus = 5))
fill_cigarre_package(pack, list(/decl/reagent/potassium = 5, /decl/reagent/sugar = 5, /decl/reagent/phosphorus = 5))
pack.desc += " 'S' has been scribbled on it."
pack = new /obj/item/storage/box/fancy/cigarettes(src)
fill_cigarre_package(pack, list(/singleton/reagent/potassium = 5, /singleton/reagent/sugar = 5, /singleton/reagent/phosphorus = 5))
fill_cigarre_package(pack, list(/decl/reagent/potassium = 5, /decl/reagent/sugar = 5, /decl/reagent/phosphorus = 5))
pack.desc += " 'S' has been scribbled on it."
pack = new /obj/item/storage/box/fancy/cigarettes(src)
// Dylovene. Going with 1.5 rather than 1.6666666...
fill_cigarre_package(pack, list(/singleton/reagent/potassium = 1.5, /singleton/reagent/ammonia = 1.5, /singleton/reagent/silicon = 1.5))
fill_cigarre_package(pack, list(/decl/reagent/potassium = 1.5, /decl/reagent/ammonia = 1.5, /decl/reagent/silicon = 1.5))
// Mindbreaker
fill_cigarre_package(pack, list(/singleton/reagent/silicon = 4.5, /singleton/reagent/hydrazine = 4.5, /singleton/reagent/dylovene = 4.5))
fill_cigarre_package(pack, list(/decl/reagent/silicon = 4.5, /decl/reagent/hydrazine = 4.5, /decl/reagent/dylovene = 4.5))
pack.desc += " 'MB' has been scribbled on it."
pack = new /obj/item/storage/box/fancy/cigarettes(src)
pack.reagents.add_reagent(/singleton/reagent/tricordrazine, 15 * pack.storage_slots)
pack.reagents.add_reagent(/decl/reagent/tricordrazine, 15 * pack.storage_slots)
pack.desc += " 'T' has been scribbled on it."
new /obj/item/flame/lighter/zippo(src)

Some files were not shown because too many files have changed in this diff Show More