mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
Grep for space indentation (#54850)
#54604 atomizing Since a lot of the space indents are in lists ill atomize those later
This commit is contained in:
@@ -39,5 +39,8 @@
|
||||
*.dmm text eol=lf merge=dmm
|
||||
*.dmi binary merge=dmi
|
||||
|
||||
##Force tab indents on dm files
|
||||
*.dm whitespace=indent-with-non-tab
|
||||
|
||||
## Force changelog merging to use union
|
||||
html/changelog.html text eol=lf merge=union
|
||||
|
||||
+10
-10
@@ -2,12 +2,12 @@
|
||||
|
||||
#define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count
|
||||
#define MC_SPLIT_TICK \
|
||||
if(split_tick_phases > 1){\
|
||||
Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\
|
||||
--split_tick_phases;\
|
||||
} else {\
|
||||
Master.current_ticklimit = original_tick_limit;\
|
||||
}
|
||||
if(split_tick_phases > 1){\
|
||||
Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\
|
||||
--split_tick_phases;\
|
||||
} else {\
|
||||
Master.current_ticklimit = original_tick_limit;\
|
||||
}
|
||||
|
||||
// Used to smooth out costs to try and avoid oscillation.
|
||||
#define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current))
|
||||
@@ -64,14 +64,14 @@
|
||||
|
||||
#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
|
||||
/datum/controller/subsystem/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/##X
|
||||
|
||||
#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
|
||||
/datum/controller/subsystem/processing/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/processing/##X
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
/// Creates a global initializer with a given InitValue expression, do not use
|
||||
#define GLOBAL_MANAGED(X, InitValue)\
|
||||
/datum/controller/global_vars/proc/InitGlobal##X(){\
|
||||
##X = ##InitValue;\
|
||||
gvars_datum_init_order += #X;\
|
||||
##X = ##InitValue;\
|
||||
gvars_datum_init_order += #X;\
|
||||
}
|
||||
/// Creates an empty global initializer, do not use
|
||||
#define GLOBAL_UNMANAGED(X) /datum/controller/global_vars/proc/InitGlobal##X() { return; }
|
||||
@@ -13,8 +13,8 @@
|
||||
#ifndef TESTING
|
||||
#define GLOBAL_PROTECT(X)\
|
||||
/datum/controller/global_vars/InitGlobal##X(){\
|
||||
..();\
|
||||
gvars_datum_protected_varlist[#X] = TRUE;\
|
||||
..();\
|
||||
gvars_datum_protected_varlist[#X] = TRUE;\
|
||||
}
|
||||
#else
|
||||
#define GLOBAL_PROTECT(X)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
///Protects a datum from being VV'd
|
||||
#define GENERAL_PROTECT_DATUM(Path)\
|
||||
##Path/can_vv_get(var_name){\
|
||||
return FALSE;\
|
||||
return FALSE;\
|
||||
}\
|
||||
##Path/vv_edit_var(var_name, var_value){\
|
||||
return FALSE;\
|
||||
return FALSE;\
|
||||
}\
|
||||
##Path/CanProcCall(procname){\
|
||||
return FALSE;\
|
||||
return FALSE;\
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define ACCESS_SECURITY 1
|
||||
/// Brig cells+timers, permabrig, gulag+gulag shuttle, prisoner management console
|
||||
#define ACCESS_BRIG 2
|
||||
/// Armory, gulag teleporter, execution chamber
|
||||
/// Armory, gulag teleporter, execution chamber
|
||||
#define ACCESS_ARMORY 3
|
||||
///Detective's office, forensics lockers, security+medical records
|
||||
#define ACCESS_FORENSICS_LOCKERS 4
|
||||
|
||||
+14
-14
@@ -40,18 +40,18 @@
|
||||
GLOBAL_LIST_EMPTY(supplypod_loading_bays)
|
||||
|
||||
GLOBAL_LIST_INIT(podstyles, list(\
|
||||
list(POD_SHAPE_NORML, "pod", TRUE, "default", "yellow", RUBBLE_NORMAL, "supply pod", "A Nanotrasen supply drop pod."),\
|
||||
list(POD_SHAPE_NORML, "advpod", TRUE, "bluespace", "blue", RUBBLE_NORMAL, "bluespace supply pod" , "A Nanotrasen Bluespace supply pod. Teleports back to CentCom after delivery."),\
|
||||
list(POD_SHAPE_NORML, "advpod", TRUE, "centcom", "blue", RUBBLE_NORMAL, "\improper CentCom supply pod", "A Nanotrasen supply pod, this one has been marked with Central Command's designations. Teleports back to CentCom after delivery."),\
|
||||
list(POD_SHAPE_NORML, "darkpod", TRUE, "syndicate", "red", RUBBLE_NORMAL, "blood-red supply pod", "An intimidating supply pod, covered in the blood-red markings of the Syndicate. It's probably best to stand back from this."),\
|
||||
list(POD_SHAPE_NORML, "darkpod", TRUE, "deathsquad", "blue", RUBBLE_NORMAL, "\improper Deathsquad drop pod", "A Nanotrasen drop pod. This one has been marked the markings of Nanotrasen's elite strike team."),\
|
||||
list(POD_SHAPE_NORML, "pod", TRUE, "cultist", "red", RUBBLE_NORMAL, "bloody supply pod", "A Nanotrasen supply pod covered in scratch-marks, blood, and strange runes."),\
|
||||
list(POD_SHAPE_OTHER, "missile", FALSE, FALSE, FALSE, RUBBLE_THIN, "cruise missile", "A big ass missile that didn't seem to fully detonate. It was likely launched from some far-off deep space missile silo. There appears to be an auxillery payload hatch on the side, though manually opening it is likely impossible."),\
|
||||
list(POD_SHAPE_OTHER, "smissile", FALSE, FALSE, FALSE, RUBBLE_THIN, "\improper Syndicate cruise missile", "A big ass, blood-red missile that didn't seem to fully detonate. It was likely launched from some deep space Syndicate missile silo. There appears to be an auxillery payload hatch on the side, though manually opening it is likely impossible."),\
|
||||
list(POD_SHAPE_OTHER, "box", TRUE, FALSE, FALSE, RUBBLE_WIDE, "\improper Aussec supply crate", "An incredibly sturdy supply crate, designed to withstand orbital re-entry. Has 'Aussec Armory - 2532' engraved on the side."),\
|
||||
list(POD_SHAPE_NORML, "clownpod", TRUE, "clown", "green", RUBBLE_NORMAL, "\improper HONK pod", "A brightly-colored supply pod. It likely originated from the Clown Federation."),\
|
||||
list(POD_SHAPE_OTHER, "orange", TRUE, FALSE, FALSE, RUBBLE_NONE, "\improper Orange", "An angry orange."),\
|
||||
list(POD_SHAPE_OTHER, FALSE, FALSE, FALSE, FALSE, RUBBLE_NONE, "\improper S.T.E.A.L.T.H. pod MKVII", "A supply pod that, under normal circumstances, is completely invisible to conventional methods of detection. How are you even seeing this?"),\
|
||||
list(POD_SHAPE_OTHER, "gondola", FALSE, FALSE, FALSE, RUBBLE_NONE, "gondola", "The silent walker. This one seems to be part of a delivery agency."),\
|
||||
list(POD_SHAPE_OTHER, FALSE, FALSE, FALSE, FALSE, RUBBLE_NONE, FALSE, FALSE, "rl_click", "give_po")\
|
||||
list(POD_SHAPE_NORML, "pod", TRUE, "default", "yellow", RUBBLE_NORMAL, "supply pod", "A Nanotrasen supply drop pod."),\
|
||||
list(POD_SHAPE_NORML, "advpod", TRUE, "bluespace", "blue", RUBBLE_NORMAL, "bluespace supply pod" , "A Nanotrasen Bluespace supply pod. Teleports back to CentCom after delivery."),\
|
||||
list(POD_SHAPE_NORML, "advpod", TRUE, "centcom", "blue", RUBBLE_NORMAL, "\improper CentCom supply pod", "A Nanotrasen supply pod, this one has been marked with Central Command's designations. Teleports back to CentCom after delivery."),\
|
||||
list(POD_SHAPE_NORML, "darkpod", TRUE, "syndicate", "red", RUBBLE_NORMAL, "blood-red supply pod", "An intimidating supply pod, covered in the blood-red markings of the Syndicate. It's probably best to stand back from this."),\
|
||||
list(POD_SHAPE_NORML, "darkpod", TRUE, "deathsquad", "blue", RUBBLE_NORMAL, "\improper Deathsquad drop pod", "A Nanotrasen drop pod. This one has been marked the markings of Nanotrasen's elite strike team."),\
|
||||
list(POD_SHAPE_NORML, "pod", TRUE, "cultist", "red", RUBBLE_NORMAL, "bloody supply pod", "A Nanotrasen supply pod covered in scratch-marks, blood, and strange runes."),\
|
||||
list(POD_SHAPE_OTHER, "missile", FALSE, FALSE, FALSE, RUBBLE_THIN, "cruise missile", "A big ass missile that didn't seem to fully detonate. It was likely launched from some far-off deep space missile silo. There appears to be an auxillery payload hatch on the side, though manually opening it is likely impossible."),\
|
||||
list(POD_SHAPE_OTHER, "smissile", FALSE, FALSE, FALSE, RUBBLE_THIN, "\improper Syndicate cruise missile", "A big ass, blood-red missile that didn't seem to fully detonate. It was likely launched from some deep space Syndicate missile silo. There appears to be an auxillery payload hatch on the side, though manually opening it is likely impossible."),\
|
||||
list(POD_SHAPE_OTHER, "box", TRUE, FALSE, FALSE, RUBBLE_WIDE, "\improper Aussec supply crate", "An incredibly sturdy supply crate, designed to withstand orbital re-entry. Has 'Aussec Armory - 2532' engraved on the side."),\
|
||||
list(POD_SHAPE_NORML, "clownpod", TRUE, "clown", "green", RUBBLE_NORMAL, "\improper HONK pod", "A brightly-colored supply pod. It likely originated from the Clown Federation."),\
|
||||
list(POD_SHAPE_OTHER, "orange", TRUE, FALSE, FALSE, RUBBLE_NONE, "\improper Orange", "An angry orange."),\
|
||||
list(POD_SHAPE_OTHER, FALSE, FALSE, FALSE, FALSE, RUBBLE_NONE, "\improper S.T.E.A.L.T.H. pod MKVII", "A supply pod that, under normal circumstances, is completely invisible to conventional methods of detection. How are you even seeing this?"),\
|
||||
list(POD_SHAPE_OTHER, "gondola", FALSE, FALSE, FALSE, RUBBLE_NONE, "gondola", "The silent walker. This one seems to be part of a delivery agency."),\
|
||||
list(POD_SHAPE_OTHER, FALSE, FALSE, FALSE, FALSE, RUBBLE_NONE, FALSE, FALSE, "rl_click", "give_po")\
|
||||
))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
/// Causes the detach proc to be called when the host object is being deleted
|
||||
#define ELEMENT_DETACH (1 << 0)
|
||||
/**
|
||||
* Only elements created with the same arguments given after `id_arg_index` share an element instance
|
||||
* The arguments are the same when the text and number values are the same and all other values have the same ref
|
||||
*/
|
||||
* Only elements created with the same arguments given after `id_arg_index` share an element instance
|
||||
* The arguments are the same when the text and number values are the same and all other values have the same ref
|
||||
*/
|
||||
#define ELEMENT_BESPOKE (1 << 1)
|
||||
|
||||
// How multiple components of the exact same type are handled in the same datum
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
#define COMPONENT_BLOCK_CONTAMINATION (1<<0)
|
||||
///from base of datum/radiation_wave/check_obstructions(): (datum/radiation_wave, width)
|
||||
#define COMSIG_ATOM_RAD_WAVE_PASSING "atom_rad_wave_pass"
|
||||
#define COMPONENT_RAD_WAVE_HANDLED (1<<0)
|
||||
#define COMPONENT_RAD_WAVE_HANDLED (1<<0)
|
||||
///from internal loop in atom/movable/proc/CanReach(): (list/next)
|
||||
#define COMSIG_ATOM_CANREACH "atom_can_reach"
|
||||
#define COMPONENT_ALLOW_REACH (1<<0)
|
||||
|
||||
@@ -185,7 +185,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
if(HAS_TRAIT_FROM_ONLY(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL))\
|
||||
REMOVE_TRAIT(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL);\
|
||||
else if(!HAS_TRAIT(x, TRAIT_KEEP_TOGETHER))\
|
||||
x.appearance_flags &= ~KEEP_TOGETHER
|
||||
x.appearance_flags &= ~KEEP_TOGETHER
|
||||
|
||||
//religious_tool flags
|
||||
#define RELIGION_TOOL_INVOKE (1<<0)
|
||||
|
||||
+12
-12
@@ -57,12 +57,12 @@ require only minor tweaks.
|
||||
|
||||
// enum - how space transitions should affect this level
|
||||
#define ZTRAIT_LINKAGE "Linkage"
|
||||
// UNAFFECTED if absent - no space transitions
|
||||
#define UNAFFECTED null
|
||||
// SELFLOOPING - space transitions always self-loop
|
||||
#define SELFLOOPING "Self"
|
||||
// CROSSLINKED - mixed in with the cross-linked space pool
|
||||
#define CROSSLINKED "Cross"
|
||||
// UNAFFECTED if absent - no space transitions
|
||||
#define UNAFFECTED null
|
||||
// SELFLOOPING - space transitions always self-loop
|
||||
#define SELFLOOPING "Self"
|
||||
// CROSSLINKED - mixed in with the cross-linked space pool
|
||||
#define CROSSLINKED "Cross"
|
||||
|
||||
// string - type path of the z-level's baseturf (defaults to space)
|
||||
#define ZTRAIT_BASETURF "Baseturf"
|
||||
@@ -72,11 +72,11 @@ require only minor tweaks.
|
||||
#define ZTRAITS_STATION list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_STATION = TRUE)
|
||||
#define ZTRAITS_SPACE list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_SPACE_RUINS = TRUE)
|
||||
#define ZTRAITS_LAVALAND list(\
|
||||
ZTRAIT_MINING = TRUE, \
|
||||
ZTRAIT_ASHSTORM = TRUE, \
|
||||
ZTRAIT_LAVA_RUINS = TRUE, \
|
||||
ZTRAIT_BOMBCAP_MULTIPLIER = 2, \
|
||||
ZTRAIT_BASETURF = /turf/open/lava/smooth/lava_land_surface)
|
||||
ZTRAIT_MINING = TRUE, \
|
||||
ZTRAIT_ASHSTORM = TRUE, \
|
||||
ZTRAIT_LAVA_RUINS = TRUE, \
|
||||
ZTRAIT_BOMBCAP_MULTIPLIER = 2, \
|
||||
ZTRAIT_BASETURF = /turf/open/lava/smooth/lava_land_surface)
|
||||
|
||||
#define DL_NAME "name"
|
||||
#define DL_TRAITS "traits"
|
||||
@@ -84,7 +84,7 @@ require only minor tweaks.
|
||||
|
||||
// must correspond to _basemap.dm for things to work correctly
|
||||
#define DEFAULT_MAP_TRAITS list(\
|
||||
DECLARE_LEVEL("CentCom", ZTRAITS_CENTCOM),\
|
||||
DECLARE_LEVEL("CentCom", ZTRAITS_CENTCOM),\
|
||||
)
|
||||
|
||||
// Camera lock flags
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#ifdef LEGACY_REFERENCE_TRACKING
|
||||
/** If LEGACY_REFERENCE_TRACKING is enabled, qdel will call this object's find_references() verb.
|
||||
*
|
||||
* Functionally identical to [QDEL_HINT_QUEUE] if [GC_FAILURE_HARD_LOOKUP] is not enabled in _compiler_options.dm.
|
||||
*
|
||||
* Functionally identical to [QDEL_HINT_QUEUE] if [GC_FAILURE_HARD_LOOKUP] is not enabled in _compiler_options.dm.
|
||||
*/
|
||||
#define QDEL_HINT_FINDREFERENCE 5
|
||||
/// Behavior as [QDEL_HINT_FINDREFERENCE], but only if the GC fails and a hard delete is forced.
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
#endif
|
||||
|
||||
/world/proc/enable_debugger()
|
||||
var/dll = world.GetConfig("env", "EXTOOLS_DLL")
|
||||
if (dll)
|
||||
call(dll, "debug_initialize")()
|
||||
var/dll = world.GetConfig("env", "EXTOOLS_DLL")
|
||||
if (dll)
|
||||
call(dll, "debug_initialize")()
|
||||
|
||||
@@ -5,43 +5,43 @@
|
||||
|
||||
//! ## DB defines
|
||||
/**
|
||||
* DB major schema version
|
||||
*
|
||||
* Update this whenever the db schema changes
|
||||
*
|
||||
* make sure you add an update to the schema_version stable in the db changelog
|
||||
*/
|
||||
* DB major schema version
|
||||
*
|
||||
* Update this whenever the db schema changes
|
||||
*
|
||||
* make sure you add an update to the schema_version stable in the db changelog
|
||||
*/
|
||||
#define DB_MAJOR_VERSION 5
|
||||
|
||||
/**
|
||||
* DB minor schema version
|
||||
*
|
||||
* Update this whenever the db schema changes
|
||||
*
|
||||
* make sure you add an update to the schema_version stable in the db changelog
|
||||
*/
|
||||
* DB minor schema version
|
||||
*
|
||||
* Update this whenever the db schema changes
|
||||
*
|
||||
* make sure you add an update to the schema_version stable in the db changelog
|
||||
*/
|
||||
#define DB_MINOR_VERSION 11
|
||||
|
||||
|
||||
//! ## Timing subsystem
|
||||
/**
|
||||
* Don't run if there is an identical unique timer active
|
||||
*
|
||||
* if the arguments to addtimer are the same as an existing timer, it doesn't create a new timer,
|
||||
* and returns the id of the existing timer
|
||||
*/
|
||||
* Don't run if there is an identical unique timer active
|
||||
*
|
||||
* if the arguments to addtimer are the same as an existing timer, it doesn't create a new timer,
|
||||
* and returns the id of the existing timer
|
||||
*/
|
||||
#define TIMER_UNIQUE (1<<0)
|
||||
|
||||
///For unique timers: Replace the old timer rather then not start this one
|
||||
#define TIMER_OVERRIDE (1<<1)
|
||||
|
||||
/**
|
||||
* Timing should be based on how timing progresses on clients, not the server.
|
||||
*
|
||||
* Tracking this is more expensive,
|
||||
* should only be used in conjuction with things that have to progress client side, such as
|
||||
* animate() or sound()
|
||||
*/
|
||||
* Timing should be based on how timing progresses on clients, not the server.
|
||||
*
|
||||
* Tracking this is more expensive,
|
||||
* should only be used in conjuction with things that have to progress client side, such as
|
||||
* animate() or sound()
|
||||
*/
|
||||
#define TIMER_CLIENT_TIME (1<<2)
|
||||
|
||||
///Timer can be stopped using deltimer()
|
||||
@@ -74,12 +74,12 @@
|
||||
///Nothing happens
|
||||
#define INITIALIZE_HINT_NORMAL 0
|
||||
/**
|
||||
* call LateInitialize at the end of all atom Initalization
|
||||
*
|
||||
* The item will be added to the late_loaders list, this is iterated over after
|
||||
* initalization of subsystems is complete and calls LateInitalize on the atom
|
||||
* see [this file for the LateIntialize proc](atom.html#proc/LateInitialize)
|
||||
*/
|
||||
* call LateInitialize at the end of all atom Initalization
|
||||
*
|
||||
* The item will be added to the late_loaders list, this is iterated over after
|
||||
* initalization of subsystems is complete and calls LateInitalize on the atom
|
||||
* see [this file for the LateIntialize proc](atom.html#proc/LateInitialize)
|
||||
*/
|
||||
#define INITIALIZE_HINT_LATELOAD 1
|
||||
|
||||
///Call qdel on the atom after intialization
|
||||
@@ -87,11 +87,11 @@
|
||||
|
||||
///type and all subtypes should always immediately call Initialize in New()
|
||||
#define INITIALIZE_IMMEDIATE(X) ##X/New(loc, ...){\
|
||||
..();\
|
||||
if(!(flags_1 & INITIALIZED_1)) {\
|
||||
args[1] = TRUE;\
|
||||
SSatoms.InitAtom(src, args);\
|
||||
}\
|
||||
..();\
|
||||
if(!(flags_1 & INITIALIZED_1)) {\
|
||||
args[1] = TRUE;\
|
||||
SSatoms.InitAtom(src, args);\
|
||||
}\
|
||||
}
|
||||
|
||||
// Subsystem init_order, from highest priority to lowest priority
|
||||
|
||||
+51
-51
@@ -117,22 +117,22 @@
|
||||
//REQUIRED HOOKS
|
||||
|
||||
/**
|
||||
* Call this somewhere in [/world/proc/New] that is always run. This function may sleep!
|
||||
*
|
||||
* * event_handler - Optional user defined [/datum/tgs_event_handler].
|
||||
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
|
||||
*/
|
||||
* Call this somewhere in [/world/proc/New] that is always run. This function may sleep!
|
||||
*
|
||||
* * event_handler - Optional user defined [/datum/tgs_event_handler].
|
||||
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
|
||||
*/
|
||||
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE)
|
||||
return
|
||||
|
||||
/**
|
||||
* Call this when your initializations are complete and your game is ready to play before any player interactions happen.
|
||||
*
|
||||
* This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running.
|
||||
* Afterwards, consider explicitly setting it to what you want to avoid this BYOND bug: http://www.byond.com/forum/post/2575184
|
||||
* Before this point, note that any static files or directories may be in use by another server. Your code should account for this.
|
||||
* This function should not be called before ..() in [/world/proc/New].
|
||||
*/
|
||||
* Call this when your initializations are complete and your game is ready to play before any player interactions happen.
|
||||
*
|
||||
* This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running.
|
||||
* Afterwards, consider explicitly setting it to what you want to avoid this BYOND bug: http://www.byond.com/forum/post/2575184
|
||||
* Before this point, note that any static files or directories may be in use by another server. Your code should account for this.
|
||||
* This function should not be called before ..() in [/world/proc/New].
|
||||
*/
|
||||
/world/proc/TgsInitializationComplete()
|
||||
return
|
||||
|
||||
@@ -140,8 +140,8 @@
|
||||
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return
|
||||
|
||||
/**
|
||||
* Call this at the beginning of [world/proc/Reboot].
|
||||
*/
|
||||
* Call this at the beginning of [world/proc/Reboot].
|
||||
*/
|
||||
/world/proc/TgsReboot()
|
||||
return
|
||||
|
||||
@@ -175,16 +175,16 @@
|
||||
var/deprefixed_parameter
|
||||
|
||||
/**
|
||||
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
|
||||
*/
|
||||
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
|
||||
*/
|
||||
/datum/tgs_version/proc/Wildcard()
|
||||
return
|
||||
|
||||
/**
|
||||
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] equals some other version.
|
||||
*
|
||||
* other_version - The [/datum/tgs_version] to compare against.
|
||||
*/
|
||||
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] equals some other version.
|
||||
*
|
||||
* other_version - The [/datum/tgs_version] to compare against.
|
||||
*/
|
||||
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
|
||||
return
|
||||
|
||||
@@ -234,10 +234,10 @@
|
||||
var/datum/tgs_chat_channel/channel
|
||||
|
||||
/**
|
||||
* User definable callback for handling TGS events.
|
||||
*
|
||||
* event_code - One of the TGS_EVENT_ defines. Extra parameters will be documented in each
|
||||
*/
|
||||
* User definable callback for handling TGS events.
|
||||
*
|
||||
* event_code - One of the TGS_EVENT_ defines. Extra parameters will be documented in each
|
||||
*/
|
||||
/datum/tgs_event_handler/proc/HandleEvent(event_code, ...)
|
||||
set waitfor = FALSE
|
||||
return
|
||||
@@ -252,11 +252,11 @@
|
||||
var/admin_only = FALSE
|
||||
|
||||
/**
|
||||
* Process command activation. Should return a string to respond to the issuer with.
|
||||
*
|
||||
* sender - The [/datum/tgs_chat_user] who issued the command.
|
||||
* params - The trimmed string following the command `/datum/tgs_chat_command/var/name].
|
||||
*/
|
||||
* Process command activation. Should return a string to respond to the issuer with.
|
||||
*
|
||||
* sender - The [/datum/tgs_chat_user] who issued the command.
|
||||
* params - The trimmed string following the command `/datum/tgs_chat_command/var/name].
|
||||
*/
|
||||
/datum/tgs_chat_command/proc/Run(datum/tgs_chat_user/sender, params)
|
||||
CRASH("[type] has no implementation for Run()")
|
||||
|
||||
@@ -271,48 +271,48 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
|
||||
*/
|
||||
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
|
||||
*/
|
||||
/world/proc/TgsAvailable()
|
||||
return
|
||||
|
||||
// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
|
||||
|
||||
/**
|
||||
* Forces a hard reboot of DreamDaemon by ending the process.
|
||||
*
|
||||
* Unlike del(world) clients will try to reconnect.
|
||||
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again
|
||||
*/
|
||||
* Forces a hard reboot of DreamDaemon by ending the process.
|
||||
*
|
||||
* Unlike del(world) clients will try to reconnect.
|
||||
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again
|
||||
*/
|
||||
/world/proc/TgsEndProcess()
|
||||
return
|
||||
|
||||
/**
|
||||
* Send a message to connected chats.
|
||||
*
|
||||
* message - The string to send.
|
||||
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
|
||||
*/
|
||||
* Send a message to connected chats.
|
||||
*
|
||||
* message - The string to send.
|
||||
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
|
||||
*/
|
||||
/world/proc/TgsTargetedChatBroadcast(message, admin_only = FALSE)
|
||||
return
|
||||
|
||||
/**
|
||||
* Send a private message to a specific user.
|
||||
*
|
||||
* message - The string to send.
|
||||
* user: The [/datum/tgs_chat_user] to PM.
|
||||
*/
|
||||
* Send a private message to a specific user.
|
||||
*
|
||||
* message - The string to send.
|
||||
* user: The [/datum/tgs_chat_user] to PM.
|
||||
*/
|
||||
/world/proc/TgsChatPrivateMessage(message, datum/tgs_chat_user/user)
|
||||
return
|
||||
|
||||
// The following functions will sleep if a call to TgsNew() is sleeping
|
||||
|
||||
/**
|
||||
* Send a message to connected chats that are flagged as game-related in TGS.
|
||||
*
|
||||
* message - The string to send.
|
||||
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
|
||||
*/
|
||||
* Send a message to connected chats that are flagged as game-related in TGS.
|
||||
*
|
||||
* message - The string to send.
|
||||
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
|
||||
*/
|
||||
/world/proc/TgsChatBroadcast(message, list/channels = null)
|
||||
return
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
GLOBAL_LIST_EMPTY(bitflag_lists)
|
||||
|
||||
/**
|
||||
* System for storing bitflags past the 24 limit, making use of an associative list.
|
||||
*
|
||||
* Macro converts a list of integers into an associative list of bitflag entries for quicker comparison.
|
||||
* Example: list(0, 4, 26, 32)) => list( "0" = ( (1<<0) | (1<<4) ), "1" = ( (1<<2) | (1<<8) ) )
|
||||
* Lists are cached into a global list of lists to avoid identical duplicates.
|
||||
* This system makes value comparisons faster than pairing every element of one list with every element of the other for evaluation.
|
||||
*
|
||||
* Arguments:
|
||||
* * target - List of integers.
|
||||
*/
|
||||
* System for storing bitflags past the 24 limit, making use of an associative list.
|
||||
*
|
||||
* Macro converts a list of integers into an associative list of bitflag entries for quicker comparison.
|
||||
* Example: list(0, 4, 26, 32)) => list( "0" = ( (1<<0) | (1<<4) ), "1" = ( (1<<2) | (1<<8) ) )
|
||||
* Lists are cached into a global list of lists to avoid identical duplicates.
|
||||
* This system makes value comparisons faster than pairing every element of one list with every element of the other for evaluation.
|
||||
*
|
||||
* Arguments:
|
||||
* * target - List of integers.
|
||||
*/
|
||||
#define SET_BITFLAG_LIST(target) \
|
||||
do { \
|
||||
var/txt_signature = target.Join("-"); \
|
||||
|
||||
+10
-10
@@ -36,11 +36,11 @@ In TGS3 it will always be sent to all connected designated game chats.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sends a message to TGS chat channels.
|
||||
*
|
||||
* message - The message to send.
|
||||
* channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s).
|
||||
*/
|
||||
* Sends a message to TGS chat channels.
|
||||
*
|
||||
* message - The message to send.
|
||||
* channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s).
|
||||
*/
|
||||
/proc/send2chat(message, channel_tag)
|
||||
if(channel_tag == null || !world.TgsAvailable())
|
||||
return
|
||||
@@ -61,11 +61,11 @@ In TGS3 it will always be sent to all connected designated game chats.
|
||||
world.TgsChatBroadcast(message, channels_to_use)
|
||||
|
||||
/**
|
||||
* Sends a message to TGS admin chat channels.
|
||||
*
|
||||
* category - The category of the mssage.
|
||||
* message - The message to send.
|
||||
*/
|
||||
* Sends a message to TGS admin chat channels.
|
||||
*
|
||||
* category - The category of the mssage.
|
||||
* message - The message to send.
|
||||
*/
|
||||
/proc/send2adminchat(category, message, embed_links = FALSE)
|
||||
category = replacetext(replacetext(category, "\proper", ""), "\improper", "")
|
||||
message = replacetext(replacetext(message, "\proper", ""), "\improper", "")
|
||||
|
||||
@@ -132,12 +132,12 @@ GLOBAL_VAR_INIT(cmp_field, "name")
|
||||
return sorttext(A.real_name,B.real_name)
|
||||
|
||||
/**
|
||||
* Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
|
||||
*
|
||||
* Prioritises [/datum/reagent] to ensure reagent requirements are always processed first when crafting.
|
||||
* This prevents any reagent_containers from being consumed before the reagents they contain, which can
|
||||
* lead to runtimes and item duplication when it happens.
|
||||
*/
|
||||
* Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
|
||||
*
|
||||
* Prioritises [/datum/reagent] to ensure reagent requirements are always processed first when crafting.
|
||||
* This prevents any reagent_containers from being consumed before the reagents they contain, which can
|
||||
* lead to runtimes and item duplication when it happens.
|
||||
*/
|
||||
/proc/cmp_crafting_req_priority(A, B)
|
||||
var/lhs
|
||||
var/rhs
|
||||
|
||||
+15
-15
@@ -1,9 +1,9 @@
|
||||
//supposedly the fastest way to do this according to https://gist.github.com/Giacom/be635398926bb463b42a
|
||||
#define RANGE_TURFS(RADIUS, CENTER) \
|
||||
block( \
|
||||
locate(max(CENTER.x-(RADIUS),1), max(CENTER.y-(RADIUS),1), CENTER.z), \
|
||||
locate(min(CENTER.x+(RADIUS),world.maxx), min(CENTER.y+(RADIUS),world.maxy), CENTER.z) \
|
||||
)
|
||||
block( \
|
||||
locate(max(CENTER.x-(RADIUS),1), max(CENTER.y-(RADIUS),1), CENTER.z), \
|
||||
locate(min(CENTER.x+(RADIUS),world.maxx), min(CENTER.y+(RADIUS),world.maxy), CENTER.z) \
|
||||
)
|
||||
|
||||
#define Z_TURFS(ZLEVEL) block(locate(1,1,ZLEVEL), locate(world.maxx, world.maxy, ZLEVEL))
|
||||
#define CULT_POLL_WAIT 2400
|
||||
@@ -181,12 +181,12 @@
|
||||
processing_list += A.contents
|
||||
|
||||
/** recursive_organ_check
|
||||
* inputs: O (object to start with)
|
||||
* outputs:
|
||||
* description: A pseudo-recursive loop based off of the recursive mob check, this check looks for any organs held
|
||||
* within 'O', toggling their frozen flag. This check excludes items held within other safe organ
|
||||
* storage units, so that only the lowest level of container dictates whether we do or don't decompose
|
||||
*/
|
||||
* inputs: O (object to start with)
|
||||
* outputs:
|
||||
* description: A pseudo-recursive loop based off of the recursive mob check, this check looks for any organs held
|
||||
* within 'O', toggling their frozen flag. This check excludes items held within other safe organ
|
||||
* storage units, so that only the lowest level of container dictates whether we do or don't decompose
|
||||
*/
|
||||
/proc/recursive_organ_check(atom/O)
|
||||
|
||||
var/list/processing_list = list(O)
|
||||
@@ -323,11 +323,11 @@
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Exiled check
|
||||
*
|
||||
* Checks if the current body of the mind has an exile implant and is currently in
|
||||
* an away mission. Returns FALSE if any of those conditions aren't met.
|
||||
*/
|
||||
* Exiled check
|
||||
*
|
||||
* Checks if the current body of the mind has an exile implant and is currently in
|
||||
* an away mission. Returns FALSE if any of those conditions aren't met.
|
||||
*/
|
||||
/proc/considered_exiled(datum/mind/M)
|
||||
if(!ishuman(M?.current))
|
||||
return FALSE
|
||||
|
||||
@@ -309,10 +309,10 @@ DEFINE_BITFIELD(smoothing_junction, list(
|
||||
|
||||
|
||||
/**
|
||||
* Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that.
|
||||
*
|
||||
* Returns the previous smoothing_junction state so the previous state can be compared with the new one after the proc ends, and see the changes, if any.
|
||||
*
|
||||
* Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that.
|
||||
*
|
||||
* Returns the previous smoothing_junction state so the previous state can be compared with the new one after the proc ends, and see the changes, if any.
|
||||
*
|
||||
*/
|
||||
/atom/proc/bitmask_smooth()
|
||||
var/new_junction = NONE
|
||||
|
||||
+66
-66
@@ -18,57 +18,57 @@ remember you first need to setup an /icon var like so:
|
||||
GLOBAL_DATUM_INIT(my_icon, /icon, new('iconfile.dmi'))
|
||||
|
||||
icon/ChangeOpacity(amount = 1)
|
||||
A very common operation in DM is to try to make an icon more or less transparent. Making an icon more
|
||||
transparent is usually much easier than making it less so, however. This proc basically is a frontend
|
||||
for MapColors() which can change opacity any way you like, in much the same way that SetIntensity()
|
||||
can make an icon lighter or darker. If amount is 0.5, the opacity of the icon will be cut in half.
|
||||
If amount is 2, opacity is doubled and anything more than half-opaque will become fully opaque.
|
||||
A very common operation in DM is to try to make an icon more or less transparent. Making an icon more
|
||||
transparent is usually much easier than making it less so, however. This proc basically is a frontend
|
||||
for MapColors() which can change opacity any way you like, in much the same way that SetIntensity()
|
||||
can make an icon lighter or darker. If amount is 0.5, the opacity of the icon will be cut in half.
|
||||
If amount is 2, opacity is doubled and anything more than half-opaque will become fully opaque.
|
||||
icon/GrayScale()
|
||||
Converts the icon to grayscale instead of a fully colored icon. Alpha values are left intact.
|
||||
Converts the icon to grayscale instead of a fully colored icon. Alpha values are left intact.
|
||||
icon/ColorTone(tone)
|
||||
Similar to GrayScale(), this proc converts the icon to a range of black -> tone -> white, where tone is an
|
||||
RGB color (its alpha is ignored). This can be used to create a sepia tone or similar effect.
|
||||
See also the global ColorTone() proc.
|
||||
Similar to GrayScale(), this proc converts the icon to a range of black -> tone -> white, where tone is an
|
||||
RGB color (its alpha is ignored). This can be used to create a sepia tone or similar effect.
|
||||
See also the global ColorTone() proc.
|
||||
icon/MinColors(icon)
|
||||
The icon is blended with a second icon where the minimum of each RGB pixel is the result.
|
||||
Transparency may increase, as if the icons were blended with ICON_ADD. You may supply a color in place of an icon.
|
||||
The icon is blended with a second icon where the minimum of each RGB pixel is the result.
|
||||
Transparency may increase, as if the icons were blended with ICON_ADD. You may supply a color in place of an icon.
|
||||
icon/MaxColors(icon)
|
||||
The icon is blended with a second icon where the maximum of each RGB pixel is the result.
|
||||
Opacity may increase, as if the icons were blended with ICON_OR. You may supply a color in place of an icon.
|
||||
The icon is blended with a second icon where the maximum of each RGB pixel is the result.
|
||||
Opacity may increase, as if the icons were blended with ICON_OR. You may supply a color in place of an icon.
|
||||
icon/Opaque(background = "#000000")
|
||||
All alpha values are set to 255 throughout the icon. Transparent pixels become black, or whatever background color you specify.
|
||||
All alpha values are set to 255 throughout the icon. Transparent pixels become black, or whatever background color you specify.
|
||||
icon/BecomeAlphaMask()
|
||||
You can convert a simple grayscale icon into an alpha mask to use with other icons very easily with this proc.
|
||||
The black parts become transparent, the white parts stay white, and anything in between becomes a translucent shade of white.
|
||||
You can convert a simple grayscale icon into an alpha mask to use with other icons very easily with this proc.
|
||||
The black parts become transparent, the white parts stay white, and anything in between becomes a translucent shade of white.
|
||||
icon/AddAlphaMask(mask)
|
||||
The alpha values of the mask icon will be blended with the current icon. Anywhere the mask is opaque,
|
||||
the current icon is untouched. Anywhere the mask is transparent, the current icon becomes transparent.
|
||||
Where the mask is translucent, the current icon becomes more transparent.
|
||||
The alpha values of the mask icon will be blended with the current icon. Anywhere the mask is opaque,
|
||||
the current icon is untouched. Anywhere the mask is transparent, the current icon becomes transparent.
|
||||
Where the mask is translucent, the current icon becomes more transparent.
|
||||
icon/UseAlphaMask(mask, mode)
|
||||
Sometimes you may want to take the alpha values from one icon and use them on a different icon.
|
||||
This proc will do that. Just supply the icon whose alpha mask you want to use, and src will change
|
||||
so it has the same colors as before but uses the mask for opacity.
|
||||
Sometimes you may want to take the alpha values from one icon and use them on a different icon.
|
||||
This proc will do that. Just supply the icon whose alpha mask you want to use, and src will change
|
||||
so it has the same colors as before but uses the mask for opacity.
|
||||
|
||||
COLOR MANAGEMENT AND HSV
|
||||
|
||||
RGB isn't the only way to represent color. Sometimes it's more useful to work with a model called HSV, which stands for hue, saturation, and value.
|
||||
|
||||
* The hue of a color describes where it is along the color wheel. It goes from red to yellow to green to
|
||||
cyan to blue to magenta and back to red.
|
||||
* The saturation of a color is how much color is in it. A color with low saturation will be more gray,
|
||||
and with no saturation at all it is a shade of gray.
|
||||
* The value of a color determines how bright it is. A high-value color is vivid, moderate value is dark,
|
||||
and no value at all is black.
|
||||
* The hue of a color describes where it is along the color wheel. It goes from red to yellow to green to
|
||||
cyan to blue to magenta and back to red.
|
||||
* The saturation of a color is how much color is in it. A color with low saturation will be more gray,
|
||||
and with no saturation at all it is a shade of gray.
|
||||
* The value of a color determines how bright it is. A high-value color is vivid, moderate value is dark,
|
||||
and no value at all is black.
|
||||
|
||||
Just as BYOND uses "#rrggbb" to represent RGB values, a similar format is used for HSV: "#hhhssvv". The hue is three
|
||||
hex digits because it ranges from 0 to 0x5FF.
|
||||
|
||||
* 0 to 0xFF - red to yellow
|
||||
* 0x100 to 0x1FF - yellow to green
|
||||
* 0x200 to 0x2FF - green to cyan
|
||||
* 0x300 to 0x3FF - cyan to blue
|
||||
* 0x400 to 0x4FF - blue to magenta
|
||||
* 0x500 to 0x5FF - magenta to red
|
||||
* 0 to 0xFF - red to yellow
|
||||
* 0x100 to 0x1FF - yellow to green
|
||||
* 0x200 to 0x2FF - green to cyan
|
||||
* 0x300 to 0x3FF - cyan to blue
|
||||
* 0x400 to 0x4FF - blue to magenta
|
||||
* 0x500 to 0x5FF - magenta to red
|
||||
|
||||
Knowing this, you can figure out that red is "#000ffff" in HSV format, which is hue 0 (red), saturation 255 (as colorful as possible),
|
||||
value 255 (as bright as possible). Green is "#200ffff" and blue is "#400ffff".
|
||||
@@ -78,42 +78,42 @@ More than one HSV color can match the same RGB color.
|
||||
Here are some procs you can use for color management:
|
||||
|
||||
ReadRGB(rgb)
|
||||
Takes an RGB string like "#ffaa55" and converts it to a list such as list(255,170,85). If an RGBA format is used
|
||||
that includes alpha, the list will have a fourth item for the alpha value.
|
||||
Takes an RGB string like "#ffaa55" and converts it to a list such as list(255,170,85). If an RGBA format is used
|
||||
that includes alpha, the list will have a fourth item for the alpha value.
|
||||
hsv(hue, sat, val, apha)
|
||||
Counterpart to rgb(), this takes the values you input and converts them to a string in "#hhhssvv" or "#hhhssvvaa"
|
||||
format. Alpha is not included in the result if null.
|
||||
Counterpart to rgb(), this takes the values you input and converts them to a string in "#hhhssvv" or "#hhhssvvaa"
|
||||
format. Alpha is not included in the result if null.
|
||||
ReadHSV(rgb)
|
||||
Takes an HSV string like "#100FF80" and converts it to a list such as list(256,255,128). If an HSVA format is used that
|
||||
includes alpha, the list will have a fourth item for the alpha value.
|
||||
Takes an HSV string like "#100FF80" and converts it to a list such as list(256,255,128). If an HSVA format is used that
|
||||
includes alpha, the list will have a fourth item for the alpha value.
|
||||
RGBtoHSV(rgb)
|
||||
Takes an RGB or RGBA string like "#ffaa55" and converts it into an HSV or HSVA color such as "#080aaff".
|
||||
Takes an RGB or RGBA string like "#ffaa55" and converts it into an HSV or HSVA color such as "#080aaff".
|
||||
HSVtoRGB(hsv)
|
||||
Takes an HSV or HSVA string like "#080aaff" and converts it into an RGB or RGBA color such as "#ff55aa".
|
||||
Takes an HSV or HSVA string like "#080aaff" and converts it into an RGB or RGBA color such as "#ff55aa".
|
||||
BlendRGB(rgb1, rgb2, amount)
|
||||
Blends between two RGB or RGBA colors using regular RGB blending. If amount is 0, the first color is the result;
|
||||
if 1, the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
|
||||
The returned value is an RGB or RGBA color.
|
||||
Blends between two RGB or RGBA colors using regular RGB blending. If amount is 0, the first color is the result;
|
||||
if 1, the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
|
||||
The returned value is an RGB or RGBA color.
|
||||
BlendHSV(hsv1, hsv2, amount)
|
||||
Blends between two HSV or HSVA colors using HSV blending, which tends to produce nicer results than regular RGB
|
||||
blending because the brightness of the color is left intact. If amount is 0, the first color is the result; if 1,
|
||||
the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
|
||||
The returned value is an HSV or HSVA color.
|
||||
Blends between two HSV or HSVA colors using HSV blending, which tends to produce nicer results than regular RGB
|
||||
blending because the brightness of the color is left intact. If amount is 0, the first color is the result; if 1,
|
||||
the second color is the result. 0.5 produces an average of the two. Values outside the 0 to 1 range are allowed as well.
|
||||
The returned value is an HSV or HSVA color.
|
||||
BlendRGBasHSV(rgb1, rgb2, amount)
|
||||
Like BlendHSV(), but the colors used and the return value are RGB or RGBA colors. The blending is done in HSV form.
|
||||
Like BlendHSV(), but the colors used and the return value are RGB or RGBA colors. The blending is done in HSV form.
|
||||
HueToAngle(hue)
|
||||
Converts a hue to an angle range of 0 to 360. Angle 0 is red, 120 is green, and 240 is blue.
|
||||
Converts a hue to an angle range of 0 to 360. Angle 0 is red, 120 is green, and 240 is blue.
|
||||
AngleToHue(hue)
|
||||
Converts an angle to a hue in the valid range.
|
||||
Converts an angle to a hue in the valid range.
|
||||
RotateHue(hsv, angle)
|
||||
Takes an HSV or HSVA value and rotates the hue forward through red, green, and blue by an angle from 0 to 360.
|
||||
(Rotating red by 60° produces yellow.) The result is another HSV or HSVA color with the same saturation and value
|
||||
as the original, but a different hue.
|
||||
Takes an HSV or HSVA value and rotates the hue forward through red, green, and blue by an angle from 0 to 360.
|
||||
(Rotating red by 60° produces yellow.) The result is another HSV or HSVA color with the same saturation and value
|
||||
as the original, but a different hue.
|
||||
GrayScale(rgb)
|
||||
Takes an RGB or RGBA color and converts it to grayscale. Returns an RGB or RGBA string.
|
||||
Takes an RGB or RGBA color and converts it to grayscale. Returns an RGB or RGBA string.
|
||||
ColorTone(rgb, tone)
|
||||
Similar to GrayScale(), this proc converts an RGB or RGBA color to a range of black -> tone -> white instead of
|
||||
using strict shades of gray. The tone value is an RGB color; any alpha value is ignored.
|
||||
Similar to GrayScale(), this proc converts an RGB or RGBA color to a range of black -> tone -> white instead of
|
||||
using strict shades of gray. The tone value is an RGB color; any alpha value is ignored.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -1112,10 +1112,10 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico
|
||||
|
||||
|
||||
/**
|
||||
* Converts an icon to base64. Operates by putting the icon in the iconCache savefile,
|
||||
* exporting it as text, and then parsing the base64 from that.
|
||||
* (This relies on byond automatically storing icons in savefiles as base64)
|
||||
*/
|
||||
* Converts an icon to base64. Operates by putting the icon in the iconCache savefile,
|
||||
* exporting it as text, and then parsing the base64 from that.
|
||||
* (This relies on byond automatically storing icons in savefiles as base64)
|
||||
*/
|
||||
/proc/icon2base64(icon/icon)
|
||||
if (!isicon(icon))
|
||||
return FALSE
|
||||
@@ -1154,7 +1154,7 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico
|
||||
return SSassets.transport.get_asset_url(name)
|
||||
return "<img class='icon icon-misc' src='[SSassets.transport.get_asset_url(name)]'>"
|
||||
var/atom/A = thing
|
||||
|
||||
|
||||
I = A.icon
|
||||
if (isnull(icon_state))
|
||||
icon_state = A.icon_state
|
||||
@@ -1162,10 +1162,10 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico
|
||||
icon_state = initial(A.icon_state)
|
||||
if (isnull(dir))
|
||||
dir = initial(A.dir)
|
||||
|
||||
|
||||
if (isnull(dir))
|
||||
dir = A.dir
|
||||
|
||||
dir = A.dir
|
||||
|
||||
if (ishuman(thing)) // Shitty workaround for a BYOND issue.
|
||||
var/icon/temp = I
|
||||
I = icon()
|
||||
|
||||
+10
-10
@@ -1,8 +1,8 @@
|
||||
// JATUM. System for making the serializing and deserializing of PoD types easier
|
||||
|
||||
/**
|
||||
* Gets the flat list that can be passed in a `new /type(argslist(retval))` expression to recreate the datum. Must only return a list containing values that can be JATUM serialized
|
||||
*/
|
||||
* Gets the flat list that can be passed in a `new /type(argslist(retval))` expression to recreate the datum. Must only return a list containing values that can be JATUM serialized
|
||||
*/
|
||||
/datum/proc/jatum_new_arglist()
|
||||
return null
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#define JATUM_VERSION 1
|
||||
|
||||
/**
|
||||
* Attempt to serialize a given value to the JATUM format.
|
||||
*
|
||||
* * value - The var to serialize.
|
||||
*/
|
||||
* Attempt to serialize a given value to the JATUM format.
|
||||
*
|
||||
* * value - The var to serialize.
|
||||
*/
|
||||
/world/proc/jatum_serialize(value)
|
||||
var/list/json_structure
|
||||
try
|
||||
@@ -135,10 +135,10 @@
|
||||
return json_structure
|
||||
|
||||
/**
|
||||
* Attempt to create a value from a JATUN JSON.
|
||||
*
|
||||
* * json - The JSON to deserialize.
|
||||
*/
|
||||
* Attempt to create a value from a JATUN JSON.
|
||||
*
|
||||
* * json - The JSON to deserialize.
|
||||
*/
|
||||
/world/proc/jatum_deserialize(json)
|
||||
if(!istext(json))
|
||||
CRASH("Non-text passed!")
|
||||
|
||||
@@ -72,9 +72,9 @@
|
||||
|
||||
//Dumps the matrix data in a matrix-grid format
|
||||
/*
|
||||
a d 0
|
||||
b e 0
|
||||
c f 1
|
||||
a d 0
|
||||
b e 0
|
||||
c f 1
|
||||
*/
|
||||
/matrix/proc/togrid()
|
||||
. = list()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
GLOBAL_LIST_EMPTY(string_assoc_lists)
|
||||
|
||||
/**
|
||||
* Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
|
||||
*/
|
||||
* Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
|
||||
*/
|
||||
/datum/proc/string_assoc_list(list/values)
|
||||
var/list/string_id = list()
|
||||
for(var/val in values)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
GLOBAL_LIST_EMPTY(string_lists)
|
||||
|
||||
/**
|
||||
* Caches lists with non-numeric stringify-able values (text or typepath).
|
||||
*/
|
||||
* Caches lists with non-numeric stringify-able values (text or typepath).
|
||||
*/
|
||||
/proc/string_list(list/values)
|
||||
var/string_id = values.Join("-")
|
||||
|
||||
|
||||
+42
-42
@@ -69,15 +69,15 @@
|
||||
return copytext((html_encode(strip_html_simple(t))),1,limit)
|
||||
|
||||
/**
|
||||
* Perform a whitespace cleanup on the text, similar to what HTML renderers do
|
||||
*
|
||||
* This is useful if you want to better predict how text is going to look like when displaying it to a user.
|
||||
* HTML renderers collapse multiple whitespaces into one, trims prepending and appending spaces, among other things. This proc attempts to do the same thing.
|
||||
* HTML5 defines whitespace pretty much exactly like regex defines the `\s` group, `[ \t\r\n\f]`.
|
||||
*
|
||||
* Arguments:
|
||||
* * t - The text to "render"
|
||||
*/
|
||||
* Perform a whitespace cleanup on the text, similar to what HTML renderers do
|
||||
*
|
||||
* This is useful if you want to better predict how text is going to look like when displaying it to a user.
|
||||
* HTML renderers collapse multiple whitespaces into one, trims prepending and appending spaces, among other things. This proc attempts to do the same thing.
|
||||
* HTML5 defines whitespace pretty much exactly like regex defines the `\s` group, `[ \t\r\n\f]`.
|
||||
*
|
||||
* Arguments:
|
||||
* * t - The text to "render"
|
||||
*/
|
||||
/proc/htmlrendertext(t)
|
||||
// Trim "whitespace" by lazily capturing word characters in the middle
|
||||
var/static/regex/matchMiddle = new(@"^\s*([\W\w]*?)\s*$")
|
||||
@@ -142,11 +142,11 @@
|
||||
#define LETTERS_DETECTED 4
|
||||
|
||||
/**
|
||||
* Filters out undesirable characters from names.
|
||||
*
|
||||
* * strict - return null immidiately instead of filtering out
|
||||
* * allow_numbers - allows numbers and common special characters - used for silicon/other weird things names
|
||||
*/
|
||||
* Filters out undesirable characters from names.
|
||||
*
|
||||
* * strict - return null immidiately instead of filtering out
|
||||
* * allow_numbers - allows numbers and common special characters - used for silicon/other weird things names
|
||||
*/
|
||||
/proc/reject_bad_name(t_in, allow_numbers = FALSE, max_length = MAX_NAME_LEN, ascii_only = TRUE, strict = FALSE)
|
||||
if(!t_in)
|
||||
return //Rejects the input if it is null
|
||||
@@ -297,16 +297,16 @@
|
||||
return ""
|
||||
|
||||
/**
|
||||
* Truncate a string to the given length
|
||||
*
|
||||
* Will only truncate if the string is larger than the length and *ignores unicode concerns*
|
||||
*
|
||||
* This exists soley because trim does other stuff too.
|
||||
*
|
||||
* Arguments:
|
||||
* * text - String
|
||||
* * max_length - integer length to truncate at
|
||||
*/
|
||||
* Truncate a string to the given length
|
||||
*
|
||||
* Will only truncate if the string is larger than the length and *ignores unicode concerns*
|
||||
*
|
||||
* This exists soley because trim does other stuff too.
|
||||
*
|
||||
* Arguments:
|
||||
* * text - String
|
||||
* * max_length - integer length to truncate at
|
||||
*/
|
||||
/proc/truncate(text, max_length)
|
||||
if(length(text) > max_length)
|
||||
return copytext(text, 1, max_length)
|
||||
@@ -883,20 +883,20 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
return "\[[loadstring]\]"
|
||||
|
||||
/**
|
||||
* Formats a number to human readable form with the appropriate SI unit.
|
||||
*
|
||||
* Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well.
|
||||
* Examples:
|
||||
* * `siunit(1234, "Pa", 1)` -> `"1.2 kPa"`
|
||||
* * `siunit(0.5345, "A", 0)` -> `"535 mA"`
|
||||
* * `siunit(1000, "Pa", 4)` -> `"1 kPa"`
|
||||
* Arguments:
|
||||
* * value - The number to convert to text. Can be positive or negative.
|
||||
* * unit - The base unit of the number, such as "Pa" or "W".
|
||||
* * maxdecimals - Maximum amount of decimals to display for the final number. Defaults to 1.
|
||||
* *
|
||||
* * For pressure conversion, use proc/siunit_pressure() below
|
||||
*/
|
||||
* Formats a number to human readable form with the appropriate SI unit.
|
||||
*
|
||||
* Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well.
|
||||
* Examples:
|
||||
* * `siunit(1234, "Pa", 1)` -> `"1.2 kPa"`
|
||||
* * `siunit(0.5345, "A", 0)` -> `"535 mA"`
|
||||
* * `siunit(1000, "Pa", 4)` -> `"1 kPa"`
|
||||
* Arguments:
|
||||
* * value - The number to convert to text. Can be positive or negative.
|
||||
* * unit - The base unit of the number, such as "Pa" or "W".
|
||||
* * maxdecimals - Maximum amount of decimals to display for the final number. Defaults to 1.
|
||||
* *
|
||||
* * For pressure conversion, use proc/siunit_pressure() below
|
||||
*/
|
||||
/proc/siunit(value, unit, maxdecimals=1)
|
||||
var/static/list/prefixes = list("f","p","n","μ","m","","k","M","G","T","P")
|
||||
|
||||
@@ -922,10 +922,10 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
|
||||
|
||||
/** The game code never uses Pa, but kPa, since 1 Pa is too small to reasonably handle
|
||||
* Thus, to ensure correct conversion from any kPa in game code, this value needs to be multiplied by 10e3 to get Pa, which the siunit() proc expects
|
||||
* Args:
|
||||
* * value_in_kpa - Value that should be converted to readable text in kPa
|
||||
* * maxdecimals - maximum number of decimals that are displayed, defaults to 1 in proc/siunit()
|
||||
* Thus, to ensure correct conversion from any kPa in game code, this value needs to be multiplied by 10e3 to get Pa, which the siunit() proc expects
|
||||
* Args:
|
||||
* * value_in_kpa - Value that should be converted to readable text in kPa
|
||||
* * maxdecimals - maximum number of decimals that are displayed, defaults to 1 in proc/siunit()
|
||||
*/
|
||||
/proc/siunit_pressure(value_in_kpa, maxdecimals)
|
||||
var/pressure_adj = value_in_kpa * 1000 //to adjust for using kPa instead of Pa
|
||||
|
||||
+34
-34
@@ -382,16 +382,16 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
return locate(x,y,A.z)
|
||||
|
||||
/**
|
||||
* Get ranged target turf, but with direct targets as opposed to directions
|
||||
*
|
||||
* Starts at atom A and gets the exact angle between A and target
|
||||
* Moves from A with that angle, Range amount of times, until it stops, bound to map size
|
||||
* Arguments:
|
||||
* * A - Initial Firer / Position
|
||||
* * target - Target to aim towards
|
||||
* * range - Distance of returned target turf from A
|
||||
* * offset - Angle offset, 180 input would make the returned target turf be in the opposite direction
|
||||
*/
|
||||
* Get ranged target turf, but with direct targets as opposed to directions
|
||||
*
|
||||
* Starts at atom A and gets the exact angle between A and target
|
||||
* Moves from A with that angle, Range amount of times, until it stops, bound to map size
|
||||
* Arguments:
|
||||
* * A - Initial Firer / Position
|
||||
* * target - Target to aim towards
|
||||
* * range - Distance of returned target turf from A
|
||||
* * offset - Angle offset, 180 input would make the returned target turf be in the opposite direction
|
||||
*/
|
||||
/proc/get_ranged_target_turf_direct(atom/A, atom/target, range, offset)
|
||||
var/angle = ATAN2(target.x - A.x, target.y - A.y)
|
||||
if(offset)
|
||||
@@ -574,16 +574,16 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
|
||||
/*
|
||||
|
||||
Gets the turf this atom's *ICON* appears to inhabit
|
||||
It takes into account:
|
||||
* Pixel_x/y
|
||||
* Matrix x/y
|
||||
Lets the turf this atom's *ICON* appears to inhabit
|
||||
it takes into account:
|
||||
* Pixel_x/y
|
||||
* Matrix x/y
|
||||
|
||||
NOTE: if your atom has non-standard bounds then this proc
|
||||
will handle it, but:
|
||||
* if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked
|
||||
(this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off)
|
||||
* if the bounds are odd, the true middle turf of the atom is returned
|
||||
NOTE: if your atom has non-standard bounds then this proc
|
||||
will handle it, but:
|
||||
* if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked
|
||||
this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off)
|
||||
* if the bounds are odd, the true middle turf of the atom is returned
|
||||
|
||||
*/
|
||||
|
||||
@@ -788,21 +788,21 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
|
||||
/*
|
||||
rough example of the "cone" made by the 3 dirs checked
|
||||
|
||||
B
|
||||
\
|
||||
\
|
||||
>
|
||||
<
|
||||
\
|
||||
\
|
||||
B --><-- A
|
||||
/
|
||||
/
|
||||
<
|
||||
>
|
||||
/
|
||||
/
|
||||
B
|
||||
|
||||
* \
|
||||
* \
|
||||
* >
|
||||
* <
|
||||
* \
|
||||
* \
|
||||
*B --><-- A
|
||||
* /
|
||||
* /
|
||||
* <
|
||||
* >
|
||||
* /
|
||||
* /
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
+14
-14
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* handles adding verbs and updating the stat panel browser
|
||||
*
|
||||
* pass the verb type path to this instead of adding it directly to verbs so the statpanel can update
|
||||
* Arguments:
|
||||
* * target - Who the verb is being added to, client or mob typepath
|
||||
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
|
||||
*/
|
||||
* handles adding verbs and updating the stat panel browser
|
||||
*
|
||||
* pass the verb type path to this instead of adding it directly to verbs so the statpanel can update
|
||||
* Arguments:
|
||||
* * target - Who the verb is being added to, client or mob typepath
|
||||
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
|
||||
*/
|
||||
/proc/add_verb(client/target, verb_or_list_to_add)
|
||||
if(!target)
|
||||
CRASH("add_verb called without a target")
|
||||
@@ -48,13 +48,13 @@
|
||||
target << output("[output_list];", "statbrowser:add_verb_list")
|
||||
|
||||
/**
|
||||
* handles removing verb and sending it to browser to update, use this for removing verbs
|
||||
*
|
||||
* pass the verb type path to this instead of removing it from verbs so the statpanel can update
|
||||
* Arguments:
|
||||
* * target - Who the verb is being removed from, client or mob typepath
|
||||
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
|
||||
*/
|
||||
* handles removing verb and sending it to browser to update, use this for removing verbs
|
||||
*
|
||||
* pass the verb type path to this instead of removing it from verbs so the statpanel can update
|
||||
* Arguments:
|
||||
* * target - Who the verb is being removed from, client or mob typepath
|
||||
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
|
||||
*/
|
||||
/proc/remove_verb(client/target, verb_or_list_to_remove)
|
||||
if(IsAdminAdvancedProcCall())
|
||||
return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
FUN ZONE OF ADMIN LISTINGS
|
||||
Try to keep this in sync with __DEFINES/traits.dm
|
||||
quirks have it's own panel so we don't need them here.
|
||||
FUN ZONE OF ADMIN LISTINGS
|
||||
Try to keep this in sync with __DEFINES/traits.dm
|
||||
quirks have it's own panel so we don't need them here.
|
||||
*/
|
||||
GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
/mob = list(
|
||||
|
||||
+33
-33
@@ -1,37 +1,37 @@
|
||||
#define js_dropdowns {"
|
||||
function dropdowns() {
|
||||
var divs = document.getElementsByTagName('div');
|
||||
var headers = new Array();
|
||||
var links = new Array();
|
||||
for(var i=0;i<divs.length;i++){
|
||||
if(divs\[i\].className=='header') {
|
||||
divs\[i\].className='header closed';
|
||||
divs\[i\].innerHTML = divs\[i\].innerHTML+' +';
|
||||
headers.push(divs\[i\]);
|
||||
}
|
||||
if(divs\[i\].className=='links') {
|
||||
divs\[i\].className='links hidden';
|
||||
links.push(divs\[i\]);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<headers.length;i++){
|
||||
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null) {
|
||||
headers\[i\].onclick = (function(elem) {
|
||||
return function() {
|
||||
if(elem.className.search('visible')>=0) {
|
||||
elem.className = elem.className.replace('visible','hidden');
|
||||
this.className = this.className.replace('open','closed');
|
||||
this.innerHTML = this.innerHTML.replace('-','+');
|
||||
}
|
||||
else {
|
||||
elem.className = elem.className.replace('hidden','visible');
|
||||
this.className = this.className.replace('closed','open');
|
||||
this.innerHTML = this.innerHTML.replace('+','-');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
})(links\[i\]);
|
||||
}
|
||||
}
|
||||
var divs = document.getElementsByTagName('div');
|
||||
var headers = new Array();
|
||||
var links = new Array();
|
||||
for(var i=0;i<divs.length;i++){
|
||||
if(divs\[i\].className=='header') {
|
||||
divs\[i\].className='header closed';
|
||||
divs\[i\].innerHTML = divs\[i\].innerHTML+' +';
|
||||
headers.push(divs\[i\]);
|
||||
}
|
||||
if(divs\[i\].className=='links') {
|
||||
divs\[i\].className='links hidden';
|
||||
links.push(divs\[i\]);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<headers.length;i++){
|
||||
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null) {
|
||||
headers\[i\].onclick = (function(elem) {
|
||||
return function() {
|
||||
if(elem.className.search('visible')>=0) {
|
||||
elem.className = elem.className.replace('visible','hidden');
|
||||
this.className = this.className.replace('open','closed');
|
||||
this.innerHTML = this.innerHTML.replace('-','+');
|
||||
}
|
||||
else {
|
||||
elem.className = elem.className.replace('hidden','visible');
|
||||
this.className = this.className.replace('closed','open');
|
||||
this.innerHTML = this.innerHTML.replace('+','-');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
})(links\[i\]);
|
||||
}
|
||||
}
|
||||
}
|
||||
"}
|
||||
|
||||
+55
-55
@@ -30,14 +30,14 @@
|
||||
next_move = world.time + ((num + adj)*mod)
|
||||
|
||||
/**
|
||||
* Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
||||
* remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
|
||||
*
|
||||
* Alternately, you could hardcode every mob's variation in a flat [/mob/proc/ClickOn] proc; however,
|
||||
* that's a lot of code duplication and is hard to maintain.
|
||||
*
|
||||
* Note that this proc can be overridden, and is in the case of screen objects.
|
||||
*/
|
||||
* Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
||||
* remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
|
||||
*
|
||||
* Alternately, you could hardcode every mob's variation in a flat [/mob/proc/ClickOn] proc; however,
|
||||
* that's a lot of code duplication and is hard to maintain.
|
||||
*
|
||||
* Note that this proc can be overridden, and is in the case of screen objects.
|
||||
*/
|
||||
/atom/Click(location,control,params)
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK, location, control, params, usr)
|
||||
@@ -52,18 +52,18 @@
|
||||
usr.MouseWheelOn(src, delta_x, delta_y, params)
|
||||
|
||||
/**
|
||||
* Standard mob ClickOn()
|
||||
* Handles exceptions: Buildmode, middle click, modified clicks, mech actions
|
||||
*
|
||||
* After that, mostly just check your state, check whether you're holding an item,
|
||||
* check whether you're adjacent to the target, then pass off the click to whoever
|
||||
* is receiving it.
|
||||
* The most common are:
|
||||
* * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
|
||||
* * [atom/proc/attackby] (item,user) - used only when adjacent
|
||||
* * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
|
||||
* * [mob/proc/RangedAttack] (atom,params) - used only ranged, only used for tk and laser eyes but could be changed
|
||||
*/
|
||||
* Standard mob ClickOn()
|
||||
* Handles exceptions: Buildmode, middle click, modified clicks, mech actions
|
||||
*
|
||||
* After that, mostly just check your state, check whether you're holding an item,
|
||||
* check whether you're adjacent to the target, then pass off the click to whoever
|
||||
* is receiving it.
|
||||
* The most common are:
|
||||
* * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
|
||||
* * [atom/proc/attackby] (item,user) - used only when adjacent
|
||||
* * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
|
||||
* * [mob/proc/RangedAttack] (atom,params) - used only ranged, only used for tk and laser eyes but could be changed
|
||||
*/
|
||||
/mob/proc/ClickOn( atom/A, params )
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
@@ -176,9 +176,9 @@
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* A backwards depth-limited breadth-first-search to see if the target is
|
||||
* logically "in" anything adjacent to us.
|
||||
*/
|
||||
* A backwards depth-limited breadth-first-search to see if the target is
|
||||
* logically "in" anything adjacent to us.
|
||||
*/
|
||||
/atom/movable/proc/CanReach(atom/ultimate_target, obj/item/tool, view_only = FALSE)
|
||||
var/list/direct_access = DirectAccess()
|
||||
var/depth = 1 + (view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH)
|
||||
@@ -250,37 +250,37 @@
|
||||
|
||||
|
||||
/**
|
||||
* Translates into [atom/proc/attack_hand], etc.
|
||||
*
|
||||
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
|
||||
* and usage when clicking on things telekinetically (flag=0). This proc will
|
||||
* not be called at ranged except with telekinesis.
|
||||
*
|
||||
* proximity_flag is not currently passed to attack_hand, and is instead used
|
||||
* in human click code to allow glove touches only at melee range.
|
||||
*/
|
||||
* Translates into [atom/proc/attack_hand], etc.
|
||||
*
|
||||
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
|
||||
* and usage when clicking on things telekinetically (flag=0). This proc will
|
||||
* not be called at ranged except with telekinesis.
|
||||
*
|
||||
* proximity_flag is not currently passed to attack_hand, and is instead used
|
||||
* in human click code to allow glove touches only at melee range.
|
||||
*/
|
||||
/mob/proc/UnarmedAttack(atom/A, proximity_flag)
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
return
|
||||
|
||||
/**
|
||||
* Ranged unarmed attack:
|
||||
*
|
||||
* This currently is just a default for all mobs, involving
|
||||
* laser eyes and telekinesis. You could easily add exceptions
|
||||
* for things like ranged glove touches, spitting alien acid/neurotoxin,
|
||||
* animals lunging, etc.
|
||||
*/
|
||||
* Ranged unarmed attack:
|
||||
*
|
||||
* This currently is just a default for all mobs, involving
|
||||
* laser eyes and telekinesis. You could easily add exceptions
|
||||
* for things like ranged glove touches, spitting alien acid/neurotoxin,
|
||||
* animals lunging, etc.
|
||||
*/
|
||||
/mob/proc/RangedAttack(atom/A, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_MOB_ATTACK_RANGED, A, params) & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
return TRUE
|
||||
|
||||
|
||||
/**
|
||||
* Middle click
|
||||
* Mainly used for swapping hands
|
||||
*/
|
||||
* Middle click
|
||||
* Mainly used for swapping hands
|
||||
*/
|
||||
/mob/proc/MiddleClickOn(atom/A)
|
||||
. = SEND_SIGNAL(src, COMSIG_MOB_MIDDLECLICKON, A)
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON)
|
||||
@@ -288,10 +288,10 @@
|
||||
swap_hand()
|
||||
|
||||
/**
|
||||
* Shift click
|
||||
* For most mobs, examine.
|
||||
* This is overridden in ai.dm
|
||||
*/
|
||||
* Shift click
|
||||
* For most mobs, examine.
|
||||
* This is overridden in ai.dm
|
||||
*/
|
||||
/mob/proc/ShiftClickOn(atom/A)
|
||||
A.ShiftClick(src)
|
||||
return
|
||||
@@ -303,9 +303,9 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Ctrl click
|
||||
* For most objects, pull
|
||||
*/
|
||||
* Ctrl click
|
||||
* For most objects, pull
|
||||
*/
|
||||
/mob/proc/CtrlClickOn(atom/A)
|
||||
A.CtrlClick(src)
|
||||
return
|
||||
@@ -326,9 +326,9 @@
|
||||
else
|
||||
..()
|
||||
/**
|
||||
* Alt click
|
||||
* Unused except for AI
|
||||
*/
|
||||
* Alt click
|
||||
* Unused except for AI
|
||||
*/
|
||||
/mob/proc/AltClickOn(atom/A)
|
||||
. = SEND_SIGNAL(src, COMSIG_MOB_ALTCLICKON, A)
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON)
|
||||
@@ -353,9 +353,9 @@
|
||||
return T.Adjacent(src)
|
||||
|
||||
/**
|
||||
* Control+Shift click
|
||||
* Unused except for AI
|
||||
*/
|
||||
* Control+Shift click
|
||||
* Unused except for AI
|
||||
*/
|
||||
/mob/proc/CtrlShiftClickOn(atom/A)
|
||||
A.CtrlShiftClick(src)
|
||||
return
|
||||
|
||||
+19
-20
@@ -2,18 +2,17 @@
|
||||
|
||||
//PUBLIC - call these wherever you want
|
||||
|
||||
|
||||
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
|
||||
|
||||
/* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already
|
||||
category is a text string. Each mob may only have one alert per category; the previous one will be replaced
|
||||
path is a type path of the actual alert type to throw
|
||||
severity is an optional number that will be placed at the end of the icon_state for this alert
|
||||
For example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2"
|
||||
new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay.
|
||||
Clicks are forwarded to master
|
||||
Override makes it so the alert is not replaced until cleared by a clear_alert with clear_override, and it's used for hallucinations.
|
||||
/**
|
||||
*Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already
|
||||
*category is a text string. Each mob may only have one alert per category; the previous one will be replaced
|
||||
*path is a type path of the actual alert type to throw
|
||||
*severity is an optional number that will be placed at the end of the icon_state for this alert
|
||||
*for example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2"
|
||||
*new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay.
|
||||
*flicks are forwarded to master
|
||||
*override makes it so the alert is not replaced until cleared by a clear_alert with clear_override, and it's used for hallucinations.
|
||||
*/
|
||||
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
|
||||
|
||||
if(!category || QDELETED(src))
|
||||
return
|
||||
@@ -284,15 +283,15 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
var/obj/item/receiving
|
||||
|
||||
/**
|
||||
* Handles assigning most of the variables for the alert that pops up when an item is offered
|
||||
*
|
||||
* Handles setting the name, description and icon of the alert and tracking the person giving
|
||||
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the giver
|
||||
* Arguments:
|
||||
* * taker - The person receiving the alert
|
||||
* * giver - The person giving the alert and item
|
||||
* * receiving - The item being given by the giver
|
||||
*/
|
||||
* Handles assigning most of the variables for the alert that pops up when an item is offered
|
||||
*
|
||||
* Handles setting the name, description and icon of the alert and tracking the person giving
|
||||
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the giver
|
||||
* Arguments:
|
||||
* * taker - The person receiving the alert
|
||||
* * giver - The person giving the alert and item
|
||||
* * receiving - The item being given by the giver
|
||||
*/
|
||||
/atom/movable/screen/alert/give/proc/setup(mob/living/carbon/taker, mob/living/carbon/giver, obj/item/receiving)
|
||||
name = "[giver] is offering [receiving]"
|
||||
desc = "[giver] is offering [receiving]. Click this alert to take it."
|
||||
|
||||
@@ -84,11 +84,11 @@
|
||||
filters += filter(type="alpha", render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE)
|
||||
|
||||
/**
|
||||
* Things placed on this mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Gets masked by blocking plane. Use for things that you want blocked by
|
||||
* mobs, items, etc.
|
||||
*/
|
||||
* Things placed on this mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Gets masked by blocking plane. Use for things that you want blocked by
|
||||
* mobs, items, etc.
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive
|
||||
name = "emissive plane master"
|
||||
plane = EMISSIVE_PLANE
|
||||
@@ -100,11 +100,11 @@
|
||||
filters += filter(type="alpha", render_source=EMISSIVE_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
|
||||
|
||||
/**
|
||||
* Things placed on this always mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Always masks the light plane, isn't blocked by anything. Use for on mob glows,
|
||||
* magic stuff, etc.
|
||||
*/
|
||||
* Things placed on this always mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Always masks the light plane, isn't blocked by anything. Use for on mob glows,
|
||||
* magic stuff, etc.
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive_unblockable
|
||||
name = "unblockable emissive plane master"
|
||||
plane = EMISSIVE_UNBLOCKABLE_PLANE
|
||||
@@ -112,10 +112,10 @@
|
||||
render_target = EMISSIVE_UNBLOCKABLE_RENDER_TARGET
|
||||
|
||||
/**
|
||||
* Things placed on this layer mask the emissive layer. Doesn't render directly
|
||||
*
|
||||
* You really shouldn't be directly using this, use atom helpers instead
|
||||
*/
|
||||
* Things placed on this layer mask the emissive layer. Doesn't render directly
|
||||
*
|
||||
* You really shouldn't be directly using this, use atom helpers instead
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive_blocker
|
||||
name = "emissive blocker plane master"
|
||||
plane = EMISSIVE_BLOCKER_PLANE
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
var/slot_id
|
||||
/// Icon when empty. For now used only by humans.
|
||||
var/icon_empty
|
||||
/// Icon when contains an item. For now used only by humans.
|
||||
/// Icon when contains an item. For now used only by humans.
|
||||
var/icon_full
|
||||
/// The overlay when hovering over with an item in your hand
|
||||
var/image/object_overlay
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* This is the proc that handles the order of an item_attack.
|
||||
*
|
||||
* The order of procs called is:
|
||||
* * [/atom/proc/tool_act] on the target. If it returns TRUE, the chain will be stopped.
|
||||
* * [/obj/item/proc/pre_attack] on src. If this returns TRUE, the chain will be stopped.
|
||||
* * [/atom/proc/attackby] on the target. If it returns TRUE, the chain will be stopped.
|
||||
* * [/obj/item/proc/afterattack]. The return value does not matter.
|
||||
*/
|
||||
* This is the proc that handles the order of an item_attack.
|
||||
*
|
||||
* The order of procs called is:
|
||||
* * [/atom/proc/tool_act] on the target. If it returns TRUE, the chain will be stopped.
|
||||
* * [/obj/item/proc/pre_attack] on src. If this returns TRUE, the chain will be stopped.
|
||||
* * [/atom/proc/attackby] on the target. If it returns TRUE, the chain will be stopped.
|
||||
* * [/obj/item/proc/afterattack]. The return value does not matter.
|
||||
*/
|
||||
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
|
||||
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
|
||||
return TRUE
|
||||
@@ -26,30 +26,30 @@
|
||||
interact(user)
|
||||
|
||||
/**
|
||||
* Called on the item before it hits something
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/A - The atom about to be hit
|
||||
* * mob/living/user - The mob doing the htting
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
* Called on the item before it hits something
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/A - The atom about to be hit
|
||||
* * mob/living/user - The mob doing the htting
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
/obj/item/proc/pre_attack(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
return TRUE
|
||||
return FALSE //return TRUE to avoid calling attackby after this proc does stuff
|
||||
|
||||
/**
|
||||
* Called on an object being hit by an item
|
||||
*
|
||||
* Arguments:
|
||||
* * obj/item/W - The item hitting this atom
|
||||
* * mob/user - The wielder of this item
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
* Called on an object being hit by an item
|
||||
*
|
||||
* Arguments:
|
||||
* * obj/item/W - The item hitting this atom
|
||||
* * mob/user - The wielder of this item
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, params) & COMPONENT_NO_AFTERATTACK)
|
||||
return TRUE
|
||||
@@ -65,12 +65,12 @@
|
||||
return I.attack(src, user)
|
||||
|
||||
/**
|
||||
* Called from [/mob/living/proc/attackby]
|
||||
*
|
||||
* Arguments:
|
||||
* * mob/living/M - The mob being hit by this item
|
||||
* * mob/living/user - The mob hitting with this item
|
||||
*/
|
||||
* Called from [/mob/living/proc/attackby]
|
||||
*
|
||||
* Arguments:
|
||||
* * mob/living/M - The mob being hit by this item
|
||||
* * mob/living/user - The mob hitting with this item
|
||||
*/
|
||||
/obj/item/proc/attack(mob/living/M, mob/living/user)
|
||||
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user)
|
||||
if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
@@ -152,14 +152,14 @@
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Last proc in the [/obj/item/proc/melee_attack_chain]
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/target - The thing that was hit
|
||||
* * mob/user - The mob doing the hitting
|
||||
* * proximity_flag - is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
* * click_parameters - is the params string from byond [/atom/proc/Click] code, see that documentation.
|
||||
*/
|
||||
* Last proc in the [/obj/item/proc/melee_attack_chain]
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/target - The thing that was hit
|
||||
* * mob/user - The mob doing the hitting
|
||||
* * proximity_flag - is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
* * click_parameters - is the params string from byond [/atom/proc/Click] code, see that documentation.
|
||||
*/
|
||||
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_AFTERATTACK, target, user, proximity_flag, click_parameters)
|
||||
SEND_SIGNAL(user, COMSIG_MOB_ITEM_AFTERATTACK, target, user, proximity_flag, click_parameters)
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis attack act, happens when the TK user clicks on a non-adjacent target in range.
|
||||
*
|
||||
* * By default, emulates the user's unarmed attack.
|
||||
* * Called indirectly by the `COMSIG_MOB_ATTACK_RANGED` signal.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis attack act, happens when the TK user clicks on a non-adjacent target in range.
|
||||
*
|
||||
* * By default, emulates the user's unarmed attack.
|
||||
* * Called indirectly by the `COMSIG_MOB_ATTACK_RANGED` signal.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/atom/proc/attack_tk(mob/user)
|
||||
if(user.stat || !tkMaxRangeCheck(user, src))
|
||||
return
|
||||
@@ -38,11 +38,11 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis object grab act.
|
||||
*
|
||||
* * Called by `/obj/attack_tk()`.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis object grab act.
|
||||
*
|
||||
* * Called by `/obj/attack_tk()`.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/obj/proc/attack_tk_grab(mob/user)
|
||||
var/obj/item/tk_grab/O = new(src)
|
||||
O.tk_user = user
|
||||
@@ -58,13 +58,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis item attack_self act.
|
||||
*
|
||||
* * This is similar to item attack_self, but applies to anything that you can grab with a telekinetic grab.
|
||||
* * It is used for manipulating things at range, for example, opening and closing closets..
|
||||
* * Defined at the `/atom` level but only used at the `/obj/item` one.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis item attack_self act.
|
||||
*
|
||||
* * This is similar to item attack_self, but applies to anything that you can grab with a telekinetic grab.
|
||||
* * It is used for manipulating things at range, for example, opening and closing closets..
|
||||
* * Defined at the `/atom` level but only used at the `/obj/item` one.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/atom/proc/attack_self_tk(mob/user)
|
||||
return
|
||||
|
||||
|
||||
@@ -263,9 +263,9 @@ special keywords defined in _DEFINES/admin.dm
|
||||
|
||||
Example config:
|
||||
{
|
||||
"Assistant" : "Don't kill everyone",
|
||||
"/datum/antagonist/highlander" : "<b>Kill everyone</b>",
|
||||
"Ash Walker" : "Kill all spacemans"
|
||||
"Assistant" : "Don't kill everyone",
|
||||
"/datum/antagonist/highlander" : "<b>Kill everyone</b>",
|
||||
"Ash Walker" : "Kill all spacemans"
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Failsafe
|
||||
*
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
/**
|
||||
* Failsafe
|
||||
*
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
**/
|
||||
|
||||
GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* StonedMC
|
||||
*
|
||||
* Designed to properly split up a given tick among subsystems
|
||||
* Note: if you read parts of this code and think "why is it doing it that way"
|
||||
* Odds are, there is a reason
|
||||
*
|
||||
/**
|
||||
* StonedMC
|
||||
*
|
||||
* Designed to properly split up a given tick among subsystems
|
||||
* Note: if you read parts of this code and think "why is it doing it that way"
|
||||
* Odds are, there is a reason
|
||||
*
|
||||
**/
|
||||
|
||||
//This is the ABSOLUTE ONLY THING that should init globally like this
|
||||
|
||||
@@ -462,27 +462,27 @@ GLOBAL_LIST_EMPTY(colored_images)
|
||||
return mix.gas_string
|
||||
|
||||
/**
|
||||
* Adds a given machine to the processing system for SSAIR_ATMOSMACHINERY processing.
|
||||
*
|
||||
* This should be fast, so no error checking is done.
|
||||
* If you start adding in things you shouldn't, you'll cause runtimes every 2 seconds for every
|
||||
* object you added. Do not use irresponsibly.
|
||||
* Arguments:
|
||||
* * machine - The machine to start processing. Can be any /obj/machinery.
|
||||
*/
|
||||
* Adds a given machine to the processing system for SSAIR_ATMOSMACHINERY processing.
|
||||
*
|
||||
* This should be fast, so no error checking is done.
|
||||
* If you start adding in things you shouldn't, you'll cause runtimes every 2 seconds for every
|
||||
* object you added. Do not use irresponsibly.
|
||||
* Arguments:
|
||||
* * machine - The machine to start processing. Can be any /obj/machinery.
|
||||
*/
|
||||
/datum/controller/subsystem/air/proc/start_processing_machine(obj/machinery/machine)
|
||||
atmos_machinery += machine
|
||||
|
||||
/**
|
||||
* Removes a given machine to the processing system for SSAIR_ATMOSMACHINERY processing.
|
||||
*
|
||||
* This should be fast, so no error checking is done.
|
||||
* If you call this proc when your machine isn't processing, you're likely attempting to
|
||||
* remove something that isn't in a list with over 1000 objects, twice. Do not use
|
||||
* irresponsibly.
|
||||
* Arguments:
|
||||
* * machine - The machine to stop processing.
|
||||
*/
|
||||
* Removes a given machine to the processing system for SSAIR_ATMOSMACHINERY processing.
|
||||
*
|
||||
* This should be fast, so no error checking is done.
|
||||
* If you call this proc when your machine isn't processing, you're likely attempting to
|
||||
* remove something that isn't in a list with over 1000 objects, twice. Do not use
|
||||
* irresponsibly.
|
||||
* Arguments:
|
||||
* * machine - The machine to stop processing.
|
||||
*/
|
||||
/datum/controller/subsystem/air/proc/stop_processing_machine(obj/machinery/machine)
|
||||
atmos_machinery -= machine
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ feedback data can be recorded in 5 formats:
|
||||
"tally"
|
||||
used to track the number of occurances of multiple related values i.e. how many times each type of gun is fired
|
||||
further calls to the same key will:
|
||||
add or subtract from the saved value of the data key if it already exists
|
||||
add or subtract from the saved value of the data key if it already exists
|
||||
append the key and it's value if it doesn't exist
|
||||
calls: SSblackbox.record_feedback("tally", "example", 1, "sample data")
|
||||
SSblackbox.record_feedback("tally", "example", 4, "sample data")
|
||||
@@ -195,7 +195,7 @@ feedback data can be recorded in 5 formats:
|
||||
the final element in the data list is used as the tracking key, all prior elements are used for nesting
|
||||
all data list elements must be strings
|
||||
further calls to the same key will:
|
||||
add or subtract from the saved value of the data key if it already exists in the same multi-dimensional position
|
||||
add or subtract from the saved value of the data key if it already exists in the same multi-dimensional position
|
||||
append the key and it's value if it doesn't exist
|
||||
calls: SSblackbox.record_feedback("nested tally", "example", 1, list("fruit", "orange", "apricot"))
|
||||
SSblackbox.record_feedback("nested tally", "example", 2, list("fruit", "orange", "orange"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
@@ -209,7 +209,7 @@ You are expected to do your own escaping of the data, and expected to provide yo
|
||||
The duplicate_key arg can be true to automatically generate this part of the query
|
||||
or set to a string that is appended to the end of the query
|
||||
Ignore_errors instructes mysql to continue inserting rows if some of them have errors.
|
||||
the erroneous row(s) aren't inserted and there isn't really any way to know why or why errored
|
||||
the erroneous row(s) aren't inserted and there isn't really any way to know why or why errored
|
||||
Delayed insert mode was removed in mysql 7 and only works with MyISAM type tables,
|
||||
It was included because it is still supported in mariadb.
|
||||
It does not work with duplicate_key and the mysql server ignores it in those cases
|
||||
|
||||
@@ -92,26 +92,26 @@ SUBSYSTEM_DEF(discord)
|
||||
notify_members_cache = notify_members // Updates the cache list
|
||||
|
||||
/**
|
||||
* Given a ckey, look up the discord user id attached to the user, if any
|
||||
*
|
||||
* This gets the most recent entry from the discord link table that is associated with the given ckey
|
||||
*
|
||||
* Arguments:
|
||||
* * lookup_ckey A string representing the ckey to search on
|
||||
*/
|
||||
* Given a ckey, look up the discord user id attached to the user, if any
|
||||
*
|
||||
* This gets the most recent entry from the discord link table that is associated with the given ckey
|
||||
*
|
||||
* Arguments:
|
||||
* * lookup_ckey A string representing the ckey to search on
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/lookup_id(lookup_ckey)
|
||||
var/datum/discord_link_record/link = find_discord_link_by_ckey(lookup_ckey)
|
||||
if(link)
|
||||
return link.discord_id
|
||||
|
||||
/**
|
||||
* Given a discord id as a string, look up the ckey attached to that account, if any
|
||||
*
|
||||
* This gets the most recent entry from the discord_link table that is associated with this discord id snowflake
|
||||
*
|
||||
* Arguments:
|
||||
* * lookup_id The discord id as a string
|
||||
*/
|
||||
* Given a discord id as a string, look up the ckey attached to that account, if any
|
||||
*
|
||||
* This gets the most recent entry from the discord_link table that is associated with this discord id snowflake
|
||||
*
|
||||
* Arguments:
|
||||
* * lookup_id The discord id as a string
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/lookup_ckey(lookup_id)
|
||||
var/datum/discord_link_record/link = find_discord_link_by_discord_id(lookup_id)
|
||||
if(link)
|
||||
@@ -127,28 +127,28 @@ SUBSYSTEM_DEF(discord)
|
||||
return generate_one_time_token(ckey)
|
||||
|
||||
/**
|
||||
* Generate a timebound token for discord verification
|
||||
*
|
||||
* This uses the common word list to generate a six word random token, this token can then be fed to a discord bot that has access
|
||||
* to the same database, and it can use it to link a ckey to a discord id, with minimal user effort
|
||||
*
|
||||
* It returns the token to the calling proc, after inserting an entry into the discord_link table of the following form
|
||||
*
|
||||
* ```
|
||||
* (unique_id, ckey, null, the current time, the one time token generated)
|
||||
* the null value will be filled out with the discord id by the integrated discord bot when a user verifies
|
||||
* ```
|
||||
*
|
||||
* Notes:
|
||||
* * The token is guaranteed to unique during it's validity period
|
||||
* * The validity period is currently set at 4 hours
|
||||
* * a token may not be unique outside it's validity window (to reduce conflicts)
|
||||
*
|
||||
* Arguments:
|
||||
* * ckey_for a string representing the ckey this token is for
|
||||
*
|
||||
* Returns a string representing the one time token
|
||||
*/
|
||||
* Generate a timebound token for discord verification
|
||||
*
|
||||
* This uses the common word list to generate a six word random token, this token can then be fed to a discord bot that has access
|
||||
* to the same database, and it can use it to link a ckey to a discord id, with minimal user effort
|
||||
*
|
||||
* It returns the token to the calling proc, after inserting an entry into the discord_link table of the following form
|
||||
*
|
||||
* ```
|
||||
* (unique_id, ckey, null, the current time, the one time token generated)
|
||||
* the null value will be filled out with the discord id by the integrated discord bot when a user verifies
|
||||
* ```
|
||||
*
|
||||
* Notes:
|
||||
* * The token is guaranteed to unique during it's validity period
|
||||
* * The validity period is currently set at 4 hours
|
||||
* * a token may not be unique outside it's validity window (to reduce conflicts)
|
||||
*
|
||||
* Arguments:
|
||||
* * ckey_for a string representing the ckey this token is for
|
||||
*
|
||||
* Returns a string representing the one time token
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/generate_one_time_token(ckey_for)
|
||||
|
||||
var/not_unique = TRUE
|
||||
@@ -175,18 +175,18 @@ SUBSYSTEM_DEF(discord)
|
||||
return one_time_token
|
||||
|
||||
/**
|
||||
* Find discord link entry by the passed in user token
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given one time token
|
||||
*
|
||||
* Remember, multiple entries can exist, as they are only guaranteed to be unique for their validity period
|
||||
*
|
||||
* Arguments:
|
||||
* * one_time_token the string of words representing the one time token
|
||||
* * timebound A boolean flag, that specifies if it should only look for entries within the last 4 hours, off by default
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
* Find discord link entry by the passed in user token
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given one time token
|
||||
*
|
||||
* Remember, multiple entries can exist, as they are only guaranteed to be unique for their validity period
|
||||
*
|
||||
* Arguments:
|
||||
* * one_time_token the string of words representing the one time token
|
||||
* * timebound A boolean flag, that specifies if it should only look for entries within the last 4 hours, off by default
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/find_discord_link_by_token(one_time_token, timebound = FALSE)
|
||||
var/timeboundsql = ""
|
||||
if(timebound)
|
||||
@@ -207,18 +207,18 @@ SUBSYSTEM_DEF(discord)
|
||||
qdel(query_get_discord_link_record)
|
||||
|
||||
/**
|
||||
* Find discord link entry by the passed in user ckey
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given ckey
|
||||
*
|
||||
* Remember, multiple entries can exist
|
||||
*
|
||||
* Arguments:
|
||||
* * ckey the users ckey as a string
|
||||
* * timebound should we search only in the last 4 hours
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
* Find discord link entry by the passed in user ckey
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given ckey
|
||||
*
|
||||
* Remember, multiple entries can exist
|
||||
*
|
||||
* Arguments:
|
||||
* * ckey the users ckey as a string
|
||||
* * timebound should we search only in the last 4 hours
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/find_discord_link_by_ckey(ckey, timebound = FALSE)
|
||||
var/timeboundsql = ""
|
||||
if(timebound)
|
||||
@@ -242,18 +242,18 @@ SUBSYSTEM_DEF(discord)
|
||||
|
||||
|
||||
/**
|
||||
* Find discord link entry by the passed in user ckey
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given ckey
|
||||
*
|
||||
* Remember, multiple entries can exist
|
||||
*
|
||||
* Arguments:
|
||||
* * discord_id The users discord id (string)
|
||||
* * timebound should we search only in the last 4 hours
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
* Find discord link entry by the passed in user ckey
|
||||
*
|
||||
* This will look into the discord link table and return the *first* entry that matches the given ckey
|
||||
*
|
||||
* Remember, multiple entries can exist
|
||||
*
|
||||
* Arguments:
|
||||
* * discord_id The users discord id (string)
|
||||
* * timebound should we search only in the last 4 hours
|
||||
*
|
||||
* Returns a [/datum/discord_link_record]
|
||||
*/
|
||||
/datum/controller/subsystem/discord/proc/find_discord_link_by_discord_id(discord_id, timebound = FALSE)
|
||||
var/timeboundsql = ""
|
||||
if(timebound)
|
||||
|
||||
@@ -59,17 +59,17 @@ SUBSYSTEM_DEF(economy)
|
||||
price_update()
|
||||
|
||||
/**
|
||||
* Handy proc for obtaining a department's bank account, given the department ID, AKA the define assigned for what department they're under.
|
||||
*/
|
||||
* Handy proc for obtaining a department's bank account, given the department ID, AKA the define assigned for what department they're under.
|
||||
*/
|
||||
/datum/controller/subsystem/economy/proc/get_dep_account(dep_id)
|
||||
for(var/datum/bank_account/department/D in generated_accounts)
|
||||
if(D.department_id == dep_id)
|
||||
return D
|
||||
|
||||
/**
|
||||
* Departmental income payments are kept static and linear for every department, and paid out once every 5 minutes, as determined by MAX_GRANT_DPT.
|
||||
* Iterates over every department account for the same payment.
|
||||
*/
|
||||
* Departmental income payments are kept static and linear for every department, and paid out once every 5 minutes, as determined by MAX_GRANT_DPT.
|
||||
* Iterates over every department account for the same payment.
|
||||
*/
|
||||
/datum/controller/subsystem/economy/proc/departmental_payouts()
|
||||
for(var/iteration in department_accounts)
|
||||
var/datum/bank_account/dept_account = get_dep_account(iteration)
|
||||
@@ -78,10 +78,10 @@ SUBSYSTEM_DEF(economy)
|
||||
dept_account.adjust_money(MAX_GRANT_DPT)
|
||||
|
||||
/**
|
||||
* Updates the prices of all station vendors with the inflation_value, increasing/decreasing costs across the station, and alerts the crew.
|
||||
*
|
||||
* Iterates over the machines list for vending machines, resets their regular and premium product prices (Not contraband), and sends a message to the newscaster network.
|
||||
**/
|
||||
* Updates the prices of all station vendors with the inflation_value, increasing/decreasing costs across the station, and alerts the crew.
|
||||
*
|
||||
* Iterates over the machines list for vending machines, resets their regular and premium product prices (Not contraband), and sends a message to the newscaster network.
|
||||
**/
|
||||
/datum/controller/subsystem/economy/proc/price_update()
|
||||
for(var/obj/machinery/vending/V in GLOB.machines)
|
||||
if(istype(V, /obj/machinery/vending/custom))
|
||||
@@ -93,12 +93,12 @@ SUBSYSTEM_DEF(economy)
|
||||
GLOB.news_network.SubmitArticle(earning_report, "Station Earnings Report", "Station Announcements", null, update_alert = FALSE)
|
||||
|
||||
/**
|
||||
* Proc that returns a value meant to shift inflation values in vendors, based on how much money exists on the station.
|
||||
*
|
||||
* If crew are somehow aquiring far too much money, this value will dynamically cause vendables across the station to skyrocket in price until some money is spent.
|
||||
* Additionally, civilain bounties will cost less, and cargo goodies will increase in price as well.
|
||||
* The goal here is that if you want to spend money, you'll have to get it, and the most efficient method is typically from other players.
|
||||
**/
|
||||
* Proc that returns a value meant to shift inflation values in vendors, based on how much money exists on the station.
|
||||
*
|
||||
* If crew are somehow aquiring far too much money, this value will dynamically cause vendables across the station to skyrocket in price until some money is spent.
|
||||
* Additionally, civilain bounties will cost less, and cargo goodies will increase in price as well.
|
||||
* The goal here is that if you want to spend money, you'll have to get it, and the most efficient method is typically from other players.
|
||||
**/
|
||||
/datum/controller/subsystem/economy/proc/inflation_value()
|
||||
if(!bank_accounts_by_id.len)
|
||||
return 1
|
||||
|
||||
@@ -155,7 +155,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
qdel(T, TRUE)
|
||||
|
||||
/* Nuke threats, for making the blue tiles on the station go RED
|
||||
Used by the AI doomsday and the self-destruct nuke.
|
||||
Used by the AI doomsday and the self-destruct nuke.
|
||||
*/
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/add_nuke_threat(datum/nuke)
|
||||
|
||||
@@ -33,18 +33,18 @@ SUBSYSTEM_DEF(processing)
|
||||
|
||||
|
||||
/**
|
||||
* This proc is called on a datum on every "cycle" if it is being processed by a subsystem. The time between each cycle is determined by the subsystem's "wait" setting.
|
||||
* You can start and stop processing a datum using the START_PROCESSING and STOP_PROCESSING defines.
|
||||
*
|
||||
* Since the wait setting of a subsystem can be changed at any time, it is important that any rate-of-change that you implement in this proc is multiplied by the delta_time that is sent as a parameter,
|
||||
* Additionally, any "prob" you use in this proc should instead use the DT_PROB define to make sure that the final probability per second stays the same even if the subsystem's wait is altered.
|
||||
* Examples where this must be considered:
|
||||
* - Implementing a cooldown timer, use `mytimer -= delta_time`, not `mytimer -= 1`. This way, `mytimer` will always have the unit of seconds
|
||||
* - Damaging a mob, do `L.adjustFireLoss(20 * delta_time)`, not `L.adjustFireLoss(20)`. This way, the damage per second stays constant even if the wait of the subsystem is changed
|
||||
* - Probability of something happening, do `if(DT_PROB(25, delta_time))`, not `if(prob(25))`. This way, if the subsystem wait is e.g. lowered, there won't be a higher chance of this event happening per second
|
||||
*
|
||||
* If you override this do not call parent, as it will return PROCESS_KILL. This is done to prevent objects that dont override process() from staying in the processing list
|
||||
*/
|
||||
* This proc is called on a datum on every "cycle" if it is being processed by a subsystem. The time between each cycle is determined by the subsystem's "wait" setting.
|
||||
* You can start and stop processing a datum using the START_PROCESSING and STOP_PROCESSING defines.
|
||||
*
|
||||
* Since the wait setting of a subsystem can be changed at any time, it is important that any rate-of-change that you implement in this proc is multiplied by the delta_time that is sent as a parameter,
|
||||
* Additionally, any "prob" you use in this proc should instead use the DT_PROB define to make sure that the final probability per second stays the same even if the subsystem's wait is altered.
|
||||
* Examples where this must be considered:
|
||||
* - Implementing a cooldown timer, use `mytimer -= delta_time`, not `mytimer -= 1`. This way, `mytimer` will always have the unit of seconds
|
||||
* - Damaging a mob, do `L.adjustFireLoss(20 * delta_time)`, not `L.adjustFireLoss(20)`. This way, the damage per second stays constant even if the wait of the subsystem is changed
|
||||
* - Probability of something happening, do `if(DT_PROB(25, delta_time))`, not `if(prob(25))`. This way, if the subsystem wait is e.g. lowered, there won't be a higher chance of this event happening per second
|
||||
*
|
||||
* If you override this do not call parent, as it will return PROCESS_KILL. This is done to prevent objects that dont override process() from staying in the processing list
|
||||
*/
|
||||
/datum/proc/process(delta_time)
|
||||
set waitfor = FALSE
|
||||
return PROCESS_KILL
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#define BUCKET_LIMIT (world.time + TICKS2DS(min(BUCKET_LEN - (SSrunechat.practical_offset - DS2TICKS(world.time - SSrunechat.head_offset)) - 1, BUCKET_LEN - 1)))
|
||||
|
||||
/**
|
||||
* # Runechat Subsystem
|
||||
*
|
||||
* Maintains a timer-like system to handle destruction of runechat messages. Much of this code is modeled
|
||||
* after or adapted from the timer subsystem.
|
||||
*
|
||||
* Note that this has the same structure for storing and queueing messages as the timer subsystem does
|
||||
* for handling timers: the bucket_list is a list of chatmessage datums, each of which are the head
|
||||
* of a circularly linked list. Any given index in bucket_list could be null, representing an empty bucket.
|
||||
*/
|
||||
* # Runechat Subsystem
|
||||
*
|
||||
* Maintains a timer-like system to handle destruction of runechat messages. Much of this code is modeled
|
||||
* after or adapted from the timer subsystem.
|
||||
*
|
||||
* Note that this has the same structure for storing and queueing messages as the timer subsystem does
|
||||
* for handling timers: the bucket_list is a list of chatmessage datums, each of which are the head
|
||||
* of a circularly linked list. Any given index in bucket_list could be null, representing an empty bucket.
|
||||
*/
|
||||
SUBSYSTEM_DEF(runechat)
|
||||
name = "Runechat"
|
||||
flags = SS_TICKER | SS_NO_INIT
|
||||
@@ -131,14 +131,14 @@ SUBSYSTEM_DEF(runechat)
|
||||
bucket_resolution = world.tick_lag
|
||||
|
||||
/**
|
||||
* Enters the runechat subsystem with this chatmessage, inserting it into the end-of-life queue
|
||||
*
|
||||
* This will also account for a chatmessage already being registered, and in which case
|
||||
* the position will be updated to remove it from the previous location if necessary
|
||||
*
|
||||
* Arguments:
|
||||
* * new_sched_destruction Optional, when provided is used to update an existing message with the new specified time
|
||||
*/
|
||||
* Enters the runechat subsystem with this chatmessage, inserting it into the end-of-life queue
|
||||
*
|
||||
* This will also account for a chatmessage already being registered, and in which case
|
||||
* the position will be updated to remove it from the previous location if necessary
|
||||
*
|
||||
* Arguments:
|
||||
* * new_sched_destruction Optional, when provided is used to update an existing message with the new specified time
|
||||
*/
|
||||
/datum/chatmessage/proc/enter_subsystem(new_sched_destruction = 0)
|
||||
// Get local references from subsystem as they are faster to access than the datum references
|
||||
var/list/bucket_list = SSrunechat.bucket_list
|
||||
@@ -194,8 +194,8 @@ SUBSYSTEM_DEF(runechat)
|
||||
|
||||
|
||||
/**
|
||||
* Removes this chatmessage datum from the runechat subsystem
|
||||
*/
|
||||
* Removes this chatmessage datum from the runechat subsystem
|
||||
*/
|
||||
/datum/chatmessage/proc/leave_subsystem()
|
||||
// Attempt to find the bucket that contains this chat message
|
||||
var/bucket_pos = BUCKET_POS(scheduled_destruction)
|
||||
|
||||
@@ -484,10 +484,10 @@ SUBSYSTEM_DEF(shuttle)
|
||||
// Then create a transit docking port in the middle
|
||||
var/coords = M.return_coords(0, 0, dock_dir)
|
||||
/* 0------2
|
||||
| |
|
||||
| |
|
||||
| x |
|
||||
3------1
|
||||
* | |
|
||||
* | |
|
||||
* | x |
|
||||
* 3------1
|
||||
*/
|
||||
|
||||
var/x0 = coords[1]
|
||||
|
||||
@@ -85,8 +85,8 @@ SUBSYSTEM_DEF(sounds)
|
||||
using_channels_by_datum[D] += .
|
||||
|
||||
/**
|
||||
* Reserves a channel and updates the datastructure. Private proc.
|
||||
*/
|
||||
* Reserves a channel and updates the datastructure. Private proc.
|
||||
*/
|
||||
/datum/controller/subsystem/sounds/proc/reserve_channel()
|
||||
PRIVATE_PROC(TRUE)
|
||||
if(channel_reserve_high <= random_channels_min) // out of channels
|
||||
@@ -96,8 +96,8 @@ SUBSYSTEM_DEF(sounds)
|
||||
return channel
|
||||
|
||||
/**
|
||||
* Frees a channel and updates the datastructure. Private proc.
|
||||
*/
|
||||
* Frees a channel and updates the datastructure. Private proc.
|
||||
*/
|
||||
/datum/controller/subsystem/sounds/proc/free_channel(number)
|
||||
PRIVATE_PROC(TRUE)
|
||||
var/text_channel = num2text(number)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
/*!
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* tgui subsystem
|
||||
*
|
||||
* Contains all tgui state and subsystem code.
|
||||
*
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
SUBSYSTEM_DEF(tgui)
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
#define TIMER_ID_MAX (2**24)
|
||||
|
||||
/**
|
||||
* # Timer Subsystem
|
||||
*
|
||||
* Handles creation, callbacks, and destruction of timed events.
|
||||
*
|
||||
* It is important to understand the buckets used in the timer subsystem are just a series of circular doubly-linked
|
||||
* lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a circular list, which has prev
|
||||
* and next references for the respective elements in that bucket's circular list.
|
||||
*/
|
||||
* # Timer Subsystem
|
||||
*
|
||||
* Handles creation, callbacks, and destruction of timed events.
|
||||
*
|
||||
* It is important to understand the buckets used in the timer subsystem are just a series of circular doubly-linked
|
||||
* lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a circular list, which has prev
|
||||
* and next references for the respective elements in that bucket's circular list.
|
||||
*/
|
||||
SUBSYSTEM_DEF(timer)
|
||||
name = "Timer"
|
||||
wait = 1 // SS_TICKER subsystem, so wait is in ticks
|
||||
@@ -209,8 +209,8 @@ SUBSYSTEM_DEF(timer)
|
||||
break
|
||||
|
||||
/**
|
||||
* Generates a string with details about the timed event for debugging purposes
|
||||
*/
|
||||
* Generates a string with details about the timed event for debugging purposes
|
||||
*/
|
||||
/datum/controller/subsystem/timer/proc/get_timer_debug_string(datum/timedevent/TE)
|
||||
. = "Timer: [TE]"
|
||||
. += "Prev: [TE.prev ? TE.prev : "NULL"], Next: [TE.next ? TE.next : "NULL"]"
|
||||
@@ -222,8 +222,8 @@ SUBSYSTEM_DEF(timer)
|
||||
. += ", NO CALLBACK"
|
||||
|
||||
/**
|
||||
* Destroys the existing buckets and creates new buckets from the existing timed events
|
||||
*/
|
||||
* Destroys the existing buckets and creates new buckets from the existing timed events
|
||||
*/
|
||||
/datum/controller/subsystem/timer/proc/reset_buckets()
|
||||
var/list/bucket_list = src.bucket_list // Store local reference to datum var, this is faster
|
||||
var/list/alltimers = list()
|
||||
@@ -320,14 +320,14 @@ SUBSYSTEM_DEF(timer)
|
||||
bucket_list |= SStimer.bucket_list
|
||||
|
||||
/**
|
||||
* # Timed Event
|
||||
*
|
||||
* This is the actual timer, it contains the callback and necessary data to maintain
|
||||
* the timer.
|
||||
*
|
||||
* See the documentation for the timer subsystem for an explanation of the buckets referenced
|
||||
* below in next and prev
|
||||
*/
|
||||
* # Timed Event
|
||||
*
|
||||
* This is the actual timer, it contains the callback and necessary data to maintain
|
||||
* the timer.
|
||||
*
|
||||
* See the documentation for the timer subsystem for an explanation of the buckets referenced
|
||||
* below in next and prev
|
||||
*/
|
||||
/datum/timedevent
|
||||
/// ID used for timers when the TIMER_STOPPABLE flag is present
|
||||
var/id
|
||||
@@ -418,8 +418,8 @@ SUBSYSTEM_DEF(timer)
|
||||
return QDEL_HINT_IWILLGC
|
||||
|
||||
/**
|
||||
* Removes this timed event from any relevant buckets, or the secondary queue
|
||||
*/
|
||||
* Removes this timed event from any relevant buckets, or the secondary queue
|
||||
*/
|
||||
/datum/timedevent/proc/bucketEject()
|
||||
// Attempt to find bucket that contains this timed event
|
||||
var/bucketpos = BUCKET_POS(src)
|
||||
@@ -459,13 +459,13 @@ SUBSYSTEM_DEF(timer)
|
||||
prev = next = null
|
||||
|
||||
/**
|
||||
* Attempts to add this timed event to a bucket, will enter the secondary queue
|
||||
* if there are no appropriate buckets at this time.
|
||||
*
|
||||
* Secondary queueing of timed events will occur when the timespan covered by the existing
|
||||
* buckets is exceeded by the time at which this timed event is scheduled to be invoked.
|
||||
* If the timed event is tracking client time, it will be added to a special bucket.
|
||||
*/
|
||||
* Attempts to add this timed event to a bucket, will enter the secondary queue
|
||||
* if there are no appropriate buckets at this time.
|
||||
*
|
||||
* Secondary queueing of timed events will occur when the timespan covered by the existing
|
||||
* buckets is exceeded by the time at which this timed event is scheduled to be invoked.
|
||||
* If the timed event is tracking client time, it will be added to a special bucket.
|
||||
*/
|
||||
/datum/timedevent/proc/bucketJoin()
|
||||
// Generate debug-friendly name for timer
|
||||
var/static/list/bitfield_flags = list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT", "TIMER_LOOP")
|
||||
@@ -507,8 +507,8 @@ SUBSYSTEM_DEF(timer)
|
||||
prev.next = src
|
||||
|
||||
/**
|
||||
* Returns a string of the type of the callback for this timer
|
||||
*/
|
||||
* Returns a string of the type of the callback for this timer
|
||||
*/
|
||||
/datum/timedevent/proc/getcallingtype()
|
||||
. = "ERROR"
|
||||
if (callBack.object == GLOBAL_PROC)
|
||||
@@ -517,14 +517,14 @@ SUBSYSTEM_DEF(timer)
|
||||
. = "[callBack.object.type]"
|
||||
|
||||
/**
|
||||
* Create a new timer and insert it in the queue.
|
||||
* You should not call this directly, and should instead use the addtimer macro, which includes source information.
|
||||
*
|
||||
* Arguments:
|
||||
* * callback the callback to call on timer finish
|
||||
* * wait deciseconds to run the timer for
|
||||
* * flags flags for this timer, see: code\__DEFINES\subsystems.dm
|
||||
*/
|
||||
* Create a new timer and insert it in the queue.
|
||||
* You should not call this directly, and should instead use the addtimer macro, which includes source information.
|
||||
*
|
||||
* Arguments:
|
||||
* * callback the callback to call on timer finish
|
||||
* * wait deciseconds to run the timer for
|
||||
* * flags flags for this timer, see: code\__DEFINES\subsystems.dm
|
||||
*/
|
||||
/proc/_addtimer(datum/callback/callback, wait = 0, flags = 0, file, line)
|
||||
if (!callback)
|
||||
CRASH("addtimer called without a callback")
|
||||
@@ -569,11 +569,11 @@ SUBSYSTEM_DEF(timer)
|
||||
return timer.id
|
||||
|
||||
/**
|
||||
* Delete a timer
|
||||
*
|
||||
* Arguments:
|
||||
* * id a timerid or a /datum/timedevent
|
||||
*/
|
||||
* Delete a timer
|
||||
*
|
||||
* Arguments:
|
||||
* * id a timerid or a /datum/timedevent
|
||||
*/
|
||||
/proc/deltimer(id)
|
||||
if (!id)
|
||||
return FALSE
|
||||
@@ -590,11 +590,11 @@ SUBSYSTEM_DEF(timer)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Get the remaining deciseconds on a timer
|
||||
*
|
||||
* Arguments:
|
||||
* * id a timerid or a /datum/timedevent
|
||||
*/
|
||||
* Get the remaining deciseconds on a timer
|
||||
*
|
||||
* Arguments:
|
||||
* * id a timerid or a /datum/timedevent
|
||||
*/
|
||||
/proc/timeleft(id)
|
||||
if (!id)
|
||||
return null
|
||||
|
||||
@@ -17,153 +17,183 @@ SUBSYSTEM_DEF(traumas)
|
||||
"aliens", "strangers", "birds", "falling", "anime", "insects"))
|
||||
|
||||
phobia_regexes = list("spiders" = construct_phobia_regex("spiders"),
|
||||
"space" = construct_phobia_regex("space"),
|
||||
"security" = construct_phobia_regex("security"),
|
||||
"clowns" = construct_phobia_regex("clowns"),
|
||||
"greytide" = construct_phobia_regex("greytide"),
|
||||
"lizards" = construct_phobia_regex("lizards"),
|
||||
"skeletons" = construct_phobia_regex("skeletons"),
|
||||
"snakes" = construct_phobia_regex("snakes"),
|
||||
"robots" = construct_phobia_regex("robots"),
|
||||
"doctors" = construct_phobia_regex("doctors"),
|
||||
"authority" = construct_phobia_regex("authority"),
|
||||
"the supernatural" = construct_phobia_regex("the supernatural"),
|
||||
"aliens" = construct_phobia_regex("aliens"),
|
||||
"strangers" = construct_phobia_regex("strangers"),
|
||||
"conspiracies" = construct_phobia_regex("conspiracies"),
|
||||
"birds" = construct_phobia_regex("birds"),
|
||||
"falling" = construct_phobia_regex("falling"),
|
||||
"anime" = construct_phobia_regex("anime"),
|
||||
"insects" = construct_phobia_regex("insects")
|
||||
)
|
||||
"space" = construct_phobia_regex("space"),
|
||||
"security" = construct_phobia_regex("security"),
|
||||
"clowns" = construct_phobia_regex("clowns"),
|
||||
"greytide" = construct_phobia_regex("greytide"),
|
||||
"lizards" = construct_phobia_regex("lizards"),
|
||||
"skeletons" = construct_phobia_regex("skeletons"),
|
||||
"snakes" = construct_phobia_regex("snakes"),
|
||||
"robots" = construct_phobia_regex("robots"),
|
||||
"doctors" = construct_phobia_regex("doctors"),
|
||||
"authority" = construct_phobia_regex("authority"),
|
||||
"the supernatural" = construct_phobia_regex("the supernatural"),
|
||||
"aliens" = construct_phobia_regex("aliens"),
|
||||
"strangers" = construct_phobia_regex("strangers"),
|
||||
"conspiracies" = construct_phobia_regex("conspiracies"),
|
||||
"birds" = construct_phobia_regex("birds"),
|
||||
"falling" = construct_phobia_regex("falling"),
|
||||
"anime" = construct_phobia_regex("anime"),
|
||||
"insects" = construct_phobia_regex("insects"),
|
||||
)
|
||||
|
||||
phobia_mobs = list("spiders" = typecacheof(list(/mob/living/simple_animal/hostile/poison/giant_spider)),
|
||||
"security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)),
|
||||
"lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard)),
|
||||
"skeletons" = typecacheof(list(/mob/living/simple_animal/hostile/skeleton)),
|
||||
"snakes" = typecacheof(list(/mob/living/simple_animal/hostile/retaliate/poison/snake)),
|
||||
"robots" = typecacheof(list(/mob/living/silicon/robot, /mob/living/silicon/ai,
|
||||
/mob/living/simple_animal/drone, /mob/living/simple_animal/bot, /mob/living/simple_animal/hostile/swarmer)),
|
||||
"doctors" = typecacheof(list(/mob/living/simple_animal/bot/medbot)),
|
||||
"the supernatural" = typecacheof(list(/mob/living/simple_animal/hostile/construct,
|
||||
/mob/living/simple_animal/revenant, /mob/living/simple_animal/shade)),
|
||||
"aliens" = typecacheof(list(/mob/living/carbon/alien, /mob/living/simple_animal/slime)),
|
||||
"conspiracies" = typecacheof(list(/mob/living/simple_animal/bot/secbot, /mob/living/simple_animal/drone,
|
||||
/mob/living/simple_animal/pet/penguin)),
|
||||
"birds" = typecacheof(list(/mob/living/simple_animal/parrot, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
|
||||
/mob/living/simple_animal/pet/penguin)),
|
||||
"anime" = typecacheof(list(/mob/living/simple_animal/hostile/guardian)),
|
||||
"insects" = typecacheof(list(/mob/living/simple_animal/hostile/cockroach, /mob/living/simple_animal/hostile/poison/bees))
|
||||
)
|
||||
"security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)),
|
||||
"lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard)),
|
||||
"skeletons" = typecacheof(list(/mob/living/simple_animal/hostile/skeleton)),
|
||||
"snakes" = typecacheof(list(/mob/living/simple_animal/hostile/retaliate/poison/snake)),
|
||||
"robots" = typecacheof(list(/mob/living/silicon/robot, /mob/living/silicon/ai,
|
||||
/mob/living/simple_animal/drone, /mob/living/simple_animal/bot, /mob/living/simple_animal/hostile/swarmer,
|
||||
)),
|
||||
"doctors" = typecacheof(list(/mob/living/simple_animal/bot/medbot)),
|
||||
"the supernatural" = typecacheof(list(/mob/living/simple_animal/hostile/construct,
|
||||
/mob/living/simple_animal/revenant, /mob/living/simple_animal/shade
|
||||
)),
|
||||
"aliens" = typecacheof(list(/mob/living/carbon/alien, /mob/living/simple_animal/slime)),
|
||||
"conspiracies" = typecacheof(list(/mob/living/simple_animal/bot/secbot, /mob/living/simple_animal/drone,
|
||||
/mob/living/simple_animal/pet/penguin
|
||||
)),
|
||||
"birds" = typecacheof(list(
|
||||
/mob/living/simple_animal/parrot, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
|
||||
/mob/living/simple_animal/pet/penguin,
|
||||
)),
|
||||
"anime" = typecacheof(list(/mob/living/simple_animal/hostile/guardian)),
|
||||
"insects" = typecacheof(list(/mob/living/simple_animal/hostile/cockroach, /mob/living/simple_animal/hostile/poison/bees))
|
||||
)
|
||||
|
||||
phobia_objs = list("snakes" = typecacheof(list(/obj/item/rod_of_asclepius, /obj/item/toy/plush/snakeplushie)),
|
||||
"spiders" = typecacheof(list(/obj/structure/spider)),
|
||||
"security" = typecacheof(list(
|
||||
/obj/item/clothing/under/rank/security/officer, /obj/item/clothing/under/rank/security/warden,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/security/detective,
|
||||
/obj/item/melee/baton, /obj/item/gun/energy/taser, /obj/item/restraints/handcuffs,
|
||||
/obj/machinery/door/airlock/security, /obj/effect/hallucination/simple/securitron,
|
||||
)),
|
||||
|
||||
"spiders" = typecacheof(list(/obj/structure/spider)),
|
||||
"clowns" = typecacheof(list(
|
||||
/obj/item/clothing/under/rank/civilian/clown, /obj/item/clothing/shoes/clown_shoes,
|
||||
/obj/item/clothing/mask/gas/clown_hat, /obj/item/instrument/bikehorn,
|
||||
/obj/item/pda/clown, /obj/item/grown/bananapeel, /obj/item/food/cheesiehonkers,
|
||||
/obj/item/trash/cheesie,
|
||||
)),
|
||||
|
||||
"security" = typecacheof(list(/obj/item/clothing/under/rank/security/officer, /obj/item/clothing/under/rank/security/warden,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/security/detective,
|
||||
/obj/item/melee/baton, /obj/item/gun/energy/taser, /obj/item/restraints/handcuffs,
|
||||
/obj/machinery/door/airlock/security, /obj/effect/hallucination/simple/securitron)),
|
||||
"greytide" = typecacheof(list(/obj/item/clothing/under/color/grey, /obj/item/melee/baton/cattleprod,
|
||||
/obj/item/spear, /obj/item/clothing/mask/gas,
|
||||
)),
|
||||
|
||||
"clowns" = typecacheof(list(/obj/item/clothing/under/rank/civilian/clown, /obj/item/clothing/shoes/clown_shoes,
|
||||
/obj/item/clothing/mask/gas/clown_hat, /obj/item/instrument/bikehorn,
|
||||
/obj/item/pda/clown, /obj/item/grown/bananapeel, /obj/item/food/cheesiehonkers,
|
||||
/obj/item/trash/cheesie)),
|
||||
"lizards" = typecacheof(list(/obj/item/toy/plush/lizardplushie, /obj/item/food/kebab/tail, /obj/item/organ/tail/lizard,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/lizardwine, /obj/item/clothing/head/lizard, /obj/item/clothing/shoes/cowboy/lizard,
|
||||
)),
|
||||
|
||||
"greytide" = typecacheof(list(/obj/item/clothing/under/color/grey, /obj/item/melee/baton/cattleprod,
|
||||
/obj/item/spear, /obj/item/clothing/mask/gas)),
|
||||
"skeletons" = typecacheof(list(/obj/item/organ/tongue/bone, /obj/item/clothing/suit/armor/bone, /obj/item/stack/sheet/bone,
|
||||
/obj/item/food/meat/slab/human/mutant/skeleton,
|
||||
/obj/effect/decal/remains/human,
|
||||
)),
|
||||
|
||||
"lizards" = typecacheof(list(/obj/item/toy/plush/lizardplushie, /obj/item/food/kebab/tail, /obj/item/organ/tail/lizard,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/lizardwine, /obj/item/clothing/head/lizard, /obj/item/clothing/shoes/cowboy/lizard)),
|
||||
"conspiracies" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/security/head_of_security,
|
||||
/obj/item/clothing/under/rank/engineering/chief_engineer, /obj/item/clothing/under/rank/medical/chief_medical_officer,
|
||||
/obj/item/clothing/under/rank/civilian/head_of_personnel, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/security/head_of_security/grey, /obj/item/clothing/under/rank/security/head_of_security/alt,
|
||||
/obj/item/clothing/under/rank/rnd/research_director/alt, /obj/item/clothing/under/rank/rnd/research_director/turtleneck,
|
||||
/obj/item/clothing/under/rank/captain/parade, /obj/item/clothing/under/rank/security/head_of_security/parade, /obj/item/clothing/under/rank/security/head_of_security/parade/female,
|
||||
/obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/melee/baton/abductor,
|
||||
/obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer,
|
||||
/obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/officer,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert, /obj/item/clothing/suit/space/hardsuit/ert/sec,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med,
|
||||
/obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad,
|
||||
/obj/machinery/door/airlock/centcom,
|
||||
)),
|
||||
|
||||
"skeletons" = typecacheof(list(/obj/item/organ/tongue/bone, /obj/item/clothing/suit/armor/bone, /obj/item/stack/sheet/bone,
|
||||
/obj/item/food/meat/slab/human/mutant/skeleton,
|
||||
/obj/effect/decal/remains/human)),
|
||||
"robots" = typecacheof(list(/obj/machinery/computer/upload, /obj/item/ai_module, /obj/machinery/recharge_station,
|
||||
/obj/item/aicard, /obj/structure/swarmer_beacon
|
||||
)),
|
||||
|
||||
"conspiracies" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/security/head_of_security,
|
||||
/obj/item/clothing/under/rank/engineering/chief_engineer, /obj/item/clothing/under/rank/medical/chief_medical_officer,
|
||||
/obj/item/clothing/under/rank/civilian/head_of_personnel, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/security/head_of_security/grey, /obj/item/clothing/under/rank/security/head_of_security/alt,
|
||||
/obj/item/clothing/under/rank/rnd/research_director/alt, /obj/item/clothing/under/rank/rnd/research_director/turtleneck,
|
||||
/obj/item/clothing/under/rank/captain/parade, /obj/item/clothing/under/rank/security/head_of_security/parade, /obj/item/clothing/under/rank/security/head_of_security/parade/female,
|
||||
/obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/melee/baton/abductor,
|
||||
/obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer,
|
||||
/obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/officer,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert, /obj/item/clothing/suit/space/hardsuit/ert/sec,
|
||||
/obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med,
|
||||
/obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad,
|
||||
/obj/machinery/door/airlock/centcom)),
|
||||
"doctors" = typecacheof(list(/obj/item/clothing/under/rank/medical,
|
||||
/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/pill/, /obj/item/reagent_containers/hypospray,
|
||||
/obj/item/storage/firstaid, /obj/item/storage/pill_bottle, /obj/item/healthanalyzer,
|
||||
/obj/structure/sign/departments/medbay, /obj/machinery/door/airlock/medical, /obj/machinery/sleeper, /obj/machinery/stasis,
|
||||
/obj/machinery/dna_scannernew, /obj/machinery/atmospherics/components/unary/cryo_cell, /obj/item/surgical_drapes,
|
||||
/obj/item/retractor, /obj/item/hemostat, /obj/item/cautery, /obj/item/surgicaldrill, /obj/item/scalpel, /obj/item/circular_saw,
|
||||
/obj/item/clothing/suit/bio_suit/plaguedoctorsuit, /obj/item/clothing/head/plaguedoctorhat, /obj/item/clothing/mask/gas/plaguedoctor,
|
||||
)),
|
||||
|
||||
"robots" = typecacheof(list(/obj/machinery/computer/upload, /obj/item/ai_module, /obj/machinery/recharge_station,
|
||||
/obj/item/aicard, /obj/structure/swarmer_beacon)),
|
||||
"authority" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/civilian/head_of_personnel,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/medical/chief_medical_officer, /obj/item/clothing/under/rank/engineering/chief_engineer,
|
||||
/obj/item/clothing/under/rank/centcom/officer, /obj/item/clothing/under/rank/centcom/commander,
|
||||
/obj/item/melee/classic_baton/telescopic, /obj/item/card/id/silver, /obj/item/card/id/gold,
|
||||
/obj/item/card/id/captains_spare, /obj/item/card/id/centcom, /obj/machinery/door/airlock/command,
|
||||
)),
|
||||
|
||||
"doctors" = typecacheof(list(/obj/item/clothing/under/rank/medical,
|
||||
/obj/item/reagent_containers/syringe, /obj/item/reagent_containers/pill/, /obj/item/reagent_containers/hypospray,
|
||||
/obj/item/storage/firstaid, /obj/item/storage/pill_bottle, /obj/item/healthanalyzer,
|
||||
/obj/structure/sign/departments/medbay, /obj/machinery/door/airlock/medical, /obj/machinery/sleeper, /obj/machinery/stasis,
|
||||
/obj/machinery/dna_scannernew, /obj/machinery/atmospherics/components/unary/cryo_cell, /obj/item/surgical_drapes,
|
||||
/obj/item/retractor, /obj/item/hemostat, /obj/item/cautery, /obj/item/surgicaldrill, /obj/item/scalpel, /obj/item/circular_saw,
|
||||
/obj/item/clothing/suit/bio_suit/plaguedoctorsuit, /obj/item/clothing/head/plaguedoctorhat, /obj/item/clothing/mask/gas/plaguedoctor)),
|
||||
"the supernatural" = typecacheof(list(/obj/structure/destructible/cult, /obj/item/tome,
|
||||
/obj/item/melee/cultblade, /obj/item/cult_bastard,
|
||||
/obj/item/restraints/legcuffs/bola/cult, /obj/item/clothing/suit/space/hardsuit/cult,
|
||||
/obj/item/clothing/suit/hooded/cultrobes, /obj/item/clothing/head/hooded/cult_hoodie, /obj/effect/rune,
|
||||
/obj/item/stack/sheet/runed_metal, /obj/machinery/door/airlock/cult, /obj/singularity/narsie,
|
||||
/obj/item/soulstone,
|
||||
/obj/item/clothing/suit/wizrobe, /obj/item/clothing/head/wizard, /obj/item/spellbook, /obj/item/staff,
|
||||
/obj/item/clothing/suit/space/hardsuit/shielded/wizard, /obj/item/clothing/suit/space/hardsuit/wizard,
|
||||
/obj/item/gun/magic/staff, /obj/item/gun/magic/wand,
|
||||
/obj/item/nullrod, /obj/item/clothing/under/rank/civilian/chaplain,
|
||||
)),
|
||||
|
||||
"authority" = typecacheof(list(/obj/item/clothing/under/rank/captain, /obj/item/clothing/under/rank/civilian/head_of_personnel,
|
||||
/obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/rnd/research_director,
|
||||
/obj/item/clothing/under/rank/medical/chief_medical_officer, /obj/item/clothing/under/rank/engineering/chief_engineer,
|
||||
/obj/item/clothing/under/rank/centcom/officer, /obj/item/clothing/under/rank/centcom/commander,
|
||||
/obj/item/melee/classic_baton/telescopic, /obj/item/card/id/silver, /obj/item/card/id/gold,
|
||||
/obj/item/card/id/captains_spare, /obj/item/card/id/centcom, /obj/machinery/door/airlock/command)),
|
||||
"aliens" = typecacheof(list(/obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo,
|
||||
/obj/structure/alien, /obj/item/toy/toy_xeno,
|
||||
/obj/item/clothing/suit/armor/abductor, /obj/item/abductor, /obj/item/gun/energy/alien,
|
||||
/obj/item/melee/baton/abductor, /obj/item/radio/headset/abductor, /obj/item/scalpel/alien, /obj/item/hemostat/alien,
|
||||
/obj/item/retractor/alien, /obj/item/circular_saw/alien, /obj/item/surgicaldrill/alien, /obj/item/cautery/alien,
|
||||
/obj/item/clothing/head/helmet/abductor, /obj/structure/bed/abductor, /obj/structure/table_frame/abductor,
|
||||
/obj/structure/table/abductor, /obj/structure/table/optable/abductor, /obj/structure/closet/abductor, /obj/item/organ/heart/gland,
|
||||
/obj/machinery/abductor, /obj/item/crowbar/abductor, /obj/item/screwdriver/abductor, /obj/item/weldingtool/abductor,
|
||||
/obj/item/wirecutters/abductor, /obj/item/wrench/abductor, /obj/item/stack/sheet/mineral/abductor,
|
||||
)),
|
||||
|
||||
"the supernatural" = typecacheof(list(/obj/structure/destructible/cult, /obj/item/tome,
|
||||
/obj/item/melee/cultblade, /obj/item/cult_bastard,
|
||||
/obj/item/restraints/legcuffs/bola/cult, /obj/item/clothing/suit/space/hardsuit/cult,
|
||||
/obj/item/clothing/suit/hooded/cultrobes, /obj/item/clothing/head/hooded/cult_hoodie, /obj/effect/rune,
|
||||
/obj/item/stack/sheet/runed_metal, /obj/machinery/door/airlock/cult, /obj/singularity/narsie,
|
||||
/obj/item/soulstone,
|
||||
/obj/item/clothing/suit/wizrobe, /obj/item/clothing/head/wizard, /obj/item/spellbook, /obj/item/staff,
|
||||
/obj/item/clothing/suit/space/hardsuit/shielded/wizard, /obj/item/clothing/suit/space/hardsuit/wizard,
|
||||
/obj/item/gun/magic/staff, /obj/item/gun/magic/wand,
|
||||
/obj/item/nullrod, /obj/item/clothing/under/rank/civilian/chaplain)),
|
||||
"birds" = typecacheof(list(/obj/item/clothing/mask/gas/plaguedoctor, /obj/item/food/cracker,
|
||||
/obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken,
|
||||
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask,
|
||||
/obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
|
||||
/obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom,
|
||||
)),
|
||||
|
||||
"aliens" = typecacheof(list(/obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo,
|
||||
/obj/structure/alien, /obj/item/toy/toy_xeno,
|
||||
/obj/item/clothing/suit/armor/abductor, /obj/item/abductor, /obj/item/gun/energy/alien,
|
||||
/obj/item/melee/baton/abductor, /obj/item/radio/headset/abductor, /obj/item/scalpel/alien, /obj/item/hemostat/alien,
|
||||
/obj/item/retractor/alien, /obj/item/circular_saw/alien, /obj/item/surgicaldrill/alien, /obj/item/cautery/alien,
|
||||
/obj/item/clothing/head/helmet/abductor, /obj/structure/bed/abductor, /obj/structure/table_frame/abductor,
|
||||
/obj/structure/table/abductor, /obj/structure/table/optable/abductor, /obj/structure/closet/abductor, /obj/item/organ/heart/gland,
|
||||
/obj/machinery/abductor, /obj/item/crowbar/abductor, /obj/item/screwdriver/abductor, /obj/item/weldingtool/abductor,
|
||||
/obj/item/wirecutters/abductor, /obj/item/wrench/abductor, /obj/item/stack/sheet/mineral/abductor)),
|
||||
"anime" = typecacheof(list(/obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/food/sashimi, /obj/item/food/chawanmushi,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, /obj/item/clothing/suit/space/space_ninja,
|
||||
/obj/item/clothing/mask/gas/space_ninja, /obj/item/clothing/shoes/space_ninja, /obj/item/clothing/gloves/space_ninja, /obj/item/vibro_weapon,
|
||||
/obj/item/nullrod/scythe/vibro, /obj/item/energy_katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana, /obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe)),
|
||||
|
||||
"birds" = typecacheof(list(/obj/item/clothing/mask/gas/plaguedoctor, /obj/item/food/cracker,
|
||||
/obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken,
|
||||
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask,
|
||||
/obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
|
||||
/obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom)),
|
||||
"birds" = typecacheof(list(/obj/item/clothing/mask/gas/plaguedoctor, /obj/item/food/cracker,
|
||||
/obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken,
|
||||
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask,
|
||||
/obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
|
||||
/obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom
|
||||
)),
|
||||
|
||||
"anime" = typecacheof(list(/obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/food/sashimi, /obj/item/food/chawanmushi,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, /obj/item/clothing/suit/space/space_ninja,
|
||||
/obj/item/clothing/mask/gas/space_ninja, /obj/item/clothing/shoes/space_ninja, /obj/item/clothing/gloves/space_ninja, /obj/item/vibro_weapon,
|
||||
/obj/item/nullrod/scythe/vibro, /obj/item/energy_katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana, /obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe)),
|
||||
"insects" = typecacheof(list(/obj/item/toy/plush/moth, /obj/item/toy/plush/beeplushie, /obj/item/clothing/mask/animal/rat/bee, /obj/item/clothing/suit/hooded/bee_costume, /obj/structure/beebox)),
|
||||
|
||||
"insects" = typecacheof(list(/obj/item/toy/plush/moth, /obj/item/toy/plush/beeplushie, /obj/item/clothing/mask/animal/rat/bee, /obj/item/clothing/suit/hooded/bee_costume, /obj/structure/beebox))
|
||||
)
|
||||
"anime" = typecacheof(list(/obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/food/sashimi, /obj/item/food/chawanmushi,
|
||||
/obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, /obj/item/clothing/suit/space/space_ninja,
|
||||
/obj/item/clothing/mask/gas/space_ninja, /obj/item/clothing/shoes/space_ninja, /obj/item/clothing/gloves/space_ninja, /obj/item/vibro_weapon,
|
||||
/obj/item/nullrod/scythe/vibro, /obj/item/energy_katana, /obj/item/toy/katana, /obj/item/nullrod/claymore/katana, /obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe
|
||||
)),
|
||||
)
|
||||
|
||||
phobia_turfs = list("space" = typecacheof(list(/turf/open/space, /turf/open/floor/holofloor/space, /turf/open/floor/fakespace)),
|
||||
"the supernatural" = typecacheof(list(/turf/open/floor/plasteel/cult, /turf/closed/wall/mineral/cult)),
|
||||
"aliens" = typecacheof(list(/turf/open/floor/plating/abductor, /turf/open/floor/plating/abductor2,
|
||||
/turf/open/floor/mineral/abductor, /turf/closed/wall/mineral/abductor)),
|
||||
"falling" = typecacheof(list(/turf/open/chasm, /turf/open/floor/fakepit))
|
||||
)
|
||||
"the supernatural" = typecacheof(list(/turf/open/floor/plasteel/cult, /turf/closed/wall/mineral/cult)),
|
||||
"aliens" = typecacheof(list(/turf/open/floor/plating/abductor, /turf/open/floor/plating/abductor2,
|
||||
/turf/open/floor/mineral/abductor, /turf/closed/wall/mineral/abductor
|
||||
)),
|
||||
"falling" = typecacheof(list(/turf/open/chasm, /turf/open/floor/fakepit))
|
||||
)
|
||||
|
||||
phobia_species = list("lizards" = typecacheof(list(/datum/species/lizard)),
|
||||
"skeletons" = typecacheof(list(/datum/species/skeleton, /datum/species/plasmaman)),
|
||||
"conspiracies" = typecacheof(list(/datum/species/abductor, /datum/species/lizard, /datum/species/synth)),
|
||||
"robots" = typecacheof(list(/datum/species/android)),
|
||||
"the supernatural" = typecacheof(list(/datum/species/golem/runic)),
|
||||
"aliens" = typecacheof(list(/datum/species/abductor, /datum/species/jelly, /datum/species/pod,
|
||||
/datum/species/shadow)),
|
||||
"anime" = typecacheof(list(/datum/species/human/felinid)),
|
||||
"insects" = typecacheof(list(/datum/species/fly, /datum/species/moth))
|
||||
)
|
||||
"skeletons" = typecacheof(list(/datum/species/skeleton, /datum/species/plasmaman)),
|
||||
"conspiracies" = typecacheof(list(/datum/species/abductor, /datum/species/lizard, /datum/species/synth)),
|
||||
"robots" = typecacheof(list(/datum/species/android)),
|
||||
"the supernatural" = typecacheof(list(/datum/species/golem/runic)),
|
||||
"aliens" = typecacheof(list(/datum/species/abductor, /datum/species/jelly, /datum/species/pod,/datum/species/shadow)),
|
||||
"anime" = typecacheof(list(/datum/species/human/felinid)),
|
||||
"insects" = typecacheof(list(/datum/species/fly, /datum/species/moth))
|
||||
)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ SUBSYSTEM_DEF(weather)
|
||||
next_hit_by_zlevel["[z]"] = null
|
||||
|
||||
/datum/controller/subsystem/weather/proc/get_weather(z, area/active_area)
|
||||
var/datum/weather/A
|
||||
for(var/V in processing)
|
||||
var/datum/weather/W = V
|
||||
if((z in W.impacted_z_levels) && W.area_type == active_area.type)
|
||||
A = W
|
||||
break
|
||||
return A
|
||||
var/datum/weather/A
|
||||
for(var/V in processing)
|
||||
var/datum/weather/W = V
|
||||
if((z in W.impacted_z_levels) && W.area_type == active_area.type)
|
||||
A = W
|
||||
break
|
||||
return A
|
||||
|
||||
@@ -424,13 +424,13 @@
|
||||
owner = M
|
||||
|
||||
/**
|
||||
* Generates a list of all laws on this datum, including rendered HTML tags if required
|
||||
*
|
||||
* Arguments:
|
||||
* * include_zeroth - Operator that controls if law 0 or law 666 is returned in the set
|
||||
* * show_numbers - Operator that controls if law numbers are prepended to the returned laws
|
||||
* * render_html - Operator controlling if HTML tags are rendered on the returned laws
|
||||
*/
|
||||
* Generates a list of all laws on this datum, including rendered HTML tags if required
|
||||
*
|
||||
* Arguments:
|
||||
* * include_zeroth - Operator that controls if law 0 or law 666 is returned in the set
|
||||
* * show_numbers - Operator that controls if law numbers are prepended to the returned laws
|
||||
* * render_html - Operator controlling if HTML tags are rendered on the returned laws
|
||||
*/
|
||||
/datum/ai_laws/proc/get_law_list(include_zeroth = FALSE, show_numbers = TRUE, render_html = TRUE)
|
||||
var/list/data = list()
|
||||
|
||||
|
||||
+48
-48
@@ -1,73 +1,73 @@
|
||||
#define ARMORID "armor-[melee]-[bullet]-[laser]-[energy]-[bomb]-[bio]-[rad]-[fire]-[acid]-[magic]-[wound]"
|
||||
|
||||
/proc/getArmor(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, wound = 0)
|
||||
. = locate(ARMORID)
|
||||
if (!.)
|
||||
. = new /datum/armor(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, magic, wound)
|
||||
. = locate(ARMORID)
|
||||
if (!.)
|
||||
. = new /datum/armor(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, magic, wound)
|
||||
|
||||
/datum/armor
|
||||
datum_flags = DF_USE_TAG
|
||||
var/melee
|
||||
var/bullet
|
||||
var/laser
|
||||
var/energy
|
||||
var/bomb
|
||||
var/bio
|
||||
var/rad
|
||||
var/fire
|
||||
var/acid
|
||||
var/magic
|
||||
var/wound
|
||||
datum_flags = DF_USE_TAG
|
||||
var/melee
|
||||
var/bullet
|
||||
var/laser
|
||||
var/energy
|
||||
var/bomb
|
||||
var/bio
|
||||
var/rad
|
||||
var/fire
|
||||
var/acid
|
||||
var/magic
|
||||
var/wound
|
||||
|
||||
/datum/armor/New(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, wound = 0)
|
||||
src.melee = melee
|
||||
src.bullet = bullet
|
||||
src.laser = laser
|
||||
src.energy = energy
|
||||
src.bomb = bomb
|
||||
src.bio = bio
|
||||
src.rad = rad
|
||||
src.fire = fire
|
||||
src.acid = acid
|
||||
src.magic = magic
|
||||
src.wound = wound
|
||||
tag = ARMORID
|
||||
src.melee = melee
|
||||
src.bullet = bullet
|
||||
src.laser = laser
|
||||
src.energy = energy
|
||||
src.bomb = bomb
|
||||
src.bio = bio
|
||||
src.rad = rad
|
||||
src.fire = fire
|
||||
src.acid = acid
|
||||
src.magic = magic
|
||||
src.wound = wound
|
||||
tag = ARMORID
|
||||
|
||||
/datum/armor/proc/modifyRating(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, wound = 0)
|
||||
return getArmor(src.melee+melee, src.bullet+bullet, src.laser+laser, src.energy+energy, src.bomb+bomb, src.bio+bio, src.rad+rad, src.fire+fire, src.acid+acid, src.magic+magic, src.wound+wound)
|
||||
return getArmor(src.melee+melee, src.bullet+bullet, src.laser+laser, src.energy+energy, src.bomb+bomb, src.bio+bio, src.rad+rad, src.fire+fire, src.acid+acid, src.magic+magic, src.wound+wound)
|
||||
|
||||
/datum/armor/proc/modifyAllRatings(modifier = 0)
|
||||
return getArmor(melee+modifier, bullet+modifier, laser+modifier, energy+modifier, bomb+modifier, bio+modifier, rad+modifier, fire+modifier, acid+modifier, magic+modifier, wound+modifier)
|
||||
return getArmor(melee+modifier, bullet+modifier, laser+modifier, energy+modifier, bomb+modifier, bio+modifier, rad+modifier, fire+modifier, acid+modifier, magic+modifier, wound+modifier)
|
||||
|
||||
/datum/armor/proc/setRating(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, magic, wound)
|
||||
return getArmor((isnull(melee) ? src.melee : melee),\
|
||||
(isnull(bullet) ? src.bullet : bullet),\
|
||||
(isnull(laser) ? src.laser : laser),\
|
||||
(isnull(energy) ? src.energy : energy),\
|
||||
(isnull(bomb) ? src.bomb : bomb),\
|
||||
(isnull(bio) ? src.bio : bio),\
|
||||
(isnull(rad) ? src.rad : rad),\
|
||||
(isnull(fire) ? src.fire : fire),\
|
||||
(isnull(acid) ? src.acid : acid),\
|
||||
(isnull(magic) ? src.magic : magic),\
|
||||
(isnull(wound) ? src.wound : wound))
|
||||
return getArmor((isnull(melee) ? src.melee : melee),\
|
||||
(isnull(bullet) ? src.bullet : bullet),\
|
||||
(isnull(laser) ? src.laser : laser),\
|
||||
(isnull(energy) ? src.energy : energy),\
|
||||
(isnull(bomb) ? src.bomb : bomb),\
|
||||
(isnull(bio) ? src.bio : bio),\
|
||||
(isnull(rad) ? src.rad : rad),\
|
||||
(isnull(fire) ? src.fire : fire),\
|
||||
(isnull(acid) ? src.acid : acid),\
|
||||
(isnull(magic) ? src.magic : magic),\
|
||||
(isnull(wound) ? src.wound : wound))
|
||||
|
||||
/datum/armor/proc/getRating(rating)
|
||||
return vars[rating]
|
||||
return vars[rating]
|
||||
|
||||
/datum/armor/proc/getList()
|
||||
return list(MELEE = melee, BULLET = bullet, LASER = laser, ENERGY = energy, BOMB = bomb, BIO = bio, RAD = rad, FIRE = fire, ACID = acid, MAGIC = magic, WOUND = wound)
|
||||
return list(MELEE = melee, BULLET = bullet, LASER = laser, ENERGY = energy, BOMB = bomb, BIO = bio, RAD = rad, FIRE = fire, ACID = acid, MAGIC = magic, WOUND = wound)
|
||||
|
||||
/datum/armor/proc/attachArmor(datum/armor/AA)
|
||||
return getArmor(melee+AA.melee, bullet+AA.bullet, laser+AA.laser, energy+AA.energy, bomb+AA.bomb, bio+AA.bio, rad+AA.rad, fire+AA.fire, acid+AA.acid, magic+AA.magic, wound+AA.wound)
|
||||
return getArmor(melee+AA.melee, bullet+AA.bullet, laser+AA.laser, energy+AA.energy, bomb+AA.bomb, bio+AA.bio, rad+AA.rad, fire+AA.fire, acid+AA.acid, magic+AA.magic, wound+AA.wound)
|
||||
|
||||
/datum/armor/proc/detachArmor(datum/armor/AA)
|
||||
return getArmor(melee-AA.melee, bullet-AA.bullet, laser-AA.laser, energy-AA.energy, bomb-AA.bomb, bio-AA.bio, rad-AA.rad, fire-AA.fire, acid-AA.acid, magic-AA.magic, wound-AA.wound)
|
||||
return getArmor(melee-AA.melee, bullet-AA.bullet, laser-AA.laser, energy-AA.energy, bomb-AA.bomb, bio-AA.bio, rad-AA.rad, fire-AA.fire, acid-AA.acid, magic-AA.magic, wound-AA.wound)
|
||||
|
||||
/datum/armor/vv_edit_var(var_name, var_value)
|
||||
if (var_name == NAMEOF(src, tag))
|
||||
return FALSE
|
||||
. = ..()
|
||||
tag = ARMORID // update tag in case armor values were edited
|
||||
if (var_name == NAMEOF(src, tag))
|
||||
return FALSE
|
||||
. = ..()
|
||||
tag = ARMORID // update tag in case armor values were edited
|
||||
|
||||
#undef ARMORID
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
lose_text = ""
|
||||
var/paralysis_type
|
||||
var/list/paralysis_traits = list()
|
||||
//for descriptions
|
||||
//for descriptions
|
||||
|
||||
/datum/brain_trauma/severe/paralysis/New(specific_type)
|
||||
if(specific_type)
|
||||
|
||||
+88
-88
@@ -1,53 +1,53 @@
|
||||
/**
|
||||
*# Callback Datums
|
||||
*A datum that holds a proc to be called on another object, used to track proccalls to other objects
|
||||
*
|
||||
* ## USAGE
|
||||
*
|
||||
* ```
|
||||
* var/datum/callback/C = new(object|null, /proc/type/path|"procstring", arg1, arg2, ... argn)
|
||||
* var/timerid = addtimer(C, time, timertype)
|
||||
* you can also use the compiler define shorthand
|
||||
* var/timerid = addtimer(CALLBACK(object|null, /proc/type/path|procstring, arg1, arg2, ... argn), time, timertype)
|
||||
* ```
|
||||
*
|
||||
* Note: proc strings can only be given for datum proc calls, global procs must be proc paths
|
||||
*
|
||||
* Also proc strings are strongly advised against because they don't compile error if the proc stops existing
|
||||
*
|
||||
* In some cases you can provide a shortform of the procname, see the proc typepath shortcuts documentation below
|
||||
*
|
||||
* ## INVOKING THE CALLBACK
|
||||
*`var/result = C.Invoke(args, to, add)` additional args are added after the ones given when the callback was created
|
||||
*
|
||||
* `var/result = C.InvokeAsync(args, to, add)` Asyncronous - returns . on the first sleep then continues on in the background
|
||||
* after the sleep/block ends, otherwise operates normally.
|
||||
*
|
||||
* ## PROC TYPEPATH SHORTCUTS
|
||||
* (these operate on paths, not types, so to these shortcuts, datum is NOT a parent of atom, etc...)
|
||||
*
|
||||
* ### global proc while in another global proc:
|
||||
* .procname
|
||||
*
|
||||
* `CALLBACK(GLOBAL_PROC, .some_proc_here)`
|
||||
*
|
||||
* ### proc defined on current(src) object (when in a /proc/ and not an override) OR overridden at src or any of it's parents:
|
||||
* .procname
|
||||
*
|
||||
* `CALLBACK(src, .some_proc_here)`
|
||||
*
|
||||
* ### when the above doesn't apply:
|
||||
*.proc/procname
|
||||
*
|
||||
* `CALLBACK(src, .proc/some_proc_here)`
|
||||
*
|
||||
*
|
||||
* proc defined on a parent of a some type
|
||||
*
|
||||
* `/some/type/.proc/some_proc_here`
|
||||
*
|
||||
* Otherwise you must always provide the full typepath of the proc (/type/of/thing/proc/procname)
|
||||
*/
|
||||
*# Callback Datums
|
||||
*A datum that holds a proc to be called on another object, used to track proccalls to other objects
|
||||
*
|
||||
* ## USAGE
|
||||
*
|
||||
* ```
|
||||
* var/datum/callback/C = new(object|null, /proc/type/path|"procstring", arg1, arg2, ... argn)
|
||||
* var/timerid = addtimer(C, time, timertype)
|
||||
* you can also use the compiler define shorthand
|
||||
* var/timerid = addtimer(CALLBACK(object|null, /proc/type/path|procstring, arg1, arg2, ... argn), time, timertype)
|
||||
* ```
|
||||
*
|
||||
* Note: proc strings can only be given for datum proc calls, global procs must be proc paths
|
||||
*
|
||||
* Also proc strings are strongly advised against because they don't compile error if the proc stops existing
|
||||
*
|
||||
* In some cases you can provide a shortform of the procname, see the proc typepath shortcuts documentation below
|
||||
*
|
||||
* ## INVOKING THE CALLBACK
|
||||
*`var/result = C.Invoke(args, to, add)` additional args are added after the ones given when the callback was created
|
||||
*
|
||||
* `var/result = C.InvokeAsync(args, to, add)` Asyncronous - returns . on the first sleep then continues on in the background
|
||||
* after the sleep/block ends, otherwise operates normally.
|
||||
*
|
||||
* ## PROC TYPEPATH SHORTCUTS
|
||||
* (these operate on paths, not types, so to these shortcuts, datum is NOT a parent of atom, etc...)
|
||||
*
|
||||
* ### global proc while in another global proc:
|
||||
* .procname
|
||||
*
|
||||
* `CALLBACK(GLOBAL_PROC, .some_proc_here)`
|
||||
*
|
||||
* ### proc defined on current(src) object (when in a /proc/ and not an override) OR overridden at src or any of it's parents:
|
||||
* .procname
|
||||
*
|
||||
* `CALLBACK(src, .some_proc_here)`
|
||||
*
|
||||
* ### when the above doesn't apply:
|
||||
*.proc/procname
|
||||
*
|
||||
* `CALLBACK(src, .proc/some_proc_here)`
|
||||
*
|
||||
*
|
||||
* proc defined on a parent of a some type
|
||||
*
|
||||
* `/some/type/.proc/some_proc_here`
|
||||
*
|
||||
* Otherwise you must always provide the full typepath of the proc (/type/of/thing/proc/procname)
|
||||
*/
|
||||
/datum/callback
|
||||
|
||||
///The object we will be calling the proc on
|
||||
@@ -60,13 +60,13 @@
|
||||
var/datum/weakref/user
|
||||
|
||||
/**
|
||||
* Create a new callback datum
|
||||
*
|
||||
* Arguments
|
||||
* * thingtocall the object to call the proc on
|
||||
* * proctocall the proc to call on the target object
|
||||
* * ... an optional list of extra arguments to pass to the proc
|
||||
*/
|
||||
* Create a new callback datum
|
||||
*
|
||||
* Arguments
|
||||
* * thingtocall the object to call the proc on
|
||||
* * proctocall the proc to call on the target object
|
||||
* * ... an optional list of extra arguments to pass to the proc
|
||||
*/
|
||||
/datum/callback/New(thingtocall, proctocall, ...)
|
||||
if (thingtocall)
|
||||
object = thingtocall
|
||||
@@ -76,13 +76,13 @@
|
||||
if(usr)
|
||||
user = WEAKREF(usr)
|
||||
/**
|
||||
* Immediately Invoke proctocall on thingtocall, with waitfor set to false
|
||||
*
|
||||
* Arguments:
|
||||
* * thingtocall Object to call on
|
||||
* * proctocall Proc to call on that object
|
||||
* * ... optional list of arguments to pass as arguments to the proc being called
|
||||
*/
|
||||
* Immediately Invoke proctocall on thingtocall, with waitfor set to false
|
||||
*
|
||||
* Arguments:
|
||||
* * thingtocall Object to call on
|
||||
* * proctocall Proc to call on that object
|
||||
* * ... optional list of arguments to pass as arguments to the proc being called
|
||||
*/
|
||||
/world/proc/ImmediateInvokeAsync(thingtocall, proctocall, ...)
|
||||
set waitfor = FALSE
|
||||
|
||||
@@ -97,13 +97,13 @@
|
||||
call(thingtocall, proctocall)(arglist(calling_arguments))
|
||||
|
||||
/**
|
||||
* Invoke this callback
|
||||
*
|
||||
* Calls the registered proc on the registered object, if the user ref
|
||||
* can be resolved it also inclues that as an arg
|
||||
*
|
||||
* If the datum being called on is varedited, the call is wrapped via [WrapAdminProcCall][/proc/WrapAdminProcCall]
|
||||
*/
|
||||
* Invoke this callback
|
||||
*
|
||||
* Calls the registered proc on the registered object, if the user ref
|
||||
* can be resolved it also inclues that as an arg
|
||||
*
|
||||
* If the datum being called on is varedited, the call is wrapped via [WrapAdminProcCall][/proc/WrapAdminProcCall]
|
||||
*/
|
||||
/datum/callback/proc/Invoke(...)
|
||||
if(!usr)
|
||||
var/datum/weakref/W = user
|
||||
@@ -130,13 +130,13 @@
|
||||
return call(object, delegate)(arglist(calling_arguments))
|
||||
|
||||
/**
|
||||
* Invoke this callback async (waitfor=false)
|
||||
*
|
||||
* Calls the registered proc on the registered object, if the user ref
|
||||
* can be resolved it also inclues that as an arg
|
||||
*
|
||||
* If the datum being called on is varedited, the call is wrapped via WrapAdminProcCall
|
||||
*/
|
||||
* Invoke this callback async (waitfor=false)
|
||||
*
|
||||
* Calls the registered proc on the registered object, if the user ref
|
||||
* can be resolved it also inclues that as an arg
|
||||
*
|
||||
* If the datum being called on is varedited, the call is wrapped via WrapAdminProcCall
|
||||
*/
|
||||
/datum/callback/proc/InvokeAsync(...)
|
||||
set waitfor = FALSE
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
/**
|
||||
Helper datum for the select callbacks proc
|
||||
*/
|
||||
*/
|
||||
/datum/callback_select
|
||||
var/list/finished
|
||||
var/pendingcount
|
||||
@@ -192,16 +192,16 @@
|
||||
finished[index] = rtn
|
||||
|
||||
/**
|
||||
* Runs a list of callbacks asyncronously, returning only when all have finished
|
||||
*
|
||||
* Callbacks can be repeated, to call it multiple times
|
||||
*
|
||||
* Arguments:
|
||||
* * list/callbacks the list of callbacks to be called
|
||||
* * list/callback_args the list of lists of arguments to pass into each callback
|
||||
* * savereturns Optionally save and return the list of returned values from each of the callbacks
|
||||
* * resolution The number of byond ticks between each time you check if all callbacks are complete
|
||||
*/
|
||||
* Runs a list of callbacks asyncronously, returning only when all have finished
|
||||
*
|
||||
* Callbacks can be repeated, to call it multiple times
|
||||
*
|
||||
* Arguments:
|
||||
* * list/callbacks the list of callbacks to be called
|
||||
* * list/callback_args the list of lists of arguments to pass into each callback
|
||||
* * savereturns Optionally save and return the list of returned values from each of the callbacks
|
||||
* * resolution The number of byond ticks between each time you check if all callbacks are complete
|
||||
*/
|
||||
/proc/callback_select(list/callbacks, list/callback_args, savereturns = TRUE, resolution = 1)
|
||||
if (!callbacks)
|
||||
return
|
||||
|
||||
+49
-49
@@ -24,10 +24,10 @@
|
||||
#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1))
|
||||
|
||||
/**
|
||||
* # Chat Message Overlay
|
||||
*
|
||||
* Datum for generating a message overlay on the map
|
||||
*/
|
||||
* # Chat Message Overlay
|
||||
*
|
||||
* Datum for generating a message overlay on the map
|
||||
*/
|
||||
/datum/chatmessage
|
||||
/// The visual element of the chat messsage
|
||||
var/image/message
|
||||
@@ -49,16 +49,16 @@
|
||||
var/static/current_z_idx = 0
|
||||
|
||||
/**
|
||||
* Constructs a chat message overlay
|
||||
*
|
||||
* Arguments:
|
||||
* * text - The text content of the overlay
|
||||
* * target - The target atom to display the overlay at
|
||||
* * owner - The mob that owns this overlay, only this mob will be able to view it
|
||||
* * language - The language this message was spoken in
|
||||
* * extra_classes - Extra classes to apply to the span that holds the text
|
||||
* * lifespan - The lifespan of the message in deciseconds
|
||||
*/
|
||||
* Constructs a chat message overlay
|
||||
*
|
||||
* Arguments:
|
||||
* * text - The text content of the overlay
|
||||
* * target - The target atom to display the overlay at
|
||||
* * owner - The mob that owns this overlay, only this mob will be able to view it
|
||||
* * language - The language this message was spoken in
|
||||
* * extra_classes - Extra classes to apply to the span that holds the text
|
||||
* * lifespan - The lifespan of the message in deciseconds
|
||||
*/
|
||||
/datum/chatmessage/New(text, atom/target, mob/owner, datum/language/language, list/extra_classes = list(), lifespan = CHAT_MESSAGE_LIFESPAN)
|
||||
. = ..()
|
||||
if (!istype(target))
|
||||
@@ -81,24 +81,24 @@
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Calls qdel on the chatmessage when its parent is deleted, used to register qdel signal
|
||||
*/
|
||||
* Calls qdel on the chatmessage when its parent is deleted, used to register qdel signal
|
||||
*/
|
||||
/datum/chatmessage/proc/on_parent_qdel()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* Generates a chat message image representation
|
||||
*
|
||||
* Arguments:
|
||||
* * text - The text content of the overlay
|
||||
* * target - The target atom to display the overlay at
|
||||
* * owner - The mob that owns this overlay, only this mob will be able to view it
|
||||
* * language - The language this message was spoken in
|
||||
* * extra_classes - Extra classes to apply to the span that holds the text
|
||||
* * lifespan - The lifespan of the message in deciseconds
|
||||
*/
|
||||
* Generates a chat message image representation
|
||||
*
|
||||
* Arguments:
|
||||
* * text - The text content of the overlay
|
||||
* * target - The target atom to display the overlay at
|
||||
* * owner - The mob that owns this overlay, only this mob will be able to view it
|
||||
* * language - The language this message was spoken in
|
||||
* * extra_classes - Extra classes to apply to the span that holds the text
|
||||
* * lifespan - The lifespan of the message in deciseconds
|
||||
*/
|
||||
/datum/chatmessage/proc/generate_image(text, atom/target, mob/owner, datum/language/language, list/extra_classes, lifespan)
|
||||
/// Cached icons to show what language the user is speaking
|
||||
var/static/list/language_icons
|
||||
@@ -208,26 +208,26 @@
|
||||
enter_subsystem()
|
||||
|
||||
/**
|
||||
* Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion,
|
||||
* sets time for scheduling deletion and re-enters the runechat SS for qdeling
|
||||
*
|
||||
* Arguments:
|
||||
* * fadetime - The amount of time to animate the message's fadeout for
|
||||
*/
|
||||
* Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion,
|
||||
* sets time for scheduling deletion and re-enters the runechat SS for qdeling
|
||||
*
|
||||
* Arguments:
|
||||
* * fadetime - The amount of time to animate the message's fadeout for
|
||||
*/
|
||||
/datum/chatmessage/proc/end_of_life(fadetime = CHAT_MESSAGE_EOL_FADE)
|
||||
eol_complete = scheduled_destruction + fadetime
|
||||
animate(message, alpha = 0, time = fadetime, flags = ANIMATION_PARALLEL)
|
||||
enter_subsystem(eol_complete) // re-enter the runechat SS with the EOL completion time to QDEL self
|
||||
|
||||
/**
|
||||
* Creates a message overlay at a defined location for a given speaker
|
||||
*
|
||||
* Arguments:
|
||||
* * speaker - The atom who is saying this message
|
||||
* * message_language - The language that the message is said in
|
||||
* * raw_message - The text content of the message
|
||||
* * spans - Additional classes to be added to the message
|
||||
*/
|
||||
* Creates a message overlay at a defined location for a given speaker
|
||||
*
|
||||
* Arguments:
|
||||
* * speaker - The atom who is saying this message
|
||||
* * message_language - The language that the message is said in
|
||||
* * raw_message - The text content of the message
|
||||
* * spans - Additional classes to be added to the message
|
||||
*/
|
||||
/mob/proc/create_chat_message(atom/movable/speaker, datum/language/message_language, raw_message, list/spans, runechat_flags = NONE)
|
||||
// Ensure the list we are using, if present, is a copy so we don't modify the list provided to us
|
||||
spans = spans ? spans.Copy() : list()
|
||||
@@ -257,15 +257,15 @@
|
||||
#define CM_COLOR_LUM_MAX 0.75
|
||||
|
||||
/**
|
||||
* Gets a color for a name, will return the same color for a given string consistently within a round.atom
|
||||
*
|
||||
* Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map.
|
||||
*
|
||||
* Arguments:
|
||||
* * name - The name to generate a color for
|
||||
* * sat_shift - A value between 0 and 1 that will be multiplied against the saturation
|
||||
* * lum_shift - A value between 0 and 1 that will be multiplied against the luminescence
|
||||
*/
|
||||
* Gets a color for a name, will return the same color for a given string consistently within a round.atom
|
||||
*
|
||||
* Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map.
|
||||
*
|
||||
* Arguments:
|
||||
* * name - The name to generate a color for
|
||||
* * sat_shift - A value between 0 and 1 that will be multiplied against the saturation
|
||||
* * lum_shift - A value between 0 and 1 that will be multiplied against the luminescence
|
||||
*/
|
||||
/datum/chatmessage/proc/colorize_string(name, sat_shift = 1, lum_shift = 1)
|
||||
// seed to help randomness
|
||||
var/static/rseed = rand(1,26)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* # Component
|
||||
*
|
||||
* The component datum
|
||||
*
|
||||
* A component should be a single standalone unit
|
||||
* of functionality, that works by receiving signals from it's parent
|
||||
* object to provide some single functionality (i.e a slippery component)
|
||||
* that makes the object it's attached to cause people to slip over.
|
||||
* Useful when you want shared behaviour independent of type inheritance
|
||||
*/
|
||||
* # Component
|
||||
*
|
||||
* The component datum
|
||||
*
|
||||
* A component should be a single standalone unit
|
||||
* of functionality, that works by receiving signals from it's parent
|
||||
* object to provide some single functionality (i.e a slippery component)
|
||||
* that makes the object it's attached to cause people to slip over.
|
||||
* Useful when you want shared behaviour independent of type inheritance
|
||||
*/
|
||||
/datum/component
|
||||
/**
|
||||
* Defines how duplicate existing components are handled when added to a datum
|
||||
@@ -39,13 +39,13 @@
|
||||
var/can_transfer = FALSE
|
||||
|
||||
/**
|
||||
* Create a new component.
|
||||
*
|
||||
* Additional arguments are passed to [Initialize()][/datum/component/proc/Initialize]
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/P the parent datum this component reacts to signals from
|
||||
*/
|
||||
* Create a new component.
|
||||
*
|
||||
* Additional arguments are passed to [Initialize()][/datum/component/proc/Initialize]
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/P the parent datum this component reacts to signals from
|
||||
*/
|
||||
/datum/component/New(list/raw_args)
|
||||
parent = raw_args[1]
|
||||
var/list/arguments = raw_args.Copy(2)
|
||||
@@ -57,20 +57,20 @@
|
||||
_JoinParent(parent)
|
||||
|
||||
/**
|
||||
* Called during component creation with the same arguments as in new excluding parent.
|
||||
*
|
||||
* Do not call `qdel(src)` from this function, `return COMPONENT_INCOMPATIBLE` instead
|
||||
*/
|
||||
* Called during component creation with the same arguments as in new excluding parent.
|
||||
*
|
||||
* Do not call `qdel(src)` from this function, `return COMPONENT_INCOMPATIBLE` instead
|
||||
*/
|
||||
/datum/component/proc/Initialize(...)
|
||||
return
|
||||
|
||||
/**
|
||||
* Properly removes the component from `parent` and cleans up references
|
||||
*
|
||||
* Arguments:
|
||||
* * force - makes it not check for and remove the component from the parent
|
||||
* * silent - deletes the component without sending a [COMSIG_COMPONENT_REMOVING] signal
|
||||
*/
|
||||
* Properly removes the component from `parent` and cleans up references
|
||||
*
|
||||
* Arguments:
|
||||
* * force - makes it not check for and remove the component from the parent
|
||||
* * silent - deletes the component without sending a [COMSIG_COMPONENT_REMOVING] signal
|
||||
*/
|
||||
/datum/component/Destroy(force=FALSE, silent=FALSE)
|
||||
if(!force && parent)
|
||||
_RemoveFromParent()
|
||||
@@ -80,8 +80,8 @@
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Internal proc to handle behaviour of components when joining a parent
|
||||
*/
|
||||
* Internal proc to handle behaviour of components when joining a parent
|
||||
*/
|
||||
/datum/component/proc/_JoinParent()
|
||||
var/datum/P = parent
|
||||
//lazy init the parent's dc list
|
||||
@@ -118,8 +118,8 @@
|
||||
RegisterWithParent()
|
||||
|
||||
/**
|
||||
* Internal proc to handle behaviour when being removed from a parent
|
||||
*/
|
||||
* Internal proc to handle behaviour when being removed from a parent
|
||||
*/
|
||||
/datum/component/proc/_RemoveFromParent()
|
||||
var/datum/P = parent
|
||||
var/list/dc = P.datum_components
|
||||
@@ -139,39 +139,39 @@
|
||||
UnregisterFromParent()
|
||||
|
||||
/**
|
||||
* Register the component with the parent object
|
||||
*
|
||||
* Use this proc to register with your parent object
|
||||
*
|
||||
* Overridable proc that's called when added to a new parent
|
||||
*/
|
||||
* Register the component with the parent object
|
||||
*
|
||||
* Use this proc to register with your parent object
|
||||
*
|
||||
* Overridable proc that's called when added to a new parent
|
||||
*/
|
||||
/datum/component/proc/RegisterWithParent()
|
||||
return
|
||||
|
||||
/**
|
||||
* Unregister from our parent object
|
||||
*
|
||||
* Use this proc to unregister from your parent object
|
||||
*
|
||||
* Overridable proc that's called when removed from a parent
|
||||
* *
|
||||
*/
|
||||
* Unregister from our parent object
|
||||
*
|
||||
* Use this proc to unregister from your parent object
|
||||
*
|
||||
* Overridable proc that's called when removed from a parent
|
||||
* *
|
||||
*/
|
||||
/datum/component/proc/UnregisterFromParent()
|
||||
return
|
||||
|
||||
/**
|
||||
* Register to listen for a signal from the passed in target
|
||||
*
|
||||
* This sets up a listening relationship such that when the target object emits a signal
|
||||
* the source datum this proc is called upon, will receive a callback to the given proctype
|
||||
* Return values from procs registered must be a bitfield
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/target The target to listen for signals from
|
||||
* * sig_type_or_types Either a string signal name, or a list of signal names (strings)
|
||||
* * proctype The proc to call back when the signal is emitted
|
||||
* * override If a previous registration exists you must explicitly set this
|
||||
*/
|
||||
* Register to listen for a signal from the passed in target
|
||||
*
|
||||
* This sets up a listening relationship such that when the target object emits a signal
|
||||
* the source datum this proc is called upon, will receive a callback to the given proctype
|
||||
* Return values from procs registered must be a bitfield
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/target The target to listen for signals from
|
||||
* * sig_type_or_types Either a string signal name, or a list of signal names (strings)
|
||||
* * proctype The proc to call back when the signal is emitted
|
||||
* * override If a previous registration exists you must explicitly set this
|
||||
*/
|
||||
/datum/proc/RegisterSignal(datum/target, sig_type_or_types, proctype, override = FALSE)
|
||||
if(QDELETED(src) || QDELETED(target))
|
||||
return
|
||||
@@ -205,16 +205,16 @@
|
||||
signal_enabled = TRUE
|
||||
|
||||
/**
|
||||
* Stop listening to a given signal from target
|
||||
*
|
||||
* Breaks the relationship between target and source datum, removing the callback when the signal fires
|
||||
*
|
||||
* Doesn't care if a registration exists or not
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/target Datum to stop listening to signals from
|
||||
* * sig_typeor_types Signal string key or list of signal keys to stop listening to specifically
|
||||
*/
|
||||
* Stop listening to a given signal from target
|
||||
*
|
||||
* Breaks the relationship between target and source datum, removing the callback when the signal fires
|
||||
*
|
||||
* Doesn't care if a registration exists or not
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/target Datum to stop listening to signals from
|
||||
* * sig_typeor_types Signal string key or list of signal keys to stop listening to specifically
|
||||
*/
|
||||
/datum/proc/UnregisterSignal(datum/target, sig_type_or_types)
|
||||
var/list/lookup = target.comp_lookup
|
||||
if(!signal_procs || !signal_procs[target] || !lookup)
|
||||
@@ -247,50 +247,50 @@
|
||||
signal_procs -= target
|
||||
|
||||
/**
|
||||
* Called on a component when a component of the same type was added to the same parent
|
||||
*
|
||||
* See [/datum/component/var/dupe_mode]
|
||||
*
|
||||
* `C`'s type will always be the same of the called component
|
||||
*/
|
||||
* Called on a component when a component of the same type was added to the same parent
|
||||
*
|
||||
* See [/datum/component/var/dupe_mode]
|
||||
*
|
||||
* `C`'s type will always be the same of the called component
|
||||
*/
|
||||
/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
|
||||
return
|
||||
|
||||
|
||||
/**
|
||||
* Called on a component when a component of the same type was added to the same parent with [COMPONENT_DUPE_SELECTIVE]
|
||||
*
|
||||
* See [/datum/component/var/dupe_mode]
|
||||
*
|
||||
* `C`'s type will always be the same of the called component
|
||||
*
|
||||
* return TRUE if you are absorbing the component, otherwise FALSE if you are fine having it exist as a duplicate component
|
||||
*/
|
||||
* Called on a component when a component of the same type was added to the same parent with [COMPONENT_DUPE_SELECTIVE]
|
||||
*
|
||||
* See [/datum/component/var/dupe_mode]
|
||||
*
|
||||
* `C`'s type will always be the same of the called component
|
||||
*
|
||||
* return TRUE if you are absorbing the component, otherwise FALSE if you are fine having it exist as a duplicate component
|
||||
*/
|
||||
/datum/component/proc/CheckDupeComponent(datum/component/C, ...)
|
||||
return
|
||||
|
||||
|
||||
/**
|
||||
* Callback Just before this component is transferred
|
||||
*
|
||||
* Use this to do any special cleanup you might need to do before being deregged from an object
|
||||
*/
|
||||
* Callback Just before this component is transferred
|
||||
*
|
||||
* Use this to do any special cleanup you might need to do before being deregged from an object
|
||||
*/
|
||||
/datum/component/proc/PreTransfer()
|
||||
return
|
||||
|
||||
/**
|
||||
* Callback Just after a component is transferred
|
||||
*
|
||||
* Use this to do any special setup you need to do after being moved to a new object
|
||||
*
|
||||
* Do not call `qdel(src)` from this function, `return COMPONENT_INCOMPATIBLE` instead
|
||||
*/
|
||||
* Callback Just after a component is transferred
|
||||
*
|
||||
* Use this to do any special setup you need to do after being moved to a new object
|
||||
*
|
||||
* Do not call `qdel(src)` from this function, `return COMPONENT_INCOMPATIBLE` instead
|
||||
*/
|
||||
/datum/component/proc/PostTransfer()
|
||||
return COMPONENT_INCOMPATIBLE //Do not support transfer by default as you must properly support it
|
||||
|
||||
/**
|
||||
* Internal proc to create a list of our type and all parent types
|
||||
*/
|
||||
* Internal proc to create a list of our type and all parent types
|
||||
*/
|
||||
/datum/component/proc/_GetInverseTypeList(our_type = type)
|
||||
//we can do this one simple trick
|
||||
var/current_type = parent_type
|
||||
@@ -301,12 +301,12 @@
|
||||
. += current_type
|
||||
|
||||
/**
|
||||
* Internal proc to handle most all of the signaling procedure
|
||||
*
|
||||
* Will runtime if used on datums with an empty component list
|
||||
*
|
||||
* Use the [SEND_SIGNAL] define instead
|
||||
*/
|
||||
* Internal proc to handle most all of the signaling procedure
|
||||
*
|
||||
* Will runtime if used on datums with an empty component list
|
||||
*
|
||||
* Use the [SEND_SIGNAL] define instead
|
||||
*/
|
||||
/datum/proc/_SendSignal(sigtype, list/arguments)
|
||||
var/target = comp_lookup[sigtype]
|
||||
if(!length(target))
|
||||
@@ -325,13 +325,13 @@
|
||||
|
||||
// The type arg is casted so initial works, you shouldn't be passing a real instance into this
|
||||
/**
|
||||
* Return any component assigned to this datum of the given type
|
||||
*
|
||||
* This will throw an error if it's possible to have more than one component of that type on the parent
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/c_type The typepath of the component you want to get a reference to
|
||||
*/
|
||||
* Return any component assigned to this datum of the given type
|
||||
*
|
||||
* This will throw an error if it's possible to have more than one component of that type on the parent
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/c_type The typepath of the component you want to get a reference to
|
||||
*/
|
||||
/datum/proc/GetComponent(datum/component/c_type)
|
||||
RETURN_TYPE(c_type)
|
||||
if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE)
|
||||
@@ -345,13 +345,13 @@
|
||||
|
||||
// The type arg is casted so initial works, you shouldn't be passing a real instance into this
|
||||
/**
|
||||
* Return any component assigned to this datum of the exact given type
|
||||
*
|
||||
* This will throw an error if it's possible to have more than one component of that type on the parent
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/c_type The typepath of the component you want to get a reference to
|
||||
*/
|
||||
* Return any component assigned to this datum of the exact given type
|
||||
*
|
||||
* This will throw an error if it's possible to have more than one component of that type on the parent
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/c_type The typepath of the component you want to get a reference to
|
||||
*/
|
||||
/datum/proc/GetExactComponent(datum/component/c_type)
|
||||
RETURN_TYPE(c_type)
|
||||
if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE)
|
||||
@@ -368,11 +368,11 @@
|
||||
return null
|
||||
|
||||
/**
|
||||
* Get all components of a given type that are attached to this datum
|
||||
*
|
||||
* Arguments:
|
||||
* * c_type The component type path
|
||||
*/
|
||||
* Get all components of a given type that are attached to this datum
|
||||
*
|
||||
* Arguments:
|
||||
* * c_type The component type path
|
||||
*/
|
||||
/datum/proc/GetComponents(c_type)
|
||||
var/list/dc = datum_components
|
||||
if(!dc)
|
||||
@@ -382,16 +382,16 @@
|
||||
return list(.)
|
||||
|
||||
/**
|
||||
* Creates an instance of `new_type` in the datum and attaches to it as parent
|
||||
*
|
||||
* Sends the [COMSIG_COMPONENT_ADDED] signal to the datum
|
||||
*
|
||||
* Returns the component that was created. Or the old component in a dupe situation where [COMPONENT_DUPE_UNIQUE] was set
|
||||
*
|
||||
* If this tries to add a component to an incompatible type, the component will be deleted and the result will be `null`. This is very unperformant, try not to do it
|
||||
*
|
||||
* Properly handles duplicate situations based on the `dupe_mode` var
|
||||
*/
|
||||
* Creates an instance of `new_type` in the datum and attaches to it as parent
|
||||
*
|
||||
* Sends the [COMSIG_COMPONENT_ADDED] signal to the datum
|
||||
*
|
||||
* Returns the component that was created. Or the old component in a dupe situation where [COMPONENT_DUPE_UNIQUE] was set
|
||||
*
|
||||
* If this tries to add a component to an incompatible type, the component will be deleted and the result will be `null`. This is very unperformant, try not to do it
|
||||
*
|
||||
* Properly handles duplicate situations based on the `dupe_mode` var
|
||||
*/
|
||||
/datum/proc/_AddComponent(list/raw_args)
|
||||
var/new_type = raw_args[1]
|
||||
var/datum/component/nt = new_type
|
||||
@@ -459,22 +459,22 @@
|
||||
return old_comp
|
||||
|
||||
/**
|
||||
* Get existing component of type, or create it and return a reference to it
|
||||
*
|
||||
* Use this if the item needs to exist at the time of this call, but may not have been created before now
|
||||
*
|
||||
* Arguments:
|
||||
* * component_type The typepath of the component to create or return
|
||||
* * ... additional arguments to be passed when creating the component if it does not exist
|
||||
*/
|
||||
* Get existing component of type, or create it and return a reference to it
|
||||
*
|
||||
* Use this if the item needs to exist at the time of this call, but may not have been created before now
|
||||
*
|
||||
* Arguments:
|
||||
* * component_type The typepath of the component to create or return
|
||||
* * ... additional arguments to be passed when creating the component if it does not exist
|
||||
*/
|
||||
/datum/proc/LoadComponent(component_type, ...)
|
||||
. = GetComponent(component_type)
|
||||
if(!.)
|
||||
return _AddComponent(args)
|
||||
|
||||
/**
|
||||
* Removes the component from parent, ends up with a null parent
|
||||
*/
|
||||
* Removes the component from parent, ends up with a null parent
|
||||
*/
|
||||
/datum/component/proc/RemoveComponent()
|
||||
if(!parent)
|
||||
return
|
||||
@@ -485,13 +485,13 @@
|
||||
SEND_SIGNAL(old_parent, COMSIG_COMPONENT_REMOVING, src)
|
||||
|
||||
/**
|
||||
* Transfer this component to another parent
|
||||
*
|
||||
* Component is taken from source datum
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/target Target datum to transfer to
|
||||
*/
|
||||
* Transfer this component to another parent
|
||||
*
|
||||
* Component is taken from source datum
|
||||
*
|
||||
* Arguments:
|
||||
* * datum/component/target Target datum to transfer to
|
||||
*/
|
||||
/datum/proc/TakeComponent(datum/component/target)
|
||||
if(!target || target.parent == src)
|
||||
return
|
||||
@@ -509,13 +509,13 @@
|
||||
target._JoinParent()
|
||||
|
||||
/**
|
||||
* Transfer all components to target
|
||||
*
|
||||
* All components from source datum are taken
|
||||
*
|
||||
* Arguments:
|
||||
* * /datum/target the target to move the components to
|
||||
*/
|
||||
* Transfer all components to target
|
||||
*
|
||||
* All components from source datum are taken
|
||||
*
|
||||
* Arguments:
|
||||
* * /datum/target the target to move the components to
|
||||
*/
|
||||
/datum/proc/TransferComponents(datum/target)
|
||||
var/list/dc = datum_components
|
||||
if(!dc)
|
||||
@@ -531,7 +531,7 @@
|
||||
target.TakeComponent(comps)
|
||||
|
||||
/**
|
||||
* Return the object that is the host of any UI's that this component has
|
||||
*/
|
||||
* Return the object that is the host of any UI's that this component has
|
||||
*/
|
||||
/datum/component/ui_host()
|
||||
return parent
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/** Component representing acid applied to an object.
|
||||
*
|
||||
* Must be attached to an atom.
|
||||
* Processes, repeatedly damaging whatever it is attached to.
|
||||
* If the parent atom is a turf it applies acid to the contents of the turf.
|
||||
*/
|
||||
*
|
||||
* Must be attached to an atom.
|
||||
* Processes, repeatedly damaging whatever it is attached to.
|
||||
* If the parent atom is a turf it applies acid to the contents of the turf.
|
||||
*/
|
||||
/datum/component/acid
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
||||
/// The strength of the acid on the parent [/atom].
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* Beauty component, makes the indoor area the parent is in prettier or uglier depending on the beauty var.
|
||||
* Clean and well decorated areas lead to positive moodlets for passerbies, while shabbier, dirtier ones
|
||||
* lead to negative moodlets exclusive to characters with the snob quirk.
|
||||
*
|
||||
* Keep in mind AddComponent is used for BOTH adding and removing beauty value here,
|
||||
* so please don't use qdel/RemoveComponent unless necessary.
|
||||
*/
|
||||
* Beauty component, makes the indoor area the parent is in prettier or uglier depending on the beauty var.
|
||||
* Clean and well decorated areas lead to positive moodlets for passerbies, while shabbier, dirtier ones
|
||||
* lead to negative moodlets exclusive to characters with the snob quirk.
|
||||
*
|
||||
* Keep in mind AddComponent is used for BOTH adding and removing beauty value here,
|
||||
* so please don't use qdel/RemoveComponent unless necessary.
|
||||
*/
|
||||
/datum/component/beauty
|
||||
var/beauty = 0
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/**
|
||||
* Component for clothing items that can pick up blood from decals and spread it around everywhere when walking, such as shoes or suits with integrated shoes.
|
||||
*/
|
||||
* Component for clothing items that can pick up blood from decals and spread it around everywhere when walking, such as shoes or suits with integrated shoes.
|
||||
*/
|
||||
/datum/component/bloodysoles
|
||||
/// The type of the last grub pool we stepped in, used to decide the type of footprints to make
|
||||
var/last_blood_state = BLOOD_STATE_NOT_BLOODY
|
||||
@@ -31,8 +31,8 @@
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/on_clean)
|
||||
|
||||
/**
|
||||
* Unregisters from the wielder if necessary
|
||||
*/
|
||||
* Unregisters from the wielder if necessary
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/unregister()
|
||||
if(!QDELETED(wielder))
|
||||
UnregisterSignal(wielder, COMSIG_MOVABLE_MOVED)
|
||||
@@ -41,21 +41,21 @@
|
||||
equipped_slot = null
|
||||
|
||||
/**
|
||||
* Returns true if the parent item is obscured by something else that the wielder is wearing
|
||||
*/
|
||||
* Returns true if the parent item is obscured by something else that the wielder is wearing
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/is_obscured()
|
||||
return wielder.check_obscured_slots(TRUE) & equipped_slot
|
||||
|
||||
/**
|
||||
* Run to update the icon of the parent
|
||||
*/
|
||||
* Run to update the icon of the parent
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/update_icon()
|
||||
var/obj/item/parent_item = parent
|
||||
parent_item.update_slot_icon()
|
||||
|
||||
/**
|
||||
* Run to equally share the blood between us and a decal
|
||||
*/
|
||||
* Run to equally share the blood between us and a decal
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/share_blood(obj/effect/decal/cleanable/pool)
|
||||
last_blood_state = pool.blood_state
|
||||
|
||||
@@ -72,24 +72,24 @@
|
||||
update_icon()
|
||||
|
||||
/**
|
||||
* Find a blood decal on a turf that matches our last_blood_state
|
||||
*/
|
||||
* Find a blood decal on a turf that matches our last_blood_state
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null)
|
||||
for(var/obj/effect/decal/cleanable/blood/pool in turfLoc)
|
||||
if(pool.blood_state == last_blood_state && (!typeFilter || istype(pool, typeFilter)))
|
||||
return pool
|
||||
|
||||
/**
|
||||
* Adds the parent type to the footprint's shoe_types var
|
||||
*/
|
||||
* Adds the parent type to the footprint's shoe_types var
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/add_parent_to_footprint(obj/effect/decal/cleanable/blood/footprints/FP)
|
||||
FP.shoe_types |= parent.type
|
||||
|
||||
/**
|
||||
* Called when the parent item is equipped by someone
|
||||
*
|
||||
* Used to register our wielder
|
||||
*/
|
||||
* Called when the parent item is equipped by someone
|
||||
*
|
||||
* Used to register our wielder
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/on_equip(datum/source, mob/equipper, slot)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -106,20 +106,20 @@
|
||||
RegisterSignal(wielder, COMSIG_STEP_ON_BLOOD, .proc/on_step_blood)
|
||||
|
||||
/**
|
||||
* Called when the parent item has been dropped
|
||||
*
|
||||
* Used to deregister our wielder
|
||||
*/
|
||||
* Called when the parent item has been dropped
|
||||
*
|
||||
* Used to deregister our wielder
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/on_drop(datum/source, mob/dropper)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
unregister()
|
||||
|
||||
/**
|
||||
* Called when the wielder has moved
|
||||
*
|
||||
* Used to make bloody footprints on the ground
|
||||
*/
|
||||
* Called when the wielder has moved
|
||||
*
|
||||
* Used to make bloody footprints on the ground
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/on_moved(datum/source, OldLoc, Dir, Forced)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -176,10 +176,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* Called when the wielder steps in a pool of blood
|
||||
*
|
||||
* Used to make the parent item bloody
|
||||
*/
|
||||
* Called when the wielder steps in a pool of blood
|
||||
*
|
||||
* Used to make the parent item bloody
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/on_step_blood(datum/source, obj/effect/decal/cleanable/pool)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -200,8 +200,8 @@
|
||||
last_pickup = world.time
|
||||
|
||||
/**
|
||||
* Called when the parent item is being washed
|
||||
*/
|
||||
* Called when the parent item is being washed
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/on_clean(datum/source, clean_types)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -215,8 +215,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Like its parent but can be applied to carbon mobs instead of clothing items
|
||||
*/
|
||||
* Like its parent but can be applied to carbon mobs instead of clothing items
|
||||
*/
|
||||
/datum/component/bloodysoles/feet
|
||||
var/static/mutable_appearance/bloody_feet
|
||||
|
||||
|
||||
@@ -60,12 +60,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check that the contents of the recipe meet the requirements.
|
||||
*
|
||||
* user: The /mob that initated the crafting.
|
||||
* R: The /datum/crafting_recipe being attempted.
|
||||
* contents: List of items to search for R's reqs.
|
||||
*/
|
||||
* Check that the contents of the recipe meet the requirements.
|
||||
*
|
||||
* user: The /mob that initated the crafting.
|
||||
* R: The /datum/crafting_recipe being attempted.
|
||||
* contents: List of items to search for R's reqs.
|
||||
*/
|
||||
/datum/component/personal_crafting/proc/check_contents(atom/a, datum/crafting_recipe/R, list/contents)
|
||||
var/list/item_instances = contents["instances"]
|
||||
contents = contents["other"]
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
blacklist += result
|
||||
|
||||
/**
|
||||
* Run custom pre-craft checks for this recipe
|
||||
*
|
||||
* user: The /mob that initiated the crafting
|
||||
* collected_requirements: A list of lists of /obj/item instances that satisfy reqs. Top level list is keyed by requirement path.
|
||||
*/
|
||||
* Run custom pre-craft checks for this recipe
|
||||
*
|
||||
* user: The /mob that initiated the crafting
|
||||
* collected_requirements: A list of lists of /obj/item instances that satisfy reqs. Top level list is keyed by requirement path.
|
||||
*/
|
||||
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
|
||||
return TRUE
|
||||
|
||||
@@ -820,8 +820,9 @@
|
||||
name = "Collosal Rib"
|
||||
always_available = FALSE
|
||||
reqs = list(
|
||||
/obj/item/stack/sheet/bone = 10,
|
||||
/datum/reagent/fuel/oil = 5)
|
||||
/obj/item/stack/sheet/bone = 10,
|
||||
/datum/reagent/fuel/oil = 5,
|
||||
)
|
||||
result = /obj/structure/statue/bone/rib
|
||||
subcategory = CAT_PRIMAL
|
||||
|
||||
@@ -829,8 +830,9 @@
|
||||
name = "Skull Carving"
|
||||
always_available = FALSE
|
||||
reqs = list(
|
||||
/obj/item/stack/sheet/bone = 6,
|
||||
/datum/reagent/fuel/oil = 5)
|
||||
/obj/item/stack/sheet/bone = 6,
|
||||
/datum/reagent/fuel/oil = 5,
|
||||
)
|
||||
result = /obj/structure/statue/bone/skull
|
||||
category = CAT_PRIMAL
|
||||
|
||||
@@ -838,8 +840,9 @@
|
||||
name = "Cracked Skull Carving"
|
||||
always_available = FALSE
|
||||
reqs = list(
|
||||
/obj/item/stack/sheet/bone = 3,
|
||||
/datum/reagent/fuel/oil = 5)
|
||||
/obj/item/stack/sheet/bone = 3,
|
||||
/datum/reagent/fuel/oil = 5,
|
||||
)
|
||||
result = /obj/structure/statue/bone/skull/half
|
||||
category = CAT_PRIMAL
|
||||
|
||||
@@ -847,42 +850,47 @@
|
||||
name = "Serrated Bone Shovel"
|
||||
always_available = FALSE
|
||||
reqs = list(
|
||||
/obj/item/stack/sheet/bone = 4,
|
||||
/datum/reagent/fuel/oil = 5,
|
||||
/obj/item/shovel/spade = 1)
|
||||
/obj/item/stack/sheet/bone = 4,
|
||||
/datum/reagent/fuel/oil = 5,
|
||||
/obj/item/shovel/spade = 1,
|
||||
)
|
||||
result = /obj/item/shovel/serrated
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/lasso
|
||||
name = "Bone Lasso"
|
||||
reqs = list(
|
||||
/obj/item/stack/sheet/bone = 1,
|
||||
/obj/item/stack/sheet/sinew = 5)
|
||||
/obj/item/stack/sheet/bone = 1,
|
||||
/obj/item/stack/sheet/sinew = 5,
|
||||
)
|
||||
result = /obj/item/key/lasso
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/gripperoffbrand
|
||||
name = "Improvised Gripper Gloves"
|
||||
reqs = list(
|
||||
/obj/item/clothing/gloves/fingerless = 1,
|
||||
/obj/item/stack/sticky_tape = 1)
|
||||
/obj/item/clothing/gloves/fingerless = 1,
|
||||
/obj/item/stack/sticky_tape = 1,
|
||||
)
|
||||
result = /obj/item/clothing/gloves/tackler/offbrand
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/boh
|
||||
name = "Bag of Holding"
|
||||
reqs = list(
|
||||
/obj/item/bag_of_holding_inert = 1,
|
||||
/obj/item/assembly/signaler/anomaly/bluespace = 1)
|
||||
/obj/item/bag_of_holding_inert = 1,
|
||||
/obj/item/assembly/signaler/anomaly/bluespace = 1,
|
||||
)
|
||||
result = /obj/item/storage/backpack/holding
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/ipickaxe
|
||||
name = "Improvised Pickaxe"
|
||||
reqs = list(
|
||||
/obj/item/crowbar = 1,
|
||||
/obj/item/kitchen/knife = 1,
|
||||
/obj/item/stack/sticky_tape = 1)
|
||||
/obj/item/crowbar = 1,
|
||||
/obj/item/kitchen/knife = 1,
|
||||
/obj/item/stack/sticky_tape = 1,
|
||||
)
|
||||
result = /obj/item/pickaxe/improvised
|
||||
category = CAT_MISC
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ GLOBAL_LIST_INIT(creamable, typecacheof(list(
|
||||
/mob/living/silicon/ai)))
|
||||
|
||||
/**
|
||||
* Creamed component
|
||||
*
|
||||
* For when you have pie on your face
|
||||
*/
|
||||
* Creamed component
|
||||
*
|
||||
* For when you have pie on your face
|
||||
*/
|
||||
/datum/component/creamed
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* A component to reset the parent to its previous state after some time passes
|
||||
*/
|
||||
* A component to reset the parent to its previous state after some time passes
|
||||
*/
|
||||
/datum/component/dejavu
|
||||
/// The turf the parent was on when this components was applied, they get moved back here after the duration
|
||||
var/turf/starting_turf
|
||||
@@ -35,7 +35,7 @@
|
||||
starting_turf = get_turf(parent)
|
||||
rewinds_remaining = rewinds
|
||||
rewind_interval = interval
|
||||
|
||||
|
||||
if(isliving(parent))
|
||||
var/mob/living/L = parent
|
||||
clone_loss = L.getCloneLoss()
|
||||
@@ -43,22 +43,22 @@
|
||||
oxy_loss = L.getOxyLoss()
|
||||
brain_loss = L.getOrganLoss(ORGAN_SLOT_BRAIN)
|
||||
rewind_type = .proc/rewind_living
|
||||
|
||||
|
||||
if(iscarbon(parent))
|
||||
var/mob/living/carbon/C = parent
|
||||
saved_bodyparts = C.save_bodyparts()
|
||||
rewind_type = .proc/rewind_carbon
|
||||
|
||||
|
||||
else if(isanimal(parent))
|
||||
var/mob/living/simple_animal/M = parent
|
||||
brute_loss = M.bruteloss
|
||||
rewind_type = .proc/rewind_animal
|
||||
|
||||
|
||||
else if(isobj(parent))
|
||||
var/obj/O = parent
|
||||
integrity = O.obj_integrity
|
||||
rewind_type = .proc/rewind_obj
|
||||
|
||||
|
||||
addtimer(CALLBACK(src, rewind_type), rewind_interval)
|
||||
|
||||
/datum/component/dejavu/Destroy()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_act)
|
||||
|
||||
/datum/component/forensics/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(COMSIG_COMPONENT_CLEAN_ACT))
|
||||
UnregisterSignal(parent, list(COMSIG_COMPONENT_CLEAN_ACT))
|
||||
|
||||
/datum/component/forensics/PostTransfer()
|
||||
if(!isatom(parent))
|
||||
|
||||
@@ -47,13 +47,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* Throw a target in a direction
|
||||
*
|
||||
* Arguments:
|
||||
* * target - Target atom to throw
|
||||
* * thrower - Thing that caused this atom to be thrown
|
||||
* * throw_dir - Direction to throw the atom
|
||||
*/
|
||||
* Throw a target in a direction
|
||||
*
|
||||
* Arguments:
|
||||
* * target - Target atom to throw
|
||||
* * thrower - Thing that caused this atom to be thrown
|
||||
* * throw_dir - Direction to throw the atom
|
||||
*/
|
||||
/datum/component/knockback/proc/do_knockback(atom/target, mob/thrower, throw_dir)
|
||||
if(!ismovable(target) || throw_dir == null)
|
||||
return
|
||||
|
||||
@@ -196,14 +196,14 @@
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* Handles how nanites leave the host's body if they find out that they're currently exceeding the maximum supported amount
|
||||
*
|
||||
* IC explanation:
|
||||
* Normally nanites simply discard excess volume by slowing replication or 'sweating' it out in imperceptible amounts,
|
||||
* but if there is a large excess volume, likely due to a programming change that leaves them unable to support their current volume,
|
||||
* the nanites attempt to leave the host as fast as necessary to prevent nanite poisoning. This can range from minor oozing to nanites
|
||||
* rapidly bursting out from every possible pathway, causing temporary inconvenience to the host.
|
||||
*/
|
||||
* Handles how nanites leave the host's body if they find out that they're currently exceeding the maximum supported amount
|
||||
*
|
||||
* IC explanation:
|
||||
* Normally nanites simply discard excess volume by slowing replication or 'sweating' it out in imperceptible amounts,
|
||||
* but if there is a large excess volume, likely due to a programming change that leaves them unable to support their current volume,
|
||||
* the nanites attempt to leave the host as fast as necessary to prevent nanite poisoning. This can range from minor oozing to nanites
|
||||
* rapidly bursting out from every possible pathway, causing temporary inconvenience to the host.
|
||||
*/
|
||||
/datum/component/nanites/proc/reject_excess_nanites()
|
||||
var/excess = nanite_volume - max_nanites
|
||||
nanite_volume = max_nanites
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* omen.dm: For when you want someone to have a really bad day
|
||||
*
|
||||
* When you attach an omen component to someone, they start running the risk of all sorts of bad environmental injuries, like nearby vending machines randomly falling on you,
|
||||
* or hitting your head really hard when you slip and fall, or... well, for now those two are all I have. More will come.
|
||||
*
|
||||
* Omens are removed once the victim is either maimed by one of the possible injuries, or if they receive a blessing (read: bashing with a bible) from the chaplain.
|
||||
*/
|
||||
* omen.dm: For when you want someone to have a really bad day
|
||||
*
|
||||
* When you attach an omen component to someone, they start running the risk of all sorts of bad environmental injuries, like nearby vending machines randomly falling on you,
|
||||
* or hitting your head really hard when you slip and fall, or... well, for now those two are all I have. More will come.
|
||||
*
|
||||
* Omens are removed once the victim is either maimed by one of the possible injuries, or if they receive a blessing (read: bashing with a bible) from the chaplain.
|
||||
*/
|
||||
/datum/component/omen
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
UnregisterSignal(parent, list(COMSIG_LIVING_STATUS_KNOCKDOWN, COMSIG_MOVABLE_MOVED, COMSIG_ADD_MOOD_EVENT))
|
||||
|
||||
/**
|
||||
* check_accident() is called each step we take
|
||||
*
|
||||
* While we're walking around, roll to see if there's any environmental hazards (currently only vending machines) on one of the adjacent tiles we can trigger.
|
||||
* We do the prob() at the beginning to A. add some tension for /when/ it will strike, and B. (more importantly) ameliorate the fact that we're checking up to 5 turfs's contents each time
|
||||
*/
|
||||
* check_accident() is called each step we take
|
||||
*
|
||||
* While we're walking around, roll to see if there's any environmental hazards (currently only vending machines) on one of the adjacent tiles we can trigger.
|
||||
* We do the prob() at the beginning to A. add some tension for /when/ it will strike, and B. (more importantly) ameliorate the fact that we're checking up to 5 turfs's contents each time
|
||||
*/
|
||||
/datum/component/omen/proc/check_accident(atom/movable/our_guy)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
#define SHORT_CAST 2
|
||||
|
||||
/**
|
||||
* Movable atom overlay-based lighting component.
|
||||
*
|
||||
* * Component works by applying a visual object to the parent target.
|
||||
*
|
||||
* * The component tracks the parent's loc to determine the current_holder.
|
||||
* * The current_holder is either the parent or its loc, whichever is on a turf. If none, then the current_holder is null and the light is not visible.
|
||||
*
|
||||
* * Lighting works at its base by applying a dark overlay and "cutting" said darkness with light, adding (possibly colored) transparency.
|
||||
* * This component uses the visible_mask visual object to apply said light mask on the darkness.
|
||||
*
|
||||
* * The main limitation of this system is that it uses a limited number of pre-baked geometrical shapes, but for most uses it does the job.
|
||||
*
|
||||
* * Another limitation is for big lights: you only see the light if you see the object emiting it.
|
||||
* * For small objects this is good (you can't see them behind a wall), but for big ones this quickly becomes prety clumsy.
|
||||
* Movable atom overlay-based lighting component.
|
||||
*
|
||||
* * Component works by applying a visual object to the parent target.
|
||||
*
|
||||
* * The component tracks the parent's loc to determine the current_holder.
|
||||
* * The current_holder is either the parent or its loc, whichever is on a turf. If none, then the current_holder is null and the light is not visible.
|
||||
*
|
||||
* * Lighting works at its base by applying a dark overlay and "cutting" said darkness with light, adding (possibly colored) transparency.
|
||||
* * This component uses the visible_mask visual object to apply said light mask on the darkness.
|
||||
*
|
||||
* * The main limitation of this system is that it uses a limited number of pre-baked geometrical shapes, but for most uses it does the job.
|
||||
*
|
||||
* * Another limitation is for big lights: you only see the light if you see the object emiting it.
|
||||
* * For small objects this is good (you can't see them behind a wall), but for big ones this quickly becomes prety clumsy.
|
||||
*/
|
||||
/datum/component/overlay_lighting
|
||||
///How far the light reaches, float.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
|
||||
/**
|
||||
* Handles simple payment operations where the cost of the object in question doesn't change.
|
||||
*
|
||||
* What this is useful for:
|
||||
* Basic forms of vending.
|
||||
* Objects that can drain the owner's money linearly.
|
||||
* What this is not useful for:
|
||||
* Things where the seller may want to fluxuate the price of the object.
|
||||
* Improving standardizing every form of payment handing, as some custom handling is specific to that object.
|
||||
**/
|
||||
* Handles simple payment operations where the cost of the object in question doesn't change.
|
||||
*
|
||||
* What this is useful for:
|
||||
* Basic forms of vending.
|
||||
* Objects that can drain the owner's money linearly.
|
||||
* What this is not useful for:
|
||||
* Things where the seller may want to fluxuate the price of the object.
|
||||
* Improving standardizing every form of payment handing, as some custom handling is specific to that object.
|
||||
**/
|
||||
/datum/component/payment
|
||||
///Standardized of operation.
|
||||
var/cost = 10
|
||||
|
||||
@@ -92,11 +92,11 @@
|
||||
UnregisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_PELLET_CLOUD_INIT, COMSIG_GRENADE_DETONATE, COMSIG_GRENADE_ARMED, COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_UNCROSSED, COMSIG_MINE_TRIGGERED, COMSIG_ITEM_DROPPED))
|
||||
|
||||
/**
|
||||
* create_casing_pellets() is for directed pellet clouds for ammo casings that have multiple pellets (buckshot and scatter lasers for instance)
|
||||
*
|
||||
* Honestly this is mostly just a rehash of [/obj/item/ammo_casing/proc/fire_casing] for pellet counts > 1, except this lets us tamper with the pellets and hook onto them for tracking purposes.
|
||||
* The arguments really don't matter, this proc is triggered by COMSIG_PELLET_CLOUD_INIT which is only for this really, it's just a big mess of the state vars we need for doing the stuff over here.
|
||||
*/
|
||||
* create_casing_pellets() is for directed pellet clouds for ammo casings that have multiple pellets (buckshot and scatter lasers for instance)
|
||||
*
|
||||
* Honestly this is mostly just a rehash of [/obj/item/ammo_casing/proc/fire_casing] for pellet counts > 1, except this lets us tamper with the pellets and hook onto them for tracking purposes.
|
||||
* The arguments really don't matter, this proc is triggered by COMSIG_PELLET_CLOUD_INIT which is only for this really, it's just a big mess of the state vars we need for doing the stuff over here.
|
||||
*/
|
||||
/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
|
||||
@@ -130,15 +130,15 @@
|
||||
shell.newshot()
|
||||
|
||||
/**
|
||||
* create_blast_pellets() is for when we have a central point we want to shred the surroundings of with a ring of shrapnel, namely frag grenades and landmines.
|
||||
*
|
||||
* Note that grenades have extra handling for someone throwing themselves/being thrown on top of it, see [/datum/component/pellet_cloud/proc/handle_martyrs]
|
||||
* Landmines just have a small check for [/obj/effect/mine/shrapnel/var/shred_triggerer], and spawn extra shrapnel for them if so
|
||||
*
|
||||
* Arguments:
|
||||
* * O- Our parent, the thing making the shrapnel obviously (grenade or landmine)
|
||||
* * punishable_triggerer- For grenade lances or people who step on the landmines (if we shred the triggerer), we spawn extra shrapnel for them in addition to the normal spread
|
||||
*/
|
||||
* create_blast_pellets() is for when we have a central point we want to shred the surroundings of with a ring of shrapnel, namely frag grenades and landmines.
|
||||
*
|
||||
* Note that grenades have extra handling for someone throwing themselves/being thrown on top of it, see [/datum/component/pellet_cloud/proc/handle_martyrs]
|
||||
* Landmines just have a small check for [/obj/effect/mine/shrapnel/var/shred_triggerer], and spawn extra shrapnel for them if so
|
||||
*
|
||||
* Arguments:
|
||||
* * O- Our parent, the thing making the shrapnel obviously (grenade or landmine)
|
||||
* * punishable_triggerer- For grenade lances or people who step on the landmines (if we shred the triggerer), we spawn extra shrapnel for them in addition to the normal spread
|
||||
*/
|
||||
/datum/component/pellet_cloud/proc/create_blast_pellets(obj/O, mob/living/punishable_triggerer)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
|
||||
@@ -164,14 +164,14 @@
|
||||
pew(shootat_turf)
|
||||
|
||||
/**
|
||||
* handle_martyrs() is used for grenades that shoot shrapnel to check if anyone threw themselves/were thrown on top of the grenade, thus absorbing a good chunk of the shrapnel
|
||||
*
|
||||
* Between the time the grenade is armed and the actual detonation, we set var/list/bodies to the list of mobs currently on the new tile, as if the grenade landed on top of them, tracking if any of them move off the tile and removing them from the "under" list
|
||||
* Once the grenade detonates, handle_martyrs() is called and gets all the new mobs on the tile, and add the ones not in var/list/bodies to var/list/martyrs
|
||||
* We then iterate through the martyrs and reduce the shrapnel magnitude for each mob on top of it, shredding each of them with some of the shrapnel they helped absorb. This can snuff out all of the shrapnel if there's enough bodies
|
||||
*
|
||||
* Note we track anyone who's alive and client'd when they get shredded in var/list/purple_hearts, for achievement checking later
|
||||
*/
|
||||
* handle_martyrs() is used for grenades that shoot shrapnel to check if anyone threw themselves/were thrown on top of the grenade, thus absorbing a good chunk of the shrapnel
|
||||
*
|
||||
* Between the time the grenade is armed and the actual detonation, we set var/list/bodies to the list of mobs currently on the new tile, as if the grenade landed on top of them, tracking if any of them move off the tile and removing them from the "under" list
|
||||
* Once the grenade detonates, handle_martyrs() is called and gets all the new mobs on the tile, and add the ones not in var/list/bodies to var/list/martyrs
|
||||
* We then iterate through the martyrs and reduce the shrapnel magnitude for each mob on top of it, shredding each of them with some of the shrapnel they helped absorb. This can snuff out all of the shrapnel if there's enough bodies
|
||||
*
|
||||
* Note we track anyone who's alive and client'd when they get shredded in var/list/purple_hearts, for achievement checking later
|
||||
*/
|
||||
/datum/component/pellet_cloud/proc/handle_martyrs(mob/living/punishable_triggerer)
|
||||
var/magnitude_absorbed
|
||||
var/list/martyrs = list()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
*
|
||||
* Allows the parent to act similarly to the Altar of Gods with modularity. Invoke and Sect Selection is done via attacking with a bible. This means you cannot sacrifice Bibles (you shouldn't want to do this anyways although now that I mentioned it you probably will want to).
|
||||
*
|
||||
*/
|
||||
*
|
||||
* Allows the parent to act similarly to the Altar of Gods with modularity. Invoke and Sect Selection is done via attacking with a bible. This means you cannot sacrifice Bibles (you shouldn't want to do this anyways although now that I mentioned it you probably will want to).
|
||||
*
|
||||
*/
|
||||
/datum/component/religious_tool
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
/// Enables access to the global sect directly
|
||||
@@ -34,8 +34,8 @@
|
||||
UnregisterSignal(parent, list(COMSIG_PARENT_ATTACKBY, COMSIG_PARENT_EXAMINE))
|
||||
|
||||
/**
|
||||
* Sets the easy access variable to the global if it exists.
|
||||
*/
|
||||
* Sets the easy access variable to the global if it exists.
|
||||
*/
|
||||
/datum/component/religious_tool/proc/SetGlobalToLocal()
|
||||
if(easy_access_sect)
|
||||
return TRUE
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Since all of these involve attackby, we require mega proc. Handles Invocation, Sacrificing, And Selection of Sects.
|
||||
*/
|
||||
* Since all of these involve attackby, we require mega proc. Handles Invocation, Sacrificing, And Selection of Sects.
|
||||
*/
|
||||
/datum/component/religious_tool/proc/AttemptActions(datum/source, obj/item/the_item, mob/living/user)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
if(!SetGlobalToLocal())
|
||||
if(!(operation_flags & RELIGION_TOOL_SECTSELECT))
|
||||
return
|
||||
//At this point you're intentionally trying to select a sect.
|
||||
//At this point you're intentionally trying to select a sect.
|
||||
INVOKE_ASYNC(src, .proc/select_sect, user)
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
QDEL_NULL(performing_rite)
|
||||
|
||||
/**
|
||||
* Generates a list of available sects to the user. Intended to support custom-availability sects. Because these are not instanced, we cannot put the availability on said sect beyond variables.
|
||||
*/
|
||||
* Generates a list of available sects to the user. Intended to support custom-availability sects. Because these are not instanced, we cannot put the availability on said sect beyond variables.
|
||||
*/
|
||||
/datum/component/religious_tool/proc/generate_available_sects(mob/user)
|
||||
. = list()
|
||||
for(var/i in subtypesof(/datum/religion_sect))
|
||||
@@ -132,8 +132,8 @@
|
||||
. += list(initial(not_a_real_instance_rs.name) = i)
|
||||
|
||||
/**
|
||||
* Appends to examine so the user knows it can be used for religious purposes.
|
||||
*/
|
||||
* Appends to examine so the user knows it can be used for religious purposes.
|
||||
*/
|
||||
/datum/component/religious_tool/proc/on_examine(datum/source, mob/user, list/examine_list)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ It has a punishment variable that is what happens to the parent when they leave
|
||||
message = _message
|
||||
|
||||
/**
|
||||
* Called when parent leaves the zlevel this is set to (aka whichever zlevel it was on when it was added)
|
||||
* Sends a message, then does an effect depending on what the punishment was.
|
||||
*
|
||||
* Punishments:
|
||||
* * PUNISHMENT_MURDER: kills parent
|
||||
* * PUNISHMENT_GIB: gibs parent
|
||||
* * PUNISHMENT_TELEPORT: finds a safe turf if possible, or a completely random one if not.
|
||||
*/
|
||||
* Called when parent leaves the zlevel this is set to (aka whichever zlevel it was on when it was added)
|
||||
* Sends a message, then does an effect depending on what the punishment was.
|
||||
*
|
||||
* Punishments:
|
||||
* * PUNISHMENT_MURDER: kills parent
|
||||
* * PUNISHMENT_GIB: gibs parent
|
||||
* * PUNISHMENT_TELEPORT: finds a safe turf if possible, or a completely random one if not.
|
||||
*/
|
||||
/datum/component/stationstuck/proc/punish()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*A storage component to be used on card piles, for use as hands/decks/discard piles. Don't use on something that's not a card pile!
|
||||
*/
|
||||
*A storage component to be used on card piles, for use as hands/decks/discard piles. Don't use on something that's not a card pile!
|
||||
*/
|
||||
/datum/component/storage/concrete/tcg
|
||||
display_numerical_stacking = FALSE
|
||||
max_w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
. = ..()
|
||||
|
||||
/** Begins the process of inserted an item.
|
||||
*
|
||||
* Clicking on the food storage with an item will begin a do_after, which if successful inserts the item.
|
||||
*
|
||||
* Arguments
|
||||
* inserted_item - the item being placed into the food
|
||||
* user - the person inserting the item
|
||||
*/
|
||||
*
|
||||
* Clicking on the food storage with an item will begin a do_after, which if successful inserts the item.
|
||||
*
|
||||
* Arguments
|
||||
* inserted_item - the item being placed into the food
|
||||
* user - the person inserting the item
|
||||
*/
|
||||
/datum/component/food_storage/proc/try_inserting_item(datum/source, obj/item/inserted_item, mob/user, params)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -74,12 +74,12 @@
|
||||
return COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/** Begins the process of attempting to remove the stored item.
|
||||
*
|
||||
* Clicking on food storage on grab intent will begin a do_after, which if successful removes the stored_item.
|
||||
*
|
||||
* Arguments
|
||||
* user - the person removing the item.
|
||||
*/
|
||||
*
|
||||
* Clicking on food storage on grab intent will begin a do_after, which if successful removes the stored_item.
|
||||
*
|
||||
* Arguments
|
||||
* user - the person removing the item.
|
||||
*/
|
||||
/datum/component/food_storage/proc/try_removing_item(datum/source, mob/user)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -96,11 +96,11 @@
|
||||
return COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/** Inserts the item into the food, after a do_after.
|
||||
*
|
||||
* Arguments
|
||||
* inserted_item - The item being inserted.
|
||||
* user - the person inserting the item.
|
||||
*/
|
||||
*
|
||||
* Arguments
|
||||
* inserted_item - The item being inserted.
|
||||
* user - the person inserting the item.
|
||||
*/
|
||||
/datum/component/food_storage/proc/insert_item(obj/item/inserted_item, mob/user)
|
||||
if(do_after(user, 1.5 SECONDS, target = parent))
|
||||
var/atom/food = parent
|
||||
@@ -113,17 +113,17 @@
|
||||
stored_item = inserted_item
|
||||
|
||||
/** Removes the item from the food, after a do_after.
|
||||
*
|
||||
* Arguments
|
||||
* user - person removing the item.
|
||||
*/
|
||||
*
|
||||
* Arguments
|
||||
* user - person removing the item.
|
||||
*/
|
||||
/datum/component/food_storage/proc/begin_remove_item(mob/user)
|
||||
if(do_after(user, 10 SECONDS, target = parent))
|
||||
remove_item(user)
|
||||
|
||||
/**
|
||||
* Removes the stored item, putting it in user's hands or on the ground, then updates the reference.
|
||||
*/
|
||||
* Removes the stored item, putting it in user's hands or on the ground, then updates the reference.
|
||||
*/
|
||||
/datum/component/food_storage/proc/remove_item(mob/user)
|
||||
if(user.put_in_hands(stored_item))
|
||||
user.visible_message("<span class='warning'>[user.name] slowly pulls [stored_item.name] out of \the [parent].</span>", \
|
||||
@@ -135,18 +135,18 @@
|
||||
update_stored_item()
|
||||
|
||||
/** Checks for stored items when the food is eaten.
|
||||
*
|
||||
* If the food is eaten while an item is stored in it, calculates the odds that the item will be found.
|
||||
* Then, if the item is found before being bitten, the item is removed.
|
||||
* If the item is found by biting into it, calls on_accidental_consumption on the stored item.
|
||||
* Afterwards, removes the item from the food if it was discovered.
|
||||
*
|
||||
* Arguments
|
||||
* target - person doing the eating (can be the same as user)
|
||||
* user - person causing the eating to happen
|
||||
* bitecount - how many times the current food has been bitten
|
||||
* bitesize - how large bties are for this food
|
||||
*/
|
||||
*
|
||||
* If the food is eaten while an item is stored in it, calculates the odds that the item will be found.
|
||||
* Then, if the item is found before being bitten, the item is removed.
|
||||
* If the item is found by biting into it, calls on_accidental_consumption on the stored item.
|
||||
* Afterwards, removes the item from the food if it was discovered.
|
||||
*
|
||||
* Arguments
|
||||
* target - person doing the eating (can be the same as user)
|
||||
* user - person causing the eating to happen
|
||||
* bitecount - how many times the current food has been bitten
|
||||
* bitesize - how large bties are for this food
|
||||
*/
|
||||
/datum/component/food_storage/proc/consume_food_storage(datum/source, mob/living/target, mob/living/user, bitecount, bitesize)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -172,13 +172,13 @@
|
||||
INVOKE_ASYNC(src, .proc/remove_item, user)
|
||||
|
||||
/** Updates the reference of the stored item.
|
||||
*
|
||||
* Checks the food's contents for if an alternate item was placed into the food.
|
||||
* If there is an alternate item, updates the reference to the new item.
|
||||
* If there isn't, updates the reference to null.
|
||||
*
|
||||
* Returns FALSE if the ref is nulled, or TRUE is another item replaced it.
|
||||
*/
|
||||
*
|
||||
* Checks the food's contents for if an alternate item was placed into the food.
|
||||
* If there is an alternate item, updates the reference to the new item.
|
||||
* If there isn't, updates the reference to null.
|
||||
*
|
||||
* Returns FALSE if the ref is nulled, or TRUE is another item replaced it.
|
||||
*/
|
||||
/datum/component/food_storage/proc/update_stored_item()
|
||||
var/atom/food = parent
|
||||
if(!food?.contents.len) //if there's no items in the food or food is deleted somehow
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
*
|
||||
* Allows parent (obj) to initiate surgeries.
|
||||
*
|
||||
*/
|
||||
*
|
||||
* Allows parent (obj) to initiate surgeries.
|
||||
*
|
||||
*/
|
||||
/datum/component/surgery_initiator
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
///allows for post-selection manipulation of parent
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#define MAX_TABLE_MESSES 12
|
||||
|
||||
/**
|
||||
* For when you want to throw a person at something and have fun stuff happen
|
||||
*
|
||||
* This component is made for carbon mobs (really, humans), and allows its parent to throw themselves and perform tackles. This is done by enabling throw mode, then clicking on your
|
||||
* intended target with an empty hand. You will then launch toward your target. If you hit a carbon, you'll roll to see how hard you hit them. If you hit a solid non-mob, you'll
|
||||
* roll to see how badly you just messed yourself up. If, along your journey, you hit a table, you'll slam onto it and send up to MAX_TABLE_MESSES (8) /obj/items on the table flying,
|
||||
* and take a bit of extra damage and stun for each thing launched.
|
||||
*
|
||||
* There are 2 separate """skill rolls""" involved here, which are handled and explained in [rollTackle()][/datum/component/tackler/proc/rollTackle] (for roll 1, carbons), and [splat()][/datum/component/tackler/proc/splat] (for roll 2, walls and solid objects)
|
||||
* For when you want to throw a person at something and have fun stuff happen
|
||||
*
|
||||
* This component is made for carbon mobs (really, humans), and allows its parent to throw themselves and perform tackles. This is done by enabling throw mode, then clicking on your
|
||||
* intended target with an empty hand. You will then launch toward your target. If you hit a carbon, you'll roll to see how hard you hit them. If you hit a solid non-mob, you'll
|
||||
* roll to see how badly you just messed yourself up. If, along your journey, you hit a table, you'll slam onto it and send up to MAX_TABLE_MESSES (8) /obj/items on the table flying,
|
||||
* and take a bit of extra damage and stun for each thing launched.
|
||||
*
|
||||
* There are 2 separate """skill rolls""" involved here, which are handled and explained in [rollTackle()][/datum/component/tackler/proc/rollTackle] (for roll 1, carbons), and [splat()][/datum/component/tackler/proc/splat] (for roll 2, walls and solid objects)
|
||||
*/
|
||||
/datum/component/tackler
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
@@ -231,14 +231,14 @@
|
||||
return COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH
|
||||
|
||||
/**
|
||||
* This handles all of the modifiers for the actual carbon-on-carbon tackling, and gets its own proc because of how many there are (with plenty more in mind!)
|
||||
*
|
||||
* The base roll is between (-3, 3), with negative numbers favoring the target, and positive numbers favoring the tackler. The target and the tackler are both assessed for
|
||||
* how easy they are to knock over, with clumsiness and dwarfiness being strong maluses for each, and gigantism giving a bonus for each. These numbers and ideas
|
||||
* are absolutely subject to change.
|
||||
* This handles all of the modifiers for the actual carbon-on-carbon tackling, and gets its own proc because of how many there are (with plenty more in mind!)
|
||||
*
|
||||
* The base roll is between (-3, 3), with negative numbers favoring the target, and positive numbers favoring the tackler. The target and the tackler are both assessed for
|
||||
* how easy they are to knock over, with clumsiness and dwarfiness being strong maluses for each, and gigantism giving a bonus for each. These numbers and ideas
|
||||
* are absolutely subject to change.
|
||||
|
||||
* In addition, after subtracting the defender's mod and adding the attacker's mod to the roll, the component's base (skill) mod is added as well. Some sources of tackles
|
||||
* are better at taking people down, like the bruiser and rocket gloves, while the dolphin gloves have a malus in exchange for better mobility.
|
||||
* In addition, after subtracting the defender's mod and adding the attacker's mod to the roll, the component's base (skill) mod is added as well. Some sources of tackles
|
||||
* are better at taking people down, like the bruiser and rocket gloves, while the dolphin gloves have a malus in exchange for better mobility.
|
||||
*/
|
||||
/datum/component/tackler/proc/rollTackle(mob/living/carbon/target)
|
||||
var/defense_mod = 0
|
||||
@@ -315,28 +315,28 @@
|
||||
|
||||
|
||||
/**
|
||||
* This is where we handle diving into dense atoms, generally with effects ranging from bad to REALLY bad. This works as a percentile roll that is modified in two steps as detailed below. The higher
|
||||
* the roll, the more severe the result.
|
||||
*
|
||||
* Mod 1: Speed-
|
||||
* * Base tackle speed is 1, which is what normal gripper gloves use. For other sources with higher speed tackles, like dolphin and ESPECIALLY rocket gloves, we obey Newton's laws and hit things harder.
|
||||
* * For every unit of speed above 1, move the lower bound of the roll up by 15. Unlike Mod 2, this only serves to raise the lower bound, so it can't be directly counteracted by anything you can control.
|
||||
*
|
||||
* Mod 2: Misc-
|
||||
* -Flat modifiers, these take whatever you rolled and add/subtract to it, with the end result capped between the minimum from Mod 1 and 100. Note that since we can't roll higher than 100 to start with,
|
||||
* wearing a helmet should be enough to remove any chance of permanently paralyzing yourself and dramatically lessen knocking yourself unconscious, even with rocket gloves. Will expand on maybe
|
||||
* * Wearing a helmet: -6
|
||||
* * Wearing riot armor: -6
|
||||
* * Clumsy: +6
|
||||
*
|
||||
* Effects: Below are the outcomes based off your roll, in order of increasing severity
|
||||
*
|
||||
* * 1-67: Knocked down for a few seconds and a bit of brute and stamina damage
|
||||
* * 68-85: Knocked silly, gain some confusion as well as the above
|
||||
* * 86-92: Cranial trauma, get a concussion and more confusion, plus more damage
|
||||
* * 93-96: Knocked unconscious, get a random mild brain trauma, as well as a fair amount of damage
|
||||
* * 97-98: Massive head damage, probably crack your skull open, random mild brain trauma
|
||||
* * 99-Infinity: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
|
||||
* This is where we handle diving into dense atoms, generally with effects ranging from bad to REALLY bad. This works as a percentile roll that is modified in two steps as detailed below. The higher
|
||||
* the roll, the more severe the result.
|
||||
*
|
||||
* Mod 1: Speed-
|
||||
* * Base tackle speed is 1, which is what normal gripper gloves use. For other sources with higher speed tackles, like dolphin and ESPECIALLY rocket gloves, we obey Newton's laws and hit things harder.
|
||||
* * For every unit of speed above 1, move the lower bound of the roll up by 15. Unlike Mod 2, this only serves to raise the lower bound, so it can't be directly counteracted by anything you can control.
|
||||
*
|
||||
* Mod 2: Misc-
|
||||
* -Flat modifiers, these take whatever you rolled and add/subtract to it, with the end result capped between the minimum from Mod 1 and 100. Note that since we can't roll higher than 100 to start with,
|
||||
* wearing a helmet should be enough to remove any chance of permanently paralyzing yourself and dramatically lessen knocking yourself unconscious, even with rocket gloves. Will expand on maybe
|
||||
* * Wearing a helmet: -6
|
||||
* * Wearing riot armor: -6
|
||||
* * Clumsy: +6
|
||||
*
|
||||
* Effects: Below are the outcomes based off your roll, in order of increasing severity
|
||||
*
|
||||
* * 1-67: Knocked down for a few seconds and a bit of brute and stamina damage
|
||||
* * 68-85: Knocked silly, gain some confusion as well as the above
|
||||
* * 86-92: Cranial trauma, get a concussion and more confusion, plus more damage
|
||||
* * 93-96: Knocked unconscious, get a random mild brain trauma, as well as a fair amount of damage
|
||||
* * 97-98: Massive head damage, probably crack your skull open, random mild brain trauma
|
||||
* * 99-Infinity: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
|
||||
*/
|
||||
/datum/component/tackler/proc/splat(mob/living/carbon/user, atom/hit)
|
||||
if(istype(hit, /obj/machinery/vending)) // before we do anything else-
|
||||
|
||||
+22
-22
@@ -76,13 +76,13 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Adds crime to security record.
|
||||
*
|
||||
* Is used to add single crime to someone's security record.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * datum/data/crime/crime - premade array containing every variable, usually created by createCrimeEntry.
|
||||
*/
|
||||
* Adds crime to security record.
|
||||
*
|
||||
* Is used to add single crime to someone's security record.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * datum/data/crime/crime - premade array containing every variable, usually created by createCrimeEntry.
|
||||
*/
|
||||
/datum/datacore/proc/addCrime(id = "", datum/data/crime/crime)
|
||||
for(var/datum/data/record/R in security)
|
||||
if(R.fields["id"] == id)
|
||||
@@ -91,13 +91,13 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Deletes crime from security record.
|
||||
*
|
||||
* Is used to delete single crime to someone's security record.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * cDataId - id of already existing crime.
|
||||
*/
|
||||
* Deletes crime from security record.
|
||||
*
|
||||
* Is used to delete single crime to someone's security record.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * cDataId - id of already existing crime.
|
||||
*/
|
||||
/datum/datacore/proc/removeCrime(id, cDataId)
|
||||
for(var/datum/data/record/R in security)
|
||||
if(R.fields["id"] == id)
|
||||
@@ -108,14 +108,14 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Adds details to a crime.
|
||||
*
|
||||
* Is used to add or replace details to already existing crime.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * cDataId - id of already existing crime.
|
||||
* * details - data you want to add.
|
||||
*/
|
||||
* Adds details to a crime.
|
||||
*
|
||||
* Is used to add or replace details to already existing crime.
|
||||
* Arguments:
|
||||
* * id - record id.
|
||||
* * cDataId - id of already existing crime.
|
||||
* * details - data you want to add.
|
||||
*/
|
||||
/datum/datacore/proc/addCrimeDetails(id, cDataId, details)
|
||||
for(var/datum/data/record/R in security)
|
||||
if(R.fields["id"] == id)
|
||||
|
||||
+44
-44
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* The absolute base class for everything
|
||||
*
|
||||
* A datum instantiated has no physical world prescence, use an atom if you want something
|
||||
* that actually lives in the world
|
||||
*
|
||||
* Be very mindful about adding variables to this class, they are inherited by every single
|
||||
* thing in the entire game, and so you can easily cause memory usage to rise a lot with careless
|
||||
* use of variables at this level
|
||||
*/
|
||||
* The absolute base class for everything
|
||||
*
|
||||
* A datum instantiated has no physical world prescence, use an atom if you want something
|
||||
* that actually lives in the world
|
||||
*
|
||||
* Be very mindful about adding variables to this class, they are inherited by every single
|
||||
* thing in the entire game, and so you can easily cause memory usage to rise a lot with careless
|
||||
* use of variables at this level
|
||||
*/
|
||||
/datum
|
||||
/**
|
||||
* Tick count time when this object was destroyed.
|
||||
@@ -67,30 +67,30 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Called when a href for this datum is clicked
|
||||
*
|
||||
* Sends a [COMSIG_TOPIC] signal
|
||||
*/
|
||||
* Called when a href for this datum is clicked
|
||||
*
|
||||
* Sends a [COMSIG_TOPIC] signal
|
||||
*/
|
||||
/datum/Topic(href, href_list[])
|
||||
..()
|
||||
SEND_SIGNAL(src, COMSIG_TOPIC, usr, href_list)
|
||||
|
||||
/**
|
||||
* Default implementation of clean-up code.
|
||||
*
|
||||
* This should be overridden to remove all references pointing to the object being destroyed, if
|
||||
* you do override it, make sure to call the parent and return it's return value by default
|
||||
*
|
||||
* Return an appropriate [QDEL_HINT][QDEL_HINT_QUEUE] to modify handling of your deletion;
|
||||
* in most cases this is [QDEL_HINT_QUEUE].
|
||||
*
|
||||
* The base case is responsible for doing the following
|
||||
* * Erasing timers pointing to this datum
|
||||
* * Erasing compenents on this datum
|
||||
* * Notifying datums listening to signals from this datum that we are going away
|
||||
*
|
||||
* Returns [QDEL_HINT_QUEUE]
|
||||
*/
|
||||
* Default implementation of clean-up code.
|
||||
*
|
||||
* This should be overridden to remove all references pointing to the object being destroyed, if
|
||||
* you do override it, make sure to call the parent and return it's return value by default
|
||||
*
|
||||
* Return an appropriate [QDEL_HINT][QDEL_HINT_QUEUE] to modify handling of your deletion;
|
||||
* in most cases this is [QDEL_HINT_QUEUE].
|
||||
*
|
||||
* The base case is responsible for doing the following
|
||||
* * Erasing timers pointing to this datum
|
||||
* * Erasing compenents on this datum
|
||||
* * Notifying datums listening to signals from this datum that we are going away
|
||||
*
|
||||
* Returns [QDEL_HINT_QUEUE]
|
||||
*/
|
||||
/datum/proc/Destroy(force=FALSE, ...)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
tag = null
|
||||
@@ -231,14 +231,14 @@
|
||||
return returned
|
||||
|
||||
/**
|
||||
* Callback called by a timer to end an associative-list-indexed cooldown.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end.
|
||||
*/
|
||||
* Callback called by a timer to end an associative-list-indexed cooldown.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end.
|
||||
*/
|
||||
/proc/end_cooldown(datum/source, index)
|
||||
if(QDELETED(source))
|
||||
return
|
||||
@@ -247,14 +247,14 @@
|
||||
|
||||
|
||||
/**
|
||||
* Proc used by stoppable timers to end a cooldown before the time has ran out.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end, passing the time left as an argument.
|
||||
*/
|
||||
* Proc used by stoppable timers to end a cooldown before the time has ran out.
|
||||
*
|
||||
* Arguments:
|
||||
* * source - datum storing the cooldown
|
||||
* * index - string index storing the cooldown on the cooldowns associative list
|
||||
*
|
||||
* This sends a signal reporting the cooldown end, passing the time left as an argument.
|
||||
*/
|
||||
/proc/reset_cooldown(datum/source, index)
|
||||
if(QDELETED(source))
|
||||
return
|
||||
|
||||
@@ -421,7 +421,7 @@
|
||||
var/datum/disease/advance/D2 = pick(diseases)
|
||||
D2.Mix(D1)
|
||||
|
||||
// Should be only 1 entry left, but if not let's only return a single entry
|
||||
// Should be only 1 entry left, but if not let's only return a single entry
|
||||
var/datum/disease/advance/to_return = pick(diseases)
|
||||
to_return.Refresh(TRUE)
|
||||
return to_return
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
var/triple_metabolism = FALSE
|
||||
var/reduced_hunger = FALSE
|
||||
desc = "The virus causes the host's metabolism to accelerate rapidly, making them process chemicals twice as fast,\
|
||||
but also causing increased hunger."
|
||||
but also causing increased hunger."
|
||||
threshold_descs = list(
|
||||
"Stealth 3" = "Reduces hunger rate.",
|
||||
"Stage Speed 10" = "Chemical metabolization is tripled instead of doubled.",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* A holder for simple behaviour that can be attached to many different types
|
||||
*
|
||||
* Only one element of each type is instanced during game init.
|
||||
* Otherwise acts basically like a lightweight component.
|
||||
*/
|
||||
* A holder for simple behaviour that can be attached to many different types
|
||||
*
|
||||
* Only one element of each type is instanced during game init.
|
||||
* Otherwise acts basically like a lightweight component.
|
||||
*/
|
||||
/datum/element
|
||||
/// Option flags for element behaviour
|
||||
var/element_flags = NONE
|
||||
@@ -49,9 +49,9 @@
|
||||
CRASH("Incompatible [arguments[1]] assigned to a [type]! args: [json_encode(args)]")
|
||||
|
||||
/**
|
||||
* Finds the singleton for the element type given and detaches it from src
|
||||
* You only need additional arguments beyond the type if you're using [ELEMENT_BESPOKE]
|
||||
*/
|
||||
* Finds the singleton for the element type given and detaches it from src
|
||||
* You only need additional arguments beyond the type if you're using [ELEMENT_BESPOKE]
|
||||
*/
|
||||
/datum/proc/_RemoveElement(list/arguments)
|
||||
var/datum/element/ele = SSdcs.GetElement(arguments)
|
||||
ele.Detach(src)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
msg = "Wow, [source.p_they()] sucks."
|
||||
|
||||
user.visible_message("<span class='notice'>[user] stops and looks intently at [source].</span>", \
|
||||
"<span class='notice'>You appraise [source]... [msg]</span>")
|
||||
"<span class='notice'>You appraise [source]... [msg]</span>")
|
||||
|
||||
/datum/element/art/proc/on_examine(atom/source, mob/user, list/examine_texts)
|
||||
SIGNAL_HANDLER
|
||||
@@ -63,4 +63,4 @@
|
||||
msg = "Wow, [source.p_they()] sucks."
|
||||
|
||||
user.visible_message("<span class='notice'>[user] stops to inspect [source].</span>", \
|
||||
"<span class='notice'>You appraise [source], inspecting the fine craftsmanship of the proletariat... [msg]</span>")
|
||||
"<span class='notice'>You appraise [source], inspecting the fine craftsmanship of the proletariat... [msg]</span>")
|
||||
|
||||
@@ -131,11 +131,11 @@
|
||||
examine_list += "[I] has a fine point, and could probably embed in someone if thrown properly!"
|
||||
|
||||
/**
|
||||
* checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.
|
||||
*
|
||||
* If we hit a valid target, we create the shrapnel_type object and immediately call tryEmbed() on it, targeting what we impacted. That will lead
|
||||
* it to call tryForceEmbed() on its own embed element (it's out of our hands here, our projectile is done), where it will run through all the checks it needs to.
|
||||
*/
|
||||
* checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.
|
||||
*
|
||||
* If we hit a valid target, we create the shrapnel_type object and immediately call tryEmbed() on it, targeting what we impacted. That will lead
|
||||
* it to call tryForceEmbed() on its own embed element (it's out of our hands here, our projectile is done), where it will run through all the checks it needs to.
|
||||
*/
|
||||
/datum/element/embed/proc/checkEmbedProjectile(obj/projectile/P, atom/movable/firer, atom/hit, angle, hit_zone)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -157,17 +157,17 @@
|
||||
Detach(P)
|
||||
|
||||
/**
|
||||
* tryForceEmbed() is called here when we fire COMSIG_EMBED_TRY_FORCE from [/obj/item/proc/tryEmbed]. Mostly, this means we're a piece of shrapnel from a projectile that just impacted something, and we're trying to embed in it.
|
||||
*
|
||||
* The reason for this extra mucking about is avoiding having to do an extra hitby(), and annoying the target by impacting them once with the projectile, then again with the shrapnel, and possibly
|
||||
* AGAIN if we actually embed. This way, we save on at least one message.
|
||||
*
|
||||
* Arguments:
|
||||
* * I- the item we're trying to insert into the target
|
||||
* * target- what we're trying to shish-kabob, either a bodypart or a carbon
|
||||
* * hit_zone- if our target is a carbon, try to hit them in this zone, if we don't have one, pick a random one. If our target is a bodypart, we already know where we're hitting.
|
||||
* * forced- if we want this to succeed 100%
|
||||
*/
|
||||
* tryForceEmbed() is called here when we fire COMSIG_EMBED_TRY_FORCE from [/obj/item/proc/tryEmbed]. Mostly, this means we're a piece of shrapnel from a projectile that just impacted something, and we're trying to embed in it.
|
||||
*
|
||||
* The reason for this extra mucking about is avoiding having to do an extra hitby(), and annoying the target by impacting them once with the projectile, then again with the shrapnel, and possibly
|
||||
* AGAIN if we actually embed. This way, we save on at least one message.
|
||||
*
|
||||
* Arguments:
|
||||
* * I- the item we're trying to insert into the target
|
||||
* * target- what we're trying to shish-kabob, either a bodypart or a carbon
|
||||
* * hit_zone- if our target is a carbon, try to hit them in this zone, if we don't have one, pick a random one. If our target is a bodypart, we already know where we're hitting.
|
||||
* * forced- if we want this to succeed 100%
|
||||
*/
|
||||
/datum/element/embed/proc/tryForceEmbed(obj/item/I, atom/target, hit_zone, forced=FALSE)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Can be applied to /atom/movable subtypes to make them apply fire stacks to things they hit
|
||||
*/
|
||||
* Can be applied to /atom/movable subtypes to make them apply fire stacks to things they hit
|
||||
*/
|
||||
/datum/element/firestacker
|
||||
element_flags = ELEMENT_BESPOKE
|
||||
id_arg_index = 2
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
/datum/element/firestacker/Attach(datum/target, amount)
|
||||
. = ..()
|
||||
|
||||
|
||||
if(!ismovable(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
|
||||
src.amount = amount
|
||||
|
||||
|
||||
RegisterSignal(target, COMSIG_MOVABLE_IMPACT, .proc/impact, override = TRUE)
|
||||
if(isitem(target))
|
||||
RegisterSignal(target, COMSIG_ITEM_ATTACK, .proc/item_attack, override = TRUE)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Attached to movable atoms with opacity. Listens to them move and updates their old and new turf loc's opacity accordingly.
|
||||
*/
|
||||
* Attached to movable atoms with opacity. Listens to them move and updates their old and new turf loc's opacity accordingly.
|
||||
*/
|
||||
/datum/element/light_blocking
|
||||
element_flags = ELEMENT_DETACH
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Object integrity regeneration element added by alien alloy.
|
||||
*/
|
||||
*/
|
||||
/datum/element/obj_regen
|
||||
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH
|
||||
id_arg_index = 2
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#define TALL 7/5
|
||||
|
||||
/**
|
||||
# squish.dm
|
||||
*
|
||||
* It's an element that squishes things. After the duration passes, it reverses the transformation it squished with, taking into account if they are a different orientation than they started (read: rotationally-fluid)
|
||||
*
|
||||
* Normal squishes apply vertically, as if the target is being squished from above, but you can set reverse to TRUE if you want to squish them from the sides, like if they pancake into a wall from the East or West
|
||||
* squish.dm
|
||||
*
|
||||
* It's an element that squishes things. After the duration passes, it reverses the transformation it squished with, taking into account if they are a different orientation than they started (read: rotationally-fluid)
|
||||
*
|
||||
* Normal squishes apply vertically, as if the target is being squished from above, but you can set reverse to TRUE if you want to squish them from the sides, like if they pancake into a wall from the East or West
|
||||
*/
|
||||
/datum/element/squish
|
||||
element_flags = ELEMENT_DETACH
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* Tool flash bespoke element
|
||||
*
|
||||
* Flashes the user when using this tool
|
||||
*/
|
||||
* Tool flash bespoke element
|
||||
*
|
||||
* Flashes the user when using this tool
|
||||
*/
|
||||
/datum/element/tool_flash
|
||||
element_flags = ELEMENT_BESPOKE
|
||||
id_arg_index = 2
|
||||
|
||||
+39
-39
@@ -425,42 +425,42 @@
|
||||
"}
|
||||
|
||||
/obj/item/disk/holodisk/ruin/snowengieruin
|
||||
name = "Blackbox Print-out #EB412"
|
||||
desc = "A holodisk containing the last moments of EB412. There's a bloody fingerprint on it."
|
||||
preset_image_type = /datum/preset_holoimage/engineer
|
||||
preset_record_text = {"
|
||||
NAME Dave Tundrale
|
||||
SAY Maria, how's Build?
|
||||
DELAY 10
|
||||
NAME Maria Dell
|
||||
PRESET /datum/preset_holoimage/engineer/atmos
|
||||
SAY It's fine, don't worry. I've got Plastic on it. And frankly, i'm kinda busy with, the, uhhm, incinerator.
|
||||
DELAY 30
|
||||
NAME Dave Tundrale
|
||||
PRESET /datum/preset_holoimage/engineer
|
||||
SAY Aight, wonderful. The science mans been kinda shit though. No RCDs-
|
||||
DELAY 20
|
||||
NAME Maria Dell
|
||||
PRESET /datum/preset_holoimage/engineer/atmos
|
||||
SAY Enough about your RCDs. They're not even that important, just bui-
|
||||
DELAY 15
|
||||
SOUND explosion
|
||||
DELAY 10
|
||||
SAY Oh, shit!
|
||||
DELAY 10
|
||||
PRESET /datum/preset_holoimage/engineer/atmos/rig
|
||||
LANGUAGE /datum/language/narsie
|
||||
NAME Unknown
|
||||
SAY RISE, MY LORD!!
|
||||
DELAY 10
|
||||
LANGUAGE /datum/language/common
|
||||
NAME Plastic
|
||||
PRESET /datum/preset_holoimage/engineer/rig
|
||||
SAY Fuck, fuck, fuck!
|
||||
DELAY 20
|
||||
SAY It's loose! CALL THE FUCKING SHUTT-
|
||||
DELAY 10
|
||||
PRESET /datum/preset_holoimage/corgi
|
||||
NAME Blackbox Automated Message
|
||||
SAY Connection lost. Dumping audio logs to disk.
|
||||
DELAY 50"}
|
||||
name = "Blackbox Print-out #EB412"
|
||||
desc = "A holodisk containing the last moments of EB412. There's a bloody fingerprint on it."
|
||||
preset_image_type = /datum/preset_holoimage/engineer
|
||||
preset_record_text = {"
|
||||
NAME Dave Tundrale
|
||||
SAY Maria, how's Build?
|
||||
DELAY 10
|
||||
NAME Maria Dell
|
||||
PRESET /datum/preset_holoimage/engineer/atmos
|
||||
SAY It's fine, don't worry. I've got Plastic on it. And frankly, i'm kinda busy with, the, uhhm, incinerator.
|
||||
DELAY 30
|
||||
NAME Dave Tundrale
|
||||
PRESET /datum/preset_holoimage/engineer
|
||||
SAY Aight, wonderful. The science mans been kinda shit though. No RCDs-
|
||||
DELAY 20
|
||||
NAME Maria Dell
|
||||
PRESET /datum/preset_holoimage/engineer/atmos
|
||||
SAY Enough about your RCDs. They're not even that important, just bui-
|
||||
DELAY 15
|
||||
SOUND explosion
|
||||
DELAY 10
|
||||
SAY Oh, shit!
|
||||
DELAY 10
|
||||
PRESET /datum/preset_holoimage/engineer/atmos/rig
|
||||
LANGUAGE /datum/language/narsie
|
||||
NAME Unknown
|
||||
SAY RISE, MY LORD!!
|
||||
DELAY 10
|
||||
LANGUAGE /datum/language/common
|
||||
NAME Plastic
|
||||
PRESET /datum/preset_holoimage/engineer/rig
|
||||
SAY Fuck, fuck, fuck!
|
||||
DELAY 20
|
||||
SAY It's loose! CALL THE FUCKING SHUTT-
|
||||
DELAY 10
|
||||
PRESET /datum/preset_holoimage/corgi
|
||||
NAME Blackbox Automated Message
|
||||
SAY Connection lost. Dumping audio logs to disk.
|
||||
DELAY 50"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/datum/keybinding/movement
|
||||
category = CATEGORY_MOVEMENT
|
||||
weight = WEIGHT_HIGHEST
|
||||
category = CATEGORY_MOVEMENT
|
||||
weight = WEIGHT_HIGHEST
|
||||
|
||||
/datum/keybinding/movement/north
|
||||
hotkey_keys = list("W", "North")
|
||||
|
||||
@@ -154,21 +154,21 @@ Simple datum which is instanced once per type and is used for every object of sa
|
||||
RemoveElement(/datum/element/turf_z_transparency, FALSE)
|
||||
|
||||
/**
|
||||
* This proc is called when the mat is found in an item that's consumed by accident. see /obj/item/proc/on_accidental_consumption.
|
||||
* Arguments
|
||||
* * M - person consuming the mat
|
||||
* * S - (optional) item the mat is contained in (NOT the item with the mat itself)
|
||||
*/
|
||||
* This proc is called when the mat is found in an item that's consumed by accident. see /obj/item/proc/on_accidental_consumption.
|
||||
* Arguments
|
||||
* * M - person consuming the mat
|
||||
* * S - (optional) item the mat is contained in (NOT the item with the mat itself)
|
||||
*/
|
||||
/datum/material/proc/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S)
|
||||
return FALSE
|
||||
|
||||
/** Returns the composition of this material.
|
||||
*
|
||||
* Mostly used for alloys when breaking down materials.
|
||||
*
|
||||
* Arguments:
|
||||
* - amount: The amount of the material to break down.
|
||||
* - breakdown_flags: Some flags dictating how exactly this material is being broken down.
|
||||
*/
|
||||
*
|
||||
* Mostly used for alloys when breaking down materials.
|
||||
*
|
||||
* Arguments:
|
||||
* - amount: The amount of the material to break down.
|
||||
* - breakdown_flags: Some flags dictating how exactly this material is being broken down.
|
||||
*/
|
||||
/datum/material/proc/return_composition(amount=1, breakdown_flags=NONE)
|
||||
return list((src) = amount) // Yes we need the parenthesis, without them BYOND stringifies src into "src" and things break.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Materials made from other materials.
|
||||
*/
|
||||
*/
|
||||
/datum/material/alloy
|
||||
name = "alloy"
|
||||
desc = "A material composed of two or more other materials."
|
||||
@@ -23,10 +23,10 @@
|
||||
|
||||
|
||||
/** Plasteel
|
||||
*
|
||||
* An alloy of iron and plasma.
|
||||
* Applies a significant slowdown effect to any and all items that contain it.
|
||||
*/
|
||||
*
|
||||
* An alloy of iron and plasma.
|
||||
* Applies a significant slowdown effect to any and all items that contain it.
|
||||
*/
|
||||
/datum/material/alloy/plasteel
|
||||
name = "plasteel"
|
||||
desc = "The heavy duty result of infusing iron with plasma."
|
||||
@@ -56,9 +56,9 @@
|
||||
target_item.slowdown -= MATERIAL_SLOWDOWN_PLASTEEL * amount / MINERAL_MATERIAL_AMOUNT
|
||||
|
||||
/** Plastitanium
|
||||
*
|
||||
* An alloy of titanium and plasma.
|
||||
*/
|
||||
*
|
||||
* An alloy of titanium and plasma.
|
||||
*/
|
||||
/datum/material/alloy/plastitanium
|
||||
name = "plastitanium"
|
||||
desc = "The extremely heat resistant result of infusing titanium with plasma."
|
||||
@@ -73,9 +73,9 @@
|
||||
composition = list(/datum/material/titanium=1, /datum/material/plasma=1)
|
||||
|
||||
/** Plasmaglass
|
||||
*
|
||||
* An alloy of silicate and plasma.
|
||||
*/
|
||||
*
|
||||
* An alloy of silicate and plasma.
|
||||
*/
|
||||
/datum/material/alloy/plasmaglass
|
||||
name = "plasmaglass"
|
||||
desc = "Plasma-infused silicate. It is much more durable and heat resistant than either of its component materials."
|
||||
@@ -91,9 +91,9 @@
|
||||
composition = list(/datum/material/glass=1, /datum/material/plasma=0.5)
|
||||
|
||||
/** Titaniumglass
|
||||
*
|
||||
* An alloy of glass and titanium.
|
||||
*/
|
||||
*
|
||||
* An alloy of glass and titanium.
|
||||
*/
|
||||
/datum/material/alloy/titaniumglass
|
||||
name = "titanium glass"
|
||||
desc = "A specialized silicate-titanium alloy that is commonly used in shuttle windows."
|
||||
@@ -108,9 +108,9 @@
|
||||
composition = list(/datum/material/glass=1, /datum/material/titanium=0.5)
|
||||
|
||||
/** Plastitanium Glass
|
||||
*
|
||||
* An alloy of plastitanium and glass.
|
||||
*/
|
||||
*
|
||||
* An alloy of plastitanium and glass.
|
||||
*/
|
||||
/datum/material/alloy/plastitaniumglass
|
||||
name = "plastitanium glass"
|
||||
desc = "A specialized silicate-plastitanium alloy."
|
||||
@@ -126,11 +126,11 @@
|
||||
composition = list(/datum/material/glass=1, /datum/material/alloy/plastitanium=0.5)
|
||||
|
||||
/** Alien Alloy
|
||||
*
|
||||
* Densified plasteel.
|
||||
* Applies a significant slowdown effect to anything that contains it.
|
||||
* Anything constructed from it can slowly regenerate.
|
||||
*/
|
||||
*
|
||||
* Densified plasteel.
|
||||
* Applies a significant slowdown effect to anything that contains it.
|
||||
* Anything constructed from it can slowly regenerate.
|
||||
*/
|
||||
/datum/material/alloy/alien
|
||||
name = "alien alloy"
|
||||
desc = "An extremely dense alloy similar to plasteel in composition. It requires exotic metallurgical processes to create."
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
mood_change = -1
|
||||
|
||||
/datum/mood_event/broken_vow //Used for when mimes break their vow of silence
|
||||
description = "<span class='boldwarning'>I have brought shame upon my name, and betrayed my fellow mimes by breaking our sacred vow...</span>\n"
|
||||
mood_change = -8
|
||||
description = "<span class='boldwarning'>I have brought shame upon my name, and betrayed my fellow mimes by breaking our sacred vow...</span>\n"
|
||||
mood_change = -8
|
||||
|
||||
/datum/mood_event/on_fire
|
||||
description = "<span class='boldwarning'>I'M ON FIRE!!!</span>\n"
|
||||
@@ -68,14 +68,14 @@
|
||||
timeout = 2 MINUTES
|
||||
|
||||
/datum/mood_event/shameful_suicide //suicide_acts that return SHAME, like sord
|
||||
description = "<span class='boldwarning'>I can't even end it all!</span>\n"
|
||||
mood_change = -15
|
||||
timeout = 60 SECONDS
|
||||
description = "<span class='boldwarning'>I can't even end it all!</span>\n"
|
||||
mood_change = -15
|
||||
timeout = 60 SECONDS
|
||||
|
||||
/datum/mood_event/dismembered
|
||||
description = "<span class='boldwarning'>AHH! I WAS USING THAT LIMB!</span>\n"
|
||||
mood_change = -10
|
||||
timeout = 8 MINUTES
|
||||
description = "<span class='boldwarning'>AHH! I WAS USING THAT LIMB!</span>\n"
|
||||
mood_change = -10
|
||||
timeout = 8 MINUTES
|
||||
|
||||
/datum/mood_event/tased
|
||||
description = "<span class='warning'>There's no \"z\" in \"taser\". It's in the zap.</span>\n"
|
||||
@@ -109,20 +109,20 @@
|
||||
description = "<span class='warning'>My fucking [banged_limb.name], man that hurts...</span>\n"
|
||||
|
||||
/datum/mood_event/brain_damage
|
||||
mood_change = -3
|
||||
mood_change = -3
|
||||
|
||||
/datum/mood_event/brain_damage/add_effects()
|
||||
var/damage_message = pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")
|
||||
description = "<span class='warning'>Hurr durr... [damage_message]</span>\n"
|
||||
var/damage_message = pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")
|
||||
description = "<span class='warning'>Hurr durr... [damage_message]</span>\n"
|
||||
|
||||
/datum/mood_event/hulk //Entire duration of having the hulk mutation
|
||||
description = "<span class='warning'>HULK SMASH!</span>\n"
|
||||
mood_change = -4
|
||||
description = "<span class='warning'>HULK SMASH!</span>\n"
|
||||
mood_change = -4
|
||||
|
||||
/datum/mood_event/epilepsy //Only when the mutation causes a seizure
|
||||
description = "<span class='warning'>I should have paid attention to the epilepsy warning.</span>\n"
|
||||
mood_change = -3
|
||||
timeout = 5 MINUTES
|
||||
description = "<span class='warning'>I should have paid attention to the epilepsy warning.</span>\n"
|
||||
mood_change = -3
|
||||
timeout = 5 MINUTES
|
||||
|
||||
/datum/mood_event/nyctophobia
|
||||
description = "<span class='warning'>It sure is dark around here...</span>\n"
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
target = target.loc
|
||||
|
||||
/**
|
||||
* Reacts to any movement that would cause a change in coordinates of the tracked movable atom
|
||||
* This works by detecting movement of either the tracked object, or anything it is inside, recursively
|
||||
*/
|
||||
* Reacts to any movement that would cause a change in coordinates of the tracked movable atom
|
||||
* This works by detecting movement of either the tracked object, or anything it is inside, recursively
|
||||
*/
|
||||
/datum/movement_detector/proc/move_react(atom/movable/mover, atom/oldloc, direction)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@
|
||||
source.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced="hulk")
|
||||
|
||||
/**
|
||||
*Checks damage of a hulk's arm and applies bone wounds as necessary.
|
||||
*
|
||||
*Called by specific atoms being attacked, such as walls. If an atom
|
||||
*does not call this proc, than punching that atom will not cause
|
||||
*arm breaking (even if the atom deals recoil damage to hulks).
|
||||
*Arguments:
|
||||
*arg1 is the arm to evaluate damage of and possibly break.
|
||||
*/
|
||||
*Checks damage of a hulk's arm and applies bone wounds as necessary.
|
||||
*
|
||||
*Called by specific atoms being attacked, such as walls. If an atom
|
||||
*does not call this proc, than punching that atom will not cause
|
||||
*arm breaking (even if the atom deals recoil damage to hulks).
|
||||
*Arguments:
|
||||
*arg1 is the arm to evaluate damage of and possibly break.
|
||||
*/
|
||||
/datum/mutation/human/hulk/proc/break_an_arm(obj/item/bodypart/arm)
|
||||
switch(arm.brute_dam)
|
||||
if(45 to 50)
|
||||
|
||||
+49
-49
@@ -1,18 +1,18 @@
|
||||
/**
|
||||
* # Outfit datums
|
||||
*
|
||||
* This is a clean system of applying outfits to mobs, if you need to equip someone in a uniform
|
||||
* this is the way to do it cleanly and properly.
|
||||
*
|
||||
* You can also specify an outfit datum on a job to have it auto equipped to the mob on join
|
||||
*
|
||||
* /mob/living/carbon/human/proc/equipOutfit(outfit) is the mob level proc to equip an outfit
|
||||
* and you pass it the relevant datum outfit
|
||||
*
|
||||
* outfits can also be saved as json blobs downloadable by a client and then can be uploaded
|
||||
* by that user to recreate the outfit, this is used by admins to allow for custom event outfits
|
||||
* that can be restored at a later date
|
||||
*/
|
||||
* # Outfit datums
|
||||
*
|
||||
* This is a clean system of applying outfits to mobs, if you need to equip someone in a uniform
|
||||
* this is the way to do it cleanly and properly.
|
||||
*
|
||||
* You can also specify an outfit datum on a job to have it auto equipped to the mob on join
|
||||
*
|
||||
* /mob/living/carbon/human/proc/equipOutfit(outfit) is the mob level proc to equip an outfit
|
||||
* and you pass it the relevant datum outfit
|
||||
*
|
||||
* outfits can also be saved as json blobs downloadable by a client and then can be uploaded
|
||||
* by that user to recreate the outfit, this is used by admins to allow for custom event outfits
|
||||
* that can be restored at a later date
|
||||
*/
|
||||
/datum/outfit
|
||||
///Name of the outfit (shows up in the equip admin verb)
|
||||
var/name = "Naked"
|
||||
@@ -88,14 +88,14 @@
|
||||
/// Internals box. Will be inserted at the start of backpack_contents
|
||||
var/box
|
||||
|
||||
/**
|
||||
/**
|
||||
* Any implants the mob should start implanted with
|
||||
*
|
||||
* Format of this list is (typepath, typepath, typepath)
|
||||
*/
|
||||
var/list/implants = null
|
||||
|
||||
/// Any undershirt. While on humans it is a string, here we use paths to stay consistent with the rest of the equips.
|
||||
/// Any undershirt. While on humans it is a string, here we use paths to stay consistent with the rest of the equips.
|
||||
var/datum/sprite_accessory/undershirt = null
|
||||
|
||||
/// Any clothing accessory item
|
||||
@@ -114,43 +114,43 @@
|
||||
var/list/chameleon_extras
|
||||
|
||||
/**
|
||||
* Called at the start of the equip proc
|
||||
*
|
||||
* Override to change the value of the slots depending on client prefs, species and
|
||||
* other such sources of change
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
* Called at the start of the equip proc
|
||||
*
|
||||
* Override to change the value of the slots depending on client prefs, species and
|
||||
* other such sources of change
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
/datum/outfit/proc/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
//to be overridden for customization depending on client prefs,species etc
|
||||
return
|
||||
|
||||
/**
|
||||
* Called after the equip proc has finished
|
||||
*
|
||||
* All items are on the mob at this point, use this proc to toggle internals
|
||||
* fiddle with id bindings and accesses etc
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
* Called after the equip proc has finished
|
||||
*
|
||||
* All items are on the mob at this point, use this proc to toggle internals
|
||||
* fiddle with id bindings and accesses etc
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
/datum/outfit/proc/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
//to be overridden for toggling internals, id binding, access etc
|
||||
return
|
||||
|
||||
/**
|
||||
* Equips all defined types and paths to the mob passed in
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
* Equips all defined types and paths to the mob passed in
|
||||
*
|
||||
* Extra Arguments
|
||||
* * visualsOnly true if this is only for display (in the character setup screen)
|
||||
*
|
||||
* If visualsOnly is true, you can omit any work that doesn't visually appear on the character sprite
|
||||
*/
|
||||
/datum/outfit/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
pre_equip(H, visualsOnly)
|
||||
|
||||
@@ -237,12 +237,12 @@
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Apply a fingerprint from the passed in human to all items in the outfit
|
||||
*
|
||||
* Used for forensics setup when the mob is first equipped at roundstart
|
||||
* essentially calls add_fingerprint to every defined item on the human
|
||||
*
|
||||
*/
|
||||
* Apply a fingerprint from the passed in human to all items in the outfit
|
||||
*
|
||||
* Used for forensics setup when the mob is first equipped at roundstart
|
||||
* essentially calls add_fingerprint to every defined item on the human
|
||||
*
|
||||
*/
|
||||
/datum/outfit/proc/apply_fingerprints(mob/living/carbon/human/H)
|
||||
if(!istype(H))
|
||||
return
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user