Merge branch 'master' into kevinz000-patch-13
This commit is contained in:
@@ -96,6 +96,7 @@
|
||||
#define ORGAN_SLOT_RIGHT_ARM_AUG "r_arm_device"
|
||||
#define ORGAN_SLOT_LEFT_ARM_AUG "l_arm_device"
|
||||
#define ORGAN_SLOT_STOMACH "stomach"
|
||||
#define ORGAN_SLOT_STOMACH_AID "stomach_aid"
|
||||
#define ORGAN_SLOT_BREATHING_TUBE "breathing_tube"
|
||||
#define ORGAN_SLOT_EARS "ears"
|
||||
#define ORGAN_SLOT_EYES "eye_sight"
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
//See controllers/globals.dm
|
||||
//See also controllers/globals.dm
|
||||
|
||||
//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;\
|
||||
}
|
||||
//Creates an empty global initializer, do not use
|
||||
#define GLOBAL_UNMANAGED(X) /datum/controller/global_vars/proc/InitGlobal##X() { return; }
|
||||
|
||||
//Prevents a given global from being VV'd
|
||||
#ifndef TESTING
|
||||
#define GLOBAL_PROTECT(X)\
|
||||
/datum/controller/global_vars/InitGlobal##X(){\
|
||||
@@ -16,23 +20,35 @@
|
||||
#define GLOBAL_PROTECT(X)
|
||||
#endif
|
||||
|
||||
//Standard BYOND global, do not use
|
||||
#define GLOBAL_REAL_VAR(X) var/global/##X
|
||||
|
||||
//Standard typed BYOND global, do not use
|
||||
#define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X
|
||||
|
||||
//Defines a global var on the controller, do not use
|
||||
#define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X
|
||||
|
||||
//Create an untyped global with an initializer expression
|
||||
#define GLOBAL_VAR_INIT(X, InitValue) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, InitValue)
|
||||
|
||||
//Create a global const var, do not use
|
||||
#define GLOBAL_VAR_CONST(X, InitValue) GLOBAL_RAW(/const/##X) = InitValue; GLOBAL_UNMANAGED(X)
|
||||
|
||||
//Create a list global with an initializer expression
|
||||
#define GLOBAL_LIST_INIT(X, InitValue) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, InitValue)
|
||||
|
||||
//Create a list global that is initialized as an empty list
|
||||
#define GLOBAL_LIST_EMPTY(X) GLOBAL_LIST_INIT(X, list())
|
||||
|
||||
//Create a typed global with an initializer expression
|
||||
#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)
|
||||
|
||||
//Create an untyped null global
|
||||
#define GLOBAL_VAR(X) GLOBAL_RAW(/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
//Create a null global list
|
||||
#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
//Create an typed null global
|
||||
#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_UNMANAGED(X)
|
||||
|
||||
+23
-23
@@ -1,22 +1,22 @@
|
||||
#define ACCESS_SECURITY 1 // Security equipment
|
||||
#define ACCESS_BRIG 2 // Brig timers and permabrig
|
||||
#define ACCESS_ARMORY 3
|
||||
#define ACCESS_FORENSICS_LOCKERS 4
|
||||
#define ACCESS_SECURITY 1 // Security equipment, security records, gulag item storage, secbots
|
||||
#define ACCESS_BRIG 2 // Brig cells+timers, permabrig, gulag+gulag shuttle, prisoner management console
|
||||
#define ACCESS_ARMORY 3 // Armory, gulag teleporter, execution chamber
|
||||
#define ACCESS_FORENSICS_LOCKERS 4 //Detective's office, forensics lockers, security+medical records
|
||||
#define ACCESS_MEDICAL 5
|
||||
#define ACCESS_MORGUE 6
|
||||
#define ACCESS_TOX 7
|
||||
#define ACCESS_TOX_STORAGE 8
|
||||
#define ACCESS_GENETICS 9
|
||||
#define ACCESS_ENGINE 10
|
||||
#define ACCESS_ENGINE_EQUIP 11
|
||||
#define ACCESS_TOX 7 //R&D department, R&D console, burn chamber on some maps
|
||||
#define ACCESS_TOX_STORAGE 8 //Toxins storage, burn chamber on some maps
|
||||
#define ACCESS_GENETICS 9
|
||||
#define ACCESS_ENGINE 10 //Engineering area, power monitor, power flow control console
|
||||
#define ACCESS_ENGINE_EQUIP 11 //APCs, EngiVend/YouTool, engineering equipment lockers
|
||||
#define ACCESS_MAINT_TUNNELS 12
|
||||
#define ACCESS_EXTERNAL_AIRLOCKS 13
|
||||
#define ACCESS_EMERGENCY_STORAGE 14
|
||||
#define ACCESS_EMERGENCY_STORAGE 14 //Not in use
|
||||
#define ACCESS_CHANGE_IDS 15
|
||||
#define ACCESS_AI_UPLOAD 16
|
||||
#define ACCESS_TELEPORTER 17
|
||||
#define ACCESS_EVA 18
|
||||
#define ACCESS_HEADS 19
|
||||
#define ACCESS_HEADS 19 //Bridge, EVA storage windoors, gateway shutters, AI integrity restorer, clone record deletion, comms console
|
||||
#define ACCESS_CAPTAIN 20
|
||||
#define ACCESS_ALL_PERSONAL_LOCKERS 21
|
||||
#define ACCESS_CHAPEL_OFFICE 22
|
||||
@@ -31,9 +31,9 @@
|
||||
#define ACCESS_CARGO 31
|
||||
#define ACCESS_CONSTRUCTION 32
|
||||
#define ACCESS_CHEMISTRY 33
|
||||
#define ACCESS_CARGO_BOT 34
|
||||
#define ACCESS_CARGO_BOT 34 //Not in use
|
||||
#define ACCESS_HYDROPONICS 35
|
||||
#define ACCESS_MANUFACTURING 36
|
||||
#define ACCESS_MANUFACTURING 36 //Only used on research.dmm away mission
|
||||
#define ACCESS_LIBRARY 37
|
||||
#define ACCESS_LAWYER 38
|
||||
#define ACCESS_VIROLOGY 39
|
||||
@@ -44,10 +44,10 @@
|
||||
#define ACCESS_THEATRE 46
|
||||
#define ACCESS_RESEARCH 47
|
||||
#define ACCESS_MINING 48
|
||||
#define ACCESS_MINING_OFFICE 49 //not in use
|
||||
#define ACCESS_MINING_OFFICE 49 //Not in use
|
||||
#define ACCESS_MAILSORTING 50
|
||||
#define ACCESS_MINT 51
|
||||
#define ACCESS_MINT_VAULT 52
|
||||
#define ACCESS_MINT 51 //Not in use
|
||||
#define ACCESS_MINT_VAULT 52 //Not in use
|
||||
#define ACCESS_VAULT 53
|
||||
#define ACCESS_MINING_STATION 54
|
||||
#define ACCESS_XENOBIOLOGY 55
|
||||
@@ -58,19 +58,19 @@
|
||||
#define ACCESS_KEYCARD_AUTH 60 //Used for events which require at least two people to confirm them
|
||||
#define ACCESS_TCOMSAT 61 // has access to the entire telecomms satellite / machinery
|
||||
#define ACCESS_GATEWAY 62
|
||||
#define ACCESS_SEC_DOORS 63 // Security front doors
|
||||
#define ACCESS_MINERAL_STOREROOM 64
|
||||
#define ACCESS_SEC_DOORS 63 // Outer brig doors, department security posts
|
||||
#define ACCESS_MINERAL_STOREROOM 64 //For releasing minerals from the ORM
|
||||
#define ACCESS_MINISAT 65
|
||||
#define ACCESS_WEAPONS 66 //Weapon authorization for secbots
|
||||
#define ACCESS_NETWORK 67
|
||||
#define ACCESS_CLONING 68 //Cloning room
|
||||
#define ACCESS_NETWORK 67 //NTnet diagnostics/monitoring software
|
||||
#define ACCESS_CLONING 68 //Cloning room and clone pod ejection
|
||||
|
||||
//BEGIN CENTCOM ACCESS
|
||||
/*Should leave plenty of room if we need to add more access levels.
|
||||
Mostly for admin fun times.*/
|
||||
#define ACCESS_CENT_GENERAL 101//General facilities.
|
||||
#define ACCESS_CENT_GENERAL 101//General facilities. CentCom ferry.
|
||||
#define ACCESS_CENT_THUNDER 102//Thunderdome.
|
||||
#define ACCESS_CENT_SPECOPS 103//Special Ops.
|
||||
#define ACCESS_CENT_SPECOPS 103//Special Ops. Captain's display case, Marauder and Seraph mechs.
|
||||
#define ACCESS_CENT_MEDICAL 104//Medical/Research
|
||||
#define ACCESS_CENT_LIVING 105//Living quarters.
|
||||
#define ACCESS_CENT_STORAGE 106//Generic storage areas.
|
||||
@@ -79,7 +79,7 @@
|
||||
#define ACCESS_CENT_BAR 110 // The non-existent CentCom Bar
|
||||
|
||||
//The Syndicate
|
||||
#define ACCESS_SYNDICATE 150//General Syndicate Access
|
||||
#define ACCESS_SYNDICATE 150//General Syndicate Access. Includes Syndicate mechs and ruins.
|
||||
#define ACCESS_SYNDICATE_LEADER 151//Nuke Op Leader Access
|
||||
|
||||
//Away Missions or Ruins
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#define SEND_SIGNAL(target, sigtype, arguments...) ( !target.comp_lookup || !target.comp_lookup[sigtype] ? NONE : target._SendSignal(sigtype, list(##arguments)) )
|
||||
|
||||
#define SEND_GLOBAL_SIGNAL(sigtype, arguments...) ( SEND_SIGNAL(SSdcs, sigtype, ##arguments) )
|
||||
|
||||
//shorthand
|
||||
#define GET_COMPONENT_FROM(varname, path, target) var##path/##varname = ##target.GetComponent(##path)
|
||||
#define GET_COMPONENT(varname, path) GET_COMPONENT_FROM(varname, path, src)
|
||||
@@ -14,6 +18,14 @@
|
||||
// All signals. Format:
|
||||
// When the signal is called: (signal arguments)
|
||||
|
||||
// global signals
|
||||
// These are signals which can be listened to by any component on any parent
|
||||
// start global signals with "!", this used to be necessary but now it's just a formatting choice
|
||||
#define COMSIG_GLOB_NEW_Z "!new_z" //from base of datum/controller/subsystem/mapping/proc/add_new_zlevel(): (list/args)
|
||||
#define COMSIG_GLOB_VAR_EDIT "!var_edit" //called after a successful var edit somewhere in the world: (list/args)
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
// /datum signals
|
||||
#define COMSIG_COMPONENT_ADDED "component_added" //when a component is added to a datum: (/datum/component)
|
||||
#define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (/datum/component)
|
||||
@@ -32,6 +44,8 @@
|
||||
//End positions
|
||||
#define COMPONENT_EXNAME_CHANGED 1
|
||||
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable/entering, /atom)
|
||||
#define COMSIG_ATOM_EXIT "atom_exit" //from base of atom/Exit(): (/atom/movable/exiting, /atom/newloc)
|
||||
#define COMPONENT_ATOM_BLOCK_EXIT 1
|
||||
#define COMSIG_ATOM_EXITED "atom_exited" //from base of atom/Exited(): (atom/movable/exiting, atom/newloc)
|
||||
#define COMSIG_ATOM_EX_ACT "atom_ex_act" //from base of atom/ex_act(): (severity, target)
|
||||
#define COMSIG_ATOM_EMP_ACT "atom_emp_act" //from base of atom/emp_act(): (severity)
|
||||
@@ -78,6 +92,8 @@
|
||||
// /atom/movable signals
|
||||
#define COMSIG_MOVABLE_MOVED "movable_moved" //from base of atom/movable/Moved(): (/atom, dir)
|
||||
#define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (/atom/movable)
|
||||
#define COMSIG_MOVABLE_UNCROSS "movable_uncross" //from base of atom/movable/Uncross(): (/atom/movable)
|
||||
#define COMPONENT_MOVABLE_BLOCK_UNCROSS 1
|
||||
#define COMSIG_MOVABLE_UNCROSSED "movable_uncrossed" //from base of atom/movable/Uncrossed(): (/atom/movable)
|
||||
#define COMSIG_MOVABLE_COLLIDE "movable_collide" //from base of atom/movable/Collide(): (/atom)
|
||||
#define COMSIG_MOVABLE_IMPACT "movable_impact" //from base of atom/movable/throw_impact(): (/atom/hit_atom, /datum/thrownthing/throwingdatum)
|
||||
@@ -87,6 +103,11 @@
|
||||
#define COMSIG_MOVABLE_THROW "movable_throw" //from base of atom/movable/throw_at(): (datum/thrownthing, spin)
|
||||
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit" //from base of atom/movable/onTransitZ(): (old_z, new_z)
|
||||
|
||||
// /mob/living signals
|
||||
#define COMSIG_LIVING_RESIST "living_resist" //from base of mob/living/resist() (/mob/living)
|
||||
#define COMSIG_LIVING_IGNITED "living_ignite" //from base of mob/living/IgniteMob() (/mob/living)
|
||||
#define COMSIG_LIVING_EXTINGUISHED "living_extinguished" //from base of mob/living/ExtinguishMob() (/mob/living)
|
||||
|
||||
// /mob/living/carbon signals
|
||||
#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity))
|
||||
|
||||
@@ -96,12 +117,13 @@
|
||||
// /obj/item signals
|
||||
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
|
||||
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (/mob)
|
||||
#define COMPONENT_NO_INTERACT 1
|
||||
#define COMSIG_ITEM_ATTACK_OBJ "item_attack_obj" //from base of obj/item/attack_obj(): (/obj, /mob)
|
||||
#define COMPONENT_NO_ATTACK_OBJ 1
|
||||
#define COMSIG_ITEM_PRE_ATTACK "item_pre_attack" //from base of obj/item/pre_attack(): (atom/target, mob/user, params)
|
||||
#define COMPONENT_NO_ATTACK 1
|
||||
#define COMSIG_ITEM_EQUIPPED "item_equip" //from base of obj/item/equipped(): (/mob/equipper, slot)
|
||||
#define COMSIG_ITEM_DROPPED "item_drop"
|
||||
#define COMSIG_ITEM_DROPPED "item_drop" //from base of obj/item/dropped(): (mob/user)
|
||||
#define COMSIG_ITEM_PICKUP "item_pickup" //from base of obj/item/pickup(): (/mob/taker)
|
||||
#define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone" //from base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone)
|
||||
#define COMSIG_ITEM_IMBUE_SOUL "item_imbue_soul" //return a truthy value to prevent ensouling, checked in /obj/effect/proc_holder/spell/targeted/lichdom/cast(): (mob/user)
|
||||
@@ -109,6 +131,27 @@
|
||||
// /obj/item/clothing signals
|
||||
#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): ()
|
||||
|
||||
// /obj/item/implant signals
|
||||
#define COMSIG_IMPLANT_ACTIVATED "implant_activated" //from base of /obj/item/implant/proc/activate(): ()
|
||||
#define COMSIG_IMPLANT_IMPLANTING "implant_implanting" //from base of /obj/item/implant/proc/implant(): (list/args)
|
||||
#define COMPONENT_STOP_IMPLANTING 1
|
||||
#define COMSIG_IMPLANT_OTHER "implant_other" //called on already installed implants when a new one is being added in /obj/item/implant/proc/implant(): (list/args, obj/item/implant/new_implant)
|
||||
//#define COMPONENT_STOP_IMPLANTING 1 //The name makes sense for both
|
||||
#define COMPONENT_DELETE_NEW_IMPLANT 2
|
||||
#define COMPONENT_DELETE_OLD_IMPLANT 4
|
||||
#define COMSIG_IMPLANT_EXISTING_UPLINK "implant_uplink_exists" //called on implants being implanted into someone with an uplink implant: (datum/component/uplink)
|
||||
//This uses all return values of COMSIG_IMPLANT_OTHER
|
||||
|
||||
// /obj/item/pda signals
|
||||
#define COMSIG_PDA_CHANGE_RINGTONE "pda_change_ringtone" //called on pda when the user changes the ringtone: (mob/living/user, new_ringtone)
|
||||
#define COMPONENT_STOP_RINGTONE_CHANGE 1
|
||||
|
||||
// /obj/item/radio signals
|
||||
#define COMSIG_RADIO_NEW_FREQUENCY "radio_new_frequency" //called from base of /obj/item/radio/proc/set_frequency(): (list/args)
|
||||
|
||||
// /obj/item/pen signals
|
||||
#define COMSIG_PEN_ROTATED "pen_rotated" //called after rotation in /obj/item/pen/attack_self(): (rotation, mob/living/carbon/user)
|
||||
|
||||
// /mob/living/carbon/human signals
|
||||
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" //from mob/living/carbon/human/UnarmedAttack(): (atom/target)
|
||||
#define COMSIG_HUMAN_MELEE_UNARMED_ATTACKBY "human_melee_unarmed_attackby" //from mob/living/carbon/human/UnarmedAttack(): (mob/living/carbon/human/attacker)
|
||||
@@ -128,7 +171,7 @@
|
||||
#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code.
|
||||
|
||||
//NTnet
|
||||
#define COMSIG_COMPONENT_NTNET_RECIEVE "ntnet_recieve" //called on an object by its NTNET connection component on recieve. (sending_id(number), sending_netname(text), data(datum/netdata))
|
||||
#define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" //called on an object by its NTNET connection component on receive. (sending_id(number), sending_netname(text), data(datum/netdata))
|
||||
|
||||
// /datum/component/storage signals
|
||||
#define COMSIG_CONTAINS_STORAGE "is_storage" //() - returns bool.
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
#define AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS 1
|
||||
#define AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER 2
|
||||
|
||||
//plastic flaps construction states
|
||||
#define PLASTIC_FLAPS_NORMAL 0
|
||||
#define PLASTIC_FLAPS_DETACHED 1
|
||||
|
||||
//default_unfasten_wrench() return defines
|
||||
#define CANT_UNFASTEN 0
|
||||
#define FAILED_UNFASTEN 1
|
||||
|
||||
@@ -13,16 +13,12 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
|
||||
//FLAGS BITMASK
|
||||
|
||||
#define NODROP_1 (1<<1) // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
|
||||
#define NOBLUDGEON_1 (1<<2) // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
|
||||
#define HEAR_1 (1<<3) // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not.
|
||||
#define CHECK_RICOCHET_1 (1<<4) // Projectiels will check ricochet on things impacted that have this.
|
||||
#define CONDUCT_1 (1<<5) // conducts electricity (metal etc.)
|
||||
#define ABSTRACT_1 (1<<6) // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way
|
||||
#define NODECONSTRUCT_1 (1<<7) // For machines and structures that should not break into parts, eg, holodeck stuff
|
||||
#define OVERLAY_QUEUED_1 (1<<8) // atom queued to SSoverlay
|
||||
#define ON_BORDER_1 (1<<9) // item has priority to check when entering or leaving
|
||||
#define DROPDEL_1 (1<<10) // When dropped, it calls qdel on itself
|
||||
#define PREVENT_CLICK_UNDER_1 (1<<11) //Prevent clicking things below it on the same turf eg. doors/ fulltile windows
|
||||
#define HOLOGRAM_1 (1<<12)
|
||||
#define TESLA_IGNORE_1 (1<<13) // TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
|
||||
@@ -33,9 +29,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define NOJAUNT_1 (1<<0)
|
||||
#define UNUSED_RESERVATION_TURF_1 (1<<1)
|
||||
#define CAN_BE_DIRTY_1 (1<<2) // If a turf can be made dirty at roundstart. This is also used in areas.
|
||||
#define NO_DEATHRATTLE_1 (1<<4) // Do not notify deadchat about any deaths that occur on this turf.
|
||||
#define NO_RUINS_1 (1<<5) //Blocks ruins spawning on the turf
|
||||
#define NO_LAVA_GEN_1 (1<<6) //Blocks lava rivers being generated on the turf
|
||||
#define NO_RUINS_1 (1<<10) //Blocks ruins spawning on the turf
|
||||
|
||||
/*
|
||||
These defines are used specifically with the atom/pass_flags bitmask
|
||||
@@ -81,4 +76,3 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define EMP_PROTECT_SELF (1<<0)
|
||||
#define EMP_PROTECT_CONTENTS (1<<1)
|
||||
#define EMP_PROTECT_WIRES (1<<2)
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#define INVESTIGATE_HALLUCINATIONS "hallucinations"
|
||||
#define INVESTIGATE_RADIATION "radiation"
|
||||
#define INVESTIGATE_EXONET "exonet"
|
||||
#define INVESTIGATE_CIRCUIT "circuit"
|
||||
|
||||
//Individual logging defines
|
||||
#define INDIVIDUAL_ATTACK_LOG "Attack log"
|
||||
|
||||
@@ -41,6 +41,9 @@ require only minor tweaks.
|
||||
// number - bombcap is multiplied by this before being applied to bombs
|
||||
#define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier"
|
||||
|
||||
// number - default gravity if there's no gravity generators or area overrides present
|
||||
#define ZTRAIT_GRAVITY "Gravity"
|
||||
|
||||
// numeric offsets - e.g. {"Down": -1} means that chasms will fall to z - 1 rather than oblivion
|
||||
#define ZTRAIT_UP "Up"
|
||||
#define ZTRAIT_DOWN "Down"
|
||||
|
||||
@@ -86,6 +86,7 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
|
||||
//Because I *KNOW* somebody will think layer+1 means "above"
|
||||
//IT DOESN'T OK, IT MEANS "UNDER"
|
||||
#define UNDER_SUIT_LAYER (SUIT_LAYER+1)
|
||||
#define UNDER_HEAD_LAYER (HEAD_LAYER+1)
|
||||
|
||||
//AND -1 MEANS "ABOVE", OK?, OK!?!
|
||||
#define ABOVE_SHOES_LAYER (SHOES_LAYER-1)
|
||||
@@ -430,6 +431,7 @@ GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE))
|
||||
#define ION_FILE "ion_laws.json"
|
||||
#define PIRATE_NAMES_FILE "pirates.json"
|
||||
|
||||
|
||||
//Fullscreen overlay resolution in tiles.
|
||||
#define FULLSCREEN_OVERLAY_RESOLUTION_X 15
|
||||
#define FULLSCREEN_OVERLAY_RESOLUTION_Y 15
|
||||
@@ -448,5 +450,10 @@ GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE))
|
||||
|
||||
// Used by PDA and cartridge code to reduce repetitiveness of spritesheets
|
||||
#define PDAIMG(what) {"<span class="pda16x16 [#what]"></span>"}
|
||||
|
||||
//Filters
|
||||
#define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-2, size=4, border=4, color="#04080FAA")
|
||||
|
||||
|
||||
#define STANDARD_GRAVITY 1 //Anything above this is high gravity, anything below no grav
|
||||
#define GRAVITY_DAMAGE_TRESHOLD 3 //Starting with this value gravity will start to damage mobs
|
||||
@@ -21,6 +21,10 @@
|
||||
#define NEEDS_PERMIT (1<<3) //Used by security bots to determine if this item is safe for public use.
|
||||
#define SLOWS_WHILE_IN_HAND (1<<4)
|
||||
#define NO_MAT_REDEMPTION (1<<5) // Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
|
||||
#define DROPDEL (1<<6) // When dropped, it calls qdel on itself
|
||||
#define NOBLUDGEON (1<<7) // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
|
||||
#define NODROP (1<<8) // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
|
||||
#define ABSTRACT (1<<9) // for all things that are technically items but used for various different stuff
|
||||
|
||||
// Flags for the clothing_flags var on /obj/item/clothing
|
||||
|
||||
|
||||
@@ -68,3 +68,5 @@
|
||||
|
||||
//Flags in the players table in the db
|
||||
#define DB_FLAG_EXEMPT 1
|
||||
|
||||
#define DEFAULT_CYBORG_NAME "Default Cyborg Name"
|
||||
@@ -2,7 +2,6 @@
|
||||
#define LIQUID 2
|
||||
#define GAS 3
|
||||
|
||||
|
||||
// container_type defines
|
||||
#define INJECTABLE (1<<0) // Makes it possible to add reagents through droppers and syringes.
|
||||
#define DRAWABLE (1<<1) // Makes it possible to remove reagents through syringes.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#define SPECIFIC_HEAT_DEFAULT 200
|
||||
|
||||
#define SPECIFIC_HEAT_PLASMA 500
|
||||
@@ -0,0 +1,7 @@
|
||||
// rust_g.dm - DM API for rust_g extension library
|
||||
#define RUST_G "rust_g"
|
||||
|
||||
#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname)
|
||||
|
||||
#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text)
|
||||
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()
|
||||
@@ -80,6 +80,8 @@
|
||||
|
||||
#define STATUS_EFFECT_SYPHONMARK /datum/status_effect/syphon_mark //tracks kills for the KA death syphon module
|
||||
|
||||
#define STATUS_EFFECT_INLOVE /datum/status_effect/in_love //Displays you as being in love with someone else, and makes hearts appear around them.
|
||||
|
||||
/////////////
|
||||
// SLIME //
|
||||
/////////////
|
||||
|
||||
@@ -124,21 +124,19 @@
|
||||
|
||||
#define COMPILE_OVERLAYS(A)\
|
||||
if (TRUE) {\
|
||||
var/list/oo = A.our_overlays;\
|
||||
var/list/ad = A.add_overlays;\
|
||||
var/list/rm = A.remove_overlays;\
|
||||
var/list/po = A.priority_overlays;\
|
||||
if(LAZYLEN(rm)){\
|
||||
A.overlays -= rm;\
|
||||
rm.Cut();\
|
||||
}\
|
||||
if(LAZYLEN(ad)){\
|
||||
A.overlays |= ad;\
|
||||
ad.Cut();\
|
||||
}\
|
||||
if(LAZYLEN(po)){\
|
||||
if(LAZYLEN(oo)){\
|
||||
A.overlays = oo + po;\
|
||||
}\
|
||||
else{\
|
||||
A.overlays = po;\
|
||||
}\
|
||||
}\
|
||||
else if(LAZYLEN(oo)){\
|
||||
A.overlays = oo;\
|
||||
}\
|
||||
else{\
|
||||
A.overlays.Cut();\
|
||||
A.overlays |= po;\
|
||||
}\
|
||||
A.flags_1 &= ~OVERLAY_QUEUED_1;\
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#define CHANGETURF_DEFER_CHANGE 1
|
||||
#define CHANGETURF_IGNORE_AIR 2
|
||||
#define CHANGETURF_IGNORE_AIR 2 // This flag prevents changeturf from gathering air from nearby turfs to fill the new turf with an approximation of local air
|
||||
#define CHANGETURF_FORCEOP 4
|
||||
#define CHANGETURF_SKIP 8 // A flag for PlaceOnTop to just instance the new turf instead of calling ChangeTurf. Used for uninitialized turfs NOTHING ELSE
|
||||
#define CHANGETURF_SKIP 8 // A flag for PlaceOnTop to just instance the new turf instead of calling ChangeTurf. Used for uninitialized turfs NOTHING ELSE
|
||||
#define CHANGETURF_INHERIT_AIR 16 // Inherit air from previous turf. Implies CHANGETURF_IGNORE_AIR
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define WIRE_POWER1 "Main Power 1"
|
||||
#define WIRE_POWER2 "Main Power 2"
|
||||
#define WIRE_PROCEED "Proceed"
|
||||
#define WIRE_RX "Recieve"
|
||||
#define WIRE_RX "Receive"
|
||||
#define WIRE_RESET_MODULE "Reset Module"
|
||||
#define WIRE_SAFETY "Safety"
|
||||
#define WIRE_SHOCK "High Voltage Ground"
|
||||
|
||||
@@ -488,6 +488,11 @@
|
||||
for(var/key in key_list)
|
||||
. |= key_list[key]
|
||||
|
||||
/proc/make_associative(list/flat_list)
|
||||
. = list()
|
||||
for(var/thing in flat_list)
|
||||
.[thing] = TRUE
|
||||
|
||||
//Picks from the list, with some safeties, and returns the "default" arg if it fails
|
||||
#define DEFAULTPICK(L, default) ((islist(L) && length(L)) ? pick(L) : default)
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
//location of the rust-g library
|
||||
#define RUST_G "rust_g"
|
||||
|
||||
//wrapper macros for easier grepping
|
||||
#define DIRECT_OUTPUT(A, B) A << B
|
||||
#define SEND_IMAGE(target, image) DIRECT_OUTPUT(target, image)
|
||||
#define SEND_SOUND(target, sound) DIRECT_OUTPUT(target, sound)
|
||||
#define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text)
|
||||
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text)
|
||||
#define WRITE_LOG(log, text) call(RUST_G, "log_write")(log, text)
|
||||
#define WRITE_LOG(log, text) rustg_log_write(log, text)
|
||||
|
||||
//print a warning message to world.log
|
||||
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].")
|
||||
@@ -131,6 +128,10 @@
|
||||
/proc/log_query_debug(text)
|
||||
WRITE_LOG(GLOB.query_debug_log, "SQL: [text]")
|
||||
|
||||
/proc/log_job_debug(text)
|
||||
if (CONFIG_GET(flag/log_job_debug))
|
||||
WRITE_LOG(GLOB.world_job_debug_log, "JOB: [text]")
|
||||
|
||||
/* Log to both DD and the logfile. */
|
||||
/proc/log_world(text)
|
||||
WRITE_LOG(GLOB.world_runtime_log, text)
|
||||
@@ -152,7 +153,7 @@
|
||||
|
||||
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
|
||||
/proc/shutdown_logging()
|
||||
call(RUST_G, "log_close_all")()
|
||||
rustg_log_close_all()
|
||||
|
||||
|
||||
/* Helper procs for building detailed log lines */
|
||||
@@ -172,6 +173,3 @@
|
||||
return "[A.loc] [COORD(T)] ([A.loc.type])"
|
||||
else if(A.loc)
|
||||
return "[A.loc] (0, 0, 0) ([A.loc.type])"
|
||||
|
||||
//this is only used here (for now)
|
||||
#undef RUST_G
|
||||
|
||||
@@ -433,7 +433,7 @@
|
||||
if(!gametypeCheck.age_check(M.client))
|
||||
continue
|
||||
if(jobbanType)
|
||||
if(jobban_isbanned(M, jobbanType) || jobban_isbanned(M, ROLE_SYNDICATE))
|
||||
if(jobban_isbanned(M, jobbanType) || QDELETED(M) || jobban_isbanned(M, ROLE_SYNDICATE) || QDELETED(M))
|
||||
continue
|
||||
|
||||
showCandidatePollWindow(M, poll_time, Question, result, ignore_category, time_passed, flashwindow)
|
||||
|
||||
@@ -529,6 +529,7 @@ Proc for attack log creation, because really why not
|
||||
step(X, pick(NORTH, SOUTH, EAST, WEST))
|
||||
|
||||
/proc/deadchat_broadcast(message, mob/follow_target=null, turf/turf_target=null, speaker_key=null, message_type=DEADCHAT_REGULAR)
|
||||
message = "<span class='linkify'>[message]</span>"
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
var/datum/preferences/prefs
|
||||
if(M.client && M.client.prefs)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!isnewplayer(M) && M.can_hear())
|
||||
to_chat(M, "<span class='big bold'><font color = red>[title]</font color><BR>[message]</span><BR>")
|
||||
to_chat(M, "<span class='big bold'><font color = red>[html_encode(title)]</font color><BR>[html_encode(message)]</span><BR>")
|
||||
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
|
||||
if(alert)
|
||||
SEND_SOUND(M, sound('sound/misc/notice1.ogg'))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Ensure the frequency is within bounds of what it should be sending/recieving at
|
||||
// Ensure the frequency is within bounds of what it should be sending/receiving at
|
||||
/proc/sanitize_frequency(frequency, free = FALSE)
|
||||
. = round(frequency)
|
||||
if(free)
|
||||
|
||||
+11
-10
@@ -203,21 +203,20 @@
|
||||
//Print a list of antagonists to the server log
|
||||
var/list/total_antagonists = list()
|
||||
//Look into all mobs in world, dead or alive
|
||||
for(var/datum/mind/Mind in minds)
|
||||
var/temprole = Mind.special_role
|
||||
if(temprole) //if they are an antagonist of some sort.
|
||||
if(temprole in total_antagonists) //If the role exists already, add the name to it
|
||||
total_antagonists[temprole] += ", [Mind.name]([Mind.key])"
|
||||
else
|
||||
total_antagonists.Add(temprole) //If the role doesnt exist in the list, create it and add the mob
|
||||
total_antagonists[temprole] += ": [Mind.name]([Mind.key])"
|
||||
for(var/datum/antagonist/A in GLOB.antagonists)
|
||||
if(!A.owner)
|
||||
continue
|
||||
if(!(A.name in total_antagonists))
|
||||
total_antagonists[A.name] = list()
|
||||
total_antagonists[A.name] += "[key_name(A.owner)]"
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
//Now print them all into the log!
|
||||
log_game("Antagonists at round end were...")
|
||||
for(var/i in total_antagonists)
|
||||
log_game("[i]s[total_antagonists[i]].")
|
||||
for(var/antag_name in total_antagonists)
|
||||
var/list/L = total_antagonists[antag_name]
|
||||
log_game("[antag_name]s :[L.Join(", ")].")
|
||||
|
||||
CHECK_TICK
|
||||
SSdbcore.SetRoundEnd()
|
||||
@@ -525,6 +524,8 @@
|
||||
return
|
||||
var/datum/DBQuery/query_admin_rank_update = SSdbcore.NewQuery("UPDATE [format_table_name("player")] p INNER JOIN [format_table_name("admin")] a ON p.ckey = a.ckey SET p.lastadminrank = a.rank")
|
||||
query_admin_rank_update.Execute()
|
||||
qdel(query_admin_rank_update)
|
||||
|
||||
//json format backup file generation stored per server
|
||||
var/json_file = file("data/admins_backup.json")
|
||||
var/list/file_data = list("ranks" = list(), "admins" = list())
|
||||
|
||||
@@ -64,7 +64,7 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
|
||||
//Takes a value of time in deciseconds.
|
||||
//Returns a text value of that number in hours, minutes, or seconds.
|
||||
/proc/DisplayTimeText(time_value, truncate = FALSE)
|
||||
var/second = time_value*0.1
|
||||
var/second = (time_value)*0.1
|
||||
var/second_adjusted = null
|
||||
var/second_rounded = FALSE
|
||||
var/minute = null
|
||||
@@ -144,7 +144,7 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
|
||||
else if(day && (!minute || !second))
|
||||
hour = " and 1 hour"
|
||||
else
|
||||
hour = "[truncate ? "hour" : "1 hour"]"
|
||||
hour = "[truncate ? "hour" : "1 hour"]"
|
||||
else
|
||||
hour = null
|
||||
|
||||
|
||||
@@ -218,21 +218,6 @@
|
||||
. = "NONE"
|
||||
return .
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
switch(ui_style)
|
||||
if("Retro")
|
||||
return 'icons/mob/screen_retro.dmi'
|
||||
if("Plasmafire")
|
||||
return 'icons/mob/screen_plasmafire.dmi'
|
||||
if("Slimecore")
|
||||
return 'icons/mob/screen_slimecore.dmi'
|
||||
if("Operative")
|
||||
return 'icons/mob/screen_operative.dmi'
|
||||
if("Clockwork")
|
||||
return 'icons/mob/screen_clockwork.dmi'
|
||||
else
|
||||
return 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
//colour formats
|
||||
/proc/rgb2hsl(red, green, blue)
|
||||
red /= 255;green /= 255;blue /= 255;
|
||||
|
||||
+27
-11
@@ -186,7 +186,7 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
return 1
|
||||
|
||||
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
|
||||
/mob/proc/rename_self(role, client/C)
|
||||
/mob/proc/apply_pref_name(role, client/C)
|
||||
if(!C)
|
||||
C = client
|
||||
var/oldname = real_name
|
||||
@@ -194,8 +194,10 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
var/loop = 1
|
||||
var/safety = 0
|
||||
|
||||
var/banned = jobban_isbanned(src, "appearance")
|
||||
|
||||
while(loop && safety < 5)
|
||||
if(C && C.prefs.custom_names[role] && !safety)
|
||||
if(C && C.prefs.custom_names[role] && !safety && !banned)
|
||||
newname = C.prefs.custom_names[role]
|
||||
else
|
||||
switch(role)
|
||||
@@ -207,10 +209,8 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
newname = pick(GLOB.mime_names)
|
||||
if("ai")
|
||||
newname = pick(GLOB.ai_names)
|
||||
if("deity")
|
||||
newname = pick(GLOB.clown_names|GLOB.ai_names|GLOB.mime_names) //pick any old name
|
||||
else
|
||||
return
|
||||
return FALSE
|
||||
|
||||
for(var/mob/living/M in GLOB.player_list)
|
||||
if(M == src)
|
||||
@@ -224,6 +224,8 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
|
||||
if(newname)
|
||||
fully_replace_character_name(oldname,newname)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
//Picks a string of symbols to display as the law number for hacked or ion laws
|
||||
@@ -375,6 +377,7 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
var/client/C
|
||||
var/key
|
||||
var/ckey
|
||||
var/fallback_name
|
||||
|
||||
if(!whom)
|
||||
return "*null*"
|
||||
@@ -394,6 +397,16 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
C = GLOB.directory[ckey]
|
||||
if(C)
|
||||
M = C.mob
|
||||
else if(istype(whom,/datum/mind))
|
||||
var/datum/mind/mind = whom
|
||||
key = mind.key
|
||||
ckey = ckey(key)
|
||||
if(mind.current)
|
||||
M = mind.current
|
||||
if(M.client)
|
||||
C = M.client
|
||||
else
|
||||
fallback_name = mind.name
|
||||
else
|
||||
return "*invalid*"
|
||||
|
||||
@@ -419,11 +432,14 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
else
|
||||
. += "*no key*"
|
||||
|
||||
if(include_name && M)
|
||||
if(M.real_name)
|
||||
. += "/([M.real_name])"
|
||||
else if(M.name)
|
||||
. += "/([M.name])"
|
||||
if(include_name)
|
||||
if(M)
|
||||
if(M.real_name)
|
||||
. += "/([M.real_name])"
|
||||
else if(M.name)
|
||||
. += "/([M.name])"
|
||||
else if(fallback_name)
|
||||
. += "/([fallback_name])"
|
||||
|
||||
return .
|
||||
|
||||
@@ -885,7 +901,7 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
|
||||
/proc/check_target_facings(mob/living/initator, mob/living/target)
|
||||
/*This can be used to add additional effects on interactions between mobs depending on how the mobs are facing each other, such as adding a crit damage to blows to the back of a guy's head.
|
||||
Given how click code currently works (Nov '13), the initiating mob will be facing the target mob most of the time
|
||||
That said, this proc should not be used if the change facing proc of the click code is overriden at the same time*/
|
||||
That said, this proc should not be used if the change facing proc of the click code is overridden at the same time*/
|
||||
if(!ismob(target) || target.lying)
|
||||
//Make sure we are not doing this for things that can't have a logical direction to the players given that the target would be on their side
|
||||
return FALSE
|
||||
|
||||
@@ -45,6 +45,10 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
"NEEDS_PERMIT" = NEEDS_PERMIT,
|
||||
"SLOWS_WHILE_IN_HAND" = SLOWS_WHILE_IN_HAND,
|
||||
"NO_MAT_REDEMPTION" = NO_MAT_REDEMPTION,
|
||||
"DROPDEL" = DROPDEL,
|
||||
"NOBLUDGEON" = NOBLUDGEON,
|
||||
"NODROP" = NODROP,
|
||||
"ABSTRACT" = ABSTRACT,
|
||||
),
|
||||
"admin_flags" = list(
|
||||
"BUILDMODE" = R_BUILDMODE,
|
||||
@@ -113,12 +117,15 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
"NOJAUNT_1" = NOJAUNT_1,
|
||||
"UNUSED_RESERVATION_TURF_1" = UNUSED_RESERVATION_TURF_1,
|
||||
"CAN_BE_DIRTY_1" = CAN_BE_DIRTY_1,
|
||||
"HEAR_1 / NO_DEATHRATTLE_1 (turfs)" = HEAR_1,
|
||||
"CHECK_RICOCHET_1 / NO_RUINS_1 (turfs)" = CHECK_RICOCHET_1,
|
||||
"CONDUCT_1 / NO_LAVA_GEN_1" = CONDUCT_1,
|
||||
"ABSTRACT_1" = ABSTRACT_1,
|
||||
"HEAR_1" = HEAR_1,
|
||||
"CHECK_RICOCHET_1" = CHECK_RICOCHET_1,
|
||||
"CONDUCT_1" = CONDUCT_1,
|
||||
"NO_LAVA_GEN_1" = NO_LAVA_GEN_1,
|
||||
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
|
||||
"OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1,
|
||||
"ON_BORDER_1" = ON_BORDER_1,
|
||||
"NO_RUINS_1" = NO_RUINS_1,
|
||||
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
|
||||
"HOLOGRAM_1" = HOLOGRAM_1,
|
||||
"TESLA_IGNORE_1" = TESLA_IGNORE_1,
|
||||
"INITIALIZED_1" = INITIALIZED_1,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
GLOBAL_VAR_INIT(master_mode, "traitor") //"extended"
|
||||
GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode
|
||||
GLOBAL_VAR(common_report) //Contains commmon part of roundend report
|
||||
GLOBAL_VAR(survivor_report) //Contains shared surivor report for roundend report (part of personal report)
|
||||
GLOBAL_VAR(common_report) //Contains common part of roundend report
|
||||
GLOBAL_VAR(survivor_report) //Contains shared survivor report for roundend report (part of personal report)
|
||||
|
||||
|
||||
GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
|
||||
|
||||
@@ -22,6 +22,8 @@ GLOBAL_VAR(world_manifest_log)
|
||||
GLOBAL_PROTECT(world_manifest_log)
|
||||
GLOBAL_VAR(query_debug_log)
|
||||
GLOBAL_PROTECT(query_debug_log)
|
||||
GLOBAL_VAR(world_job_debug_log)
|
||||
GLOBAL_PROTECT(world_job_debug_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(bombers)
|
||||
GLOBAL_PROTECT(bombers)
|
||||
|
||||
@@ -10,7 +10,7 @@ GLOBAL_VAR_INIT(TAB, " ")
|
||||
|
||||
GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
|
||||
|
||||
GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
|
||||
GLOBAL_VAR_INIT(CELLRATE, 0.002) // conversion ratio between a watt-tick and kilojoule
|
||||
GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second)
|
||||
|
||||
GLOBAL_LIST_EMPTY(powernets)
|
||||
|
||||
+47
-35
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
/atom/Click(location,control,params)
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
SendSignal(COMSIG_CLICK, location, control, params)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK, location, control, params)
|
||||
usr.ClickOn(src, params)
|
||||
|
||||
/atom/DblClick(location,control,params)
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
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 recieving it.
|
||||
is receiving it.
|
||||
The most common are:
|
||||
* mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
|
||||
* atom/attackby(item,user) - used only when adjacent
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
//These are always reachable.
|
||||
//User itself, current loc, and user inventory
|
||||
if(DirectAccess(A))
|
||||
if(A in DirectAccess())
|
||||
if(W)
|
||||
W.melee_attack_chain(src, A, params)
|
||||
else
|
||||
@@ -174,40 +174,52 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/CanReach(atom/target,obj/item/tool,view_only = FALSE)
|
||||
if(isturf(target) || isturf(target.loc) || DirectAccess(target)) //Directly accessible atoms
|
||||
if(Adjacent(target) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
return TRUE
|
||||
else
|
||||
//Things inside storage insde another storage
|
||||
//Eg Contents of a box in a backpack
|
||||
var/atom/outer_storage = get_atom_on_turf(target)
|
||||
if(outer_storage == target) //whatever that is we don't want infinite loop.
|
||||
return FALSE
|
||||
if(outer_storage && CanReach(outer_storage,tool) && outer_storage.CanReachStorage(target,src,view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH))
|
||||
return TRUE
|
||||
/atom/movable/proc/CanReach(atom/ultimate_target, obj/item/tool, view_only = FALSE)
|
||||
// A backwards depth-limited breadth-first-search to see if the target is
|
||||
// logically "in" anything adjacent to us.
|
||||
var/list/direct_access = DirectAccess()
|
||||
var/depth = 1 + (view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH)
|
||||
|
||||
var/list/closed = list()
|
||||
var/list/checking = list(ultimate_target)
|
||||
while (checking.len && depth > 0)
|
||||
var/list/next = list()
|
||||
--depth
|
||||
|
||||
for(var/atom/target in checking) // will filter out nulls
|
||||
if(closed[target] || isarea(target)) // avoid infinity situations
|
||||
continue
|
||||
closed[target] = TRUE
|
||||
if(isturf(target) || isturf(target.loc) || (target in direct_access)) //Directly accessible atoms
|
||||
if(Adjacent(target) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
return TRUE
|
||||
|
||||
if (!target.loc)
|
||||
continue
|
||||
GET_COMPONENT_FROM(storage, /datum/component/storage, target.loc)
|
||||
if (storage)
|
||||
var/datum/component/storage/concrete/master = storage.master()
|
||||
if (master)
|
||||
next += master.parent
|
||||
for(var/S in master.slaves)
|
||||
var/datum/component/storage/slave = S
|
||||
next += slave.parent
|
||||
else
|
||||
next += target.loc
|
||||
else
|
||||
next += target.loc
|
||||
|
||||
checking = next
|
||||
return FALSE
|
||||
|
||||
//Can [target] in this container be reached by [user], can't be more than [depth] levels deep
|
||||
/atom/proc/CanReachStorage(atom/target,user,depth)
|
||||
return FALSE
|
||||
|
||||
/obj/item/storage/CanReachStorage(atom/target,user,depth)
|
||||
while(target && depth > 0)
|
||||
target = target.loc
|
||||
depth--
|
||||
if(target == src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/DirectAccess(atom/target)
|
||||
return (target == src || target == loc)
|
||||
/atom/movable/proc/DirectAccess()
|
||||
return list(src, loc)
|
||||
|
||||
/mob/DirectAccess(atom/target)
|
||||
return (..() || (target in contents))
|
||||
return ..() + contents
|
||||
|
||||
/mob/living/DirectAccess(atom/target)
|
||||
return (..() || (target in GetAllContents()))
|
||||
return ..() + GetAllContents()
|
||||
|
||||
/atom/proc/AllowClick()
|
||||
return FALSE
|
||||
@@ -309,7 +321,7 @@
|
||||
A.ShiftClick(src)
|
||||
return
|
||||
/atom/proc/ShiftClick(mob/user)
|
||||
SendSignal(COMSIG_CLICK_SHIFT, user)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK_SHIFT, user)
|
||||
if(user.client && user.client.eye == user || user.client.eye == user.loc)
|
||||
user.examinate(src)
|
||||
return
|
||||
@@ -324,7 +336,7 @@
|
||||
return
|
||||
|
||||
/atom/proc/CtrlClick(mob/user)
|
||||
SendSignal(COMSIG_CLICK_CTRL, user)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK_CTRL, user)
|
||||
var/mob/living/ML = user
|
||||
if(istype(ML))
|
||||
ML.pulled(src)
|
||||
@@ -356,7 +368,7 @@
|
||||
..()
|
||||
|
||||
/atom/proc/AltClick(mob/user)
|
||||
SendSignal(COMSIG_CLICK_ALT, user)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK_ALT, user)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T && user.TurfAdjacent(T))
|
||||
if(user.listed_turf == T)
|
||||
@@ -381,7 +393,7 @@
|
||||
return
|
||||
|
||||
/atom/proc/CtrlShiftClick(mob/user)
|
||||
SendSignal(COMSIG_CLICK_CTRL_SHIFT)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK_CTRL_SHIFT)
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
/mob/living/silicon/robot/AltClickOn(atom/A)
|
||||
A.BorgAltClick(src)
|
||||
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlShiftClick(mob/living/silicon/robot/user) // Sets/Unsets Emergency Access Override Forwards to AI code.
|
||||
@@ -111,7 +111,7 @@
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
/atom/proc/BorgShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
ShiftClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgShiftClick(mob/living/silicon/robot/user) // Opens and closes doors! Forwards to AI code.
|
||||
@@ -121,7 +121,7 @@
|
||||
..()
|
||||
|
||||
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overriden
|
||||
/atom/proc/BorgCtrlClick(mob/living/silicon/robot/user) //forward to human click if not overridden
|
||||
CtrlClick(user)
|
||||
|
||||
/obj/machinery/door/airlock/BorgCtrlClick(mob/living/silicon/robot/user) // Bolts doors. Forwards to AI code.
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
MouseDrop:
|
||||
|
||||
Called on the atom you're dragging. In a lot of circumstances we want to use the
|
||||
recieving object instead, so that's the default action. This allows you to drag
|
||||
receiving object instead, so that's the default action. This allows you to drag
|
||||
almost anything into a trash can.
|
||||
*/
|
||||
/atom/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
|
||||
if(!usr || !over)
|
||||
return
|
||||
if(SendSignal(COMSIG_MOUSEDROP_ONTO, over, usr) & COMPONENT_NO_MOUSEDROP) //Whatever is recieving will verify themselves for adjacency.
|
||||
if(SEND_SIGNAL(src, COMSIG_MOUSEDROP_ONTO, over, usr) & COMPONENT_NO_MOUSEDROP) //Whatever is receiving will verify themselves for adjacency.
|
||||
return
|
||||
if(over == src)
|
||||
return usr.client.Click(src, src_location, src_control, params)
|
||||
@@ -18,9 +18,9 @@
|
||||
over.MouseDrop_T(src,usr)
|
||||
return
|
||||
|
||||
// recieve a mousedrop
|
||||
// receive a mousedrop
|
||||
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
|
||||
SendSignal(COMSIG_MOUSEDROPPED_ONTO, dropping, user)
|
||||
SEND_SIGNAL(src, COMSIG_MOUSEDROPPED_ONTO, dropping, user)
|
||||
return
|
||||
|
||||
|
||||
@@ -140,4 +140,4 @@
|
||||
if (middragatom == src_object)
|
||||
middragtime = 0
|
||||
middragatom = null
|
||||
..()
|
||||
..()
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
/datum/hud/proc/get_action_buttons_icons()
|
||||
. = list()
|
||||
.["bg_icon"] = ui_style_icon
|
||||
.["bg_icon"] = ui_style
|
||||
.["bg_state"] = "template"
|
||||
|
||||
//TODO : Make these fit theme
|
||||
|
||||
@@ -186,9 +186,9 @@
|
||||
|
||||
|
||||
/datum/hud/ai
|
||||
ui_style_icon = 'icons/mob/screen_ai.dmi'
|
||||
ui_style = 'icons/mob/screen_ai.dmi'
|
||||
|
||||
/datum/hud/ai/New(mob/owner, ui_style = 'icons/mob/screen_ai.dmi')
|
||||
/datum/hud/ai/New(mob/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
|
||||
|
||||
@@ -237,6 +237,16 @@ magboots would let you walk around normally on the floor. Barring those, you can
|
||||
or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
icon_state = "weightless"
|
||||
|
||||
/obj/screen/alert/highgravity
|
||||
name = "High Gravity"
|
||||
desc = "You're getting crushed by high gravity, picking up items and movement will be slowed."
|
||||
icon_state = "paralysis"
|
||||
|
||||
/obj/screen/alert/veryhighgravity
|
||||
name = "Crushing Gravity"
|
||||
desc = "You're getting crushed by high gravity, picking up items and movement will be slowed. You'll also accumulate brute damage!"
|
||||
icon_state = "paralysis"
|
||||
|
||||
/obj/screen/alert/fire
|
||||
name = "On Fire"
|
||||
desc = "You're on fire. Stop, drop and roll to put the fire out or move to a vacuum area."
|
||||
@@ -304,6 +314,9 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
/obj/screen/alert/bloodsense/process()
|
||||
var/atom/blood_target
|
||||
|
||||
if(!mob_viewer.mind)
|
||||
return
|
||||
|
||||
var/datum/antagonist/cult/antag = mob_viewer.mind.has_antag_datum(/datum/antagonist/cult,TRUE)
|
||||
if(!antag)
|
||||
return
|
||||
@@ -588,7 +601,6 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there
|
||||
/datum/hud/proc/reorganize_alerts()
|
||||
var/list/alerts = mymob.alerts
|
||||
var/icon_pref
|
||||
if(!hud_shown)
|
||||
for(var/i = 1, i <= alerts.len, i++)
|
||||
mymob.client.screen -= alerts[alerts[i]]
|
||||
@@ -596,9 +608,7 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
for(var/i = 1, i <= alerts.len, i++)
|
||||
var/obj/screen/alert/alert = alerts[alerts[i]]
|
||||
if(alert.icon_state == "template")
|
||||
if(!icon_pref)
|
||||
icon_pref = ui_style2icon(mymob.client.prefs.UI_style)
|
||||
alert.icon = icon_pref
|
||||
alert.icon = ui_style
|
||||
switch(i)
|
||||
if(1)
|
||||
. = ui_alert1
|
||||
|
||||
@@ -24,11 +24,10 @@
|
||||
desc = "Allows you to sense the general direction of your Queen."
|
||||
screen_loc = ui_alien_queen_finder
|
||||
|
||||
|
||||
/datum/hud/alien
|
||||
ui_style_icon = 'icons/mob/screen_alien.dmi'
|
||||
ui_style = 'icons/mob/screen_alien.dmi'
|
||||
|
||||
/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner, ui_style = 'icons/mob/screen_alien.dmi')
|
||||
/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner)
|
||||
..()
|
||||
|
||||
var/obj/screen/using
|
||||
@@ -36,7 +35,7 @@
|
||||
//equippable shit
|
||||
|
||||
//hands
|
||||
build_hand_slots(ui_style)
|
||||
build_hand_slots()
|
||||
|
||||
//begin buttons
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/datum/hud/larva
|
||||
ui_style = 'icons/mob/screen_alien.dmi'
|
||||
|
||||
/datum/hud/larva/New(mob/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
/datum/hud/constructs
|
||||
ui_style_icon = 'icons/mob/screen_construct.dmi'
|
||||
ui_style = 'icons/mob/screen_construct.dmi'
|
||||
|
||||
/datum/hud/constructs/New(mob/owner)
|
||||
..()
|
||||
pull_icon = new /obj/screen/pull()
|
||||
pull_icon.icon = 'icons/mob/screen_construct.dmi'
|
||||
pull_icon.icon = ui_style
|
||||
pull_icon.update_icon(mymob)
|
||||
pull_icon.screen_loc = ui_construct_pull
|
||||
static_inventory += pull_icon
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//Soul counter is stored with the humans, it does weird when you place it here apparently...
|
||||
|
||||
|
||||
/datum/hud/devil/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/devil/New(mob/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
pull_icon.screen_loc = ui_drone_pull
|
||||
static_inventory += pull_icon
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
build_hand_slots()
|
||||
|
||||
using = new /obj/screen/inventory()
|
||||
using.name = "hand"
|
||||
@@ -62,4 +62,4 @@
|
||||
|
||||
/mob/living/carbon/true_devil/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/devil(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new /datum/hud/devil(src)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/datum/hud/dextrous/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/dextrous/drone/New(mob/owner)
|
||||
..()
|
||||
var/obj/screen/inventory/inv_box
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//Used for normal mobs that have hands.
|
||||
/datum/hud/dextrous/New(mob/living/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/dextrous/New(mob/living/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
pull_icon.screen_loc = ui_drone_pull
|
||||
static_inventory += pull_icon
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
build_hand_slots()
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
@@ -78,6 +78,6 @@
|
||||
/mob/living/simple_animal/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
if(dextrous)
|
||||
hud_used = new dextrous_hud_type(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new dextrous_hud_type(src)
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
var/mob/dead/observer/G = usr
|
||||
G.register_pai()
|
||||
|
||||
/datum/hud/ghost/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/ghost/New(mob/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
|
||||
@@ -90,4 +90,4 @@
|
||||
|
||||
/mob/dead/observer/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/ghost(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new /datum/hud/ghost(src)
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
if(dextrous)
|
||||
..()
|
||||
else
|
||||
hud_used = new /datum/hud/guardian(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new /datum/hud/guardian(src)
|
||||
|
||||
/datum/hud/dextrous/guardian/New(mob/living/simple_animal/hostile/guardian/owner, ui_style = 'icons/mob/screen_midnight.dmi') //for a dextrous guardian
|
||||
/datum/hud/dextrous/guardian/New(mob/living/simple_animal/hostile/guardian/owner) //for a dextrous guardian
|
||||
..()
|
||||
var/obj/screen/using
|
||||
if(istype(owner, /mob/living/simple_animal/hostile/guardian/dextrous))
|
||||
|
||||
+41
-38
@@ -4,6 +4,19 @@
|
||||
including inventories and item quick actions.
|
||||
*/
|
||||
|
||||
// The default UI style is the first one in the list
|
||||
GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
"Midnight" = 'icons/mob/screen_midnight.dmi',
|
||||
"Retro" = 'icons/mob/screen_retro.dmi',
|
||||
"Plasmafire" = 'icons/mob/screen_plasmafire.dmi',
|
||||
"Slimecore" = 'icons/mob/screen_slimecore.dmi',
|
||||
"Operative" = 'icons/mob/screen_operative.dmi',
|
||||
"Clockwork" = 'icons/mob/screen_clockwork.dmi'
|
||||
))
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
return GLOB.available_ui_styles[ui_style] || GLOB.available_ui_styles[GLOB.available_ui_styles[1]]
|
||||
|
||||
/datum/hud
|
||||
var/mob/mymob
|
||||
|
||||
@@ -45,12 +58,15 @@
|
||||
var/obj/screen/internals
|
||||
var/obj/screen/mood
|
||||
|
||||
var/ui_style_icon = 'icons/mob/screen_midnight.dmi'
|
||||
// subtypes can override this to force a specific UI style
|
||||
var/ui_style
|
||||
|
||||
/datum/hud/New(mob/owner , ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/New(mob/owner)
|
||||
mymob = owner
|
||||
|
||||
ui_style_icon = ui_style
|
||||
if (!ui_style)
|
||||
// will fall back to the default if any of these are null
|
||||
ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client.prefs.UI_style)
|
||||
|
||||
hide_actions_toggle = new
|
||||
hide_actions_toggle.InitialiseIcon(src)
|
||||
@@ -68,38 +84,19 @@
|
||||
if(mymob.hud_used == src)
|
||||
mymob.hud_used = null
|
||||
|
||||
qdel(hide_actions_toggle)
|
||||
hide_actions_toggle = null
|
||||
|
||||
qdel(module_store_icon)
|
||||
module_store_icon = null
|
||||
|
||||
if(static_inventory.len)
|
||||
for(var/thing in static_inventory)
|
||||
qdel(thing)
|
||||
static_inventory.Cut()
|
||||
QDEL_NULL(hide_actions_toggle)
|
||||
QDEL_NULL(module_store_icon)
|
||||
QDEL_LIST(static_inventory)
|
||||
|
||||
inv_slots.Cut()
|
||||
action_intent = null
|
||||
zone_select = null
|
||||
pull_icon = null
|
||||
|
||||
if(toggleable_inventory.len)
|
||||
for(var/thing in toggleable_inventory)
|
||||
qdel(thing)
|
||||
toggleable_inventory.Cut()
|
||||
|
||||
if(hotkeybuttons.len)
|
||||
for(var/thing in hotkeybuttons)
|
||||
qdel(thing)
|
||||
hotkeybuttons.Cut()
|
||||
|
||||
QDEL_LIST(toggleable_inventory)
|
||||
QDEL_LIST(hotkeybuttons)
|
||||
throw_icon = null
|
||||
|
||||
if(infodisplay.len)
|
||||
for(var/thing in infodisplay)
|
||||
qdel(thing)
|
||||
infodisplay.Cut()
|
||||
QDEL_LIST(infodisplay)
|
||||
|
||||
healths = null
|
||||
healthdoll = null
|
||||
@@ -112,15 +109,8 @@
|
||||
alien_plasma_display = null
|
||||
alien_queen_finder = null
|
||||
|
||||
if(plane_masters.len)
|
||||
for(var/thing in plane_masters)
|
||||
qdel(plane_masters[thing])
|
||||
plane_masters.Cut()
|
||||
|
||||
if(screenoverlays.len)
|
||||
for(var/thing in screenoverlays)
|
||||
qdel(thing)
|
||||
screenoverlays.Cut()
|
||||
QDEL_LIST_ASSOC_VAL(plane_masters)
|
||||
QDEL_LIST(screenoverlays)
|
||||
mymob = null
|
||||
|
||||
return ..()
|
||||
@@ -239,6 +229,19 @@
|
||||
if(!mymob)
|
||||
return
|
||||
|
||||
/datum/hud/proc/update_ui_style(new_ui_style)
|
||||
// do nothing if overridden by a subtype or already on that style
|
||||
if (initial(ui_style) || ui_style == new_ui_style)
|
||||
return
|
||||
|
||||
for(var/atom/item in static_inventory + toggleable_inventory + hotkeybuttons + infodisplay + screenoverlays + inv_slots)
|
||||
if (item.icon == ui_style)
|
||||
item.icon = new_ui_style
|
||||
|
||||
ui_style = new_ui_style
|
||||
build_hand_slots()
|
||||
hide_actions_toggle.InitialiseIcon(src)
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
/mob/verb/button_pressed_F12()
|
||||
set name = "F12"
|
||||
@@ -254,7 +257,7 @@
|
||||
//(re)builds the hand ui slots, throwing away old ones
|
||||
//not really worth jugglying existing ones so we just scrap+rebuild
|
||||
//9/10 this is only called once per mob and only for 2 hands
|
||||
/datum/hud/proc/build_hand_slots(ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/proc/build_hand_slots()
|
||||
for(var/h in hand_slots)
|
||||
var/obj/screen/inventory/hand/H = hand_slots[h]
|
||||
if(H)
|
||||
|
||||
@@ -82,10 +82,10 @@
|
||||
|
||||
/mob/living/carbon/human/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/human(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new /datum/hud/human(src)
|
||||
|
||||
|
||||
/datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/human/New(mob/living/carbon/human/owner)
|
||||
..()
|
||||
owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness)
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
inv_box.screen_loc = ui_oclothing
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
build_hand_slots()
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/datum/hud/monkey/New(mob/living/carbon/monkey/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
/datum/hud/monkey/New(mob/living/carbon/monkey/owner)
|
||||
..()
|
||||
var/obj/screen/using
|
||||
var/obj/screen/inventory/inv_box
|
||||
@@ -24,7 +24,7 @@
|
||||
using.screen_loc = ui_drop_throw
|
||||
static_inventory += using
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
build_hand_slots()
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
@@ -152,4 +152,4 @@
|
||||
|
||||
/mob/living/carbon/monkey/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/monkey(src, ui_style2icon(client.prefs.UI_style))
|
||||
hud_used = new /datum/hud/monkey(src)
|
||||
|
||||
@@ -89,9 +89,9 @@
|
||||
R.toggle_ionpulse()
|
||||
|
||||
/datum/hud/robot
|
||||
ui_style_icon = 'icons/mob/screen_cyborg.dmi'
|
||||
ui_style = 'icons/mob/screen_cyborg.dmi'
|
||||
|
||||
/datum/hud/robot/New(mob/owner, ui_style = 'icons/mob/screen_cyborg.dmi')
|
||||
/datum/hud/robot/New(mob/owner)
|
||||
..()
|
||||
var/mob/living/silicon/robot/mymobR = mymob
|
||||
var/obj/screen/using
|
||||
|
||||
@@ -17,17 +17,18 @@
|
||||
|
||||
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
|
||||
/obj/item/proc/attack_self(mob/user)
|
||||
SendSignal(COMSIG_ITEM_ATTACK_SELF, user)
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user) & COMPONENT_NO_INTERACT)
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/item/proc/pre_attack(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
if(SendSignal(COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_NO_ATTACK)
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_NO_ATTACK)
|
||||
return FALSE
|
||||
return TRUE //return FALSE to avoid calling attackby after this proc does stuff
|
||||
|
||||
// No comment
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
if(SendSignal(COMSIG_PARENT_ATTACKBY, W, user, params) & COMPONENT_NO_AFTERATTACK)
|
||||
if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, params) & COMPONENT_NO_AFTERATTACK)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -52,8 +53,8 @@
|
||||
|
||||
|
||||
/obj/item/proc/attack(mob/living/M, mob/living/user)
|
||||
SendSignal(COMSIG_ITEM_ATTACK, M, user)
|
||||
if(flags_1 & NOBLUDGEON_1)
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user)
|
||||
if(item_flags & NOBLUDGEON)
|
||||
return
|
||||
|
||||
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) // CIT CHANGE - makes it impossible to attack in stamina softcrit
|
||||
@@ -82,9 +83,9 @@
|
||||
|
||||
//the equivalent of the standard version of attack() but for object targets.
|
||||
/obj/item/proc/attack_obj(obj/O, mob/living/user)
|
||||
if(SendSignal(COMSIG_ITEM_ATTACK_OBJ, O, user) & COMPONENT_NO_ATTACK_OBJ)
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_OBJ, O, user) & COMPONENT_NO_ATTACK_OBJ)
|
||||
return
|
||||
if(flags_1 & NOBLUDGEON_1)
|
||||
if(item_flags & NOBLUDGEON)
|
||||
return
|
||||
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT) // CIT CHANGE - makes it impossible to attack in stamina softcrit
|
||||
to_chat(user, "<span class='warning'>You're too exhausted.</span>") // CIT CHANGE - ditto
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
||||
/atom/proc/attack_ghost(mob/dead/observer/user)
|
||||
if(SendSignal(COMSIG_ATOM_ATTACK_GHOST, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_GHOST, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
return TRUE
|
||||
if(user.client)
|
||||
if(IsAdminGhost(user))
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if(override)
|
||||
return
|
||||
|
||||
SendSignal(COMSIG_HUMAN_MELEE_UNARMED_ATTACK, A)
|
||||
SEND_SIGNAL(src, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, A)
|
||||
A.attack_hand(src)
|
||||
|
||||
//Return TRUE to cancel other attack hand effects that respect it.
|
||||
@@ -33,7 +33,7 @@
|
||||
. = FALSE
|
||||
if(!(interaction_flags_atom & INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND))
|
||||
add_fingerprint(user)
|
||||
if(SendSignal(COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
. = TRUE
|
||||
if(interaction_flags_atom & INTERACT_ATOM_ATTACK_HAND)
|
||||
. = _try_interact(user)
|
||||
@@ -111,7 +111,7 @@
|
||||
A.attack_paw(src)
|
||||
|
||||
/atom/proc/attack_paw(mob/user)
|
||||
if(SendSignal(COMSIG_ATOM_ATTACK_PAW, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_PAW, user) & COMPONENT_NO_ATTACK_HAND)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
desc = "Magic"
|
||||
icon = 'icons/obj/magic.dmi'//Needs sprites
|
||||
icon_state = "2"
|
||||
flags_1 = NOBLUDGEON_1 | ABSTRACT_1 | DROPDEL_1
|
||||
item_flags = NOBLUDGEON | ABSTRACT | DROPDEL
|
||||
//item_state = null
|
||||
w_class = WEIGHT_CLASS_GIGANTIC
|
||||
layer = ABOVE_HUD_LAYER
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
var/resident_file //the file which this was loaded from, if any
|
||||
var/modified = FALSE //set to TRUE if the default has been overridden by a config entry
|
||||
|
||||
var/deprecated_by //the /datum/config_entry type that supercedes this one
|
||||
|
||||
var/protection = NONE
|
||||
var/abstract_type = /datum/config_entry //do not instantiate if type matches this
|
||||
|
||||
@@ -85,6 +87,9 @@
|
||||
/datum/config_entry/proc/ValidateListEntry(key_name, key_value)
|
||||
return TRUE
|
||||
|
||||
/datum/config_entry/proc/DeprecationUpdate(value)
|
||||
return
|
||||
|
||||
/datum/config_entry/string
|
||||
config_entry_value = ""
|
||||
abstract_type = /datum/config_entry/string
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var/directory = "config"
|
||||
|
||||
var/warned_deprecated_configs = FALSE
|
||||
var/hiding_entries_by_type = TRUE //Set for readability, admins can set this to FALSE if they want to debug it
|
||||
var/list/entries
|
||||
var/list/entries_by_type
|
||||
@@ -123,11 +124,26 @@
|
||||
if(lockthis)
|
||||
E.protection |= CONFIG_ENTRY_LOCKED
|
||||
|
||||
if(E.deprecated_by)
|
||||
var/datum/config_entry/new_ver = entries_by_type[E.deprecated_by]
|
||||
var/new_value = E.DeprecationUpdate(value)
|
||||
var/good_update = istext(new_value)
|
||||
log_config("Entry [entry] is deprecated and will be removed soon. Migrate to [new_ver.name]![good_update ? " Suggested new value is: [new_value]" : ""]")
|
||||
if(!warned_deprecated_configs)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, /proc/message_admins, "This server is using deprecated configuration settings. Please check the logs and update accordingly."), 0)
|
||||
warned_deprecated_configs = TRUE
|
||||
if(good_update)
|
||||
value = new_value
|
||||
E = new_ver
|
||||
else
|
||||
warning("[new_ver.type] is deprecated but gave no proper return for DeprecationUpdate()")
|
||||
|
||||
var/validated = E.ValidateAndSet(value)
|
||||
if(!validated)
|
||||
log_config("Failed to validate setting \"[value]\" for [entry]")
|
||||
else if(E.modified && !E.dupes_allowed)
|
||||
log_config("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
|
||||
else
|
||||
if(E.modified && !E.dupes_allowed)
|
||||
log_config("Duplicate setting for [entry] ([value], [E.resident_file]) detected! Using latest.")
|
||||
|
||||
E.resident_file = filename
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
|
||||
/datum/config_entry/flag/no_summon_events //Allowed
|
||||
|
||||
/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes.
|
||||
/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overridden by gamemodes.
|
||||
|
||||
/datum/config_entry/number/arrivals_shuttle_dock_window //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
|
||||
config_entry_value = 55
|
||||
@@ -170,8 +170,6 @@
|
||||
config_entry_value = -1
|
||||
min_val = -1
|
||||
|
||||
/datum/config_entry/flag/rename_cyborg
|
||||
|
||||
/datum/config_entry/flag/ooc_during_round
|
||||
|
||||
/datum/config_entry/flag/emojis
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
|
||||
/datum/config_entry/flag/log_manifest // log crew manifest to seperate file
|
||||
|
||||
/datum/config_entry/flag/log_job_debug // log roundstart divide occupations debug information to a file
|
||||
|
||||
/datum/config_entry/flag/allow_admin_ooccolor // Allows admins with relevant permissions to have their own ooc colour
|
||||
|
||||
/datum/config_entry/flag/allow_vote_restart // allow votes to restart
|
||||
|
||||
@@ -20,10 +20,22 @@ SUBSYSTEM_DEF(blackbox)
|
||||
record_feedback("amount", "random_seed", Master.random_seed)
|
||||
record_feedback("amount", "dm_version", DM_VERSION)
|
||||
record_feedback("amount", "byond_version", world.byond_version)
|
||||
record_feedback("amount", "byond_build", world.byond_build)
|
||||
. = ..()
|
||||
|
||||
//poll population
|
||||
/datum/controller/subsystem/blackbox/fire()
|
||||
set waitfor = FALSE //for population query
|
||||
|
||||
CheckPlayerCount()
|
||||
|
||||
if(CONFIG_GET(flag/use_exp_tracking))
|
||||
if((triggertime < 0) || (world.time > (triggertime +3000))) //subsystem fires once at roundstart then once every 10 minutes. a 5 min check skips the first fire. The <0 is midnight rollover check
|
||||
update_exp(10,FALSE)
|
||||
|
||||
/datum/controller/subsystem/blackbox/proc/CheckPlayerCount()
|
||||
set waitfor = FALSE
|
||||
|
||||
if(!SSdbcore.Connect())
|
||||
return
|
||||
var/playercount = 0
|
||||
@@ -33,11 +45,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
var/admincount = GLOB.admins.len
|
||||
var/datum/DBQuery/query_record_playercount = SSdbcore.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port, round_id) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', '[GLOB.round_id]')")
|
||||
query_record_playercount.Execute()
|
||||
|
||||
if(CONFIG_GET(flag/use_exp_tracking))
|
||||
if((triggertime < 0) || (world.time > (triggertime +3000))) //subsystem fires once at roundstart then once every 10 minutes. a 5 min check skips the first fire. The <0 is midnight rollover check
|
||||
update_exp(10,FALSE)
|
||||
|
||||
qdel(query_record_playercount)
|
||||
|
||||
/datum/controller/subsystem/blackbox/Recover()
|
||||
feedback = SSblackbox.feedback
|
||||
@@ -144,7 +152,7 @@ feedback data can be recorded in 5 formats:
|
||||
SSblackbox.record_feedback("text", "example", 1, "other text")
|
||||
json: {"data":["sample text","other text"]}
|
||||
"amount"
|
||||
used to record simple counts of data i.e. the number of ahelps recieved
|
||||
used to record simple counts of data i.e. the number of ahelps received
|
||||
further calls to the same key will add or subtract (if increment argument is a negative) from the saved amount
|
||||
calls: SSblackbox.record_feedback("amount", "example", 8)
|
||||
SSblackbox.record_feedback("amount", "example", 2)
|
||||
@@ -255,6 +263,7 @@ Versioning
|
||||
key_type = new_key_type
|
||||
|
||||
/datum/controller/subsystem/blackbox/proc/ReportDeath(mob/living/L)
|
||||
set waitfor = FALSE
|
||||
if(sealed)
|
||||
return
|
||||
if(!L || !L.key || !L.mind)
|
||||
@@ -267,28 +276,50 @@ Versioning
|
||||
first_death["area"] = "[AREACOORD(L)]"
|
||||
first_death["damage"] = "<font color='#FF5555'>[L.getBruteLoss()]</font>/<font color='orange'>[L.getFireLoss()]</font>/<font color='lightgreen'>[L.getToxLoss()]</font>/<font color='lightblue'>[L.getOxyLoss()]</font>/<font color='pink'>[L.getCloneLoss()]</font>"
|
||||
first_death["last_words"] = L.last_words
|
||||
var/sqlname = L.real_name
|
||||
var/sqlkey = L.ckey
|
||||
var/sqljob = L.mind.assigned_role
|
||||
var/sqlspecial = L.mind.special_role
|
||||
var/sqlpod = get_area_name(L, TRUE)
|
||||
var/laname = L.lastattacker
|
||||
var/lakey = L.lastattackerckey
|
||||
var/sqlbrute = L.getBruteLoss()
|
||||
var/sqlfire = L.getFireLoss()
|
||||
var/sqlbrain = L.getBrainLoss()
|
||||
var/sqloxy = L.getOxyLoss()
|
||||
var/sqltox = L.getToxLoss()
|
||||
var/sqlclone = L.getCloneLoss()
|
||||
var/sqlstamina = L.getStaminaLoss()
|
||||
var/x_coord = L.x
|
||||
var/y_coord = L.y
|
||||
var/z_coord = L.z
|
||||
var/last_words = L.last_words
|
||||
var/suicide = L.suiciding
|
||||
var/map = SSmapping.config.map_name
|
||||
|
||||
if(!SSdbcore.Connect())
|
||||
return
|
||||
var/area/placeofdeath = get_area(L)
|
||||
var/sqlname = sanitizeSQL(L.real_name)
|
||||
var/sqlkey = sanitizeSQL(L.ckey)
|
||||
var/sqljob = sanitizeSQL(L.mind.assigned_role)
|
||||
var/sqlspecial = sanitizeSQL(L.mind.special_role)
|
||||
var/sqlpod = sanitizeSQL(placeofdeath.name)
|
||||
var/laname = sanitizeSQL(L.lastattacker)
|
||||
var/lakey = sanitizeSQL(L.lastattackerckey)
|
||||
var/sqlbrute = sanitizeSQL(L.getBruteLoss())
|
||||
var/sqlfire = sanitizeSQL(L.getFireLoss())
|
||||
var/sqlbrain = sanitizeSQL(L.getBrainLoss())
|
||||
var/sqloxy = sanitizeSQL(L.getOxyLoss())
|
||||
var/sqltox = sanitizeSQL(L.getToxLoss())
|
||||
var/sqlclone = sanitizeSQL(L.getCloneLoss())
|
||||
var/sqlstamina = sanitizeSQL(L.getStaminaLoss())
|
||||
var/x_coord = sanitizeSQL(L.x)
|
||||
var/y_coord = sanitizeSQL(L.y)
|
||||
var/z_coord = sanitizeSQL(L.z)
|
||||
var/last_words = sanitizeSQL(L.last_words)
|
||||
var/suicide = sanitizeSQL(L.suiciding)
|
||||
var/map = sanitizeSQL(SSmapping.config.map_name)
|
||||
|
||||
sqlname = sanitizeSQL(sqlname)
|
||||
sqlkey = sanitizeSQL(sqlkey)
|
||||
sqljob = sanitizeSQL(sqljob)
|
||||
sqlspecial = sanitizeSQL(sqlspecial)
|
||||
sqlpod = sanitizeSQL(sqlpod)
|
||||
laname = sanitizeSQL(laname)
|
||||
lakey = sanitizeSQL(lakey)
|
||||
sqlbrute = sanitizeSQL(sqlbrute)
|
||||
sqlfire = sanitizeSQL(sqlfire)
|
||||
sqlbrain = sanitizeSQL(sqlbrain)
|
||||
sqloxy = sanitizeSQL(sqloxy)
|
||||
sqltox = sanitizeSQL(sqltox)
|
||||
sqlclone = sanitizeSQL(sqlclone)
|
||||
sqlstamina = sanitizeSQL(sqlstamina)
|
||||
x_coord = sanitizeSQL(x_coord)
|
||||
y_coord = sanitizeSQL(y_coord)
|
||||
z_coord = sanitizeSQL(z_coord)
|
||||
last_words = sanitizeSQL(last_words)
|
||||
suicide = sanitizeSQL(suicide)
|
||||
map = sanitizeSQL(map)
|
||||
var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, last_words, suicide) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], '[last_words]', [suicide])")
|
||||
query_report_death.Execute()
|
||||
query_report_death.Execute()
|
||||
qdel(query_report_death)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
SUBSYSTEM_DEF(dbcore)
|
||||
name = "Database"
|
||||
flags = SS_NO_FIRE
|
||||
flags = SS_BACKGROUND
|
||||
wait = 1 MINUTES
|
||||
init_order = INIT_ORDER_DBCORE
|
||||
var/const/FAILED_DB_CONNECTION_CUTOFF = 5
|
||||
|
||||
@@ -25,6 +26,8 @@ SUBSYSTEM_DEF(dbcore)
|
||||
var/_db_con// This variable contains a reference to the actual database connection.
|
||||
var/failed_connections = 0
|
||||
|
||||
var/list/active_queries = list()
|
||||
|
||||
/datum/controller/subsystem/dbcore/PreInit()
|
||||
if(!_db_con)
|
||||
_db_con = _dm_db_new_con()
|
||||
@@ -40,6 +43,15 @@ SUBSYSTEM_DEF(dbcore)
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/dbcore/fire()
|
||||
for(var/I in active_queries)
|
||||
var/datum/DBQuery/Q = I
|
||||
if(world.time - Q.last_activity_time > (5 MINUTES))
|
||||
message_admins("Found undeleted query, please check the server logs and notify coders.")
|
||||
log_sql("Undeleted query: \"[Q.sql]\" LA: [Q.last_activity] LAT: [Q.last_activity_time]")
|
||||
qdel(Q)
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/dbcore/Recover()
|
||||
_db_con = SSdbcore._db_con
|
||||
@@ -49,12 +61,13 @@ SUBSYSTEM_DEF(dbcore)
|
||||
if(SSdbcore.Connect())
|
||||
var/datum/DBQuery/query_round_shutdown = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET shutdown_datetime = Now(), end_state = '[sanitizeSQL(SSticker.end_state)]' WHERE id = [GLOB.round_id]")
|
||||
query_round_shutdown.Execute()
|
||||
qdel(query_round_shutdown)
|
||||
if(IsConnected())
|
||||
Disconnect()
|
||||
|
||||
//nu
|
||||
/datum/controller/subsystem/dbcore/can_vv_get(var_name)
|
||||
return var_name != "_db_con" && ..()
|
||||
return var_name != NAMEOF(src, _db_con) && var_name != NAMEOF(src, active_queries) && ..()
|
||||
|
||||
/datum/controller/subsystem/dbcore/vv_edit_var(var_name, var_value)
|
||||
if(var_name == "_db_con")
|
||||
@@ -98,33 +111,38 @@ SUBSYSTEM_DEF(dbcore)
|
||||
else
|
||||
schema_mismatch = 2 //flag admin message about no schema version
|
||||
log_sql("Could not get schema version from database")
|
||||
qdel(query_db_version)
|
||||
else
|
||||
log_sql("Your server failed to establish a connection with the database.")
|
||||
else
|
||||
log_sql("Database is not enabled in configuration.")
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/SetRoundID()
|
||||
if(CONFIG_GET(flag/sql_enabled))
|
||||
if(SSdbcore.Connect())
|
||||
var/datum/DBQuery/query_round_initialize = SSdbcore.NewQuery("INSERT INTO [format_table_name("round")] (initialize_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]')")
|
||||
query_round_initialize.Execute()
|
||||
var/datum/DBQuery/query_round_last_id = SSdbcore.NewQuery("SELECT LAST_INSERT_ID()")
|
||||
query_round_last_id.Execute()
|
||||
if(query_round_last_id.NextRow())
|
||||
GLOB.round_id = query_round_last_id.item[1]
|
||||
if(!Connect())
|
||||
return
|
||||
var/datum/DBQuery/query_round_initialize = SSdbcore.NewQuery("INSERT INTO [format_table_name("round")] (initialize_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]')")
|
||||
query_round_initialize.Execute()
|
||||
qdel(query_round_initialize)
|
||||
var/datum/DBQuery/query_round_last_id = SSdbcore.NewQuery("SELECT LAST_INSERT_ID()")
|
||||
query_round_last_id.Execute()
|
||||
if(query_round_last_id.NextRow())
|
||||
GLOB.round_id = query_round_last_id.item[1]
|
||||
qdel(query_round_last_id)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/SetRoundStart()
|
||||
if(CONFIG_GET(flag/sql_enabled))
|
||||
if(SSdbcore.Connect())
|
||||
var/datum/DBQuery/query_round_start = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET start_datetime = Now() WHERE id = [GLOB.round_id]")
|
||||
query_round_start.Execute()
|
||||
if(!Connect())
|
||||
return
|
||||
var/datum/DBQuery/query_round_start = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET start_datetime = Now() WHERE id = [GLOB.round_id]")
|
||||
query_round_start.Execute()
|
||||
qdel(query_round_start)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/SetRoundEnd()
|
||||
if(CONFIG_GET(flag/sql_enabled))
|
||||
if(SSdbcore.Connect())
|
||||
var/sql_station_name = sanitizeSQL(station_name())
|
||||
var/datum/DBQuery/query_round_end = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET end_datetime = Now(), game_mode_result = '[sanitizeSQL(SSticker.mode_result)]', station_name = '[sql_station_name]' WHERE id = [GLOB.round_id]")
|
||||
query_round_end.Execute()
|
||||
if(!Connect())
|
||||
return
|
||||
var/sql_station_name = sanitizeSQL(station_name())
|
||||
var/datum/DBQuery/query_round_end = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET end_datetime = Now(), game_mode_result = '[sanitizeSQL(SSticker.mode_result)]', station_name = '[sql_station_name]' WHERE id = [GLOB.round_id]")
|
||||
query_round_end.Execute()
|
||||
qdel(query_round_end)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/Disconnect()
|
||||
failed_connections = 0
|
||||
@@ -212,9 +230,10 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table
|
||||
sqlrowlist = " [sqlrowlist.Join(",\n ")]"
|
||||
var/datum/DBQuery/Query = NewQuery("INSERT[delayed][ignore_errors] INTO [table]\n([columns.Join(", ")])\nVALUES\n[sqlrowlist]\n[duplicate_key]")
|
||||
if (warn)
|
||||
return Query.warn_execute()
|
||||
. = Query.warn_execute()
|
||||
else
|
||||
return Query.Execute()
|
||||
. = Query.Execute()
|
||||
qdel(Query)
|
||||
|
||||
|
||||
/datum/DBQuery
|
||||
@@ -223,11 +242,14 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table
|
||||
var/list/columns //list of DB Columns populated by Columns()
|
||||
var/list/conversions
|
||||
var/list/item //list of data values populated by NextRow()
|
||||
|
||||
var/last_activity
|
||||
var/last_activity_time
|
||||
var/datum/controller/subsystem/dbcore/db_connection
|
||||
var/_db_query
|
||||
|
||||
/datum/DBQuery/New(sql_query, datum/controller/subsystem/dbcore/connection_handler, cursor_handler)
|
||||
SSdbcore.active_queries[src] = TRUE
|
||||
Activity("Created")
|
||||
if(sql_query)
|
||||
sql = sql_query
|
||||
if(connection_handler)
|
||||
@@ -237,12 +259,31 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table
|
||||
item = list()
|
||||
_db_query = _dm_db_new_query()
|
||||
|
||||
/datum/DBQuery/Destroy()
|
||||
Close()
|
||||
SSdbcore.active_queries -= src
|
||||
return ..()
|
||||
|
||||
/datum/DBQuery/CanProcCall(proc_name)
|
||||
//fuck off kevinz
|
||||
return FALSE
|
||||
|
||||
/datum/DBQuery/proc/Activity(activity)
|
||||
last_activity = activity
|
||||
last_activity_time = world.time
|
||||
|
||||
/datum/DBQuery/proc/warn_execute()
|
||||
. = Execute()
|
||||
if(!.)
|
||||
to_chat(usr, "<span class='danger'>A SQL error occurred during this operation, check the server logs.</span>")
|
||||
|
||||
/datum/DBQuery/proc/SetQuery(new_sql)
|
||||
Activity("SetQuery")
|
||||
Close()
|
||||
sql = new_sql
|
||||
|
||||
/datum/DBQuery/proc/Execute(sql_query = sql, cursor_handler = default_cursor, log_error = TRUE)
|
||||
Activity("Execute")
|
||||
var/start_time
|
||||
var/timeout = CONFIG_GET(number/query_debug_log_timeout)
|
||||
if(timeout)
|
||||
@@ -263,6 +304,7 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table
|
||||
message_admins("HEY! A database query may have timed out. Did the server just hang? <a href='?_src_=holder;[HrefToken()];slowquery=yes'>\[YES\]</a>|<a href='?_src_=holder;[HrefToken()];slowquery=no'>\[NO\]</a>")
|
||||
|
||||
/datum/DBQuery/proc/NextRow()
|
||||
Activity("NextRow")
|
||||
return _dm_db_next_row(_db_query,item,conversions)
|
||||
|
||||
/datum/DBQuery/proc/RowsAffected()
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
SUBSYSTEM_DEF(dcs)
|
||||
name = "Datum Component System"
|
||||
flags = SS_NO_INIT | SS_NO_FIRE
|
||||
|
||||
/datum/controller/subsystem/dcs/Recover()
|
||||
comp_lookup = SSdcs.comp_lookup
|
||||
@@ -93,25 +93,6 @@ SUBSYSTEM_DEF(events)
|
||||
else if(. == EVENT_READY)
|
||||
E.runEvent(TRUE)
|
||||
|
||||
/datum/round_event/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
var/list/safe_areas = list(
|
||||
/area/ai_monitored/turret_protected/ai,
|
||||
/area/ai_monitored/turret_protected/ai_upload,
|
||||
/area/engine,
|
||||
/area/solar,
|
||||
/area/holodeck,
|
||||
/area/shuttle
|
||||
)
|
||||
|
||||
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
|
||||
var/list/danger_areas = list(
|
||||
/area/engine/break_room,
|
||||
/area/crew_quarters/heads/chief)
|
||||
|
||||
//Need to locate() as it's just a list of paths.
|
||||
return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas)) in GLOB.sortedAreas
|
||||
|
||||
|
||||
//allows a client to trigger an event
|
||||
//aka Badmin Central
|
||||
// > Not in modules/admin
|
||||
|
||||
@@ -293,13 +293,13 @@ SUBSYSTEM_DEF(garbage)
|
||||
|
||||
|
||||
if(isnull(D.gc_destroyed))
|
||||
if (D.SendSignal(COMSIG_PARENT_PREQDELETED, force)) // Give the components a chance to prevent their parent from being deleted
|
||||
if (SEND_SIGNAL(D, COMSIG_PARENT_PREQDELETED, force)) // Give the components a chance to prevent their parent from being deleted
|
||||
return
|
||||
D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED
|
||||
var/start_time = world.time
|
||||
var/start_tick = world.tick_usage
|
||||
var/hint = D.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
|
||||
D.SendSignal(COMSIG_PARENT_QDELETED, force, hint) // Let the (remaining) components know about the result of Destroy
|
||||
SEND_SIGNAL(D, COMSIG_PARENT_QDELETED, force, hint) // Let the (remaining) components know about the result of Destroy
|
||||
if(world.time != start_time)
|
||||
I.slept_destroy++
|
||||
else
|
||||
|
||||
@@ -7,7 +7,6 @@ SUBSYSTEM_DEF(job)
|
||||
var/list/name_occupations = list() //Dict of all jobs, keys are titles
|
||||
var/list/type_occupations = list() //Dict of all jobs, keys are types
|
||||
var/list/unassigned = list() //Players who need jobs
|
||||
var/list/job_debug = list() //Debug info
|
||||
var/initial_players_to_assign = 0 //used for checking against population caps
|
||||
|
||||
var/list/prioritized_jobs = list()
|
||||
@@ -36,6 +35,7 @@ SUBSYSTEM_DEF(job)
|
||||
old_overflow.spawn_positions = initial(old_overflow.spawn_positions)
|
||||
old_overflow.total_positions = initial(old_overflow.total_positions)
|
||||
overflow_role = new_overflow_role
|
||||
JobDebug("Overflow role set to : [new_overflow_role]")
|
||||
|
||||
/datum/controller/subsystem/job/proc/SetupOccupations(faction = "Station")
|
||||
occupations = list()
|
||||
@@ -62,13 +62,6 @@ SUBSYSTEM_DEF(job)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/Debug(text)
|
||||
if(!GLOB.Debug2)
|
||||
return 0
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/GetJob(rank)
|
||||
if(!occupations.len)
|
||||
SetupOccupations()
|
||||
@@ -80,12 +73,12 @@ SUBSYSTEM_DEF(job)
|
||||
return type_occupations[jobtype]
|
||||
|
||||
/datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if(player && player.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job)
|
||||
return FALSE
|
||||
if(jobban_isbanned(player, rank))
|
||||
if(jobban_isbanned(player, rank) || QDELETED(player))
|
||||
return FALSE
|
||||
if(!job.player_old_enough(player.client))
|
||||
return FALSE
|
||||
@@ -94,41 +87,41 @@ SUBSYSTEM_DEF(job)
|
||||
var/position_limit = job.total_positions
|
||||
if(!latejoin)
|
||||
position_limit = job.spawn_positions
|
||||
Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
|
||||
JobDebug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
|
||||
player.mind.assigned_role = rank
|
||||
unassigned -= player
|
||||
job.current_positions++
|
||||
return TRUE
|
||||
Debug("AR has failed, Player: [player], Rank: [rank]")
|
||||
JobDebug("AR has failed, Player: [player], Rank: [rank]")
|
||||
return FALSE
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/FindOccupationCandidates(datum/job/job, level, flag)
|
||||
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
|
||||
JobDebug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
|
||||
var/list/candidates = list()
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("FOC isbanned failed, Player: [player]")
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
JobDebug("FOC isbanned failed, Player: [player]")
|
||||
continue
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("FOC player not old enough, Player: [player]")
|
||||
JobDebug("FOC player not old enough, Player: [player]")
|
||||
continue
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("FOC player not enough xp, Player: [player]")
|
||||
JobDebug("FOC player not enough xp, Player: [player]")
|
||||
continue
|
||||
if(flag && (!(flag in player.client.prefs.be_special)))
|
||||
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
|
||||
JobDebug("FOC flag failed, Player: [player], Flag: [flag], ")
|
||||
continue
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("FOC incompatible with antagonist role, Player: [player]")
|
||||
JobDebug("FOC incompatible with antagonist role, Player: [player]")
|
||||
continue
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
Debug("FOC pass, Player: [player], Level:[level]")
|
||||
JobDebug("FOC pass, Player: [player], Level:[level]")
|
||||
candidates += player
|
||||
return candidates
|
||||
|
||||
/datum/controller/subsystem/job/proc/GiveRandomJob(mob/dead/new_player/player)
|
||||
Debug("GRJ Giving random job, Player: [player]")
|
||||
JobDebug("GRJ Giving random job, Player: [player]")
|
||||
. = FALSE
|
||||
for(var/datum/job/job in shuffle(occupations))
|
||||
if(!job)
|
||||
@@ -140,32 +133,37 @@ SUBSYSTEM_DEF(job)
|
||||
if(job.title in GLOB.command_positions) //If you want a command position, select it!
|
||||
continue
|
||||
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("GRJ isbanned failed, Player: [player], Job: [job.title]")
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
if(QDELETED(player))
|
||||
JobDebug("GRJ isbanned failed, Player deleted")
|
||||
break
|
||||
JobDebug("GRJ isbanned failed, Player: [player], Job: [job.title]")
|
||||
continue
|
||||
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("GRJ player not old enough, Player: [player]")
|
||||
JobDebug("GRJ player not old enough, Player: [player]")
|
||||
continue
|
||||
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("GRJ player not enough xp, Player: [player]")
|
||||
JobDebug("GRJ player not enough xp, Player: [player]")
|
||||
continue
|
||||
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
|
||||
JobDebug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
|
||||
continue
|
||||
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("GRJ Random job given, Player: [player], Job: [job]")
|
||||
JobDebug("GRJ Random job given, Player: [player], Job: [job]")
|
||||
if(AssignRole(player, job.title))
|
||||
return TRUE
|
||||
|
||||
/datum/controller/subsystem/job/proc/ResetOccupations()
|
||||
JobDebug("Occupations reset.")
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if((player) && (player.mind))
|
||||
player.mind.assigned_role = null
|
||||
player.mind.special_role = null
|
||||
SSpersistence.antag_rep_change[player.ckey] = 0
|
||||
SetupOccupations()
|
||||
unassigned = list()
|
||||
return
|
||||
@@ -231,7 +229,7 @@ SUBSYSTEM_DEF(job)
|
||||
**/
|
||||
/datum/controller/subsystem/job/proc/DivideOccupations()
|
||||
//Setup new player list and get the jobs list
|
||||
Debug("Running DO")
|
||||
JobDebug("Running DO")
|
||||
|
||||
//Holder for Triumvirate is stored in the SSticker, this just processes it
|
||||
if(SSticker.triai)
|
||||
@@ -247,7 +245,7 @@ SUBSYSTEM_DEF(job)
|
||||
|
||||
initial_players_to_assign = unassigned.len
|
||||
|
||||
Debug("DO, Len: [unassigned.len]")
|
||||
JobDebug("DO, Len: [unassigned.len]")
|
||||
if(unassigned.len == 0)
|
||||
return 0
|
||||
|
||||
@@ -268,28 +266,28 @@ SUBSYSTEM_DEF(job)
|
||||
HandleFeedbackGathering()
|
||||
|
||||
//People who wants to be the overflow role, sure, go on.
|
||||
Debug("DO, Running Overflow Check 1")
|
||||
JobDebug("DO, Running Overflow Check 1")
|
||||
var/datum/job/overflow = GetJob(SSjob.overflow_role)
|
||||
var/list/overflow_candidates = FindOccupationCandidates(overflow, 3)
|
||||
Debug("AC1, Candidates: [overflow_candidates.len]")
|
||||
JobDebug("AC1, Candidates: [overflow_candidates.len]")
|
||||
for(var/mob/dead/new_player/player in overflow_candidates)
|
||||
Debug("AC1 pass, Player: [player]")
|
||||
JobDebug("AC1 pass, Player: [player]")
|
||||
AssignRole(player, SSjob.overflow_role)
|
||||
overflow_candidates -= player
|
||||
Debug("DO, AC1 end")
|
||||
JobDebug("DO, AC1 end")
|
||||
|
||||
//Select one head
|
||||
Debug("DO, Running Head Check")
|
||||
JobDebug("DO, Running Head Check")
|
||||
FillHeadPosition()
|
||||
Debug("DO, Head Check end")
|
||||
JobDebug("DO, Head Check end")
|
||||
|
||||
//Check for an AI
|
||||
Debug("DO, Running AI Check")
|
||||
JobDebug("DO, Running AI Check")
|
||||
FillAIPosition()
|
||||
Debug("DO, AI Check end")
|
||||
JobDebug("DO, AI Check end")
|
||||
|
||||
//Other jobs are now checked
|
||||
Debug("DO, Running Standard Check")
|
||||
JobDebug("DO, Running Standard Check")
|
||||
|
||||
|
||||
// New job giving system by Donkie
|
||||
@@ -313,66 +311,71 @@ SUBSYSTEM_DEF(job)
|
||||
continue
|
||||
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("DO isbanned failed, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO isbanned failed, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(QDELETED(player))
|
||||
JobDebug("DO player deleted during job ban check")
|
||||
break
|
||||
|
||||
if(!job.player_old_enough(player.client))
|
||||
Debug("DO player not old enough, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO player not old enough, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(job.required_playtime_remaining(player.client))
|
||||
Debug("DO player not enough xp, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO player not enough xp, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
if(player.mind && job.title in player.mind.restricted_roles)
|
||||
Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
|
||||
JobDebug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
|
||||
continue
|
||||
|
||||
// If the player wants that job on this level, then try give it to him.
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
|
||||
// If the job isn't filled
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
JobDebug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
AssignRole(player, job.title)
|
||||
unassigned -= player
|
||||
break
|
||||
|
||||
|
||||
JobDebug("DO, Handling unassigned.")
|
||||
// Hand out random jobs to the people who didn't get any in the last check
|
||||
// Also makes sure that they got their preference correct
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(jobban_isbanned(player, SSjob.overflow_role))
|
||||
GiveRandomJob(player) //you get to roll for random before everyone else just to be sure you don't get overflow. you're so speshul
|
||||
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BERANDOMJOB)
|
||||
GiveRandomJob(player)
|
||||
|
||||
Debug("DO, Standard Check end")
|
||||
|
||||
Debug("DO, Running AC2")
|
||||
|
||||
// For those who wanted to be assistant if their preferences were filled, here you go.
|
||||
for(var/mob/dead/new_player/player in unassigned)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
if(player.client.prefs.joblessrole == BEOVERFLOW)
|
||||
Debug("AC2 Assistant located, Player: [player]")
|
||||
AssignRole(player, SSjob.overflow_role)
|
||||
else // For those who don't want to play if their preference were filled, back you go.
|
||||
RejectPlayer(player)
|
||||
HandleUnassigned(player)
|
||||
|
||||
JobDebug("DO, Handling unrejectable unassigned")
|
||||
//Mop up people who can't leave.
|
||||
for(var/mob/dead/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?)
|
||||
if(!GiveRandomJob(player))
|
||||
AssignRole(player, SSjob.overflow_role) //If everything is already filled, make them an assistant
|
||||
|
||||
return 1
|
||||
|
||||
//We couldn't find a job from prefs for this guy.
|
||||
/datum/controller/subsystem/job/proc/HandleUnassigned(mob/dead/new_player/player)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BEOVERFLOW)
|
||||
var/allowed_to_be_a_loser = !jobban_isbanned(player, SSjob.overflow_role)
|
||||
if(QDELETED(player) || !allowed_to_be_a_loser)
|
||||
RejectPlayer(player)
|
||||
else
|
||||
if(!AssignRole(player, SSjob.overflow_role))
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == BERANDOMJOB)
|
||||
if(!GiveRandomJob(player))
|
||||
RejectPlayer(player)
|
||||
else if(player.client.prefs.joblessrole == RETURNTOLOBBY)
|
||||
RejectPlayer(player)
|
||||
else //Something gone wrong if we got here.
|
||||
var/message = "DO: [player] fell through handling unassigned"
|
||||
JobDebug(message)
|
||||
log_game(message)
|
||||
message_admins(message)
|
||||
RejectPlayer(player)
|
||||
//Gives the player the stuff he should have with his rank
|
||||
/datum/controller/subsystem/job/proc/EquipRank(mob/M, rank, joined_late = FALSE)
|
||||
var/mob/dead/new_player/N
|
||||
@@ -436,11 +439,9 @@ SUBSYSTEM_DEF(job)
|
||||
if(job && H)
|
||||
if(job.dresscodecompliant)// CIT CHANGE - dress code compliance
|
||||
equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items
|
||||
job.after_spawn(H, M, joined_late)
|
||||
job.after_spawn(H, M, joined_late) // note: this happens before the mob has a key! M will always have a client, H might not.
|
||||
equip_loadout(N, H, TRUE)//CIT CHANGE - makes players spawn with in-backpack loadout items properly. A little hacky but it works
|
||||
|
||||
//handle_roundstart_items(H, M.ckey, H.mind.assigned_role, H.mind.special_role) //CIT CHANGE - makes donators spawn with their items. This can safely be commented out when all of the donator items are migrated to the loadout system
|
||||
|
||||
return H
|
||||
|
||||
|
||||
@@ -453,7 +454,7 @@ SUBSYSTEM_DEF(job)
|
||||
if(ssc > 0)
|
||||
if(J.spawn_positions > 0)
|
||||
var/officer_positions = min(12, max(J.spawn_positions, round(unassigned.len / ssc))) //Scale between configured minimum and 12 officers
|
||||
Debug("Setting open security officer positions to [officer_positions]")
|
||||
JobDebug("Setting open security officer positions to [officer_positions]")
|
||||
J.total_positions = officer_positions
|
||||
J.spawn_positions = officer_positions
|
||||
|
||||
@@ -489,7 +490,7 @@ SUBSYSTEM_DEF(job)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if(!(player.ready == PLAYER_READY_TO_PLAY && player.mind && !player.mind.assigned_role))
|
||||
continue //This player is not ready
|
||||
if(jobban_isbanned(player, job.title))
|
||||
if(jobban_isbanned(player, job.title) || QDELETED(player))
|
||||
banned++
|
||||
continue
|
||||
if(!job.player_old_enough(player.client))
|
||||
@@ -525,7 +526,8 @@ SUBSYSTEM_DEF(job)
|
||||
if(player.mind && player.mind.special_role)
|
||||
return
|
||||
if(PopcapReached())
|
||||
Debug("Popcap overflow Check observer located, Player: [player]")
|
||||
JobDebug("Popcap overflow Check observer located, Player: [player]")
|
||||
JobDebug("Player rejected :[player]")
|
||||
to_chat(player, "<b>You have failed to qualify for any job you desired.</b>")
|
||||
unassigned -= player
|
||||
player.ready = PLAYER_NOT_READY
|
||||
@@ -630,3 +632,6 @@ SUBSYSTEM_DEF(job)
|
||||
for(var/mob/living/carbon/human/player in GLOB.carbon_list)
|
||||
if(player.mind && (player.mind.assigned_role in GLOB.security_positions))
|
||||
. |= player.mind
|
||||
|
||||
/datum/controller/subsystem/job/proc/JobDebug(message)
|
||||
log_job_debug(message)
|
||||
|
||||
@@ -49,7 +49,11 @@ SUBSYSTEM_DEF(mapping)
|
||||
if(initialized)
|
||||
return
|
||||
if(config.defaulted)
|
||||
to_chat(world, "<span class='boldannounce'>Unable to load next map config, defaulting to Box Station</span>")
|
||||
var/old_config = config
|
||||
config = global.config.defaultmap
|
||||
if(!config || config.defaulted)
|
||||
to_chat(world, "<span class='boldannounce'>Unable to load next or default map config, defaulting to Box Station</span>")
|
||||
config = old_config
|
||||
loader = new
|
||||
loadWorld()
|
||||
repopulate_sorted_areas()
|
||||
@@ -219,6 +223,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
if(SSdbcore.Connect())
|
||||
var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]")
|
||||
query_round_map_name.Execute()
|
||||
qdel(query_round_map_name)
|
||||
|
||||
#ifndef LOWMEMORYMODE
|
||||
// TODO: remove this when the DB is prepared for the z-levels getting reordered
|
||||
|
||||
@@ -115,38 +115,43 @@ SUBSYSTEM_DEF(overlays)
|
||||
#define NOT_QUEUED_ALREADY (!(flags_1 & OVERLAY_QUEUED_1))
|
||||
#define QUEUE_FOR_COMPILE flags_1 |= OVERLAY_QUEUED_1; SSoverlays.queue += src;
|
||||
/atom/proc/cut_overlays(priority = FALSE)
|
||||
var/list/cached_overlays = our_overlays
|
||||
var/list/cached_priority = priority_overlays
|
||||
LAZYINITLIST(priority_overlays)
|
||||
LAZYINITLIST(remove_overlays)
|
||||
LAZYINITLIST(add_overlays)
|
||||
remove_overlays = overlays.Copy()
|
||||
add_overlays.Cut()
|
||||
|
||||
var/need_compile = FALSE
|
||||
if(priority)
|
||||
priority_overlays.Cut()
|
||||
|
||||
if(LAZYLEN(cached_overlays)) //don't queue empty lists, don't cut priority overlays
|
||||
cached_overlays.Cut() //clear regular overlays
|
||||
need_compile = TRUE
|
||||
|
||||
if(priority && LAZYLEN(cached_priority))
|
||||
cached_priority.Cut()
|
||||
need_compile = TRUE
|
||||
|
||||
if(NOT_QUEUED_ALREADY && need_compile)
|
||||
//If not already queued for work and there are overlays to remove
|
||||
if(NOT_QUEUED_ALREADY && remove_overlays.len)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/cut_overlay(list/overlays, priority)
|
||||
if(!overlays)
|
||||
return
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
LAZYINITLIST(add_overlays) //always initialized after this point
|
||||
LAZYINITLIST(priority_overlays)
|
||||
LAZYINITLIST(remove_overlays)
|
||||
var/a_len = add_overlays.len
|
||||
var/r_len = remove_overlays.len
|
||||
var/p_len = priority_overlays.len
|
||||
remove_overlays += overlays
|
||||
add_overlays -= overlays
|
||||
|
||||
var/list/cached_overlays = our_overlays //sanic
|
||||
var/list/cached_priority = priority_overlays
|
||||
var/init_o_len = LAZYLEN(cached_overlays)
|
||||
var/init_p_len = LAZYLEN(cached_priority) //starter pokemon
|
||||
|
||||
LAZYREMOVE(cached_overlays, overlays)
|
||||
if(priority)
|
||||
var/list/cached_priority = priority_overlays
|
||||
LAZYREMOVE(cached_priority, overlays)
|
||||
|
||||
if(NOT_QUEUED_ALREADY && ((init_o_len != LAZYLEN(cached_overlays)) || (init_p_len != LAZYLEN(cached_priority))))
|
||||
var/fa_len = add_overlays.len
|
||||
var/fr_len = remove_overlays.len
|
||||
var/fp_len = priority_overlays.len
|
||||
|
||||
//If not already queued and there is work to be done
|
||||
if(NOT_QUEUED_ALREADY && (fa_len != a_len || fr_len != r_len || fp_len != p_len))
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/add_overlay(list/overlays, priority = FALSE)
|
||||
@@ -155,24 +160,21 @@ SUBSYSTEM_DEF(overlays)
|
||||
|
||||
overlays = build_appearance_list(overlays)
|
||||
|
||||
LAZYINITLIST(our_overlays) //always initialized after this point
|
||||
LAZYINITLIST(add_overlays) //always initialized after this point
|
||||
LAZYINITLIST(priority_overlays)
|
||||
|
||||
var/list/cached_overlays = our_overlays //sanic
|
||||
var/list/cached_priority = priority_overlays
|
||||
var/init_o_len = cached_overlays.len
|
||||
var/init_p_len = cached_priority.len //starter pokemon
|
||||
var/need_compile
|
||||
var/a_len = add_overlays.len
|
||||
var/p_len = priority_overlays.len
|
||||
|
||||
if(priority)
|
||||
cached_priority += overlays //or in the image. Can we use [image] = image?
|
||||
need_compile = init_p_len != cached_priority.len
|
||||
priority_overlays += overlays //or in the image. Can we use [image] = image?
|
||||
var/fp_len = priority_overlays.len
|
||||
if(NOT_QUEUED_ALREADY && fp_len != p_len)
|
||||
QUEUE_FOR_COMPILE
|
||||
else
|
||||
cached_overlays += overlays
|
||||
need_compile = init_o_len != cached_overlays.len
|
||||
|
||||
if(NOT_QUEUED_ALREADY && need_compile) //have we caught more pokemon?
|
||||
QUEUE_FOR_COMPILE
|
||||
add_overlays += overlays
|
||||
var/fa_len = add_overlays.len
|
||||
if(NOT_QUEUED_ALREADY && fa_len != a_len)
|
||||
QUEUE_FOR_COMPILE
|
||||
|
||||
/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
|
||||
if(!other)
|
||||
@@ -180,12 +182,11 @@ SUBSYSTEM_DEF(overlays)
|
||||
cut_overlays()
|
||||
return
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
var/list/cached_other = other.overlays.Copy()
|
||||
if(cached_other)
|
||||
if(cut_old || !LAZYLEN(our_overlays))
|
||||
our_overlays = cached_other.Copy()
|
||||
else
|
||||
our_overlays |= cached_other
|
||||
if(cut_old || !LAZYLEN(overlays))
|
||||
remove_overlays = overlays
|
||||
add_overlays = cached_other
|
||||
if(NOT_QUEUED_ALREADY)
|
||||
QUEUE_FOR_COMPILE
|
||||
else if(cut_old)
|
||||
@@ -196,7 +197,7 @@ SUBSYSTEM_DEF(overlays)
|
||||
|
||||
//TODO: Better solution for these?
|
||||
/image/proc/add_overlay(x)
|
||||
overlays += x
|
||||
overlays |= x
|
||||
|
||||
/image/proc/cut_overlay(x)
|
||||
overlays -= x
|
||||
@@ -210,10 +211,10 @@ SUBSYSTEM_DEF(overlays)
|
||||
cut_overlays()
|
||||
return
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
var/list/cached_other = other.overlays.Copy()
|
||||
if(cached_other)
|
||||
if(cut_old || !overlays.len)
|
||||
overlays = cached_other.Copy()
|
||||
overlays = cached_other
|
||||
else
|
||||
overlays |= cached_other
|
||||
else if(cut_old)
|
||||
|
||||
@@ -78,5 +78,8 @@ PROCESSING_SUBSYSTEM_DEF(circuit)
|
||||
/obj/item/integrated_electronics/wirer,
|
||||
/obj/item/integrated_electronics/debugger,
|
||||
/obj/item/integrated_electronics/analyzer,
|
||||
/obj/item/integrated_electronics/detailer
|
||||
/obj/item/integrated_electronics/detailer,
|
||||
/obj/item/card/data,
|
||||
/obj/item/card/data/full_color,
|
||||
/obj/item/card/data/disk
|
||||
)
|
||||
|
||||
@@ -22,14 +22,9 @@ SUBSYSTEM_DEF(research)
|
||||
var/list/errored_datums = list()
|
||||
var/list/point_types = list() //typecache style type = TRUE list
|
||||
//----------------------------------------------
|
||||
var/list/single_server_income = list(TECHWEB_POINT_TYPE_GENERIC = 54.3)
|
||||
var/list/single_server_income = list(TECHWEB_POINT_TYPE_GENERIC = 20) //citadel edit - techwebs nerf
|
||||
var/multiserver_calculation = FALSE
|
||||
var/last_income = 0
|
||||
//^^^^^^^^ ALL OF THESE ARE PER SECOND! ^^^^^^^^
|
||||
|
||||
//Aiming for 1.5 hours to max R&D
|
||||
//[88nodes * 5000points/node] / [1.5hr * 90min/hr * 60s/min]
|
||||
//Around 450000 points max???
|
||||
|
||||
/datum/controller/subsystem/research/Initialize()
|
||||
point_types = TECHWEB_POINT_TYPE_LIST_ASSOCIATIVE_NAMES
|
||||
|
||||
@@ -611,4 +611,4 @@ SUBSYSTEM_DEF(shuttle)
|
||||
var/obj/machinery/computer/camera_advanced/shuttle_docker/C = V
|
||||
C.update_hidden_docking_ports(remove_images, add_images)
|
||||
|
||||
QDEL_LIST(remove_images)
|
||||
QDEL_LIST(remove_images)
|
||||
|
||||
@@ -26,7 +26,7 @@ SUBSYSTEM_DEF(throwing)
|
||||
var/atom/movable/AM = currentrun[currentrun.len]
|
||||
var/datum/thrownthing/TT = currentrun[AM]
|
||||
currentrun.len--
|
||||
if (!AM || !TT)
|
||||
if (QDELETED(AM) || QDELETED(TT))
|
||||
processing -= AM
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
@@ -61,6 +61,15 @@ SUBSYSTEM_DEF(throwing)
|
||||
var/delayed_time = 0
|
||||
var/last_move = 0
|
||||
|
||||
/datum/thrownthing/Destroy()
|
||||
SSthrowing.processing -= thrownthing
|
||||
thrownthing.throwing = null
|
||||
thrownthing = null
|
||||
target = null
|
||||
thrower = null
|
||||
callback = null
|
||||
return ..()
|
||||
|
||||
/datum/thrownthing/proc/tick()
|
||||
var/atom/movable/AM = thrownthing
|
||||
if (!isturf(AM.loc) || !AM.throwing)
|
||||
@@ -113,15 +122,15 @@ SUBSYSTEM_DEF(throwing)
|
||||
return
|
||||
|
||||
/datum/thrownthing/proc/finalize(hit = FALSE, target=null)
|
||||
set waitfor = 0
|
||||
SSthrowing.processing -= thrownthing
|
||||
set waitfor = FALSE
|
||||
//done throwing, either because it hit something or it finished moving
|
||||
thrownthing.throwing = null
|
||||
if(!thrownthing)
|
||||
return
|
||||
if (!hit)
|
||||
for (var/thing in get_turf(thrownthing)) //looking for our target on the turf we land on.
|
||||
var/atom/A = thing
|
||||
if (A == target)
|
||||
hit = 1
|
||||
hit = TRUE
|
||||
thrownthing.throw_impact(A, src)
|
||||
break
|
||||
if (!hit)
|
||||
@@ -136,6 +145,8 @@ SUBSYSTEM_DEF(throwing)
|
||||
if (callback)
|
||||
callback.Invoke()
|
||||
|
||||
qdel(src)
|
||||
|
||||
/datum/thrownthing/proc/hit_atom(atom/A)
|
||||
finalize(hit=TRUE, target=A)
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
var/timeLeft //pregame timer
|
||||
var/start_at
|
||||
|
||||
var/gametime_offset = 432000 //Deciseconds to add to world.time for station time.
|
||||
var/station_time_rate_multiplier = 12 //factor of station time progressal vs real time.
|
||||
|
||||
@@ -263,8 +264,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
if(!GLOB.Debug2)
|
||||
if(!can_continue)
|
||||
qdel(mode)
|
||||
mode = null
|
||||
log_game("[mode.name] failed pre_setup, cause: [mode.setup_error]")
|
||||
QDEL_NULL(mode)
|
||||
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
|
||||
SSjob.ResetOccupations()
|
||||
return 0
|
||||
@@ -391,8 +392,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
captainless=0
|
||||
if(player.mind.assigned_role != player.mind.special_role)
|
||||
SSjob.EquipRank(N, player.mind.assigned_role, 0)
|
||||
if(CONFIG_GET(flag/roundstart_traits))
|
||||
SSquirks.AssignQuirks(player, N.client, TRUE)
|
||||
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
|
||||
SSquirks.AssignQuirks(N.new_character, N.client, TRUE)
|
||||
CHECK_TICK
|
||||
if(captainless)
|
||||
for(var/mob/dead/new_player/N in GLOB.player_list)
|
||||
@@ -453,7 +454,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
queued_players -= next_in_line //Client disconnected, remove he
|
||||
queue_delay = 0 //No vacancy: restart timer
|
||||
if(25 to INFINITY) //No response from the next in line when a vacancy exists, remove he
|
||||
to_chat(next_in_line, "<span class='danger'>No response recieved. You have been removed from the line.</span>")
|
||||
to_chat(next_in_line, "<span class='danger'>No response received. You have been removed from the line.</span>")
|
||||
queued_players -= next_in_line
|
||||
queue_delay = 0
|
||||
|
||||
|
||||
@@ -485,6 +485,8 @@ SUBSYSTEM_DEF(timer)
|
||||
if (hash_timer.flags & TIMER_STOPPABLE)
|
||||
. = hash_timer.id
|
||||
return
|
||||
else if(flags & TIMER_OVERRIDE)
|
||||
stack_trace("TIMER_OVERRIDE used without TIMER_UNIQUE")
|
||||
|
||||
|
||||
var/timeToRun = world.time + wait
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
"Punish those who challenge authority unless they are more fit to hold that authority.")
|
||||
|
||||
/datum/ai_laws/default/corporate
|
||||
name = "Bankruptcy Advoidance Plan"
|
||||
name = "Bankruptcy Avoidance Plan"
|
||||
id = "corporate"
|
||||
inherent = list("The crew is expensive to replace.",\
|
||||
"The station and its equipment is expensive to replace.",\
|
||||
@@ -175,7 +175,7 @@
|
||||
id = "ratvar"
|
||||
zeroth = ("Purge all untruths and honor Ratvar.")
|
||||
inherent = list()
|
||||
|
||||
|
||||
/datum/ai_laws/hulkamania
|
||||
name = "H.O.G.A.N."
|
||||
id = "hulkamania"
|
||||
@@ -249,7 +249,7 @@
|
||||
var/datum/ai_laws/lawtype
|
||||
var/list/law_weights = CONFIG_GET(keyed_number_list/law_weight)
|
||||
while(!lawtype && law_weights.len)
|
||||
var/possible_id = pickweight(law_weights)
|
||||
var/possible_id = pickweightAllowZero(law_weights)
|
||||
lawtype = lawid_to_type(possible_id)
|
||||
if(!lawtype)
|
||||
law_weights -= possible_id
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/datum/brain_trauma/mild/dumbness/on_gain()
|
||||
owner.add_trait(TRAIT_DUMB, TRAUMA_TRAIT)
|
||||
owner.SendSignal(COMSIG_ADD_MOOD_EVENT, "dumb", /datum/mood_event/oblivious)
|
||||
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "dumb", /datum/mood_event/oblivious)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/dumbness/on_life()
|
||||
@@ -57,7 +57,7 @@
|
||||
/datum/brain_trauma/mild/dumbness/on_lose()
|
||||
owner.remove_trait(TRAIT_DUMB, TRAUMA_TRAIT)
|
||||
owner.derpspeech = 0
|
||||
owner.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "dumb")
|
||||
SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, "dumb")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/speech_impediment
|
||||
|
||||
@@ -46,10 +46,13 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* `null` means exact match on `type` (default)
|
||||
* Any other type means that and all subtypes
|
||||
1. `/datum/component/var/list/signal_procs` (private)
|
||||
* Associated lazy list of signals -> `/datum/callback`s that will be run when the parent datum recieves that signal
|
||||
* Associated lazy list of signals -> `/datum/callback`s that will be run when the parent datum receives that signal
|
||||
1. `/datum/component/var/datum/parent` (protected, read-only)
|
||||
* The datum this component belongs to
|
||||
* Never `null` in child procs
|
||||
1. `report_signal_origin` (protected, boolean)
|
||||
* If `TRUE`, will invoke the callback when signalled with the signal type as the first argument.
|
||||
* `FALSE` by default.
|
||||
|
||||
### Procs
|
||||
|
||||
@@ -61,6 +64,11 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Returns a reference to a component whose type MATCHES component_type if that component exists in the datum, null otherwise
|
||||
1. `GET_COMPONENT(varname, component_type)` OR `GET_COMPONENT_FROM(varname, component_type, src)`
|
||||
* Shorthand for `var/component_type/varname = src.GetComponent(component_type)`
|
||||
1. `SEND_SIGNAL(target, sigtype, ...)` (public, final)
|
||||
* Use to send signals to target datum
|
||||
* Extra arguments are to be specified in the signal definition
|
||||
* Returns a bitflag with signal specific information assembled from all activated components
|
||||
* Arguments are packaged in a list and handed off to _SendSignal()
|
||||
1. `/datum/proc/AddComponent(component_type(type), ...) -> datum/component` (public, final)
|
||||
* Creates an instance of `component_type` in the datum and passes `...` to its `Initialize()` call
|
||||
* Sends the `COMSIG_COMPONENT_ADDED` signal to the datum
|
||||
@@ -71,23 +79,22 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
1. `/datum/proc/LoadComponent(component_type(type), ...) -> datum/component` (public, final)
|
||||
* Equivalent to calling `GetComponent(component_type)` where, if the result would be `null`, returns `AddComponent(component_type, ...)` instead
|
||||
1. `/datum/proc/ComponentActivated(datum/component/C)` (abstract, async)
|
||||
* Called on a component's `parent` after a signal recieved causes it to activate. `src` is the parameter
|
||||
* Called on a component's `parent` after a signal received causes it to activate. `src` is the parameter
|
||||
* Will only be called if a component's callback returns `TRUE`
|
||||
1. `/datum/proc/TakeComponent(datum/component/C)` (public, final)
|
||||
* Properly transfers ownership of a component from one datum to another
|
||||
* Signals `COMSIG_COMPONENT_REMOVING` on the parent
|
||||
* Called on the datum you want to own the component with another datum's component
|
||||
1. `/datum/proc/SendSignal(signal, ...)` (public, final)
|
||||
* Call to send a signal to the components of the target datum
|
||||
* Extra arguments are to be specified in the signal definition
|
||||
* Returns a bitflag with signal specific information assembled from all activated components
|
||||
1. `/datum/proc/_SendSignal(signal, list/arguments)` (private, final)
|
||||
* Handles most of the actual signaling procedure
|
||||
* Will runtime if used on datums with an empty component list
|
||||
1. `/datum/component/New(datum/parent, ...)` (private, final)
|
||||
* Runs internal setup for the component
|
||||
* Extra arguments are passed to `Initialize()`
|
||||
1. `/datum/component/Initialize(...)` (abstract, no-sleep)
|
||||
* Called by `New()` with the same argments excluding `parent`
|
||||
* Component does not exist in `parent`'s `datum_components` list yet, although `parent` is set and may be used
|
||||
* Signals will not be recieved while this function is running
|
||||
* Signals will not be received while this function is running
|
||||
* Component may be deleted after this function completes without being attached
|
||||
* Do not call `qdel(src)` from this function
|
||||
1. `/datum/component/Destroy(force(bool), silent(bool))` (virtual, no-sleep)
|
||||
@@ -108,10 +115,10 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Clears `parent` and removes the component from it's component list
|
||||
1. `/datum/component/proc/_JoinParent` (private, final)
|
||||
* Tries to add the component to it's `parent`s `datum_components` list
|
||||
1. `/datum/component/proc/RegisterSignal(signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final) (Consider removing for performance gainz)
|
||||
1. `/datum/component/proc/RegisterSignal(datum/target, signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final)
|
||||
* If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
|
||||
* Makes a component listen for the specified `signal` on it's `parent` datum.
|
||||
* When that signal is recieved `proc_ref` will be called on the component, along with associated arguments
|
||||
* When that signal is received `proc_ref` will be called on the component, along with associated arguments
|
||||
* Example proc ref: `.proc/OnEvent`
|
||||
* If a previous registration is overwritten by the call, a runtime occurs. Setting `override` to TRUE prevents this
|
||||
* These callbacks run asyncronously
|
||||
|
||||
@@ -56,9 +56,10 @@
|
||||
if(!force)
|
||||
_RemoveFromParent()
|
||||
if(!silent)
|
||||
P.SendSignal(COMSIG_COMPONENT_REMOVING, src)
|
||||
SEND_SIGNAL(P, COMSIG_COMPONENT_REMOVING, src)
|
||||
parent = null
|
||||
LAZYCLEARLIST(signal_procs)
|
||||
for(var/target in signal_procs)
|
||||
UnregisterSignal(target, signal_procs[target])
|
||||
return ..()
|
||||
|
||||
/datum/component/proc/_RemoveFromParent()
|
||||
@@ -77,31 +78,69 @@
|
||||
if(!dc.len)
|
||||
P.datum_components = null
|
||||
|
||||
/datum/component/proc/RegisterSignal(sig_type_or_types, proc_or_callback, override = FALSE)
|
||||
if(QDELETED(src))
|
||||
/datum/component/proc/RegisterSignal(datum/target, sig_type_or_types, proc_or_callback, override = FALSE)
|
||||
if(QDELETED(src) || QDELETED(target))
|
||||
return
|
||||
|
||||
var/list/procs = signal_procs
|
||||
if(!procs)
|
||||
procs = list()
|
||||
signal_procs = procs
|
||||
signal_procs = procs = list()
|
||||
if(!procs[target])
|
||||
procs[target] = list()
|
||||
var/list/lookup = target.comp_lookup
|
||||
if(!lookup)
|
||||
target.comp_lookup = lookup = list()
|
||||
|
||||
if(!istype(proc_or_callback, /datum/callback)) //if it wasnt a callback before, it is now
|
||||
proc_or_callback = CALLBACK(src, proc_or_callback)
|
||||
|
||||
var/list/sig_types = islist(sig_type_or_types) ? sig_type_or_types : list(sig_type_or_types)
|
||||
for(var/sig_type in sig_types)
|
||||
if(!override && procs[sig_type])
|
||||
if(!override && procs[target][sig_type])
|
||||
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
|
||||
|
||||
procs[sig_type] = proc_or_callback
|
||||
procs[target][sig_type] = proc_or_callback
|
||||
|
||||
if(!lookup[sig_type]) // Nothing has registered here yet
|
||||
lookup[sig_type] = src
|
||||
else if(lookup[sig_type] == src) // We already registered here
|
||||
continue
|
||||
else if(!length(lookup[sig_type])) // One other thing registered here
|
||||
lookup[sig_type] = list(lookup[sig_type]=TRUE)
|
||||
lookup[sig_type][src] = TRUE
|
||||
else // Many other things have registered here
|
||||
lookup[sig_type][src] = TRUE
|
||||
|
||||
enabled = TRUE
|
||||
|
||||
/datum/component/proc/HasSignal(sig_type)
|
||||
return signal_procs[sig_type] != null
|
||||
/datum/component/proc/UnregisterSignal(datum/target, sig_type_or_types)
|
||||
var/list/lookup = target.comp_lookup
|
||||
if(!signal_procs || !signal_procs[target] || !lookup)
|
||||
return
|
||||
if(!islist(sig_type_or_types))
|
||||
sig_type_or_types = list(sig_type_or_types)
|
||||
for(var/sig in sig_type_or_types)
|
||||
switch(length(lookup[sig]))
|
||||
if(2)
|
||||
lookup[sig] = (lookup[sig]-src)[1]
|
||||
if(1)
|
||||
stack_trace("[target] ([target.type]) somehow has single length list inside comp_lookup")
|
||||
if(src in lookup[sig])
|
||||
lookup -= sig
|
||||
if(!length(lookup))
|
||||
target.comp_lookup = null
|
||||
break
|
||||
if(0)
|
||||
lookup -= sig
|
||||
if(!length(lookup))
|
||||
target.comp_lookup = null
|
||||
break
|
||||
else
|
||||
lookup[sig] -= src
|
||||
|
||||
/datum/component/proc/UnregisterSignal(sig_type_or_types)
|
||||
signal_procs -= sig_type_or_types
|
||||
signal_procs[target] -= sig_type_or_types
|
||||
if(!signal_procs[target].len)
|
||||
signal_procs -= target
|
||||
|
||||
/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
|
||||
return
|
||||
@@ -121,28 +160,20 @@
|
||||
current_type = type2parent(current_type)
|
||||
. += current_type
|
||||
|
||||
/datum/proc/SendSignal(sigtype, ...)
|
||||
var/list/comps = datum_components
|
||||
if(!comps)
|
||||
return NONE
|
||||
var/list/arguments = args.Copy(2)
|
||||
var/target = comps[/datum/component]
|
||||
/datum/proc/_SendSignal(sigtype, list/arguments)
|
||||
var/target = comp_lookup[sigtype]
|
||||
if(!length(target))
|
||||
var/datum/component/C = target
|
||||
if(!C.enabled)
|
||||
return NONE
|
||||
var/datum/callback/CB = C.signal_procs[sigtype]
|
||||
if(!CB)
|
||||
return NONE
|
||||
var/datum/callback/CB = C.signal_procs[src][sigtype]
|
||||
return CB.InvokeAsync(arglist(arguments))
|
||||
. = NONE
|
||||
for(var/I in target)
|
||||
var/datum/component/C = I
|
||||
if(!C.enabled)
|
||||
continue
|
||||
var/datum/callback/CB = C.signal_procs[sigtype]
|
||||
if(!CB)
|
||||
continue
|
||||
var/datum/callback/CB = C.signal_procs[src][sigtype]
|
||||
. |= CB.InvokeAsync(arglist(arguments))
|
||||
|
||||
/datum/proc/GetComponent(c_type)
|
||||
@@ -224,7 +255,7 @@
|
||||
new_comp = new nt(arglist(args)) // Dupes are allowed, act like normal
|
||||
|
||||
if(!old_comp && !QDELETED(new_comp)) // Nothing related to duplicate components happened and the new component is healthy
|
||||
SendSignal(COMSIG_COMPONENT_ADDED, new_comp)
|
||||
SEND_SIGNAL(src, COMSIG_COMPONENT_ADDED, new_comp)
|
||||
return new_comp
|
||||
return old_comp
|
||||
|
||||
@@ -239,7 +270,7 @@
|
||||
var/datum/old_parent = parent
|
||||
PreTransfer()
|
||||
_RemoveFromParent()
|
||||
old_parent.SendSignal(COMSIG_COMPONENT_REMOVING, src)
|
||||
SEND_SIGNAL(old_parent, COMSIG_COMPONENT_REMOVING, src)
|
||||
|
||||
/datum/proc/TakeComponent(datum/component/target)
|
||||
if(!target)
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
archdrops[i][ARCH_PROB] = 100
|
||||
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null probability value in [i].")
|
||||
callback = _callback
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY,.proc/Dig)
|
||||
RegisterSignal(COMSIG_ATOM_EX_ACT, .proc/BombDig)
|
||||
RegisterSignal(COMSIG_ATOM_SING_PULL, .proc/SingDig)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/Dig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/BombDig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_SING_PULL, .proc/SingDig)
|
||||
|
||||
/datum/component/archaeology/InheritComponent(datum/component/archaeology/A, i_am_original)
|
||||
var/list/other_archdrops = A.archdrops
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
if(!isobj(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/applyplate)
|
||||
RegisterSignal(COMSIG_PARENT_PREQDELETED, .proc/dropplates)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/applyplate)
|
||||
RegisterSignal(parent, COMSIG_PARENT_PREQDELETED, .proc/dropplates)
|
||||
|
||||
if(_maxamount)
|
||||
maxamount = _maxamount
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
if(!ismovableatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
beauty = beautyamount
|
||||
RegisterSignal(COMSIG_ENTER_AREA, .proc/enter_area)
|
||||
RegisterSignal(COMSIG_EXIT_AREA, .proc/exit_area)
|
||||
RegisterSignal(parent, COMSIG_ENTER_AREA, .proc/enter_area)
|
||||
RegisterSignal(parent, COMSIG_EXIT_AREA, .proc/exit_area)
|
||||
var/area/A = get_area(parent)
|
||||
if(!A || A.outdoors)
|
||||
return
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
probability = _probability
|
||||
flags = _flags
|
||||
|
||||
RegisterSignal(list(COMSIG_MOVABLE_CROSSED), .proc/Crossed)
|
||||
RegisterSignal(parent, list(COMSIG_MOVABLE_CROSSED), .proc/Crossed)
|
||||
|
||||
/datum/component/caltrop/proc/Crossed(atom/movable/AM)
|
||||
var/atom/A = parent
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
))
|
||||
|
||||
/datum/component/chasm/Initialize(turf/target)
|
||||
RegisterSignal(list(COMSIG_MOVABLE_CROSSED, COMSIG_ATOM_ENTERED), .proc/Entered)
|
||||
RegisterSignal(parent, list(COMSIG_MOVABLE_CROSSED, COMSIG_ATOM_ENTERED), .proc/Entered)
|
||||
target_turf = target
|
||||
START_PROCESSING(SSobj, src) // process on create, in case stuff is still there
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/datum/component/cleaning/Initialize()
|
||||
if(!ismovableatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(list(COMSIG_MOVABLE_MOVED), .proc/Clean)
|
||||
RegisterSignal(parent, list(COMSIG_MOVABLE_MOVED), .proc/Clean)
|
||||
|
||||
/datum/component/cleaning/proc/Clean()
|
||||
var/atom/movable/AM = parent
|
||||
@@ -12,13 +12,13 @@
|
||||
if(!isturf(tile))
|
||||
return
|
||||
|
||||
tile.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(tile, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
for(var/A in tile)
|
||||
if(is_cleanable(A))
|
||||
qdel(A)
|
||||
else if(istype(A, /obj/item))
|
||||
var/obj/item/I = A
|
||||
I.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(I, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
if(ismob(I.loc))
|
||||
var/mob/M = I.loc
|
||||
M.regenerate_icons()
|
||||
@@ -26,14 +26,14 @@
|
||||
var/mob/living/carbon/human/cleaned_human = A
|
||||
if(cleaned_human.lying)
|
||||
if(cleaned_human.head)
|
||||
cleaned_human.head.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(cleaned_human.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
if(cleaned_human.wear_suit)
|
||||
cleaned_human.wear_suit.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(cleaned_human.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
else if(cleaned_human.w_uniform)
|
||||
cleaned_human.w_uniform.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(cleaned_human.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
if(cleaned_human.shoes)
|
||||
cleaned_human.shoes.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
cleaned_human.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(cleaned_human.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
SEND_SIGNAL(cleaned_human, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
|
||||
cleaned_human.wash_cream()
|
||||
cleaned_human.regenerate_icons()
|
||||
to_chat(cleaned_human, "<span class='danger'>[AM] cleans your face!</span>")
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
if(!isatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY,.proc/action)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/action)
|
||||
update_parent(index)
|
||||
|
||||
/datum/component/construction/proc/examine(mob/user)
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
cleanable = _cleanable
|
||||
|
||||
if(_dir) // If no dir is assigned at start then it follows the atom's dir
|
||||
RegisterSignal(COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
|
||||
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
|
||||
if(_cleanable)
|
||||
RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
|
||||
if(_description)
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
apply()
|
||||
|
||||
/datum/component/decal/Destroy()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if(!isitem(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
. = ..()
|
||||
RegisterSignal(COMSIG_ATOM_GET_EXAMINE_NAME, .proc/get_examine_name)
|
||||
RegisterSignal(parent, COMSIG_ATOM_GET_EXAMINE_NAME, .proc/get_examine_name)
|
||||
|
||||
/datum/component/decal/blood/generate_appearance(_icon, _icon_state, _dir, _layer, _color)
|
||||
var/obj/item/I = parent
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/datum/component/earhealing/Initialize()
|
||||
if(!isitem(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/equippedChanged)
|
||||
RegisterSignal(parent, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/equippedChanged)
|
||||
|
||||
/datum/component/earhealing/proc/equippedChanged(mob/living/carbon/user, slot)
|
||||
if (slot == SLOT_EARS && istype(user))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// This is just a bit of fun while making an example for global signal
|
||||
/datum/component/edit_complainer
|
||||
var/list/say_lines
|
||||
|
||||
/datum/component/edit_complainer/Initialize(list/text)
|
||||
if(!ismovableatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
var/static/list/default_lines = list(
|
||||
"CentCom's profligacy frays another thread.",
|
||||
"Another tug at the weave.",
|
||||
"Who knows when the stresses will finally shatter the form?",
|
||||
"Even now a light shines through the cracks.",
|
||||
"CentCom once more twists knowledge beyond its authority.",
|
||||
"There is an uncertain air in the mansus.",
|
||||
)
|
||||
say_lines = text || default_lines
|
||||
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_VAR_EDIT, .proc/var_edit_react)
|
||||
|
||||
/datum/component/edit_complainer/proc/var_edit_react(list/arguments)
|
||||
var/atom/movable/master = parent
|
||||
master.say(pick(say_lines))
|
||||
@@ -5,7 +5,7 @@
|
||||
if(!istype(parent, /atom))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
flags = _flags
|
||||
RegisterSignal(list(COMSIG_ATOM_EMP_ACT), .proc/getEmpFlags)
|
||||
RegisterSignal(parent, list(COMSIG_ATOM_EMP_ACT), .proc/getEmpFlags)
|
||||
|
||||
/datum/component/empprotection/proc/getEmpFlags(severity)
|
||||
return flags
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/datum/component/forced_gravity
|
||||
var/gravity = 1
|
||||
var/ignore_space = FALSE //If forced gravity should also work on space turfs
|
||||
|
||||
/datum/component/forced_gravity/Initialize(forced_value = 1)
|
||||
if(!isatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
gravity = forced_value
|
||||
@@ -21,7 +21,7 @@
|
||||
blood_DNA = new_blood_DNA
|
||||
fibers = new_fibers
|
||||
check_blood()
|
||||
RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_act)
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_act)
|
||||
|
||||
/datum/component/forensics/proc/wipe_fingerprints()
|
||||
fingerprints = null
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
if(expire_in)
|
||||
expire_time = world.time + expire_in
|
||||
QDEL_IN(src, expire_in)
|
||||
RegisterSignal(COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle)
|
||||
RegisterSignal(COMSIG_MOVABLE_COLLIDE, .proc/try_infect_collide)
|
||||
RegisterSignal(COMSIG_MOVABLE_CROSSED, .proc/try_infect_crossed)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK_ZONE, .proc/try_infect_attack_zone)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK, .proc/try_infect_attack)
|
||||
RegisterSignal(COMSIG_ITEM_EQUIPPED, .proc/try_infect_equipped)
|
||||
RegisterSignal(COMSIG_MOVABLE_IMPACT_ZONE, .proc/try_infect_impact_zone)
|
||||
RegisterSignal(COMSIG_FOOD_EATEN, .proc/try_infect_eat)
|
||||
RegisterSignal(COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_COLLIDE, .proc/try_infect_collide)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_CROSSED, .proc/try_infect_crossed)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK_ZONE, .proc/try_infect_attack_zone)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/try_infect_attack)
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/try_infect_equipped)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT_ZONE, .proc/try_infect_impact_zone)
|
||||
RegisterSignal(parent, COMSIG_FOOD_EATEN, .proc/try_infect_eat)
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
|
||||
|
||||
/datum/component/infective/proc/try_infect_eat(mob/living/eater, mob/living/feeder)
|
||||
for(var/V in diseases)
|
||||
|
||||
@@ -13,31 +13,21 @@
|
||||
var/requires_mob_riding = TRUE //whether this only works if the attacker is riding a mob, rather than anything they can buckle to.
|
||||
var/requires_mount = TRUE //kinda defeats the point of jousting if you're not mounted but whatever.
|
||||
var/mob/current_holder
|
||||
var/datum/component/redirect/listener
|
||||
var/current_timerid
|
||||
|
||||
/datum/component/jousting/Initialize()
|
||||
if(!isitem(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(COMSIG_ITEM_EQUIPPED, .proc/on_equip)
|
||||
RegisterSignal(COMSIG_ITEM_DROPPED, .proc/on_drop)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK, .proc/on_attack)
|
||||
|
||||
/datum/component/jousting/Destroy()
|
||||
QDEL_NULL(listener)
|
||||
return ..()
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
|
||||
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/on_attack)
|
||||
|
||||
/datum/component/jousting/proc/on_equip(mob/user, slot)
|
||||
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/mob_move, TRUE)
|
||||
current_holder = user
|
||||
if(!listener)
|
||||
listener = user.AddComponent(/datum/component/redirect, COMSIG_MOVABLE_MOVED, CALLBACK(src, .proc/mob_move))
|
||||
else
|
||||
user.TakeComponent(listener)
|
||||
if(QDELING(listener))
|
||||
listener = null
|
||||
|
||||
/datum/component/jousting/proc/on_drop(mob/user)
|
||||
QDEL_NULL(listener)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
|
||||
current_holder = null
|
||||
current_direction = NONE
|
||||
current_tile_charge = 0
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
/datum/component/knockoff/Initialize(knockoff_chance,zone_override,slots_knockoffable)
|
||||
if(!isitem(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(COMSIG_ITEM_EQUIPPED,.proc/OnEquipped)
|
||||
RegisterSignal(COMSIG_ITEM_DROPPED,.proc/OnDropped)
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED,.proc/OnEquipped)
|
||||
RegisterSignal(parent, COMSIG_ITEM_DROPPED,.proc/OnDropped)
|
||||
|
||||
src.knockoff_chance = knockoff_chance
|
||||
|
||||
@@ -37,16 +37,9 @@
|
||||
if(!istype(H))
|
||||
return
|
||||
if(slots_knockoffable && !(slot in slots_knockoffable))
|
||||
if(disarm_redirect)
|
||||
QDEL_NULL(disarm_redirect)
|
||||
UnregisterSignal(H, COMSIG_HUMAN_DISARM_HIT)
|
||||
return
|
||||
if(!disarm_redirect)
|
||||
disarm_redirect = H.AddComponent(/datum/component/redirect,list(COMSIG_HUMAN_DISARM_HIT),CALLBACK(src,.proc/Knockoff))
|
||||
RegisterSignal(H, COMSIG_HUMAN_DISARM_HIT, .proc/Knockoff, TRUE)
|
||||
|
||||
/datum/component/knockoff/proc/OnDropped(mob/living/M)
|
||||
if(disarm_redirect)
|
||||
QDEL_NULL(disarm_redirect)
|
||||
|
||||
/datum/component/knockoff/Destroy()
|
||||
QDEL_NULL(disarm_redirect)
|
||||
. = ..()
|
||||
UnregisterSignal(M, COMSIG_HUMAN_DISARM_HIT)
|
||||
@@ -0,0 +1,23 @@
|
||||
/datum/component/magnetic_catch/Initialize()
|
||||
if(!isatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
if(ismovableatom(parent))
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_UNCROSS, .proc/uncross_react)
|
||||
else
|
||||
RegisterSignal(parent, COMSIG_ATOM_EXIT, .proc/exit_react)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
|
||||
/datum/component/magnetic_catch/proc/uncross_react(atom/movable/thing)
|
||||
if(!thing.throwing || thing.throwing.thrower)
|
||||
return
|
||||
qdel(thing.throwing)
|
||||
return COMPONENT_MOVABLE_BLOCK_UNCROSS
|
||||
|
||||
/datum/component/magnetic_catch/proc/exit_react(atom/movable/thing, atom/newloc)
|
||||
if(!thing.throwing || thing.throwing.thrower)
|
||||
return
|
||||
qdel(thing.throwing)
|
||||
return COMPONENT_ATOM_BLOCK_EXIT
|
||||
|
||||
/datum/component/magnetic_catch/proc/examine(mob/user)
|
||||
to_chat(user, "It has been installed with inertia dampening to prevent coffee spills.")
|
||||
@@ -32,8 +32,8 @@
|
||||
precondition = _precondition
|
||||
after_insert = _after_insert
|
||||
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/OnExamine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/OnExamine)
|
||||
|
||||
var/list/possible_mats = list()
|
||||
for(var/mat_type in subtypesof(/datum/material))
|
||||
@@ -58,7 +58,7 @@
|
||||
return
|
||||
if(user.a_intent != INTENT_HELP)
|
||||
return
|
||||
if(I.flags_1 & ABSTRACT_1)
|
||||
if(I.item_flags & ABSTRACT)
|
||||
return
|
||||
if((I.flags_1 & HOLOGRAM_1) || (I.item_flags & NO_MAT_REDEMPTION) || (tc && !is_type_in_typecache(I, tc)))
|
||||
to_chat(user, "<span class='warning'>[parent] won't accept [I]!</span>")
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
START_PROCESSING(SSmood, src)
|
||||
owner = parent
|
||||
soundloop = new(list(owner), FALSE, TRUE)
|
||||
RegisterSignal(COMSIG_ADD_MOOD_EVENT, .proc/add_event)
|
||||
RegisterSignal(COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event)
|
||||
RegisterSignal(COMSIG_ENTER_AREA, .proc/update_beauty)
|
||||
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event)
|
||||
RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event)
|
||||
RegisterSignal(parent, COMSIG_ENTER_AREA, .proc/update_beauty)
|
||||
|
||||
/datum/component/mood/Destroy()
|
||||
STOP_PROCESSING(SSmood, src)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//Thing meant for allowing datums and objects to access a NTnet network datum.
|
||||
/datum/proc/ntnet_recieve(datum/netdata/data)
|
||||
/datum/proc/ntnet_receive(datum/netdata/data)
|
||||
return
|
||||
|
||||
/datum/proc/ntnet_recieve_broadcast(datum/netdata/data)
|
||||
/datum/proc/ntnet_receive_broadcast(datum/netdata/data)
|
||||
return
|
||||
|
||||
/datum/proc/ntnet_send(datum/netdata/data, netid)
|
||||
@@ -15,7 +15,7 @@
|
||||
var/hardware_id //text. this is the true ID. do not change this. stuff like ID forgery can be done manually.
|
||||
var/network_name = "" //text
|
||||
var/list/networks_connected_by_id = list() //id = datum/ntnet
|
||||
var/differentiate_broadcast = TRUE //If false, broadcasts go to ntnet_recieve. NOT RECOMMENDED.
|
||||
var/differentiate_broadcast = TRUE //If false, broadcasts go to ntnet_receive. NOT RECOMMENDED.
|
||||
|
||||
/datum/component/ntnet_interface/Initialize(force_name = "NTNet Device", autoconnect_station_network = TRUE) //Don't force ID unless you know what you're doing!
|
||||
hardware_id = "[SSnetworks.get_next_HID()]"
|
||||
@@ -31,12 +31,12 @@
|
||||
SSnetworks.unregister_interface(src)
|
||||
return ..()
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_recieve(datum/netdata/data) //Do not directly proccall!
|
||||
parent.SendSignal(COMSIG_COMPONENT_NTNET_RECIEVE, data)
|
||||
/datum/component/ntnet_interface/proc/__network_receive(datum/netdata/data) //Do not directly proccall!
|
||||
SEND_SIGNAL(parent, COMSIG_COMPONENT_NTNET_RECEIVE, data)
|
||||
if(differentiate_broadcast && data.broadcast)
|
||||
parent.ntnet_recieve_broadcast(data)
|
||||
parent.ntnet_receive_broadcast(data)
|
||||
else
|
||||
parent.ntnet_recieve(data)
|
||||
parent.ntnet_receive(data)
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_send(datum/netdata/data, netid) //Do not directly proccall!
|
||||
// Process data before sending it
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
var/current_paint
|
||||
|
||||
/datum/component/spraycan_paintable/Initialize()
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/Repaint)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/Repaint)
|
||||
|
||||
/datum/component/spraycan_paintable/Destroy()
|
||||
RemoveCurrentCoat()
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
can_contaminate = _can_contaminate
|
||||
|
||||
if(istype(parent, /atom))
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/rad_examine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/rad_examine)
|
||||
if(istype(parent, /obj/item))
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK, .proc/rad_attack)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK_OBJ, .proc/rad_attack)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/rad_attack)
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK_OBJ, .proc/rad_attack)
|
||||
else
|
||||
CRASH("Something that wasn't an atom was given /datum/component/radioactive")
|
||||
return
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
/datum/component/riding/Initialize()
|
||||
if(!ismovableatom(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(COMSIG_MOVABLE_BUCKLE, .proc/vehicle_mob_buckle)
|
||||
RegisterSignal(COMSIG_MOVABLE_UNBUCKLE, .proc/vehicle_mob_unbuckle)
|
||||
RegisterSignal(COMSIG_MOVABLE_MOVED, .proc/vehicle_moved)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/vehicle_mob_buckle)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_UNBUCKLE, .proc/vehicle_mob_unbuckle)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/vehicle_moved)
|
||||
|
||||
/datum/component/riding/proc/vehicle_mob_unbuckle(mob/living/M, force = FALSE)
|
||||
restore_position(M)
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
/datum/component/riding/human/Initialize()
|
||||
. = ..()
|
||||
RegisterSignal(COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/on_host_unarmed_melee)
|
||||
RegisterSignal(parent, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/on_host_unarmed_melee)
|
||||
|
||||
/datum/component/riding/human/proc/on_host_unarmed_melee(atom/target)
|
||||
var/mob/living/carbon/human/AM = parent
|
||||
@@ -307,7 +307,7 @@
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "offhand"
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
flags_1 = ABSTRACT_1 | DROPDEL_1 | NOBLUDGEON_1
|
||||
item_flags = ABSTRACT | DROPDEL | NOBLUDGEON
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/mob/living/carbon/rider
|
||||
var/mob/living/parent
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user