Merge branch 'master' into mirror-38933

This commit is contained in:
kevinz000
2018-07-14 15:26:49 -07:00
committed by GitHub
1555 changed files with 162517 additions and 36374 deletions
+1
View File
@@ -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"
+2 -2
View File
@@ -19,8 +19,8 @@
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = TRUE;Processor.processing += Datum}
#define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = FALSE;Processor.processing -= Datum
#define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
#define STOP_PROCESSING(Processor, Datum) Datum.datum_flags &= ~DF_ISPROCESSING;Processor.processing -= Datum
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
+17 -1
View File
@@ -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
View File
@@ -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
+3
View File
@@ -58,7 +58,9 @@
#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_FULLMONTY_NONAME(user)]"
#define ADMIN_JMP(src) "(<a href='?_src_=holder;[HrefToken(TRUE)];adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)"
#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]"
#define AREACOORD(src) "[src ? "[get_area_name(src, TRUE)] ([src.x], [src.y], [src.z])" : "nonexistent location"]"
#define ADMIN_COORDJMP(src) "[src ? "[COORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]"
#define ADMIN_VERBOSEJMP(src) "[src ? "[AREACOORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]"
#define ADMIN_INDIVIDUALLOG(user) "(<a href='?_src_=holder;[HrefToken(TRUE)];individuallog=[REF(user)]'>LOGS</a>)"
#define ADMIN_PUNISHMENT_LIGHTNING "Lightning bolt"
@@ -67,6 +69,7 @@
#define ADMIN_PUNISHMENT_BSA "Bluespace Artillery Device"
#define ADMIN_PUNISHMENT_FIREBALL "Fireball"
#define ADMIN_PUNISHMENT_ROD "Immovable Rod"
#define ADMIN_PUNISHMENT_SUPPLYPOD "Supply Pod"
#define AHELP_ACTIVE 1
#define AHELP_CLOSED 2
+44 -13
View File
@@ -194,6 +194,37 @@
#define ATMOS_GAS_MONITOR_WASTE_ENGINE "engine-waste_out"
#define ATMOS_GAS_MONITOR_WASTE_ATMOS "atmos-waste_out"
//AIRLOCK CONTROLLER TAGS
//RnD toxins burn chamber
#define INCINERATOR_TOXMIX_IGNITER "toxmix_igniter"
#define INCINERATOR_TOXMIX_VENT "toxmix_vent"
#define INCINERATOR_TOXMIX_DP_VENTPUMP "toxmix_airlock_pump"
#define INCINERATOR_TOXMIX_AIRLOCK_SENSOR "toxmix_airlock_sensor"
#define INCINERATOR_TOXMIX_AIRLOCK_CONTROLLER "toxmix_airlock_controller"
#define INCINERATOR_TOXMIX_AIRLOCK_INTERIOR "toxmix_airlock_interior"
#define INCINERATOR_TOXMIX_AIRLOCK_EXTERIOR "toxmix_airlock_exterior"
//Atmospherics/maintenance incinerator
#define INCINERATOR_ATMOS_IGNITER "atmos_incinerator_igniter"
#define INCINERATOR_ATMOS_MAINVENT "atmos_incinerator_mainvent"
#define INCINERATOR_ATMOS_AUXVENT "atmos_incinerator_auxvent"
#define INCINERATOR_ATMOS_DP_VENTPUMP "atmos_incinerator_airlock_pump"
#define INCINERATOR_ATMOS_AIRLOCK_SENSOR "atmos_incinerator_airlock_sensor"
#define INCINERATOR_ATMOS_AIRLOCK_CONTROLLER "atmos_incinerator_airlock_controller"
#define INCINERATOR_ATMOS_AIRLOCK_INTERIOR "atmos_incinerator_airlock_interior"
#define INCINERATOR_ATMOS_AIRLOCK_EXTERIOR "atmos_incinerator_airlock_exterior"
//Syndicate lavaland base incinerator (lavaland_surface_syndicate_base1.dmm)
#define INCINERATOR_SYNDICATELAVA_IGNITER "syndicatelava_igniter"
#define INCINERATOR_SYNDICATELAVA_MAINVENT "syndicatelava_mainvent"
#define INCINERATOR_SYNDICATELAVA_AUXVENT "syndicatelava_auxvent"
#define INCINERATOR_SYNDICATELAVA_DP_VENTPUMP "syndicatelava_airlock_pump"
#define INCINERATOR_SYNDICATELAVA_AIRLOCK_SENSOR "syndicatelava_airlock_sensor"
#define INCINERATOR_SYNDICATELAVA_AIRLOCK_CONTROLLER "syndicatelava_airlock_controller"
#define INCINERATOR_SYNDICATELAVA_AIRLOCK_INTERIOR "syndicatelava_airlock_interior"
#define INCINERATOR_SYNDICATELAVA_AIRLOCK_EXTERIOR "syndicatelava_airlock_exterior"
//MULTIPIPES
//IF YOU EVER CHANGE THESE CHANGE SPRITES TO MATCH.
#define PIPING_LAYER_MIN 1
@@ -217,16 +248,16 @@
#define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) };
GLOBAL_LIST_INIT(pipe_paint_colors, list(
"Amethyst" = rgb(130,43,255), //supplymain
"Blue" = rgb(0,0,255),
"Brown" = rgb(178,100,56),
"Cyan" = rgb(0,255,249),
"Dark" = rgb(69,69,69),
"Green" = rgb(30,255,0),
"Grey" = rgb(255,255,255),
"Orange" = rgb(255,129,25),
"Purple" = rgb(128,0,182),
"Red" = rgb(255,0,0),
"Violet" = rgb(64,0,128),
"Yellow" = rgb(255,198,0)
))
"amethyst" = rgb(130,43,255), //supplymain
"blue" = rgb(0,0,255),
"brown" = rgb(178,100,56),
"cyan" = rgb(0,255,249),
"dark" = rgb(69,69,69),
"green" = rgb(30,255,0),
"grey" = rgb(255,255,255),
"orange" = rgb(255,129,25),
"purple" = rgb(128,0,182),
"red" = rgb(255,0,0),
"violet" = rgb(64,0,128),
"yellow" = rgb(255,198,0)
))
+51 -2
View File
@@ -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,21 +103,32 @@
#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 Signals
#define COMSIG_MOB_RECEIVE_MAGIC "mob_receive_magic" //from base of mob/anti_magic_check(): (magic, holy, protection_sources)
#define COMPONENT_BLOCK_MAGIC 1
// /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))
// /obj signals
#define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled)
#define COMSIG_OBJ_SETANCHORED "obj_setanchored" //called in /obj/structure/setAnchored(): (value)
// /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 +136,28 @@
// /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 +177,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.
-9
View File
@@ -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
@@ -45,11 +41,6 @@
#define GLASS_CORE 4
#define AI_READY_CORE 5
//emitter construction defines
#define EM_UNSECURED 0
#define EM_SECURED 1
#define EM_WELDED 2
//Construction defines for the pinion airlock
#define GEAR_SECURE 1
#define GEAR_LOOSE 2
+24 -14
View File
@@ -9,32 +9,28 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
// for /datum/var/datum_flags
#define DF_USE_TAG (1<<0)
#define DF_VAR_EDITED (1<<1)
#define DF_ISPROCESSING (1<<2)
//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 NO_EMP_WIRES_1 (1<<12)
#define HOLOGRAM_1 (1<<13)
#define TESLA_IGNORE_1 (1<<14) // TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define HOLOGRAM_1 (1<<12)
#define TESLA_IGNORE_1 (1<<13) // TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define INITIALIZED_1 (1<<14) //Whether /atom/Initialize() has already run for the object
#define ADMIN_SPAWNED_1 (1<<15) //was this spawned by an admin? used for stat tracking stuff.
//turf-only flags
#define NOJAUNT_1 (1<<0)
#define UNUSED_TRANSIT_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 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_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
@@ -66,3 +62,17 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define ACID_PROOF (1<<5) //acid stuck on it doesn't melt it.
#define INDESTRUCTIBLE (1<<6) //doesn't take damage
#define FREEZE_PROOF (1<<7) //can't be frozen
//tesla_zap
#define TESLA_MACHINE_EXPLOSIVE (1<<0)
#define TESLA_ALLOW_DUPLICATES (1<<1)
#define TESLA_OBJ_DAMAGE (1<<2)
#define TESLA_MOB_DAMAGE (1<<3)
#define TESLA_MOB_STUN (1<<4)
#define TESLA_DEFAULT_FLAGS ALL
//EMP protection
#define EMP_PROTECT_SELF (1<<0)
#define EMP_PROTECT_CONTENTS (1<<1)
#define EMP_PROTECT_WIRES (1<<2)
+1 -1
View File
@@ -181,7 +181,7 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(
#define is_glass_sheet(O) (is_type_in_typecache(O, GLOB.glass_sheet_types))
#define iseffect(O) (is_type_in_typecache(O, GLOB.typecache_effect))
#define iseffect(O) (istype(O, /obj/effect))
#define isblobmonster(O) (istype(O, /mob/living/simple_animal/hostile/blob))
+5 -1
View File
@@ -14,10 +14,14 @@
#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"
#define INDIVIDUAL_SAY_LOG "Say log"
#define INDIVIDUAL_EMOTE_LOG "Emote log"
#define INDIVIDUAL_OOC_LOG "OOC log"
#define INDIVIDUAL_SHOW_ALL_LOG "All logs"
#define INDIVIDUAL_OWNERSHIP_LOG "Ownership log"
#define INDIVIDUAL_SHOW_ALL_LOG "All logs"
#define LOGSRC_CLIENT "Client"
#define LOGSRC_MOB "Mob"
+7 -2
View File
@@ -33,7 +33,7 @@ require only minor tweaks.
#define ZTRAIT_STATION "Station"
#define ZTRAIT_MINING "Mining"
#define ZTRAIT_REEBE "Reebe"
#define ZTRAIT_TRANSIT "Transit"
#define ZTRAIT_RESERVED "Transit/Reserved"
#define ZTRAIT_AWAY "Away Mission"
#define ZTRAIT_SPACE_RUINS "Space Ruins"
#define ZTRAIT_LAVA_RUINS "Lava Ruins"
@@ -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"
@@ -55,7 +58,7 @@ require only minor tweaks.
#define CROSSLINKED "Cross"
// default trait definitions, used by SSmapping
#define ZTRAITS_CENTCOM list(ZTRAIT_LINKAGE = SELFLOOPING, ZTRAIT_CENTCOM = TRUE)
#define ZTRAITS_CENTCOM list(ZTRAIT_CENTCOM = TRUE)
#define ZTRAITS_STATION list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_STATION = TRUE)
#define ZTRAITS_SPACE list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_SPACE_RUINS = TRUE)
#define ZTRAITS_LAVALAND list(ZTRAIT_MINING = TRUE, ZTRAIT_LAVA_RUINS = TRUE, ZTRAIT_BOMBCAP_MULTIPLIER = 2)
@@ -76,6 +79,8 @@ require only minor tweaks.
#define CAMERA_LOCK_CENTCOM 4
#define CAMERA_LOCK_REEBE 8
//Reserved/Transit turf type
#define RESERVED_TURF_TYPE /turf/open/space/basic //What the turf is when not being used
//Ruin Generation
+9 -2
View File
@@ -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)
@@ -254,6 +255,8 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define ORBITRON "Orbitron"
#define SHARE "Share Tech Mono"
GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE))
//Color Defines
#define OOC_COLOR "#002eb8"
@@ -403,8 +406,6 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define MAX_PROC_DEPTH 195 // 200 proc calls deep and shit breaks, this is a bit lower to give some safety room
#define DUMMY_HUMAN_SLOT_MANIFEST "dummy_manifest_generation"
#define SYRINGE_DRAW 0
#define SYRINGE_INJECT 1
@@ -430,6 +431,7 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#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(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
// 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
+1 -1
View File
@@ -244,7 +244,7 @@
#define OFFSET_NECK "neck"
//MINOR TWEAKS/MISC
#define AGE_MIN 17 //youngest a character can be
#define AGE_MIN 18 //youngest a character can be //CITADEL EDIT - 17 --> 18
#define AGE_MAX 85 //oldest a character can be
#define WIZARD_AGE_MIN 30 //youngest a wizard can be
#define APPRENTICE_AGE_MIN 29 //youngest an apprentice can be
+4
View File
@@ -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
+2
View File
@@ -68,3 +68,5 @@
//Flags in the players table in the db
#define DB_FLAG_EXEMPT 1
#define DEFAULT_CYBORG_NAME "Default Cyborg Name"
-1
View File
@@ -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.
+3
View File
@@ -0,0 +1,3 @@
#define SPECIFIC_HEAT_DEFAULT 200
#define SPECIFIC_HEAT_PLASMA 500
+1 -1
View File
@@ -29,7 +29,7 @@
#define RDSCREEN_TEXT_NO_PROTOLATHE "<div><h3>No Protolathe Linked!</h3></div><br>"
#define RDSCREEN_TEXT_NO_IMPRINTER "<div><h3>No Circuit Imprinter Linked!</h3></div><br>"
#define RDSCREEN_TEXT_NO_DECONSTRUCT "<div><h3>No Deconstructive Analyzer Linked!</h3></div><br>"
#define RDSCREEN_TEXT_NO_DECONSTRUCT "<div><h3>No Destructive Analyzer Linked!</h3></div><br>"
#define RDSCREEN_TEXT_NO_TDISK "<div><h3>No Technology Disk Inserted!</h3></div><br>"
#define RDSCREEN_TEXT_NO_DDISK "<div><h3>No Design Disk Inserted!</h3></div><br>"
#define RDSCREEN_TEXT_NO_SNODE "<div><h3>No Technology Node Selected!</h3></div><br>"
+7
View File
@@ -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")()
+3 -1
View File
@@ -80,9 +80,11 @@
#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 //
/////////////
#define STATUS_EFFECT_RAINBOWPROTECTION /datum/status_effect/rainbow_protection //Invulnerable and pacifistic
#define STATUS_EFFECT_SLIMESKIN /datum/status_effect/slimeskin //Increased armor
#define STATUS_EFFECT_SLIMESKIN /datum/status_effect/slimeskin //Increased armor
+12 -14
View File
@@ -38,7 +38,7 @@
//type and all subtypes should always call Initialize in New()
#define INITIALIZE_IMMEDIATE(X) ##X/New(loc, ...){\
..();\
if(!initialized) {\
if(!(flags_1 & INITIALIZED_1)) {\
args[1] = TRUE;\
SSatoms.InitAtom(src, args);\
}\
@@ -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;\
}
+4 -1
View File
@@ -40,11 +40,14 @@
#define TRAIT_NOBREATH "no_breath"
#define TRAIT_ANTIMAGIC "anti_magic"
#define TRAIT_HOLY "holy"
#define TRAIT_DEPRESSION "depression"
#define TRAIT_DEPRESSION "depression"
#define TRAIT_JOLLY "jolly"
#define TRAIT_NOCRITDAMAGE "no_crit"
#define TRAIT_NOSLIPWATER "noslip_water"
#define TRAIT_NOSLIPALL "noslip_all"
#define TRAIT_NODEATH "nodeath"
#define TRAIT_NOHARDCRIT "nohardcrit"
#define TRAIT_NOSOFTCRIT "nosoftcrit"
#define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance"
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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"
+6 -8
View File
@@ -73,14 +73,7 @@
return FALSE
//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
/proc/is_type_in_typecache(atom/A, list/L)
if(!LAZYLEN(L) || !A)
return FALSE
if(ispath(A))
. = L[A]
else
. = L[A.type]
#define is_type_in_typecache(A, L) (A && length(L) && L[(ispath(A) ? A : A:type)])
//Checks for a string in a list
/proc/is_string_in_list(string, list/L)
@@ -495,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)
+6 -8
View File
@@ -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
+2 -2
View File
@@ -15,7 +15,7 @@
var/turf/sourceT = found_turfs[1]
if(break_if_found[sourceT.type])
return FALSE
if (is_type_in_typecache(sourceT.loc, GLOB.typecache_shuttle_area))
if (istype(sourceT.loc, /area/shuttle))
return FALSE
found_turfs.Cut(1, 2)
var/dir_flags = checked_turfs[sourceT]
@@ -50,7 +50,7 @@
var/list/areas = list("New Area" = /area)
for(var/i in 1 to turfs.len)
var/area/place = get_area(turfs[i])
if(blacklisted_areas[place.type] || GLOB.typecache_shuttle_area[place.type])
if(blacklisted_areas[place.type] || istype(place, /area/shuttle))
continue
if(!place.requires_power || place.noteleport || place.hidden)
continue // No expanding powerless rooms etc
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -117,7 +117,7 @@
return
if(QDELETED(A))
return
if((A.smooth & SMOOTH_TRUE) || (A.smooth & SMOOTH_MORE))
if(A.smooth & (SMOOTH_TRUE | SMOOTH_MORE))
var/adjacencies = calculate_adjacencies(A)
if(A.smooth & SMOOTH_DIAGONAL)
@@ -156,7 +156,7 @@
/turf/closed/wall/diagonal_smooth(adjacencies)
adjacencies = reverse_ndir(..())
if(adjacencies)
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = TURF_LAYER)
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = TURF_LAYER, plane = FLOOR_PLANE)
var/list/U = list(underlay_appearance)
if(fixed_underlay)
if(fixed_underlay["space"])
+1 -1
View File
@@ -9,7 +9,7 @@
#define is_reebe(z) SSmapping.level_trait(z, ZTRAIT_REEBE)
#define is_transit_level(z) SSmapping.level_trait(z, ZTRAIT_TRANSIT)
#define is_reserved_level(z) SSmapping.level_trait(z, ZTRAIT_RESERVED)
#define is_away_level(z) SSmapping.level_trait(z, ZTRAIT_AWAY)
+7 -4
View File
@@ -278,8 +278,8 @@ Proc for attack log creation, because really why not
/proc/add_logs(mob/user, mob/target, what_done, object=null, addition=null)
var/turf/attack_location = get_turf(target)
var/is_mob_user = user && GLOB.typecache_mob[user.type]
var/is_mob_target = target && GLOB.typecache_mob[target.type]
var/is_mob_user = user && ismob(user)
var/is_mob_target = target && ismob(target)
var/mob/living/living_target
@@ -505,7 +505,8 @@ Proc for attack log creation, because really why not
for(var/j in 1 to amount)
var/atom/X = new spawn_type(arglist(new_args))
X.admin_spawned = admin_spawn
if (admin_spawn)
X.flags_1 |= ADMIN_SPAWNED_1
/proc/spawn_and_random_walk(spawn_type, target, amount, walk_chance=100, max_walk=3, always_max_walk=FALSE, admin_spawn=FALSE)
var/turf/T = get_turf(target)
@@ -515,7 +516,8 @@ Proc for attack log creation, because really why not
for(var/j in 1 to amount)
var/atom/movable/X = new spawn_type(T)
X.admin_spawned = admin_spawn
if (admin_spawn)
X.flags_1 |= ADMIN_SPAWNED_1
if(always_max_walk || prob(walk_chance))
if(always_max_walk)
@@ -527,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)
+1 -1
View File
@@ -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'))
+2 -1
View File
@@ -42,5 +42,6 @@
last_huge_pulse = world.time
log = TRUE
if(log)
log_game("Radiation pulse with intensity:[intensity] and range modifier:[range_modifier] in area [get_area(source)] ")
var/turf/_source_T = isturf(source) ? source : get_turf(source)
log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [AREACOORD(_source_T)] ")
return TRUE
+1 -1
View File
@@ -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
View File
@@ -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())
+2 -2
View File
@@ -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
-15
View File
@@ -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;
+28 -15
View File
@@ -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
@@ -1271,10 +1287,7 @@ GLOBAL_REAL_VAR(list/stack_trace_storage)
if(!istype(C))
return
var/animate_color = initial(C.color)
var/datum/client_colour/CC = C.mob.client_colours[1]
if(CC)
animate_color = CC.colour
var/animate_color = C.color
C.color = flash_color
animate(C, color = animate_color, time = flash_time)
+41 -9
View File
@@ -35,7 +35,8 @@ GLOBAL_LIST_INIT(bitfields, list(
),
"datum_flags" = list(
"DF_USE_TAG" = DF_USE_TAG,
"DF_VAR_EDITED" = DF_VAR_EDITED
"DF_VAR_EDITED" = DF_VAR_EDITED,
"DF_ISPROCESSING" = DF_ISPROCESSING,
),
"item_flags" = list(
"BEING_REMOVED" = BEING_REMOVED,
@@ -44,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,
@@ -110,16 +115,21 @@ GLOBAL_LIST_INIT(bitfields, list(
),
"flags_1" = list(
"NOJAUNT_1" = NOJAUNT_1,
"NODROP_1 / UNUSED_TRANSIT_TURF_1 (turfs)" = NODROP_1,
"NOBLUDGEON_1 / CAN_BE_DIRTY_1 (turfs)" = NOBLUDGEON_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,
"UNUSED_RESERVATION_TURF_1" = UNUSED_RESERVATION_TURF_1,
"CAN_BE_DIRTY_1" = CAN_BE_DIRTY_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
"TESLA_IGNORE_1" = TESLA_IGNORE_1,
"INITIALIZED_1" = INITIALIZED_1,
"ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1,
),
"clothing_flags" = list(
"LAVAPROTECT" = LAVAPROTECT,
@@ -128,5 +138,27 @@ GLOBAL_LIST_INIT(bitfields, list(
"MASKINTERNALS" = MASKINTERNALS,
"NOSLIP" = NOSLIP,
"THICKMATERIAL" = THICKMATERIAL,
)
),
"tesla_flags" = list(
"TESLA_MOB_DAMAGE" = TESLA_MOB_DAMAGE,
"TESLA_OBJ_DAMAGE" = TESLA_OBJ_DAMAGE,
"TESLA_MOB_STUN" = TESLA_MOB_STUN,
"TESLA_ALLOW_DUPLICATES" = TESLA_ALLOW_DUPLICATES,
"TESLA_MACHINE_EXPLOSIVE" = TESLA_MACHINE_EXPLOSIVE,
),
"smooth" = list(
"SMOOTH_TRUE" = SMOOTH_TRUE,
"SMOOTH_MORE" = SMOOTH_MORE,
"SMOOTH_DIAGONAL" = SMOOTH_DIAGONAL,
"SMOOTH_BORDER" = SMOOTH_BORDER,
"SMOOTH_QUEUED" = SMOOTH_QUEUED,
),
"container_type" = list(
"INJECTABLE" = INJECTABLE,
"DRAWABLE" = DRAWABLE,
"REFILLABLE" = REFILLABLE,
"DRAINABLE" = DRAINABLE,
"TRANSPARENT" = TRANSPARENT,
"AMOUNT_VISIBLE" = AMOUNT_VISIBLE,
),
))
+2 -2
View File
@@ -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
+1
View File
@@ -30,6 +30,7 @@ GLOBAL_LIST_EMPTY(ruin_landmarks)
//away missions
GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can take you to
GLOBAL_LIST_EMPTY(vr_spawnpoints)
//used by jump-to-area etc. Updated by area/updateName()
GLOBAL_LIST_EMPTY(sortedAreas)
-8
View File
@@ -5,12 +5,4 @@
GLOBAL_LIST_INIT(typecache_mob, typecacheof(/mob))
GLOBAL_LIST_INIT(typecache_living, typecacheof(/mob/living))
GLOBAL_LIST_INIT(typecache_machine_or_structure, typecacheof(list(/obj/machinery, /obj/structure)))
GLOBAL_LIST_INIT(typecache_shuttle_area, typecacheof(/area/shuttle))
GLOBAL_LIST_INIT(typecache_clothing, typecacheof(/obj/item/clothing))
GLOBAL_LIST_INIT(typecache_effect, typecacheof(/obj/effect))
+2 -2
View File
@@ -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)
@@ -41,6 +43,4 @@ GLOBAL_PROTECT(OOClog)
GLOBAL_LIST_EMPTY(adminlog)
GLOBAL_PROTECT(adminlog)
GLOBAL_LIST_EMPTY(individual_log_list) // Logs each mob individual logs, a global so it doesn't get lost on cloning/changing mobs
GLOBAL_LIST_EMPTY(active_turfs_startlist)
+1 -1
View File
@@ -10,7 +10,7 @@ GLOBAL_VAR_INIT(TAB, "&nbsp;&nbsp;&nbsp;&nbsp;")
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)
+10 -2
View File
@@ -26,6 +26,14 @@
return
next_click = world.time + 1
if(multicam_on)
var/turf/T = get_turf(A)
if(T)
for(var/obj/screen/movable/pic_in_pic/ai/P in T.vis_locs)
if(P.ai == src)
P.Click(params)
break
if(check_click_intercept(params,A))
return
@@ -38,8 +46,8 @@
if(!can_see(A))
if(isturf(A)) //On unmodified clients clicking the static overlay clicks the turf underneath
return //So there's no point messaging admins
message_admins("[key_name_admin(src)] might be running a modified client! (failed can_see on AI click of [A]([ADMIN_COORDJMP(pixel_turf)]))")
var/message = "[key_name(src)] might be running a modified client! (failed can_see on AI click of [A]([COORD(pixel_turf)]))"
message_admins("[ADMIN_LOOKUPFLW(src)] might be running a modified client! (failed can_see on AI click of [A] (Turf Loc: [ADMIN_VERBOSEJMP(pixel_turf)]))")
var/message = "[key_name(src)] might be running a modified client! (failed can_see on AI click of [A] (Turf Loc: [AREACOORD(pixel_turf)]))"
log_admin(message)
if(REALTIMEOFDAY >= chnotify + 9000)
chnotify = REALTIMEOFDAY
+50 -38
View File
@@ -39,16 +39,16 @@
Note that this proc can be overridden, and is in the case of screen objects.
*/
/atom/Click(location,control,params)
if(initialized)
SendSignal(COMSIG_CLICK, location, control, params)
if(flags_1 & INITIALIZED_1)
SEND_SIGNAL(src, COMSIG_CLICK, location, control, params)
usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
if(initialized)
if(flags_1 & INITIALIZED_1)
usr.DblClickOn(src,params)
/atom/MouseWheel(delta_x,delta_y,location,control,params)
if(initialized)
if(flags_1 & INITIALIZED_1)
usr.MouseWheelOn(src, delta_x, delta_y, 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
/*
+3 -3
View File
@@ -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.
+5 -5
View File
@@ -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
..()
..()
+2
View File
@@ -134,6 +134,8 @@
#define ui_ai_take_picture "SOUTH:6,WEST+12"
#define ui_ai_view_images "SOUTH:6,WEST+13"
#define ui_ai_sensor "SOUTH:6,WEST+14"
#define ui_ai_multicam "SOUTH+1:6,WEST+13"
#define ui_ai_add_multicam "SOUTH+1:6,WEST+14"
//Pop-up inventory
#define ui_shoes "WEST+1:8,SOUTH:5"
+21 -1
View File
@@ -11,7 +11,24 @@
var/id
var/ordered = TRUE //If the button gets placed into the default bar
/obj/screen/movable/action_button/proc/can_use(mob/user)
if (linked_action)
return linked_action.owner == user
else if (isobserver(user))
var/mob/dead/observer/O = user
return !O.observetarget
else
return TRUE
/obj/screen/movable/action_button/MouseDrop()
if (!can_use(usr))
return
return ..()
/obj/screen/movable/action_button/Click(location,control,params)
if (!can_use(usr))
return
var/list/modifiers = params2list(params)
if(modifiers["shift"])
if(locked)
@@ -44,6 +61,9 @@
var/show_state = "show"
/obj/screen/movable/action_button/hide_toggle/Click(location,control,params)
if (!can_use(usr))
return
var/list/modifiers = params2list(params)
if(modifiers["shift"])
if(locked)
@@ -118,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
+31 -3
View File
@@ -164,11 +164,31 @@
var/mob/living/silicon/S = usr
S.toggle_sensors()
/obj/screen/ai/multicam
name = "Multicamera Mode"
icon_state = "multicam"
/obj/screen/ai/multicam/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.toggle_multicam()
/obj/screen/ai/add_multicam
name = "New Camera"
icon_state = "new_cam"
/obj/screen/ai/add_multicam/Click()
if(..())
return
var/mob/living/silicon/ai/AI = usr
AI.drop_new_multicam()
/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
@@ -247,12 +267,20 @@
using.screen_loc = ui_ai_view_images
static_inventory += using
//Medical/Security sensors
using = new /obj/screen/ai/sensors()
using.screen_loc = ui_ai_sensor
static_inventory += using
//Multicamera mode
using = new /obj/screen/ai/multicam()
using.screen_loc = ui_ai_multicam
static_inventory += using
//Add multicamera camera
using = new /obj/screen/ai/add_multicam()
using.screen_loc = ui_ai_add_multicam
static_inventory += using
/mob/living/silicon/ai/create_mob_hud()
if(client && !hud_used)
+14 -4
View File
@@ -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
+3 -4
View File
@@ -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
+3
View File
@@ -1,3 +1,6 @@
/datum/hud/larva
ui_style = 'icons/mob/screen_alien.dmi'
/datum/hud/larva/New(mob/owner)
..()
var/obj/screen/using
+2 -3
View File
@@ -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
+3 -3
View File
@@ -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 -1
View File
@@ -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
+3 -3
View File
@@ -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
..()
+8 -2
View File
@@ -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
@@ -73,6 +73,12 @@
static_inventory += using
/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
var/mob/dead/observer/O = mymob
if (istype(O) && O.observetarget)
plane_masters_update()
return FALSE
. = ..()
if(!.)
return
@@ -84,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)
+2 -2
View File
@@ -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))
+61 -46
View File
@@ -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 ..()
@@ -131,7 +121,7 @@
update_sight()
//Version denotes which style should be displayed. blank or 0 means "next version"
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
/datum/hud/proc/show_hud(version = 0, mob/viewmob)
if(!ismob(mymob))
return FALSE
var/mob/screenmob = viewmob || mymob
@@ -195,19 +185,30 @@
if(infodisplay.len)
screenmob.client.screen -= infodisplay
for(var/thing in plane_masters)
var/obj/screen/plane_master/PM = plane_masters[thing]
PM.backdrop(screenmob)
screenmob.client.screen += PM
hud_version = display_hud_version
persistent_inventory_update(screenmob)
screenmob.update_action_buttons(1)
reorganize_alerts()
screenmob.reload_fullscreen()
update_parallax_pref(screenmob)
// ensure observers get an accurate and up-to-date view
if (!viewmob)
plane_masters_update()
for(var/M in mymob.observers)
show_hud(hud_version, M)
else if (viewmob.hud_used)
viewmob.hud_used.plane_masters_update()
return TRUE
/datum/hud/proc/plane_masters_update()
// Plane masters are always shown to OUR mob, never to observers
for(var/thing in plane_masters)
var/obj/screen/plane_master/PM = plane_masters[thing]
PM.backdrop(mymob)
mymob.client.screen += PM
/datum/hud/human/show_hud(version = 0,mob/viewmob)
. = ..()
if(!.)
@@ -228,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"
@@ -243,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)
@@ -268,8 +282,9 @@
i++
for(var/obj/screen/human/equip/E in static_inventory)
E.screen_loc = ui_equip_position(mymob)
if(mymob.hud_used)
show_hud(HUD_STYLE_STANDARD,mymob)
if(ismob(mymob) && mymob.hud_used == src)
show_hud(hud_version)
/datum/hud/proc/update_locked_slots()
return
+3 -3
View File
@@ -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
+3 -3
View File
@@ -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)
+4 -2
View File
@@ -12,6 +12,8 @@
var/snap2grid = FALSE
var/moved = FALSE
var/locked = FALSE
var/x_off = -16
var/y_off = -16
//Snap Screen Object
//Tied to the grid, snaps to the nearest turf
@@ -42,8 +44,8 @@
screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]"
else //Normalise Pixel Values (So the object drops at the center of the mouse, not 16 pixels off)
var/pix_X = text2num(screen_loc_X[2]) - 16
var/pix_Y = text2num(screen_loc_Y[2]) - 16
var/pix_X = text2num(screen_loc_X[2]) + x_off
var/pix_Y = text2num(screen_loc_Y[2]) + y_off
screen_loc = "[screen_loc_X[1]]:[pix_X],[screen_loc_Y[1]]:[pix_Y]"
moved = screen_loc
+144
View File
@@ -0,0 +1,144 @@
/obj/screen/movable/pic_in_pic
name = "Picture-in-picture"
screen_loc = "CENTER"
plane = FLOOR_PLANE
var/atom/center
var/width = 0
var/height = 0
var/list/shown_to = list()
var/list/viewing_turfs = list()
var/obj/screen/component_button/button_x
var/obj/screen/component_button/button_expand
var/obj/screen/component_button/button_shrink
var/mutable_appearance/standard_background
var/const/max_dimensions = 10
/obj/screen/movable/pic_in_pic/Initialize()
. = ..()
make_backgrounds()
/obj/screen/movable/pic_in_pic/Destroy()
for(var/C in shown_to)
unshow_to(C)
QDEL_NULL(button_x)
QDEL_NULL(button_shrink)
QDEL_NULL(button_expand)
return ..()
/obj/screen/movable/pic_in_pic/component_click(obj/screen/component_button/component, params)
if(component == button_x)
qdel(src)
else if(component == button_expand)
set_view_size(width+1, height+1)
else if(component == button_shrink)
set_view_size(width-1, height-1)
/obj/screen/movable/pic_in_pic/proc/make_backgrounds()
standard_background = new /mutable_appearance()
standard_background.icon = 'icons/misc/pic_in_pic.dmi'
standard_background.icon_state = "background"
standard_background.layer = SPACE_LAYER
/obj/screen/movable/pic_in_pic/proc/add_buttons()
var/static/mutable_appearance/move_tab
if(!move_tab)
move_tab = new /mutable_appearance()
//all these properties are always the same, and since adding something to the overlay
//list makes a copy, there is no reason to make a new one each call
move_tab.icon = 'icons/misc/pic_in_pic.dmi'
move_tab.icon_state = "move"
move_tab.plane = HUD_PLANE
var/matrix/M = matrix()
M.Translate(0, (height + 0.25) * world.icon_size)
move_tab.transform = M
add_overlay(move_tab)
if(!button_x)
button_x = new /obj/screen/component_button(null, src)
var/mutable_appearance/MA = new /mutable_appearance()
MA.name = "close"
MA.icon = 'icons/misc/pic_in_pic.dmi'
MA.icon_state = "x"
MA.plane = HUD_PLANE
button_x.appearance = MA
M = matrix()
M.Translate((max(4, width) - 0.75) * world.icon_size, (height + 0.25) * world.icon_size)
button_x.transform = M
vis_contents += button_x
if(!button_expand)
button_expand = new /obj/screen/component_button(null, src)
var/mutable_appearance/MA = new /mutable_appearance()
MA.name = "expand"
MA.icon = 'icons/misc/pic_in_pic.dmi'
MA.icon_state = "expand"
MA.plane = HUD_PLANE
button_expand.appearance = MA
M = matrix()
M.Translate(world.icon_size, (height + 0.25) * world.icon_size)
button_expand.transform = M
vis_contents += button_expand
if(!button_shrink)
button_shrink = new /obj/screen/component_button(null, src)
var/mutable_appearance/MA = new /mutable_appearance()
MA.name = "shrink"
MA.icon = 'icons/misc/pic_in_pic.dmi'
MA.icon_state = "shrink"
MA.plane = HUD_PLANE
button_shrink.appearance = MA
M = matrix()
M.Translate(2 * world.icon_size, (height + 0.25) * world.icon_size)
button_shrink.transform = M
vis_contents += button_shrink
/obj/screen/movable/pic_in_pic/proc/add_background()
if((width > 0) && (height > 0))
var/matrix/M = matrix()
M.Scale(width + 0.5, height + 0.5)
M.Translate((width-1)/2 * world.icon_size, (height-1)/2 * world.icon_size)
standard_background.transform = M
add_overlay(standard_background)
/obj/screen/movable/pic_in_pic/proc/set_view_size(width, height, do_refresh = TRUE)
width = CLAMP(width, 0, max_dimensions)
height = CLAMP(height, 0, max_dimensions)
src.width = width
src.height = height
y_off = -height * world.icon_size - 16
cut_overlays()
add_background()
add_buttons()
if(do_refresh)
refresh_view()
/obj/screen/movable/pic_in_pic/proc/set_view_center(atom/target, do_refresh = TRUE)
center = target
if(do_refresh)
refresh_view()
/obj/screen/movable/pic_in_pic/proc/refresh_view()
vis_contents -= viewing_turfs
if(!width || !height)
return
var/turf/T = get_turf(center)
if(!T)
return
var/turf/lowerleft = locate(max(1, T.x - round(width/2)), max(1, T.y - round(height/2)), T.z)
var/turf/upperright = locate(min(world.maxx, lowerleft.x + width - 1), min(world.maxy, lowerleft.y + height - 1), lowerleft.z)
viewing_turfs = block(lowerleft, upperright)
vis_contents += viewing_turfs
/obj/screen/movable/pic_in_pic/proc/show_to(client/C)
if(C)
shown_to[C] = 1
C.screen += src
/obj/screen/movable/pic_in_pic/proc/unshow_to(client/C)
if(C)
shown_to -= C
C.screen -= src
+2 -2
View File
@@ -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
+15
View File
@@ -30,6 +30,9 @@
/obj/screen/orbit()
return
/obj/screen/proc/component_click(obj/screen/component_button/component, params)
return
/obj/screen/text
icon = null
icon_state = null
@@ -604,3 +607,15 @@
holder.screen -= src
holder = null
return ..()
/obj/screen/component_button
var/obj/screen/parent
/obj/screen/component_button/Initialize(mapload, obj/screen/parent)
. = ..()
src.parent = parent
/obj/screen/component_button/Click(params)
if(parent)
parent.component_click(src, params)
+8 -7
View File
@@ -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
+1 -1
View File
@@ -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))
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
@@ -25,10 +26,13 @@
InitEntries()
LoadModes()
if(fexists("[directory]/config.txt") && LoadEntries("config.txt") <= 1)
log_config("No $include directives found in config.txt! Loading legacy game_options/dbconfig/comms files...")
LoadEntries("game_options.txt")
LoadEntries("dbconfig.txt")
LoadEntries("comms.txt")
var/list/legacy_configs = list("game_options.txt", "dbconfig.txt", "comms.txt")
for(var/I in legacy_configs)
if(fexists("[directory]/[I]"))
log_config("No $include directives found in config.txt! Loading legacy [legacy_configs.Join("/")] files...")
for(var/J in legacy_configs)
LoadEntries(J)
break
loadmaplist(CONFIG_MAPS_FILE)
LoadMOTD()
@@ -120,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
@@ -288,6 +286,11 @@
/datum/config_entry/flag/shift_time_realtime
/datum/config_entry/keyed_number_list/antag_rep
/datum/config_entry/number/monkeycap
config_entry_value = 64
min_val = 0
//Cit changes - Adds config options for crew objectives and miscreants
/datum/config_entry/flag/allow_crew_objectives
@@ -304,4 +307,4 @@
/datum/config_entry/number/nightshift_finish
config_entry_value = 6
//End of Cit changes
//End of Cit changes
@@ -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
@@ -177,6 +179,10 @@
/datum/config_entry/string/githuburl
config_entry_value = "https://www.github.com/tgstation/-tg-station"
/datum/config_entry/string/roundstatsurl
/datum/config_entry/string/gamelogurl
/datum/config_entry/number/githubrepoid
config_entry_value = null
min_val = 0
+1 -1
View File
@@ -263,7 +263,7 @@ SUBSYSTEM_DEF(air)
currentrun |= T
if(blockchanges && T.excited_group)
T.excited_group.garbage_collect()
else if(T.initialized)
else if(T.flags_1 & INITIALIZED_1)
for(var/turf/S in T.atmos_adjacent_turfs)
add_to_active(S)
else if(map_loading)
+3 -3
View File
@@ -37,14 +37,14 @@ SUBSYSTEM_DEF(atoms)
count = atoms.len
for(var/I in atoms)
var/atom/A = I
if(!A.initialized)
if(!(A.flags_1 & INITIALIZED_1))
if(InitAtom(I, mapload_arg))
atoms -= I
CHECK_TICK
else
count = 0
for(var/atom/A in world)
if(!A.initialized)
if(!(A.flags_1 & INITIALIZED_1))
InitAtom(A, mapload_arg)
++count
CHECK_TICK
@@ -95,7 +95,7 @@ SUBSYSTEM_DEF(atoms)
if(!A) //possible harddel
qdeleted = TRUE
else if(!A.initialized)
else if(!(A.flags_1 & INITIALIZED_1))
BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT
return qdeleted || QDELING(A)
+62 -31
View File
@@ -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,40 +263,63 @@ Versioning
key_type = new_key_type
/datum/controller/subsystem/blackbox/proc/ReportDeath(mob/living/L)
set waitfor = FALSE
if(sealed)
return
if(!SSdbcore.Connect())
return
if(!L || !L.key || !L.mind)
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)
if(!L.suiciding && !first_death.len)
first_death["name"] = "[(L.real_name == L.name) ? L.real_name : "[L.real_name] as [L.name]"]"
first_death["role"] = null
if(L.mind.assigned_role)
first_death["role"] = L.mind.assigned_role
first_death["area"] = "[get_area_name(L, TRUE)] [COORD(L)]"
first_death["damage"] = "<font color='#FF5555'>[sqlbrute]</font>/<font color='orange'>[sqlfire]</font>/<font color='lightgreen'>[sqltox]</font>/<font color='lightblue'>[sqloxy]</font>/<font color='pink'>[sqlclone]</font>"
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
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()
qdel(query_report_death)
+1 -1
View File
@@ -26,7 +26,7 @@ SUBSYSTEM_DEF(communications)
priority_announce(html_decode(user.treat_message(input)), null, 'sound/misc/announce.ogg', "Captain")
nonsilicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN
log_talk(user,"[key_name(user)] has made a priority announcement: [input]",LOGSAY)
message_admins("[key_name_admin(user)] has made a priority announcement.")
message_admins("[ADMIN_LOOKUPFLW(user)] has made a priority announcement.")
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
for(var/obj/machinery/computer/communications/C in GLOB.machines)
+64 -22
View File
@@ -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()
+6
View File
@@ -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
-19
View File
@@ -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
+2 -2
View File
@@ -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
+16 -6
View File
@@ -6,16 +6,26 @@ SUBSYSTEM_DEF(icon_smooth)
flags = SS_TICKER
var/list/smooth_queue = list()
var/list/deferred = list()
/datum/controller/subsystem/icon_smooth/fire()
while(smooth_queue.len)
var/atom/A = smooth_queue[smooth_queue.len]
smooth_queue.len--
smooth_icon(A)
var/list/cached = smooth_queue
while(cached.len)
var/atom/A = cached[cached.len]
cached.len--
if (A.flags_1 & INITIALIZED_1)
smooth_icon(A)
else
deferred += A
if (MC_TICK_CHECK)
return
if (!smooth_queue.len)
can_fire = 0
if (!cached.len)
if (deferred.len)
smooth_queue = deferred
deferred = cached
else
can_fire = 0
/datum/controller/subsystem/icon_smooth/Initialize()
smooth_zlevel(1,TRUE)
+80 -75
View File
@@ -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
@@ -422,7 +425,7 @@ SUBSYSTEM_DEF(job)
else
M = H
SSpersistence.antag_rep_change[M.client.ckey] += job.antag_rep
SSpersistence.antag_rep_change[M.client.ckey] += job.GetAntagRep()
to_chat(M, "<b>You are the [rank].</b>")
if(job)
@@ -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)
+1 -9
View File
@@ -85,12 +85,4 @@ SUBSYSTEM_DEF(lighting)
/datum/controller/subsystem/lighting/Recover()
initialized = SSlighting.initialized
..()
/datum/controller/subsystem/lighting/proc/initialize_lighting_objects(list/turfs)
for(var/turf/T in turfs)
if(!IS_DYNAMIC_LIGHTING(T))
continue
new/atom/movable/lighting_object(T)
CHECK_TICK
..()
+1 -1
View File
@@ -45,7 +45,7 @@ SUBSYSTEM_DEF(machines)
else
processing -= thing
if (!QDELETED(thing))
thing.isprocessing = FALSE
thing.datum_flags &= ~DF_ISPROCESSING
if (MC_TICK_CHECK)
return
+112 -13
View File
@@ -21,6 +21,11 @@ SUBSYSTEM_DEF(mapping)
var/list/areas_in_z = list()
var/loading_ruins = FALSE
var/list/turf/unused_turfs = list() //Not actually unused turfs they're unused but reserved for use for whatever requests them. "[zlevel_of_turf]" = list(turfs)
var/list/datum/turf_reservations //list of turf reservations
var/list/used_turfs = list() //list of turf = datum/turf_reservation
var/clearing_reserved_turfs = FALSE
// Z-manager stuff
var/station_start // should only be used for maploading-related tasks
@@ -41,8 +46,14 @@ SUBSYSTEM_DEF(mapping)
/datum/controller/subsystem/mapping/Initialize(timeofday)
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()
@@ -58,12 +69,13 @@ SUBSYSTEM_DEF(mapping)
++space_levels_so_far
empty_space = add_new_zlevel("Empty Area [space_levels_so_far]", list(ZTRAIT_LINKAGE = CROSSLINKED))
// and the transit level
transit = add_new_zlevel("Transit", list(ZTRAIT_TRANSIT = TRUE))
transit = add_new_zlevel("Transit/Reserved", list(ZTRAIT_RESERVED = TRUE))
// Pick a random away mission.
if(CONFIG_GET(flag/roundstart_away))
createRandomZlevel()
// Generate mining ruins
loading_ruins = TRUE
var/list/lava_ruins = levels_by_trait(ZTRAIT_LAVA_RUINS)
@@ -83,12 +95,42 @@ SUBSYSTEM_DEF(mapping)
setup_map_transitions()
generate_station_area_list()
QDEL_NULL(loader)
initialize_reserved_level()
..()
/* Nuke threats, for making the blue tiles on the station go RED
Used by the AI doomsday and the self destruct nuke.
*/
/datum/controller/subsystem/mapping/proc/wipe_reservations(wipe_safety_delay = 100)
if(clearing_reserved_turfs || !initialized) //in either case this is just not needed.
return
clearing_reserved_turfs = TRUE
SSshuttle.transit_requesters.Cut()
message_admins("Clearing dynamic reservation space.")
var/list/obj/docking_port/mobile/in_transit = list()
for(var/i in SSshuttle.transit)
var/obj/docking_port/stationary/transit/T = i
if(!istype(T))
continue
in_transit[T] = T.get_docked()
var/go_ahead = world.time + wipe_safety_delay
if(in_transit.len)
message_admins("Shuttles in transit detected. Attempting to fast travel. Timeout is [wipe_safety_delay/10] seconds.")
var/list/cleared = list()
for(var/i in in_transit)
INVOKE_ASYNC(src, .proc/safety_clear_transit_dock, i, in_transit[i], cleared)
UNTIL((go_ahead < world.time) || (cleared.len == in_transit.len))
do_wipe_turf_reservations()
clearing_reserved_turfs = FALSE
/datum/controller/subsystem/mapping/proc/safety_clear_transit_dock(obj/docking_port/stationary/transit/T, obj/docking_port/mobile/M, list/returning)
M.setTimer(0)
var/error = M.initiate_docking(M.destination, M.preferred_direction)
if(!error)
returning += M
qdel(T, TRUE)
/datum/controller/subsystem/mapping/proc/add_nuke_threat(datum/nuke)
nuke_threats[nuke] = TRUE
check_nuke_threats()
@@ -108,20 +150,26 @@ SUBSYSTEM_DEF(mapping)
/datum/controller/subsystem/mapping/Recover()
flags |= SS_NO_INIT
initialized = SSmapping.initialized
map_templates = SSmapping.map_templates
ruins_templates = SSmapping.ruins_templates
space_ruins_templates = SSmapping.space_ruins_templates
lava_ruins_templates = SSmapping.lava_ruins_templates
shuttle_templates = SSmapping.shuttle_templates
shelter_templates = SSmapping.shelter_templates
unused_turfs = SSmapping.unused_turfs
turf_reservations = SSmapping.turf_reservations
used_turfs = SSmapping.used_turfs
config = SSmapping.config
next_map_config = SSmapping.next_map_config
clearing_reserved_turfs = SSmapping.clearing_reserved_turfs
z_list = SSmapping.z_list
#define INIT_ANNOUNCE(X) to_chat(world, "<span class='boldannounce'>[X]</span>"); log_world(X)
/datum/controller/subsystem/mapping/proc/LoadGroup(list/errorList, name, path, files, list/traits, list/default_traits)
/datum/controller/subsystem/mapping/proc/LoadGroup(list/errorList, name, path, files, list/traits, list/default_traits, silent = FALSE)
var/start_time = REALTIMEOFDAY
if (!islist(files)) // handle single-level maps
@@ -157,8 +205,8 @@ SUBSYSTEM_DEF(mapping)
var/full_path = "_maps/[path]/[file]"
if(!loader.load_map(file(full_path), 0, 0, start_z + files[file], no_changeturf = TRUE))
errorList |= full_path
INIT_ANNOUNCE("Loaded [name] in [(REALTIMEOFDAY - start_time)/10]s!")
if(!silent)
INIT_ANNOUNCE("Loaded [name] in [(REALTIMEOFDAY - start_time)/10]s!")
/datum/controller/subsystem/mapping/proc/loadWorld()
//if any of these fail, something has gone horribly, HORRIBLY, wrong
@@ -175,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
@@ -187,9 +236,6 @@ SUBSYSTEM_DEF(mapping)
LoadGroup(FailedZs, "Lavaland", "map_files/Mining", "Lavaland.dmm", default_traits = ZTRAITS_LAVALAND)
else if (!isnull(config.minetype))
INIT_ANNOUNCE("WARNING: An unknown minetype '[config.minetype]' was set! This is being ignored! Update the maploader code!")
// load Reebe
LoadGroup(FailedZs, "Reebe", "map_files/generic", "City_of_Cogs.dmm", default_traits = ZTRAITS_REEBE)
#endif
if(LAZYLEN(FailedZs)) //but seriously, unless the server's filesystem is messed up this will never happen
@@ -331,7 +377,6 @@ GLOBAL_LIST_EMPTY(the_station_areas)
shelter_templates[S.shelter_id] = S
map_templates[S.shelter_id] = S
//Manual loading of away missions.
/client/proc/admin_away()
set name = "Load Away Mission"
@@ -367,14 +412,14 @@ GLOBAL_LIST_EMPTY(the_station_areas)
away_level = template.load_new_z()
else
return
message_admins("Admin [key_name_admin(usr)] has loaded [away_name] away mission.")
log_admin("Admin [key_name(usr)] has loaded [away_name] away mission.")
if(!away_level)
message_admins("Loading [away_name] failed!")
return
if(GLOB.the_gateway)
//Link any found away gate with station gate
var/obj/machinery/gateway/centeraway/new_gate
@@ -384,4 +429,58 @@ GLOBAL_LIST_EMPTY(the_station_areas)
break
//Link station gate with away gate and remove wait time.
GLOB.the_gateway.awaygate = new_gate
GLOB.the_gateway.wait = world.time
GLOB.the_gateway.wait = world.time
/datum/controller/subsystem/mapping/proc/RequestBlockReservation(width, height, z, type = /datum/turf_reservation, turf_type_override)
UNTIL(initialized && !clearing_reserved_turfs)
var/datum/turf_reservation/reserve = new type
if(turf_type_override)
reserve.turf_type = turf_type_override
if(!z)
for(var/i in levels_by_trait(ZTRAIT_RESERVED))
if(reserve.Reserve(width, height, i))
return reserve
else
if(!level_trait(z, ZTRAIT_RESERVED))
qdel(reserve)
return
else
if(reserve.Reserve(width, height, z))
return reserve
QDEL_NULL(reserve)
//This is not for wiping reserved levels, use wipe_reservations() for that.
/datum/controller/subsystem/mapping/proc/initialize_reserved_level()
UNTIL(!clearing_reserved_turfs) //regardless, lets add a check just in case.
clearing_reserved_turfs = TRUE //This operation will likely clear any existing reservations, so lets make sure nothing tries to make one while we're doing it.
for(var/i in levels_by_trait(ZTRAIT_RESERVED))
var/turf/A = get_turf(locate(SHUTTLE_TRANSIT_BORDER,SHUTTLE_TRANSIT_BORDER,i))
var/turf/B = get_turf(locate(world.maxx - SHUTTLE_TRANSIT_BORDER,world.maxy - SHUTTLE_TRANSIT_BORDER,i))
reserve_turfs(block(A, B))
clearing_reserved_turfs = FALSE
/datum/controller/subsystem/mapping/proc/reserve_turfs(list/turfs)
for(var/i in turfs)
var/turf/T = i
T.empty(RESERVED_TURF_TYPE, RESERVED_TURF_TYPE, null, TRUE)
LAZYINITLIST(unused_turfs["[T.z]"])
unused_turfs["[T.z]"] |= T
T.flags_1 |= UNUSED_RESERVATION_TURF_1
CHECK_TICK
//DO NOT CALL THIS PROC DIRECTLY, CALL wipe_reservations().
/datum/controller/subsystem/mapping/proc/do_wipe_turf_reservations()
UNTIL(initialized) //This proc is for AFTER init, before init turf reservations won't even exist and using this will likely break things.
for(var/i in turf_reservations)
var/datum/turf_reservation/TR = i
if(!QDELETED(TR))
qdel(TR, TRUE)
UNSETEMPTY(turf_reservations)
var/list/clearing = list()
for(var/l in unused_turfs) //unused_turfs is a assoc list by z = list(turfs)
if(islist(unused_turfs[l]))
clearing |= unused_turfs[l]
clearing |= used_turfs //used turfs is an associative list, BUT, reserve_turfs() can still handle it. If the code above works properly, this won't even be needed as the turfs would be freed already.
unused_turfs.Cut()
used_turfs.Cut()
reserve_turfs(clearing)
-1
View File
@@ -7,7 +7,6 @@ SUBSYSTEM_DEF(mobs)
var/list/currentrun = list()
var/static/list/clients_by_zlevel[][]
var/static/list/cubemonkeys = list()
var/cubemonkeycap = 64
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_living_list.len]")
+42 -41
View File
@@ -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)
+1 -1
View File
@@ -212,7 +212,7 @@ SUBSYSTEM_DEF(persistence)
continue
var/list/savable_obj = list()
for(var/obj/O in F)
if(is_type_in_typecache(O, satchel_blacklist) || O.admin_spawned)
if(is_type_in_typecache(O, satchel_blacklist) || (O.flags_1 & ADMIN_SPAWNED_1))
continue
if(O.persistence_replacement)
savable_obj += O.persistence_replacement
@@ -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
)
@@ -27,7 +27,6 @@ SUBSYSTEM_DEF(processing)
if (MC_TICK_CHECK)
return
/datum/var/isprocessing = FALSE
/datum/proc/process()
set waitfor = 0
STOP_PROCESSING(SSobj, src)
+1
View File
@@ -8,3 +8,4 @@ SUBSYSTEM_DEF(religion)
var/bible_icon_state
var/bible_item_state
var/holy_weapon_type
var/holy_armor_type
+2 -8
View File
@@ -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
@@ -44,9 +39,8 @@ SUBSYSTEM_DEF(research)
handle_research_income()
/datum/controller/subsystem/research/proc/handle_research_income()
var/list/bitcoins
var/list/bitcoins = list()
if(multiserver_calculation)
bitcoins = list()
var/eff = calculate_server_coefficient()
for(var/obj/machinery/rnd/server/miner in servers)
var/list/result = (miner.mine()) //SLAVE AWAY, SLAVE.
+36 -124
View File
@@ -1,4 +1,3 @@
#define HIGHLIGHT_DYNAMIC_TRANSIT 0
#define MAX_TRANSIT_REQUEST_RETRIES 10
SUBSYSTEM_DEF(shuttle)
@@ -14,10 +13,8 @@ SUBSYSTEM_DEF(shuttle)
var/list/stationary = list()
var/list/transit = list()
var/list/turf/transit_turfs = list()
var/list/transit_requesters = list()
var/list/transit_request_failures = list()
var/clear_transit = FALSE
//emergency shuttle stuff
var/obj/docking_port/mobile/emergency/emergency
@@ -67,15 +64,8 @@ SUBSYSTEM_DEF(shuttle)
continue
supply_packs[P.type] = P
if(!transit_turfs.len)
setup_transit_zone()
initial_load()
#ifdef HIGHLIGHT_DYNAMIC_TRANSIT
color_space()
#endif
if(!arrivals)
WARNING("No /obj/docking_port/mobile/arrivals placed on the map!")
if(!emergency)
@@ -95,33 +85,6 @@ SUBSYSTEM_DEF(shuttle)
S.load_roundstart()
CHECK_TICK
/datum/controller/subsystem/shuttle/proc/setup_transit_zone()
// transit zone
var/z = SSmapping.transit.z_value
var/turf/A = get_turf(locate(SHUTTLE_TRANSIT_BORDER,SHUTTLE_TRANSIT_BORDER,z))
var/turf/B = get_turf(locate(world.maxx - SHUTTLE_TRANSIT_BORDER,world.maxy - SHUTTLE_TRANSIT_BORDER,z))
for(var/i in block(A, B))
var/turf/T = i
T.ChangeTurf(/turf/open/space)
transit_turfs += T
T.flags_1 |= UNUSED_TRANSIT_TURF_1
#ifdef HIGHLIGHT_DYNAMIC_TRANSIT
/datum/controller/subsystem/shuttle/proc/color_space()
var/z = SSmapping.transit.z_value
var/turf/A = get_turf(locate(SHUTTLE_TRANSIT_BORDER,SHUTTLE_TRANSIT_BORDER,z))
var/turf/B = get_turf(locate(world.maxx - SHUTTLE_TRANSIT_BORDER,world.maxy - SHUTTLE_TRANSIT_BORDER,z))
for(var/i in block(A, B))
var/turf/T = i
// Only dying the "pure" space, not the transit tiles
if(istype(T, /turf/open/space/transit) || !isspaceturf(T))
continue
if((T.x == A.x) || (T.x == B.x) || (T.y == A.y) || (T.y == B.y))
T.color = "#ffff00"
else
T.color = "#00ffff"
#endif
/datum/controller/subsystem/shuttle/fire()
for(var/thing in mobile)
if(!thing)
@@ -129,12 +92,10 @@ SUBSYSTEM_DEF(shuttle)
continue
var/obj/docking_port/mobile/P = thing
P.check()
var/changed_transit = FALSE
for(var/thing in transit)
var/obj/docking_port/stationary/transit/T = thing
if(!T.owner)
qdel(T, force=TRUE)
changed_transit = TRUE
// This next one removes transit docks/zones that aren't
// immediately being used. This will mean that the zone creation
// code will be running a lot.
@@ -145,32 +106,21 @@ SUBSYSTEM_DEF(shuttle)
var/not_in_use = (!T.get_docked())
if(idle && not_centcom_evac && not_in_use)
qdel(T, force=TRUE)
changed_transit = TRUE
if(clear_transit)
transit_requesters.Cut()
for(var/i in transit)
qdel(i, force=TRUE)
setup_transit_zone()
clear_transit = FALSE
changed_transit = TRUE
#ifdef HIGHLIGHT_DYNAMIC_TRANSIT
if(changed_transit)
color_space()
#endif
CheckAutoEvac()
while(transit_requesters.len)
var/requester = popleft(transit_requesters)
var/success = generate_transit_dock(requester)
if(!success) // BACK OF THE QUEUE
transit_request_failures[requester]++
if(transit_request_failures[requester] < MAX_TRANSIT_REQUEST_RETRIES)
transit_requesters += requester
else
var/obj/docking_port/mobile/M = requester
M.transit_failure()
if(MC_TICK_CHECK)
break
if(!SSmapping.clearing_reserved_turfs)
while(transit_requesters.len)
var/requester = popleft(transit_requesters)
var/success = generate_transit_dock(requester)
if(!success) // BACK OF THE QUEUE
transit_request_failures[requester]++
if(transit_request_failures[requester] < MAX_TRANSIT_REQUEST_RETRIES)
transit_requesters += requester
else
var/obj/docking_port/mobile/M = requester
M.transit_failure()
if(MC_TICK_CHECK)
break
/datum/controller/subsystem/shuttle/proc/CheckAutoEvac()
if(emergencyNoEscape || emergencyNoRecall || !emergency || !SSticker.HasRoundStarted())
@@ -277,7 +227,7 @@ SUBSYSTEM_DEF(shuttle)
if(call_reason)
SSblackbox.record_feedback("text", "shuttle_reason", 1, "[call_reason]")
log_game("Shuttle call reason: [call_reason]")
message_admins("[key_name_admin(user)] has called the shuttle. (<A HREF='?_src_=holder;[HrefToken()];trigger_centcom_recall=1'>TRIGGER CENTCOM RECALL</A>)")
message_admins("[ADMIN_LOOKUPFLW(user)] has called the shuttle. (<A HREF='?_src_=holder;[HrefToken()];trigger_centcom_recall=1'>TRIGGER CENTCOM RECALL</A>)")
/datum/controller/subsystem/shuttle/proc/centcom_recall(old_timer, admiral_message)
if(emergency.mode != SHUTTLE_CALL || emergency.timer != old_timer)
@@ -310,9 +260,8 @@ SUBSYSTEM_DEF(shuttle)
if(canRecall())
emergency.cancel(get_area(user))
log_game("[key_name(user)] has recalled the shuttle.")
message_admins("[key_name_admin(user)] has recalled the shuttle.")
var/area/A = get_area(user)
deadchat_broadcast("<span class='deadsay'><span class='name'>[user.real_name]</span> has recalled the shuttle at <span class='name'>[A.name]</span>.</span>", user)
message_admins("[ADMIN_LOOKUPFLW(user)] has recalled the shuttle.")
deadchat_broadcast("<span class='deadsay'><span class='name'>[user.real_name]</span> has recalled the shuttle from <span class='name'>[get_area_name(user, TRUE)]</span>.</span>", user)
return 1
/datum/controller/subsystem/shuttle/proc/canRecall()
@@ -476,43 +425,29 @@ SUBSYSTEM_DEF(shuttle)
if(EAST, WEST)
transit_width += M.height
transit_height += M.width
/*
to_chat(world, "The attempted transit dock will be [transit_width] width, and \)
[transit_height] in height. The travel dir is [travel_dir]."
*/
// Then find a place to put the zone
var/transit_path = /turf/open/space/transit
switch(travel_dir)
if(NORTH)
transit_path = /turf/open/space/transit/north
if(SOUTH)
transit_path = /turf/open/space/transit/south
if(EAST)
transit_path = /turf/open/space/transit/east
if(WEST)
transit_path = /turf/open/space/transit/west
var/list/proposed_zone
var/datum/turf_reservation/proposal = SSmapping.RequestBlockReservation(transit_width, transit_height, null, /datum/turf_reservation/transit, transit_path)
base:
for(var/i in transit_turfs)
CHECK_TICK
var/turf/topleft = i
if(!(topleft.flags_1 & UNUSED_TRANSIT_TURF_1))
continue
var/turf/bottomright = locate(topleft.x + transit_width,
topleft.y + transit_height, topleft.z)
if(!bottomright)
continue
if(!(bottomright.flags_1 & UNUSED_TRANSIT_TURF_1))
continue
proposed_zone = block(topleft, bottomright)
if(!proposed_zone)
continue
for(var/j in proposed_zone)
var/turf/T = j
if(!T)
continue base
if(!(T.flags_1 & UNUSED_TRANSIT_TURF_1))
continue base
break base
if((!proposed_zone) || (!proposed_zone.len))
if(!istype(proposal))
return FALSE
var/turf/topleft = proposed_zone[1]
var/turf/bottomleft = locate(proposal.bottom_left_coords[1], proposal.bottom_left_coords[2], proposal.bottom_left_coords[3])
// Then create a transit docking port in the middle
var/coords = M.return_coords(0, 0, dock_dir)
/* 0------2
@@ -531,41 +466,24 @@ SUBSYSTEM_DEF(shuttle)
var/y2 = min(y0, y1)
// Then invert the numbers
var/transit_x = topleft.x + SHUTTLE_TRANSIT_BORDER + abs(x2)
var/transit_y = topleft.y + SHUTTLE_TRANSIT_BORDER + abs(y2)
var/transit_x = bottomleft.x + SHUTTLE_TRANSIT_BORDER + abs(x2)
var/transit_y = bottomleft.y + SHUTTLE_TRANSIT_BORDER + abs(y2)
var/transit_path = /turf/open/space/transit
switch(travel_dir)
if(NORTH)
transit_path = /turf/open/space/transit/north
if(SOUTH)
transit_path = /turf/open/space/transit/south
if(EAST)
transit_path = /turf/open/space/transit/east
if(WEST)
transit_path = /turf/open/space/transit/west
var/turf/midpoint = locate(transit_x, transit_y, topleft.z)
var/turf/midpoint = locate(transit_x, transit_y, bottomleft.z)
if(!midpoint)
return FALSE
var/area/shuttle/transit/A = new()
A.parallax_movedir = travel_dir
A.contents = proposed_zone
A.contents = proposal.reserved_turfs
var/obj/docking_port/stationary/transit/new_transit_dock = new(midpoint)
new_transit_dock.assigned_turfs = proposed_zone
new_transit_dock.reserved_area = proposal
new_transit_dock.name = "Transit for [M.id]/[M.name]"
new_transit_dock.owner = M
new_transit_dock.assigned_area = A
// Add 180, because ports point inwards, rather than outwards
new_transit_dock.setDir(angle2dir(dock_angle))
for(var/i in new_transit_dock.assigned_turfs)
var/turf/T = i
T.ChangeTurf(transit_path)
T.flags_1 &= ~(UNUSED_TRANSIT_TURF_1)
M.assigned_transit = new_transit_dock
return new_transit_dock
@@ -576,9 +494,6 @@ SUBSYSTEM_DEF(shuttle)
stationary = SSshuttle.stationary
if (istype(SSshuttle.transit))
transit = SSshuttle.transit
if (istype(SSshuttle.transit_turfs))
transit_turfs = SSshuttle.transit_turfs
if (istype(SSshuttle.transit_requesters))
transit_requesters = SSshuttle.transit_requesters
if (istype(SSshuttle.transit_request_failures))
@@ -616,9 +531,6 @@ SUBSYSTEM_DEF(shuttle)
if (istype(SSshuttle.shuttle_purchase_requirements_met))
shuttle_purchase_requirements_met = SSshuttle.shuttle_purchase_requirements_met
if (clear_transit)
WARNING("The shuttle subsystem crashed and was recovered while clearing transit.")
centcom_message = SSshuttle.centcom_message
ordernum = SSshuttle.ordernum
points = SSshuttle.points
@@ -699,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)
+16 -5
View File
@@ -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)
+13 -5
View File
@@ -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
@@ -647,6 +648,13 @@ SUBSYSTEM_DEF(ticker)
if(end_string)
end_state = end_string
var/statspage = CONFIG_GET(string/roundstatsurl)
var/gamelogloc = CONFIG_GET(string/gamelogurl)
if(statspage)
to_chat(world, "<span class='info'>Round statistics and logs can be viewed <a href=\"[statspage][GLOB.round_id]\">at this website!</a></span>")
else if(gamelogloc)
to_chat(world, "<span class='info'>Round logs can be located <a href=\"[gamelogloc]\">at this website!</a></span>")
log_game("<span class='boldannounce'>Rebooting World. [reason]</span>")
world.Reboot()
+2
View File
@@ -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

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