Merge branch 'master' into Ghommie-cit539
This commit is contained in:
@@ -138,8 +138,8 @@
|
||||
|
||||
////organ defines
|
||||
#define STANDARD_ORGAN_THRESHOLD 100
|
||||
#define STANDARD_ORGAN_HEALING 0.001
|
||||
#define STANDARD_ORGAN_DECAY 0.00222 //designed to fail organs when left to decay for ~15 minutes
|
||||
#define STANDARD_ORGAN_HEALING (1/(15 MINUTES / (2 SECONDS)))
|
||||
#define STANDARD_ORGAN_DECAY (1/(15 MINUTES / (2 SECONDS))) //designed to fail organs when left to decay for ~15 minutes. 2 SECOND is SSmobs tickrate.
|
||||
|
||||
#define G_MALE 1
|
||||
#define G_FEMALE 2
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
|
||||
|
||||
#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
|
||||
#define STOP_PROCESSING(Processor, Datum) Datum.datum_flags &= ~DF_ISPROCESSING;Processor.processing -= Datum;Processor.currentrun -= Datum
|
||||
|
||||
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
#define ADMIN_PUNISHMENT_SUPPLYPOD "Supply Pod"
|
||||
#define ADMIN_PUNISHMENT_MAZING "Puzzle"
|
||||
#define ADMIN_PUNISHMENT_PIE "Cream Pie"
|
||||
#define ADMIN_PUNISHMENT_CUSTOM_PIE "Custom Cream Pie"
|
||||
|
||||
#define AHELP_ACTIVE 1
|
||||
#define AHELP_CLOSED 2
|
||||
@@ -87,5 +88,5 @@
|
||||
#define MAX_KEYPRESS_COMMANDLENGTH 16
|
||||
///Max amount of keypress messages per second over two seconds before client is autokicked
|
||||
#define MAX_KEYPRESS_AUTOKICK 100
|
||||
///Length of held key rolling buffer
|
||||
#define HELD_KEY_BUFFER_LENGTH 15
|
||||
///Length of max held keys
|
||||
#define MAX_HELD_KEYS 15
|
||||
|
||||
@@ -149,9 +149,9 @@
|
||||
|
||||
//OPEN TURF ATMOS
|
||||
#define OPENTURF_DEFAULT_ATMOS "o2=22;n2=82;TEMP=293.15" //the default air mix that open turfs spawn
|
||||
#define TCOMMS_ATMOS "n2=100;TEMP=80" //-193,15°C telecommunications. also used for xenobiology slime killrooms
|
||||
#define TCOMMS_ATMOS "n2=100;TEMP=80" //-193,15degC telecommunications. also used for xenobiology slime killrooms
|
||||
#define AIRLESS_ATMOS "TEMP=2.7" //space
|
||||
#define FROZEN_ATMOS "o2=22;n2=82;TEMP=180" //-93.15°C snow and ice turfs
|
||||
#define FROZEN_ATMOS "o2=22;n2=82;TEMP=180" //-93.15degC snow and ice turfs
|
||||
#define BURNMIX_ATMOS "o2=2500;plasma=5000;TEMP=370" //used in the holodeck burn test program
|
||||
|
||||
//ATMOSPHERICS DEPARTMENT GAS TANK TURFS
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define CAN_MASTURBATE_WITH (1<<5)
|
||||
#define MASTURBATE_LINKED_ORGAN (1<<6) //used to pass our mission to the linked organ
|
||||
#define CAN_CLIMAX_WITH (1<<7)
|
||||
#define GENITAL_CAN_AROUSE (1<<8)
|
||||
|
||||
#define COCK_SIZE_MIN 1
|
||||
#define COCK_SIZE_MAX 20
|
||||
|
||||
@@ -106,6 +106,9 @@
|
||||
|
||||
#define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params, mob/user)
|
||||
#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob)
|
||||
#define COMPONENT_ALLOW_EXAMINATE 1
|
||||
#define COMPONENT_DENY_EXAMINATE 2 //Higher priority compared to the above one
|
||||
|
||||
#define COMSIG_CLICK_CTRL "ctrl_click" //from base of atom/CtrlClickOn(): (/mob)
|
||||
#define COMSIG_CLICK_ALT "alt_click" //from base of atom/AltClick(): (/mob)
|
||||
#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" //from base of atom/CtrlShiftClick(/mob)
|
||||
@@ -159,7 +162,6 @@
|
||||
|
||||
// /mob signals
|
||||
#define COMSIG_MOB_EXAMINATE "mob_examinate" //from base of /mob/verb/examinate(): (atom/A)
|
||||
#define COMPONENT_ALLOW_EXAMINE 1
|
||||
#define COMSIG_MOB_DEATH "mob_death" //from base of mob/death(): (gibbed)
|
||||
#define COMPONENT_BLOCK_DEATH_BROADCAST 1 //stops the death from being broadcasted in deadchat.
|
||||
#define COMSIG_MOB_GHOSTIZE "mob_ghostize" //from base of mob/Ghostize(): (can_reenter_corpse, special, penalize)
|
||||
@@ -185,10 +187,10 @@
|
||||
#define SPEECH_MESSAGE 1
|
||||
// #define SPEECH_BUBBLE_TYPE 2
|
||||
#define SPEECH_SPANS 3
|
||||
/* #define SPEECH_SANITIZE 4
|
||||
// #define SPEECH_SANITIZE 4
|
||||
#define SPEECH_LANGUAGE 5
|
||||
#define SPEECH_IGNORE_SPAM 6
|
||||
#define SPEECH_FORCED 7 */
|
||||
// #define SPEECH_IGNORE_SPAM 6
|
||||
// #define SPEECH_FORCED 7
|
||||
|
||||
// /mob/living signals
|
||||
#define COMSIG_LIVING_FULLY_HEAL "living_fully_healed" //from base of /mob/living/fully_heal(): (admin_revive)
|
||||
@@ -198,6 +200,7 @@
|
||||
#define COMSIG_LIVING_EXTINGUISHED "living_extinguished" //from base of mob/living/ExtinguishMob() (/mob/living)
|
||||
#define COMSIG_LIVING_ELECTROCUTE_ACT "living_electrocute_act" //from base of mob/living/electrocute_act(): (shock_damage)
|
||||
#define COMSIG_LIVING_MINOR_SHOCK "living_minor_shock" //sent by stuff like stunbatons and tasers: ()
|
||||
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login" //sent when a mob/login() finishes: (client)
|
||||
#define COMSIG_LIVING_GUN_PROCESS_FIRE "living_gun_process_fire" //from base of /obj/item/gun/proc/process_fire(): (atom/target, params, zone_override)
|
||||
|
||||
// /mob/living/carbon signals
|
||||
@@ -275,8 +278,6 @@
|
||||
#define COMSIG_TURF_MAKE_DRY "make_turf_try" //(max_strength, immediate, duration_decrease = INFINITY): Returns bool.
|
||||
#define COMSIG_COMPONENT_CLEAN_ACT "clean_act" //called on an object to clean it of cleanables. Usualy with soap: (num/strength)
|
||||
|
||||
//Blood color
|
||||
#define COMSIG_BLOOD_COLOR "blood_DNA_to_color" //RGB blood stuff
|
||||
//Food
|
||||
#define COMSIG_FOOD_EATEN "food_eaten" //from base of obj/item/reagent_containers/food/snacks/attack(): (mob/living/eater, mob/feeder)
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#define NO_ASSASSIN (1<<0)
|
||||
#define WAROPS_ALWAYS_ALLOWED (1<<1)
|
||||
#define USE_PREF_WEIGHTS (1<<2)
|
||||
|
||||
#define ONLY_RULESET (1<<0)
|
||||
#define HIGHLANDER_RULESET (1<<1)
|
||||
|
||||
@@ -56,11 +56,12 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
|
||||
|
||||
//Movement Types
|
||||
#define GROUND (1<<0)
|
||||
#define FLYING (1<<1)
|
||||
#define VENTCRAWLING (1<<2)
|
||||
#define FLOATING (1<<3)
|
||||
#define UNSTOPPABLE (1<<4) //When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
|
||||
#define GROUND (1<<0)
|
||||
#define FLYING (1<<1)
|
||||
#define VENTCRAWLING (1<<2)
|
||||
#define FLOATING (1<<3)
|
||||
#define UNSTOPPABLE (1<<4) //When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
|
||||
#define CRAWLING (1<<5) //Applied if you're crawling around on the ground/resting.
|
||||
|
||||
//Fire and Acid stuff, for resistance_flags
|
||||
#define LAVA_PROOF (1<<0)
|
||||
|
||||
+13
-12
@@ -24,18 +24,19 @@
|
||||
#define LOG_SAY (1 << 1)
|
||||
#define LOG_WHISPER (1 << 2)
|
||||
#define LOG_EMOTE (1 << 3)
|
||||
#define LOG_DSAY (1 << 4)
|
||||
#define LOG_PDA (1 << 5)
|
||||
#define LOG_CHAT (1 << 6)
|
||||
#define LOG_COMMENT (1 << 7)
|
||||
#define LOG_TELECOMMS (1 << 8)
|
||||
#define LOG_OOC (1 << 9)
|
||||
#define LOG_ADMIN (1 << 10)
|
||||
#define LOG_OWNERSHIP (1 << 11)
|
||||
#define LOG_GAME (1 << 12)
|
||||
#define LOG_ADMIN_PRIVATE (1 << 13)
|
||||
#define LOG_ASAY (1 << 14)
|
||||
#define LOG_VIRUS (1 << 15)
|
||||
#define LOG_SUBTLER (1 << 4)
|
||||
#define LOG_DSAY (1 << 5)
|
||||
#define LOG_PDA (1 << 6)
|
||||
#define LOG_CHAT (1 << 7)
|
||||
#define LOG_COMMENT (1 << 8)
|
||||
#define LOG_TELECOMMS (1 << 9)
|
||||
#define LOG_OOC (1 << 10)
|
||||
#define LOG_ADMIN (1 << 11)
|
||||
#define LOG_OWNERSHIP (1 << 12)
|
||||
#define LOG_GAME (1 << 13)
|
||||
#define LOG_ADMIN_PRIVATE (1 << 14)
|
||||
#define LOG_ASAY (1 << 15)
|
||||
#define LOG_VIRUS (1 << 16)
|
||||
|
||||
//Individual logging panel pages
|
||||
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)
|
||||
|
||||
@@ -96,12 +96,22 @@
|
||||
#define NUKESTATE_CORE_EXPOSED 1
|
||||
#define NUKESTATE_CORE_REMOVED 0
|
||||
|
||||
#define NUKEUI_AWAIT_DISK 0
|
||||
#define NUKEUI_AWAIT_CODE 1
|
||||
#define NUKEUI_AWAIT_TIMER 2
|
||||
#define NUKEUI_AWAIT_ARM 3
|
||||
#define NUKEUI_TIMING 4
|
||||
#define NUKEUI_EXPLODED 5
|
||||
|
||||
#define NUKE_OFF_LOCKED 0
|
||||
#define NUKE_OFF_UNLOCKED 1
|
||||
#define NUKE_ON_TIMING 2
|
||||
#define NUKE_ON_EXPLODING 3
|
||||
|
||||
#define MACHINE_NOT_ELECTRIFIED 0
|
||||
#define MACHINE_ELECTRIFIED_PERMANENT -1
|
||||
#define MACHINE_DEFAULT_ELECTRIFY_TIME 30
|
||||
|
||||
//these flags are used to tell the DNA modifier if a plant gene cannot be extracted or modified.
|
||||
#define PLANT_GENE_REMOVABLE (1<<0)
|
||||
#define PLANT_GENE_EXTRACTABLE (1<<1)
|
||||
#define PLANT_GENE_EXTRACTABLE (1<<1)
|
||||
|
||||
@@ -199,4 +199,6 @@
|
||||
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
|
||||
|
||||
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
|
||||
// )
|
||||
// )
|
||||
|
||||
#define MANHATTAN_DISTANCE(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
|
||||
+16
-14
@@ -35,17 +35,17 @@
|
||||
#define BLOODCRAWL 1
|
||||
#define BLOODCRAWL_EAT 2
|
||||
|
||||
//Mob bio-types
|
||||
#define MOB_ORGANIC "organic"
|
||||
#define MOB_INORGANIC "inorganic"
|
||||
#define MOB_ROBOTIC "robotic"
|
||||
#define MOB_UNDEAD "undead"
|
||||
#define MOB_HUMANOID "humanoid"
|
||||
#define MOB_BUG "bug"
|
||||
#define MOB_BEAST "beast"
|
||||
#define MOB_EPIC "epic" //megafauna
|
||||
#define MOB_REPTILE "reptile"
|
||||
#define MOB_SPIRIT "spirit"
|
||||
//Mob bio-types flags
|
||||
#define MOB_ORGANIC 1 << 0
|
||||
#define MOB_MINERAL 1 << 1
|
||||
#define MOB_ROBOTIC 1 << 2
|
||||
#define MOB_UNDEAD 1 << 3
|
||||
#define MOB_HUMANOID 1 << 4
|
||||
#define MOB_BUG 1 << 5
|
||||
#define MOB_BEAST 1 << 6
|
||||
#define MOB_EPIC 1 << 7 //megafauna
|
||||
#define MOB_REPTILE 1 << 8
|
||||
#define MOB_SPIRIT 1 << 9
|
||||
|
||||
//Organ defines for carbon mobs
|
||||
#define ORGAN_ORGANIC 1
|
||||
@@ -200,9 +200,11 @@
|
||||
#define NO_SLIP_WHEN_WALKING (1<<0)
|
||||
#define SLIDE (1<<1)
|
||||
#define GALOSHES_DONT_HELP (1<<2)
|
||||
#define SLIDE_ICE (1<<3)
|
||||
#define SLIP_WHEN_CRAWLING (1<<4) //clown planet ruin
|
||||
#define SLIP_WHEN_JOGGING (1<<5) //slips prevented by walking are also dodged if the mob is not sprinting or fatigued... unless this flag is on.
|
||||
#define FLYING_DOESNT_HELP (1<<3)
|
||||
#define SLIDE_ICE (1<<4)
|
||||
#define SLIP_WHEN_CRAWLING (1<<5) //clown planet ruin amongst others
|
||||
#define SLIP_WHEN_JOGGING (1<<6) //slips prevented by walking are also dodged if the mob is nor sprinting or fatigued... unless this flag is on.
|
||||
|
||||
|
||||
#define MAX_CHICKENS 50
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define PROFILE_START ;PROFILE_STORE = list();PROFILE_SET;
|
||||
#define PROFILE_STOP ;PROFILE_STORE = null;
|
||||
#define LINE_PROFILE_START ;PROFILE_STORE = list();PROFILE_SET;
|
||||
#define LINE_PROFILE_STOP ;PROFILE_STORE = null;
|
||||
|
||||
#define PROFILE_SET ;PROFILE_TIME = TICK_USAGE_REAL; PROFILE_LINE = __LINE__; PROFILE_FILE = __FILE__; PROFILE_SLEEPCHECK = world.time;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#define REAGENT_PURITY_ACCURACY 0.001
|
||||
#define DEFAULT_SPECIFIC_HEAT 200
|
||||
|
||||
// container_type defines
|
||||
//reagents_holder_flags 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.
|
||||
|
||||
@@ -29,12 +29,19 @@
|
||||
#define PATCH 4 // patches
|
||||
#define INJECT 5 // injection
|
||||
|
||||
//container_flags
|
||||
#define PH_WEAK (1 << 0)
|
||||
#define TEMP_WEAK (1 << 1)
|
||||
#define APTFT_VERB (1 << 2) //APTFT stands for "amount per transfer from this"
|
||||
#define APTFT_ALTCLICK (1 << 3)
|
||||
|
||||
//defines passed through to the on_reagent_change proc
|
||||
#define DEL_REAGENT 1 // reagent deleted (fully cleared)
|
||||
#define ADD_REAGENT 2 // reagent added
|
||||
#define REM_REAGENT 3 // reagent removed (may still exist)
|
||||
|
||||
#define THRESHOLD_UNHUSK 50 // health threshold for synthflesh/rezadone to unhusk someone
|
||||
|
||||
//reagent bitflags, used for altering how they works
|
||||
#define REAGENT_DEAD_PROCESS (1<<0) //calls on_mob_dead() if present in a dead body
|
||||
#define REAGENT_DONOTSPLIT (1<<1) //Do not split the chem at all during processing
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define ROLE_BLOODSUCKER "bloodsucker"
|
||||
//#define ROLE_MONSTERHUNTER "monster hunter" Disabled for now
|
||||
#define ROLE_GHOSTCAFE "ghostcafe"
|
||||
#define ROLE_MINOR_ANTAG "minorantag"
|
||||
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
|
||||
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
|
||||
//(in game days played) to play that role
|
||||
|
||||
@@ -11,3 +11,8 @@
|
||||
#define SHOULD_CALL_PARENT(X)
|
||||
#define UNLINT(X) X
|
||||
#endif
|
||||
|
||||
/world/proc/enable_debugger()
|
||||
var/dll = world.GetConfig("env", "EXTOOLS_DLL")
|
||||
if (dll)
|
||||
call(dll, "debug_initialize")()
|
||||
|
||||
@@ -46,7 +46,9 @@
|
||||
|
||||
#define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep
|
||||
|
||||
#define STATUS_EFFECT_TASED /datum/status_effect/no_combat_mode/electrode/ //the affected has been tased, preventing fine muscle control
|
||||
#define STATUS_EFFECT_TASED_WEAK /datum/status_effect/electrode //not as crippling, just slows down
|
||||
|
||||
#define STATUS_EFFECT_TASED /datum/status_effect/electrode/no_combat_mode //the affected has been tased, preventing fine muscle control
|
||||
|
||||
#define STATUS_EFFECT_PACIFY /datum/status_effect/pacify //the affected is pacified, preventing direct hostile actions
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
// Subsystems shutdown in the reverse of the order they initialize in
|
||||
// The numbers just define the ordering, they are meaningless otherwise.
|
||||
|
||||
#define INIT_ORDER_PROFILER 101
|
||||
#define INIT_ORDER_FAIL2TOPIC 22
|
||||
#define INIT_ORDER_TITLE 20
|
||||
#define INIT_ORDER_GARBAGE 19
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#define TGS_EXTERNAL_CONFIGURATION
|
||||
#define TGS_V3_API
|
||||
#define TGS_DEFINE_AND_SET_GLOBAL(Name, Value) GLOBAL_VAR_INIT(##Name, ##Value); GLOBAL_PROTECT(##Name)
|
||||
#define TGS_READ_GLOBAL(Name) GLOB.##Name
|
||||
#define TGS_WRITE_GLOBAL(Name, Value) GLOB.##Name = ##Value
|
||||
|
||||
+21
-5
@@ -107,6 +107,22 @@
|
||||
var/commit //full sha of compiled commit
|
||||
var/origin_commit //full sha of last known remote commit. This may be null if the TGS repository is not currently tracking a remote branch
|
||||
|
||||
//represents a version of tgstation-server
|
||||
/datum/tgs_version
|
||||
var/suite //The suite version, can be >=3
|
||||
|
||||
//this group of variables can be null to represent a wild card
|
||||
var/major //The major version
|
||||
var/minor //The minor version
|
||||
var/patch //The patch version
|
||||
|
||||
var/raw_parameter //The unparsed parameter
|
||||
var/deprefixed_parameter //The version only bit of raw_parameter
|
||||
|
||||
//if the tgs_version is a wildcard version
|
||||
/datum/tgs_version/proc/Wildcard()
|
||||
return
|
||||
|
||||
//represents a merge of a GitHub pull request
|
||||
/datum/tgs_revision_information/test_merge
|
||||
var/number //pull request number
|
||||
@@ -155,22 +171,22 @@
|
||||
|
||||
//FUNCTIONS
|
||||
|
||||
//Returns the respective string version of the API
|
||||
//Returns the respective supported /datum/tgs_version of the API
|
||||
/world/proc/TgsMaximumAPIVersion()
|
||||
return
|
||||
|
||||
/world/proc/TgsMinimumAPIVersion()
|
||||
return
|
||||
|
||||
//Gets the current version of the server tools running the server
|
||||
/world/proc/TgsVersion()
|
||||
return
|
||||
|
||||
//Returns TRUE if the world was launched under the server tools and the API matches, FALSE otherwise
|
||||
//No function below this succeeds if it returns FALSE
|
||||
/world/proc/TgsAvailable()
|
||||
return
|
||||
|
||||
//Gets the current /datum/tgs_version of the server tools running the server
|
||||
/world/proc/TgsVersion()
|
||||
return
|
||||
|
||||
/world/proc/TgsInstanceName()
|
||||
return
|
||||
|
||||
|
||||
@@ -54,5 +54,5 @@ When using time2text(), please use "DDD" to find the weekday. Refrain from using
|
||||
#define WORLDTIME2TEXT(format) GAMETIMESTAMP(format, world.time)
|
||||
#define WORLDTIMEOFDAY2TEXT(format) GAMETIMESTAMP(format, world.timeofday)
|
||||
#define TIME_STAMP(format, showds) showds ? "[WORLDTIMEOFDAY2TEXT(format)]:[world.timeofday % 10]" : WORLDTIMEOFDAY2TEXT(format)
|
||||
#define STATION_TIME(display_only) ((((world.time - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - (display_only? GLOB.timezoneOffset : 0)
|
||||
#define STATION_TIME_TIMESTAMP(format) time2text(STATION_TIME(TRUE), format)
|
||||
#define STATION_TIME(display_only, wtime) ((((wtime - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - (display_only? GLOB.timezoneOffset : 0)
|
||||
#define STATION_TIME_TIMESTAMP(format, wtime) time2text(STATION_TIME(TRUE, wtime), format)
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
#define TRAIT_NOHARDCRIT "nohardcrit"
|
||||
#define TRAIT_NOSOFTCRIT "nosoftcrit"
|
||||
#define TRAIT_MINDSHIELD "mindshield"
|
||||
#define TRAIT_HIJACKER "hijacker"
|
||||
#define TRAIT_SIXTHSENSE "sixthsense"
|
||||
#define TRAIT_DISSECTED "dissected"
|
||||
#define TRAIT_FEARLESS "fearless"
|
||||
@@ -174,6 +175,7 @@
|
||||
#define TRAIT_CLOWN_MENTALITY "clown_mentality" // The future is now, clownman.
|
||||
#define TRAIT_FREESPRINT "free_sprinting"
|
||||
#define TRAIT_NO_TELEPORT "no-teleport" //you just can't
|
||||
#define TRAIT_NO_INTERNALS "no-internals"
|
||||
#define TRAIT_NO_ALCOHOL "alcohol_intolerance"
|
||||
|
||||
// common trait sources
|
||||
@@ -232,9 +234,9 @@
|
||||
#define SLEEPING_CARP_TRAIT "sleeping_carp"
|
||||
#define RISING_BASS_TRAIT "rising_bass"
|
||||
#define ABDUCTOR_ANTAGONIST "abductor-antagonist"
|
||||
#define NUKEOP_ANTAGONIST "nukeop-antagonist"
|
||||
#define MADE_UNCLONEABLE "made-uncloneable"
|
||||
#define TIMESTOP_TRAIT "timestop"
|
||||
#define NUKEOP_TRAIT "nuke-op"
|
||||
#define CLOWNOP_TRAIT "clown-op"
|
||||
#define MEGAFAUNA_TRAIT "megafauna"
|
||||
#define DEATHSQUAD_TRAIT "deathsquad"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define TYPEID_NULL "0"
|
||||
#define TYPEID_NORMAL_LIST "f"
|
||||
//helper macros
|
||||
#define GET_TYPEID(ref) ( ( (length(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, length(ref)-6) ) )
|
||||
#define GET_TYPEID(ref) ( ( (length(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, -7) ) )
|
||||
#define IS_NORMAL_LIST(L) (GET_TYPEID("\ref[L]") == TYPEID_NORMAL_LIST)
|
||||
|
||||
|
||||
|
||||
+12
-1
@@ -1,6 +1,17 @@
|
||||
#define PLURALITY_VOTING 0
|
||||
#define APPROVAL_VOTING 1
|
||||
#define RANKED_CHOICE_VOTING 2
|
||||
#define SCHULZE_VOTING 2
|
||||
#define SCORE_VOTING 3
|
||||
#define MAJORITY_JUDGEMENT_VOTING 4
|
||||
#define INSTANT_RUNOFF_VOTING 5
|
||||
|
||||
GLOBAL_LIST_INIT(vote_score_options,list("Bad","Poor","Acceptable","Good","Great"))
|
||||
|
||||
GLOBAL_LIST_INIT(vote_type_names,list(\
|
||||
"Plurality (default)" = PLURALITY_VOTING,\
|
||||
"Approval" = APPROVAL_VOTING,\
|
||||
"IRV (single winner ranked choice)" = INSTANT_RUNOFF_VOTING,\
|
||||
"Schulze (ranked choice, higher result=better)" = SCHULZE_VOTING,\
|
||||
"Raw Score (returns results from 0 to 1, winner is 1)" = SCORE_VOTING,\
|
||||
"Majority Judgement (single-winner score voting)" = MAJORITY_JUDGEMENT_VOTING,\
|
||||
))
|
||||
|
||||
@@ -57,14 +57,11 @@ GLOBAL_LIST_EMPTY(ipc_antennas_list)
|
||||
|
||||
//Genitals and Arousal Lists
|
||||
GLOBAL_LIST_EMPTY(genitals_list)
|
||||
GLOBAL_LIST_EMPTY(cock_shapes_list)//global_lists.dm for the list initializations //Now also _DATASTRUCTURES globals.dm
|
||||
GLOBAL_LIST_EMPTY(cock_shapes_icons) //Associated list for names->icon_states for cockshapes.
|
||||
GLOBAL_LIST_EMPTY(cock_shapes_list)
|
||||
GLOBAL_LIST_EMPTY(gentlemans_organ_names)
|
||||
GLOBAL_LIST_EMPTY(balls_shapes_list)
|
||||
GLOBAL_LIST_EMPTY(balls_shapes_icons)
|
||||
GLOBAL_LIST_EMPTY(breasts_size_list)
|
||||
GLOBAL_LIST_EMPTY(breasts_shapes_list)
|
||||
GLOBAL_LIST_EMPTY(breasts_shapes_icons)
|
||||
GLOBAL_LIST_EMPTY(vagina_shapes_list)
|
||||
GLOBAL_LIST_INIT(cum_into_containers_list, list(/obj/item/reagent_containers/food/snacks/pie)) //Yer fuggin snowflake name list jfc
|
||||
GLOBAL_LIST_INIT(dick_nouns, list("dick","cock","member","shaft"))
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
if (CONFIG_GET(flag/log_adminchat))
|
||||
WRITE_LOG(GLOB.world_game_log, "ADMIN: DSAY: [text]")
|
||||
|
||||
/proc/log_consent(text)
|
||||
WRITE_LOG(GLOB.world_game_log,"CONSENT: [text]")
|
||||
|
||||
/* All other items are public. */
|
||||
/proc/log_game(text)
|
||||
@@ -94,6 +96,10 @@
|
||||
if (CONFIG_GET(flag/log_emote))
|
||||
WRITE_LOG(GLOB.world_game_log, "EMOTE: [text]")
|
||||
|
||||
/proc/log_subtler(text)
|
||||
if (CONFIG_GET(flag/log_emote))
|
||||
WRITE_LOG(GLOB.world_game_log, "EMOTE (SUBTLER): [text]")
|
||||
|
||||
/proc/log_prayer(text)
|
||||
if (CONFIG_GET(flag/log_prayer))
|
||||
WRITE_LOG(GLOB.world_game_log, "PRAY: [text]")
|
||||
@@ -165,10 +171,21 @@
|
||||
/proc/log_mapping(text)
|
||||
WRITE_LOG(GLOB.world_map_error_log, text)
|
||||
|
||||
/proc/log_reagent(text)
|
||||
WRITE_LOG(GLOB.reagent_log, text)
|
||||
|
||||
/proc/log_reagent_transfer(text)
|
||||
log_reagent("TRANSFER: [text]")
|
||||
|
||||
/* For logging round startup. */
|
||||
/proc/start_log(log)
|
||||
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
|
||||
|
||||
/* ui logging */
|
||||
|
||||
/proc/log_tgui(text)
|
||||
WRITE_LOG(GLOB.tgui_log, text)
|
||||
|
||||
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
|
||||
/proc/shutdown_logging()
|
||||
rustg_log_close_all()
|
||||
|
||||
@@ -227,6 +227,8 @@
|
||||
/proc/get_sub_areas_contents(area/A, include_base = TRUE)
|
||||
if(ispath(A))
|
||||
A = GLOB.areas_by_type[A]
|
||||
else
|
||||
A = get_area(A) //in case it's called on other atoms.
|
||||
if(!A)
|
||||
return
|
||||
if(A.base_area)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
continue
|
||||
path += choice
|
||||
|
||||
if(copytext(path,-1,0) != "/") //didn't choose a directory, no need to iterate again
|
||||
if(copytext_char(path, -1) != "/") //didn't choose a directory, no need to iterate again
|
||||
break
|
||||
var/extensions
|
||||
for(var/i in valid_extensions)
|
||||
|
||||
+15
-34
@@ -145,20 +145,6 @@
|
||||
turfs += T
|
||||
return turfs
|
||||
|
||||
|
||||
//This is the new version of recursive_mob_check, used for say().
|
||||
//The other proc was left intact because morgue trays use it.
|
||||
//Sped this up again for real this time
|
||||
/proc/recursive_hear_check(O)
|
||||
var/list/processing_list = list(O)
|
||||
. = list()
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
if(A.flags_1 & HEAR_1)
|
||||
. += A
|
||||
processing_list.Cut(1, 2)
|
||||
processing_list += A.contents
|
||||
|
||||
/** recursive_organ_check
|
||||
* inputs: O (object to start with)
|
||||
* outputs:
|
||||
@@ -238,35 +224,30 @@
|
||||
|
||||
return found_mobs
|
||||
|
||||
|
||||
/proc/get_hearers_in_view(R, atom/source)
|
||||
// Returns a list of hearers in view(R) from source (ignoring luminosity). Used in saycode.
|
||||
var/turf/T = get_turf(source)
|
||||
. = list()
|
||||
|
||||
if(!T)
|
||||
return
|
||||
|
||||
var/list/processing_list = list()
|
||||
if (R == 0) // if the range is zero, we know exactly where to look for, we can skip view
|
||||
processing_list += T.contents // We can shave off one iteration by assuming turfs cannot hear
|
||||
else // A variation of get_hear inlined here to take advantage of the compiler's fastpath for obj/mob in view
|
||||
var/list/processing = list()
|
||||
if(R == 0)
|
||||
processing += T.contents
|
||||
else
|
||||
var/lum = T.luminosity
|
||||
T.luminosity = 6 // This is the maximum luminosity
|
||||
var/list/cachedview = view(R, T)
|
||||
for(var/mob/M in cachedview)
|
||||
processing_list += M
|
||||
for(var/obj/O in cachedview)
|
||||
processing_list += O
|
||||
T.luminosity = 6
|
||||
var/list/cached_view = view(R, T)
|
||||
for(var/mob/M in cached_view)
|
||||
processing += M
|
||||
for(var/obj/O in cached_view)
|
||||
processing += O
|
||||
T.luminosity = lum
|
||||
|
||||
while(processing_list.len) // recursive_hear_check inlined here
|
||||
var/atom/A = processing_list[1]
|
||||
var/i = 0
|
||||
while(i < length(processing))
|
||||
var/atom/A = processing[++i]
|
||||
if(A.flags_1 & HEAR_1)
|
||||
. += A
|
||||
SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing_list, .)
|
||||
processing_list.Cut(1, 2)
|
||||
processing_list += A.contents
|
||||
SEND_SIGNAL(A, COMSIG_ATOM_HEARER_IN_VIEW, processing, .)
|
||||
processing += A.contents
|
||||
|
||||
/proc/get_mobs_in_radio_ranges(list/obj/item/radio/radios)
|
||||
. = list()
|
||||
|
||||
@@ -51,26 +51,15 @@
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/antenna, GLOB.ipc_antennas_list, roundstart = TRUE)
|
||||
//genitals
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/penis, GLOB.cock_shapes_list)
|
||||
for(var/K in GLOB.cock_shapes_list)
|
||||
var/datum/sprite_accessory/penis/value = GLOB.cock_shapes_list[K]
|
||||
GLOB.cock_shapes_icons[K] = value.icon_state
|
||||
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/vagina, GLOB.vagina_shapes_list)
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/breasts, GLOB.breasts_shapes_list)
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/testicles, GLOB.balls_shapes_list)
|
||||
GLOB.breasts_size_list = list ("a", "b", "c", "d", "e") //We need the list to choose from initialized, but it's no longer a sprite_accessory thing.
|
||||
GLOB.gentlemans_organ_names = list("phallus", "willy", "dick", "prick", "member", "tool", "gentleman's organ",
|
||||
"cock", "wang", "knob", "dong", "joystick", "pecker", "johnson", "weenie", "tadger", "schlong", "thirsty ferret",
|
||||
"baloney pony", "schlanger", "Mutton dagger", "old blind bob","Hanging Johnny", "fishing rod", "Tally whacker", "polly rocket",
|
||||
"One eyed trouser trout", "Ding dong", "ankle spanker", "Pork sword", "engine cranker", "Harry hot dog", "Davy Crockett",
|
||||
"Kidney cracker", "Heat seeking moisture missile", "Giggle stick", "love whistle", "Tube steak", "Uncle Dick", "Purple helmet warrior")
|
||||
for(var/K in GLOB.breasts_shapes_list)
|
||||
var/datum/sprite_accessory/breasts/value = GLOB.breasts_shapes_list[K]
|
||||
GLOB.breasts_shapes_icons[K] = value.icon_state
|
||||
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/testicles, GLOB.balls_shapes_list)
|
||||
for(var/K in GLOB.balls_shapes_list)
|
||||
var/datum/sprite_accessory/testicles/value = GLOB.balls_shapes_list[K]
|
||||
GLOB.balls_shapes_icons[K] = value.icon_state
|
||||
|
||||
for(var/gpath in subtypesof(/obj/item/organ/genital))
|
||||
var/obj/item/organ/genital/G = gpath
|
||||
|
||||
@@ -985,7 +985,7 @@ world
|
||||
var/icon/atom_icon = new(A.icon, A.icon_state)
|
||||
|
||||
if(!letter)
|
||||
letter = copytext(A.name, 1, 2)
|
||||
letter = A.name[1]
|
||||
if(uppercase == 1)
|
||||
letter = uppertext(letter)
|
||||
else if(uppercase == -1)
|
||||
@@ -1113,7 +1113,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0
|
||||
WRITE_FILE(GLOB.iconCache[iconKey], icon)
|
||||
var/iconData = GLOB.iconCache.ExportText(iconKey)
|
||||
var/list/partial = splittext(iconData, "{")
|
||||
return replacetext(copytext(partial[2], 3, -5), "\n", "")
|
||||
return replacetext(copytext_char(partial[2], 3, -5), "\n", "")
|
||||
|
||||
/proc/icon2html(thing, target, icon_state, dir, frame = 1, moving = FALSE)
|
||||
if (!thing)
|
||||
|
||||
@@ -179,7 +179,6 @@
|
||||
"balls_cum_rate" = CUM_RATE,
|
||||
"balls_cum_mult" = CUM_RATE_MULT,
|
||||
"balls_efficiency" = CUM_EFFICIENCY,
|
||||
"balls_fluid" = "semen",
|
||||
"has_ovi" = FALSE,
|
||||
"ovi_shape" = "knotted",
|
||||
"ovi_length" = 6,
|
||||
@@ -194,7 +193,6 @@
|
||||
"breasts_color" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"),
|
||||
"breasts_size" = pick(GLOB.breasts_size_list),
|
||||
"breasts_shape" = "Pair",
|
||||
"breasts_fluid" = "milk",
|
||||
"breasts_producing" = FALSE,
|
||||
"has_vag" = FALSE,
|
||||
"vag_shape" = pick(GLOB.vagina_shapes_list),
|
||||
@@ -206,7 +204,6 @@
|
||||
"womb_cum_rate" = CUM_RATE,
|
||||
"womb_cum_mult" = CUM_RATE_MULT,
|
||||
"womb_efficiency" = CUM_EFFICIENCY,
|
||||
"womb_fluid" = "femcum",
|
||||
"ipc_screen" = "Sunburst",
|
||||
"ipc_antenna" = "None",
|
||||
"flavor_text" = "",
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
. = "does"
|
||||
|
||||
/datum/proc/p_theyve(capitalized, temp_gender)
|
||||
. = p_they(capitalized, temp_gender) + "'" + copytext(p_have(temp_gender), 3)
|
||||
. = p_they(capitalized, temp_gender) + "'" + copytext_char(p_have(temp_gender), 3)
|
||||
|
||||
/datum/proc/p_theyre(capitalized, temp_gender)
|
||||
. = p_they(capitalized, temp_gender) + "'" + copytext(p_are(temp_gender), 2)
|
||||
. = p_they(capitalized, temp_gender) + "'" + copytext_char(p_are(temp_gender), 2)
|
||||
|
||||
/datum/proc/p_s(temp_gender) //is this a descriptive proc name, or what?
|
||||
. = "s"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Ensure the frequency is within bounds of what it should be sending/receiving at
|
||||
/proc/sanitize_frequency(frequency, free = FALSE)
|
||||
. = round(frequency)
|
||||
frequency = round(frequency)
|
||||
if(free)
|
||||
. = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
|
||||
else
|
||||
|
||||
@@ -72,3 +72,26 @@
|
||||
if(!GLOB.chemical_reactions_list[primary_reagent])
|
||||
GLOB.chemical_reactions_list[primary_reagent] = list()
|
||||
GLOB.chemical_reactions_list[primary_reagent] += R
|
||||
|
||||
/proc/choose_reagent_id(mob/user)
|
||||
var/chosen_id
|
||||
switch(alert(user, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky"))
|
||||
if("Search")
|
||||
var/valid_id
|
||||
while(!valid_id)
|
||||
chosen_id = input(user, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text
|
||||
if(isnull(chosen_id)) //Get me out of here!
|
||||
break
|
||||
if(!ispath(text2path(chosen_id)))
|
||||
chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/datum/reagent)))
|
||||
if(ispath(chosen_id))
|
||||
valid_id = TRUE
|
||||
else
|
||||
valid_id = TRUE
|
||||
if(!valid_id)
|
||||
to_chat(user, "<span class='warning'>A reagent with that ID doesn't exist!</span>")
|
||||
if("Choose from a list")
|
||||
chosen_id = input(user, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent)
|
||||
if("I'm feeling lucky")
|
||||
chosen_id = pick(subtypesof(/datum/reagent))
|
||||
return chosen_id
|
||||
+23
-10
@@ -3,6 +3,9 @@
|
||||
#define POPCOUNT_SHUTTLE_ESCAPEES "shuttle_escapees" //Emergency shuttle only.
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/gather_roundend_feedback()
|
||||
var/datum/station_state/end_state = new /datum/station_state()
|
||||
end_state.count()
|
||||
station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
|
||||
gather_antag_data()
|
||||
record_nuke_disk_location()
|
||||
var/json_file = file("[GLOB.log_directory]/round_end_data.json")
|
||||
@@ -71,9 +74,6 @@
|
||||
mob_data += list("name" = m.name, "typepath" = m.type)
|
||||
var/pos = length(file_data["[escaped]"]["[category]"]) + 1
|
||||
file_data["[escaped]"]["[category]"]["[pos]"] = mob_data
|
||||
var/datum/station_state/end_state = new /datum/station_state()
|
||||
end_state.count()
|
||||
var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
|
||||
file_data["additional data"]["station integrity"] = station_integrity
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
SSblackbox.record_feedback("nested tally", "round_end_stats", num_survivors, list("survivors", "total"))
|
||||
@@ -111,7 +111,14 @@
|
||||
|
||||
if(A.objectives.len)
|
||||
for(var/datum/objective/O in A.objectives)
|
||||
var/result = O.check_completion() ? "SUCCESS" : "FAIL"
|
||||
var/result = "UNKNOWN"
|
||||
var/actual_result = O.check_completion()
|
||||
if(actual_result >= 1)
|
||||
result = "SUCCESS"
|
||||
else if(actual_result <= 0)
|
||||
result = "FAIL"
|
||||
else
|
||||
result = "[actual_result*100]%"
|
||||
antag_info["objectives"] += list(list("objective_type"=O.type,"text"=O.explanation_text,"result"=result))
|
||||
SSblackbox.record_feedback("associative", "antagonists", 1, antag_info)
|
||||
|
||||
@@ -139,19 +146,19 @@
|
||||
var/list/file_data = list()
|
||||
var/pos = 1
|
||||
for(var/V in GLOB.news_network.network_channels)
|
||||
var/datum/newscaster/feed_channel/channel = V
|
||||
var/datum/news/feed_channel/channel = V
|
||||
if(!istype(channel))
|
||||
stack_trace("Non-channel in newscaster channel list")
|
||||
continue
|
||||
file_data["[pos]"] = list("channel name" = "[channel.channel_name]", "author" = "[channel.author]", "censored" = channel.censored ? 1 : 0, "author censored" = channel.authorCensor ? 1 : 0, "messages" = list())
|
||||
for(var/M in channel.messages)
|
||||
var/datum/newscaster/feed_message/message = M
|
||||
var/datum/news/feed_message/message = M
|
||||
if(!istype(message))
|
||||
stack_trace("Non-message in newscaster channel messages list")
|
||||
continue
|
||||
var/list/comment_data = list()
|
||||
for(var/C in message.comments)
|
||||
var/datum/newscaster/feed_comment/comment = C
|
||||
var/datum/news/feed_comment/comment = C
|
||||
if(!istype(comment))
|
||||
stack_trace("Non-message in newscaster message comments list")
|
||||
continue
|
||||
@@ -550,10 +557,16 @@
|
||||
var/list/objective_parts = list()
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in objectives)
|
||||
if(objective.check_completion())
|
||||
objective_parts += "<b>Objective #[count]</b>: [objective.explanation_text] <span class='greentext'>Success!</span>"
|
||||
if(objective.completable)
|
||||
var/completion = objective.check_completion()
|
||||
if(completion >= 1)
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='greentext'><B>Success!</span>"
|
||||
else if(completion <= 0)
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='redtext'>Fail.</span>"
|
||||
else
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text] <span class='yellowtext'>[completion*100]%</span>"
|
||||
else
|
||||
objective_parts += "<b>Objective #[count]</b>: [objective.explanation_text] <span class='redtext'>Fail.</span>"
|
||||
objective_parts += "<B>Objective #[count]</B>: [objective.explanation_text]"
|
||||
count++
|
||||
return objective_parts.Join("<br>")
|
||||
|
||||
|
||||
@@ -43,24 +43,30 @@
|
||||
if(!istext(color))
|
||||
color = ""
|
||||
|
||||
var/start = 1 + (text2ascii(color,1)==35)
|
||||
var/start = 1 + (text2ascii(color, 1) == 35)
|
||||
var/len = length(color)
|
||||
var/step_size = 1 + ((len+1)-start != desired_format)
|
||||
var/char = ""
|
||||
// RRGGBB -> RGB but awful
|
||||
var/convert_to_shorthand = desired_format == 3 && length_char(color) > 3
|
||||
|
||||
. = ""
|
||||
for(var/i=start, i<=len, i+=step_size)
|
||||
var/ascii = text2ascii(color,i)
|
||||
switch(ascii)
|
||||
if(48 to 57)
|
||||
. += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102)
|
||||
. += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70)
|
||||
. += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
var/i = start
|
||||
while(i <= len)
|
||||
char = color[i]
|
||||
switch(text2ascii(char))
|
||||
if(48 to 57) //numbers 0 to 9
|
||||
. += char
|
||||
if(97 to 102) //letters a to f
|
||||
. += char
|
||||
if(65 to 70) //letters A to F
|
||||
. += lowertext(char)
|
||||
else
|
||||
break
|
||||
i += length(char)
|
||||
if(convert_to_shorthand && i <= len) //skip next one
|
||||
i += length(color[i])
|
||||
|
||||
if(length(.) != desired_format)
|
||||
if(length_char(.) != desired_format)
|
||||
if(default)
|
||||
return default
|
||||
return crunch + repeat_string(desired_format, "0")
|
||||
@@ -68,7 +74,9 @@
|
||||
return crunch + .
|
||||
|
||||
/proc/sanitize_ooccolor(color)
|
||||
var/list/HSL = rgb2hsl(hex2num(copytext(color,2,4)),hex2num(copytext(color,4,6)),hex2num(copytext(color,6,8)))
|
||||
if(length(color) != length_char(color))
|
||||
CRASH("Invalid characters in color '[color]'")
|
||||
var/list/HSL = rgb2hsl(hex2num(copytext(color, 2, 4)), hex2num(copytext(color, 4, 6)), hex2num(copytext(color, 6, 8)))
|
||||
HSL[3] = min(HSL[3],0.4)
|
||||
var/list/RGB = hsl2rgb(arglist(HSL))
|
||||
return "#[num2hex(RGB[1],2)][num2hex(RGB[2],2)][num2hex(RGB[3],2)]"
|
||||
return "#[num2hex(RGB[1],2)][num2hex(RGB[2],2)][num2hex(RGB[3],2)]"
|
||||
|
||||
@@ -52,6 +52,6 @@
|
||||
if(bad_chars)
|
||||
bad_match = url_encode(bad_chars_regex.match)
|
||||
scrubbed_url += bad_match
|
||||
last_good = bad_chars + length(bad_match)
|
||||
last_good = bad_chars + length(bad_chars_regex.match)
|
||||
while(bad_chars)
|
||||
. = scrubbed_url
|
||||
|
||||
+220
-232
@@ -40,10 +40,16 @@
|
||||
for(var/char in repl_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1)
|
||||
index = findtext(t, char, index+1)
|
||||
t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index + length(char))
|
||||
index = findtext(t, char, index + length(char))
|
||||
return t
|
||||
|
||||
/proc/sanitize_name(t,list/repl_chars = null)
|
||||
if(t == "space" || t == "floor" || t == "wall" || t == "r-wall" || t == "monkey" || t == "unknown" || t == "inactive ai") //prevents these common metagamey names
|
||||
alert("Invalid name.")
|
||||
return ""
|
||||
return sanitize(t)
|
||||
|
||||
/proc/sanitize_filename(t)
|
||||
return sanitize_simple(t, list("\n"="", "\t"="", "/"="", "\\"="", "?"="", "%"="", "*"="", ":"="", "|"="", "\""="", "<"="", ">"=""))
|
||||
|
||||
@@ -63,22 +69,28 @@
|
||||
|
||||
|
||||
//Returns null if there is any bad text in the string
|
||||
/proc/reject_bad_text(text, max_length=512)
|
||||
if(length(text) > max_length)
|
||||
return //message too long
|
||||
var/non_whitespace = 0
|
||||
for(var/i=1, i<=length(text), i++)
|
||||
switch(text2ascii(text,i))
|
||||
if(62,60,92,47)
|
||||
return //rejects the text if it contains these bad characters: <, >, \ or /
|
||||
if(127 to 255)
|
||||
return //rejects weird letters like �
|
||||
/proc/reject_bad_text(text, max_length = 512, ascii_only = TRUE)
|
||||
var/char_count = 0
|
||||
var/non_whitespace = FALSE
|
||||
var/lenbytes = length(text)
|
||||
var/char = ""
|
||||
for(var/i = 1, i <= lenbytes, i += length(char))
|
||||
char = text[i]
|
||||
char_count++
|
||||
if(char_count > max_length)
|
||||
return
|
||||
switch(text2ascii(char))
|
||||
if(62,60,92,47) // <, >, \, /
|
||||
return
|
||||
if(0 to 31)
|
||||
return //more weird stuff
|
||||
return
|
||||
if(32)
|
||||
continue //whitespace
|
||||
if(127 to INFINITY)
|
||||
if(ascii_only)
|
||||
return
|
||||
else
|
||||
non_whitespace = 1
|
||||
non_whitespace = TRUE
|
||||
if(non_whitespace)
|
||||
return text //only accepts the text if it has some non-spaces
|
||||
|
||||
@@ -101,73 +113,84 @@
|
||||
else
|
||||
return trim(html_encode(name), max_length)
|
||||
|
||||
#define NO_CHARS_DETECTED 0
|
||||
#define SPACES_DETECTED 1
|
||||
#define SYMBOLS_DETECTED 2
|
||||
#define NUMBERS_DETECTED 3
|
||||
#define LETTERS_DETECTED 4
|
||||
|
||||
//Filters out undesirable characters from names
|
||||
/proc/reject_bad_name(t_in, allow_numbers=0, max_length=MAX_NAME_LEN)
|
||||
if(!t_in || length(t_in) > max_length)
|
||||
return //Rejects the input if it is null or if it is longer then the max length allowed
|
||||
/proc/reject_bad_name(t_in, allow_numbers = FALSE, max_length = MAX_NAME_LEN, ascii_only = TRUE)
|
||||
if(!t_in)
|
||||
return //Rejects the input if it is null
|
||||
|
||||
var/number_of_alphanumeric = 0
|
||||
var/last_char_group = 0
|
||||
var/number_of_alphanumeric = 0
|
||||
var/last_char_group = NO_CHARS_DETECTED
|
||||
var/t_out = ""
|
||||
var/t_len = length(t_in)
|
||||
var/charcount = 0
|
||||
var/char = ""
|
||||
|
||||
for(var/i=1, i<=length(t_in), i++)
|
||||
var/ascii_char = text2ascii(t_in,i)
|
||||
switch(ascii_char)
|
||||
|
||||
for(var/i = 1, i <= t_len, i += length(char))
|
||||
char = t_in[i]
|
||||
|
||||
switch(text2ascii(char))
|
||||
// A .. Z
|
||||
if(65 to 90) //Uppercase Letters
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
last_char_group = LETTERS_DETECTED
|
||||
|
||||
// a .. z
|
||||
if(97 to 122) //Lowercase Letters
|
||||
if(last_char_group<2)
|
||||
t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else
|
||||
t_out += ascii2text(ascii_char)
|
||||
if(last_char_group == NO_CHARS_DETECTED || last_char_group == SPACES_DETECTED || last_char_group == SYMBOLS_DETECTED) //start of a word
|
||||
char = uppertext(char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
last_char_group = LETTERS_DETECTED
|
||||
|
||||
// 0 .. 9
|
||||
if(48 to 57) //Numbers
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
if(last_char_group == NO_CHARS_DETECTED || !allow_numbers) //suppress at start of string
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 3
|
||||
last_char_group = NUMBERS_DETECTED
|
||||
|
||||
// ' - .
|
||||
if(39,45,46) //Common name punctuation
|
||||
if(!last_char_group)
|
||||
if(last_char_group == NO_CHARS_DETECTED)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
last_char_group = SYMBOLS_DETECTED
|
||||
|
||||
// ~ | @ : # $ % & * +
|
||||
if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI)
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
if(last_char_group == NO_CHARS_DETECTED || !allow_numbers) //suppress at start of string
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
last_char_group = SYMBOLS_DETECTED
|
||||
|
||||
//Space
|
||||
if(32)
|
||||
if(last_char_group <= 1)
|
||||
continue //suppress double-spaces and spaces at start of string
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 1
|
||||
if(last_char_group == NO_CHARS_DETECTED || last_char_group == SPACES_DETECTED) //suppress double-spaces and spaces at start of string
|
||||
continue
|
||||
last_char_group = SPACES_DETECTED
|
||||
|
||||
if(127 to INFINITY)
|
||||
if(ascii_only)
|
||||
continue
|
||||
last_char_group = SYMBOLS_DETECTED //for now, we'll treat all non-ascii characters like symbols even though most are letters
|
||||
|
||||
else
|
||||
return
|
||||
continue
|
||||
|
||||
t_out += char
|
||||
charcount++
|
||||
if(charcount >= max_length)
|
||||
break
|
||||
|
||||
if(number_of_alphanumeric < 2)
|
||||
return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
if(last_char_group == 1)
|
||||
t_out = copytext(t_out,1,length(t_out)) //removes the last character (in this case a space)
|
||||
if(last_char_group == SPACES_DETECTED)
|
||||
t_out = copytext_char(t_out, 1, -1) //removes the last character (in this case a space)
|
||||
|
||||
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
|
||||
if(cmptext(t_out,bad_name))
|
||||
@@ -175,6 +198,11 @@
|
||||
|
||||
return t_out
|
||||
|
||||
#undef NO_CHARS_DETECTED
|
||||
#undef SPACES_DETECTED
|
||||
#undef NUMBERS_DETECTED
|
||||
#undef LETTERS_DETECTED
|
||||
|
||||
//html_encode helper proc that returns the smallest non null of two numbers
|
||||
//or 0 if they're both null (needed because of findtext returning 0 when a value is not present)
|
||||
/proc/non_zero_min(a, b)
|
||||
@@ -184,39 +212,6 @@
|
||||
return a
|
||||
return (a < b ? a : b)
|
||||
|
||||
/*
|
||||
* Text searches
|
||||
*/
|
||||
|
||||
//Checks the beginning of a string for a specified sub-string
|
||||
//Returns the position of the substring or 0 if it was not found
|
||||
/proc/dd_hasprefix(text, prefix)
|
||||
var/start = 1
|
||||
var/end = length(prefix) + 1
|
||||
return findtext(text, prefix, start, end)
|
||||
|
||||
//Checks the beginning of a string for a specified sub-string. This proc is case sensitive
|
||||
//Returns the position of the substring or 0 if it was not found
|
||||
/proc/dd_hasprefix_case(text, prefix)
|
||||
var/start = 1
|
||||
var/end = length(prefix) + 1
|
||||
return findtextEx(text, prefix, start, end)
|
||||
|
||||
//Checks the end of a string for a specified substring.
|
||||
//Returns the position of the substring or 0 if it was not found
|
||||
/proc/dd_hassuffix(text, suffix)
|
||||
var/start = length(text) - length(suffix)
|
||||
if(start)
|
||||
return findtext(text, suffix, start, null)
|
||||
return
|
||||
|
||||
//Checks the end of a string for a specified substring. This proc is case sensitive
|
||||
//Returns the position of the substring or 0 if it was not found
|
||||
/proc/dd_hassuffix_case(text, suffix)
|
||||
var/start = length(text) - length(suffix)
|
||||
if(start)
|
||||
return findtextEx(text, suffix, start, null)
|
||||
|
||||
//Checks if any of a given list of needles is in the haystack
|
||||
/proc/text_in_list(haystack, list/needle_list, start=1, end=0)
|
||||
for(var/needle in needle_list)
|
||||
@@ -231,23 +226,19 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Adds 'u' number of zeros ahead of the text 't'
|
||||
/proc/add_zero(t, u)
|
||||
while (length(t) < u)
|
||||
t = "0[t]"
|
||||
return t
|
||||
//Adds 'char' ahead of 'text' until there are 'count' characters total
|
||||
/proc/add_leading(text, count, char = " ")
|
||||
text = "[text]"
|
||||
var/charcount = count - length_char(text)
|
||||
var/list/chars_to_add[max(charcount + 1, 0)]
|
||||
return jointext(chars_to_add, char) + text
|
||||
|
||||
//Adds 'u' number of spaces ahead of the text 't'
|
||||
/proc/add_lspace(t, u)
|
||||
while(length(t) < u)
|
||||
t = " [t]"
|
||||
return t
|
||||
|
||||
//Adds 'u' number of spaces behind the text 't'
|
||||
/proc/add_tspace(t, u)
|
||||
while(length(t) < u)
|
||||
t = "[t] "
|
||||
return t
|
||||
//Adds 'char' behind 'text' until there are 'count' characters total
|
||||
/proc/add_trailing(text, count, char = " ")
|
||||
text = "[text]"
|
||||
var/charcount = count - length_char(text)
|
||||
var/list/chars_to_add[max(charcount + 1, 0)]
|
||||
return text + jointext(chars_to_add, char)
|
||||
|
||||
//Returns a string with reserved characters and spaces before the first letter removed
|
||||
/proc/trim_left(text)
|
||||
@@ -267,57 +258,41 @@
|
||||
//Returns a string with reserved characters and spaces before the first word and after the last word removed.
|
||||
/proc/trim(text, max_length)
|
||||
if(max_length)
|
||||
text = copytext(text, 1, max_length)
|
||||
text = copytext_char(text, 1, max_length)
|
||||
return trim_left(trim_right(text))
|
||||
|
||||
//Returns a string with the first element of the string capitalized.
|
||||
/proc/capitalize(t as text)
|
||||
return uppertext(copytext(t, 1, 2)) + copytext(t, 2)
|
||||
|
||||
//Centers text by adding spaces to either side of the string.
|
||||
/proc/dd_centertext(message, length)
|
||||
var/new_message = message
|
||||
var/size = length(message)
|
||||
var/delta = length - size
|
||||
if(size == length)
|
||||
return new_message
|
||||
if(size > length)
|
||||
return copytext(new_message, 1, length + 1)
|
||||
if(delta == 1)
|
||||
return new_message + " "
|
||||
if(delta % 2)
|
||||
new_message = " " + new_message
|
||||
delta--
|
||||
var/spaces = add_lspace("",delta/2-1)
|
||||
return spaces + new_message + spaces
|
||||
|
||||
//Limits the length of the text. Note: MAX_MESSAGE_LEN and MAX_NAME_LEN are widely used for this purpose
|
||||
/proc/dd_limittext(message, length)
|
||||
var/size = length(message)
|
||||
if(size <= length)
|
||||
return message
|
||||
return copytext(message, 1, length + 1)
|
||||
|
||||
. = t
|
||||
if(t)
|
||||
. = t[1]
|
||||
return uppertext(.) + copytext(t, 1 + length(.))
|
||||
|
||||
/proc/stringmerge(text,compare,replace = "*")
|
||||
//This proc fills in all spaces with the "replace" var (* by default) with whatever
|
||||
//is in the other string at the same spot (assuming it is not a replace char).
|
||||
//This is used for fingerprints
|
||||
var/newtext = text
|
||||
if(length(text) != length(compare))
|
||||
return 0
|
||||
for(var/i = 1, i < length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
var/b = copytext(compare,i,i+1)
|
||||
var/text_it = 1 //iterators
|
||||
var/comp_it = 1
|
||||
var/newtext_it = 1
|
||||
var/text_length = length(text)
|
||||
var/comp_length = length(compare)
|
||||
while(comp_it <= comp_length && text_it <= text_length)
|
||||
var/a = text[text_it]
|
||||
var/b = compare[comp_it]
|
||||
//if it isn't both the same letter, or if they are both the replacement character
|
||||
//(no way to know what it was supposed to be)
|
||||
if(a != b)
|
||||
if(a == replace) //if A is the replacement char
|
||||
newtext = copytext(newtext,1,i) + b + copytext(newtext, i+1)
|
||||
newtext = copytext(newtext, 1, newtext_it) + b + copytext(newtext, newtext_it + length(newtext[newtext_it]))
|
||||
else if(b == replace) //if B is the replacement char
|
||||
newtext = copytext(newtext,1,i) + a + copytext(newtext, i+1)
|
||||
newtext = copytext(newtext, 1, newtext_it) + a + copytext(newtext, newtext_it + length(newtext[newtext_it]))
|
||||
else //The lists disagree, Uh-oh!
|
||||
return 0
|
||||
text_it += length(a)
|
||||
comp_it += length(b)
|
||||
newtext_it += length(newtext[newtext_it])
|
||||
return newtext
|
||||
|
||||
/proc/stringpercent(text,character = "*")
|
||||
@@ -326,16 +301,21 @@
|
||||
if(!text || !character)
|
||||
return 0
|
||||
var/count = 0
|
||||
for(var/i = 1, i <= length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
var/lentext = length(text)
|
||||
var/a = ""
|
||||
for(var/i = 1, i <= lentext, i += length(a))
|
||||
a = text[i]
|
||||
if(a == character)
|
||||
count++
|
||||
return count
|
||||
|
||||
/proc/reverse_text(text = "")
|
||||
var/new_text = ""
|
||||
for(var/i = length(text); i > 0; i--)
|
||||
new_text += copytext(text, i, i+1)
|
||||
var/lentext = length(text)
|
||||
var/letter = ""
|
||||
for(var/i = 1, i <= lentext, i += length(letter))
|
||||
letter = text[i]
|
||||
new_text = letter + new_text
|
||||
return new_text
|
||||
|
||||
GLOBAL_LIST_INIT(zero_character_only, list("0"))
|
||||
@@ -358,15 +338,6 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
/proc/random_color()
|
||||
return random_string(6, GLOB.hex_characters)
|
||||
|
||||
/proc/add_zero2(t, u)
|
||||
var/temp1
|
||||
while (length(t) < u)
|
||||
t = "0[t]"
|
||||
temp1 = t
|
||||
if (length(t) > u)
|
||||
temp1 = copytext(t,2,u+1)
|
||||
return temp1
|
||||
|
||||
//merges non-null characters (3rd argument) from "from" into "into". Returns result
|
||||
//e.g. into = "Hello World"
|
||||
// from = "Seeya______"
|
||||
@@ -379,41 +350,48 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
into = ""
|
||||
if(!istext(from))
|
||||
from = ""
|
||||
var/null_ascii = istext(null_char) ? text2ascii(null_char,1) : null_char
|
||||
|
||||
var/previous = 0
|
||||
var/null_ascii = istext(null_char) ? text2ascii(null_char, 1) : null_char
|
||||
var/copying_into = FALSE
|
||||
var/char = ""
|
||||
var/start = 1
|
||||
var/end = length(into) + 1
|
||||
|
||||
for(var/i=1, i<end, i++)
|
||||
var/ascii = text2ascii(from, i)
|
||||
if(ascii == null_ascii)
|
||||
if(previous != 1)
|
||||
. += copytext(from, start, i)
|
||||
start = i
|
||||
previous = 1
|
||||
var/end_from = length(from)
|
||||
var/end_into = length(into)
|
||||
var/into_it = 1
|
||||
var/from_it = 1
|
||||
while(from_it <= end_from && into_it <= end_into)
|
||||
char = from[from_it]
|
||||
if(text2ascii(char) == null_ascii)
|
||||
if(!copying_into)
|
||||
. += copytext(from, start, from_it)
|
||||
start = into_it
|
||||
copying_into = TRUE
|
||||
else
|
||||
if(previous != 0)
|
||||
. += copytext(into, start, i)
|
||||
start = i
|
||||
previous = 0
|
||||
if(copying_into)
|
||||
. += copytext(into, start, into_it)
|
||||
start = from_it
|
||||
copying_into = FALSE
|
||||
into_it += length(into[into_it])
|
||||
from_it += length(char)
|
||||
|
||||
if(previous == 0)
|
||||
. += copytext(from, start, end)
|
||||
if(copying_into)
|
||||
. += copytext(into, start)
|
||||
else
|
||||
. += copytext(into, start, end)
|
||||
. += copytext(from, start, from_it)
|
||||
if(into_it <= end_into)
|
||||
. += copytext(into, into_it)
|
||||
|
||||
//finds the first occurrence of one of the characters from needles argument inside haystack
|
||||
//it may appear this can be optimised, but it really can't. findtext() is so much faster than anything you can do in byondcode.
|
||||
//stupid byond :(
|
||||
/proc/findchar(haystack, needles, start=1, end=0)
|
||||
var/temp
|
||||
var/char = ""
|
||||
var/len = length(needles)
|
||||
for(var/i=1, i<=len, i++)
|
||||
temp = findtextEx(haystack, ascii2text(text2ascii(needles,i)), start, end) //Note: ascii2text(text2ascii) is faster than copytext()
|
||||
if(temp)
|
||||
end = temp
|
||||
return end
|
||||
for(var/i = 1, i <= len, i += length(char))
|
||||
char = needles[i]
|
||||
. = findtextEx(haystack, char, start, end)
|
||||
if(.)
|
||||
return
|
||||
return 0
|
||||
|
||||
/proc/parsemarkdown_basic_step1(t, limited=FALSE)
|
||||
if(length(t) <= 0)
|
||||
@@ -571,23 +549,28 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
|
||||
return t
|
||||
|
||||
#define string2charlist(string) (splittext(string, regex("(.)")) - splittext(string, ""))
|
||||
/proc/text2charlist(text)
|
||||
var/char = ""
|
||||
var/lentext = length(text)
|
||||
. = list()
|
||||
for(var/i = 1, i <= lentext, i += length(char))
|
||||
char = text[i]
|
||||
. += char
|
||||
|
||||
/proc/rot13(text = "")
|
||||
var/list/textlist = string2charlist(text)
|
||||
var/list/result = list()
|
||||
for(var/c in textlist)
|
||||
var/ca = text2ascii(c)
|
||||
if(ca >= text2ascii("a") && ca <= text2ascii("m"))
|
||||
ca += 13
|
||||
else if(ca >= text2ascii("n") && ca <= text2ascii("z"))
|
||||
ca -= 13
|
||||
else if(ca >= text2ascii("A") && ca <= text2ascii("M"))
|
||||
ca += 13
|
||||
else if(ca >= text2ascii("N") && ca <= text2ascii("Z"))
|
||||
ca -= 13
|
||||
result += ascii2text(ca)
|
||||
return jointext(result, "")
|
||||
var/lentext = length(text)
|
||||
var/char = ""
|
||||
var/ascii = 0
|
||||
. = ""
|
||||
for(var/i = 1, i <= lentext, i += length(char))
|
||||
char = text[i]
|
||||
ascii = text2ascii(char)
|
||||
switch(ascii)
|
||||
if(65 to 77, 97 to 109) //A to M, a to m
|
||||
ascii += 13
|
||||
if(78 to 90, 110 to 122) //N to Z, n to z
|
||||
ascii -= 13
|
||||
. += ascii2text(ascii)
|
||||
|
||||
//Takes a list of values, sanitizes it down for readability and character count,
|
||||
//then exports it as a json file at data/npc_saves/[filename].json.
|
||||
@@ -599,7 +582,8 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
return
|
||||
|
||||
//Regular expressions are, as usual, absolute magic
|
||||
var/regex/all_invalid_symbols = new("\[^ -~]+")
|
||||
//Any characters outside of 32 (space) to 126 (~) because treating things you don't understand as "magic" is really stupid
|
||||
var/regex/all_invalid_symbols = new(@"[^ -~]{1}")
|
||||
|
||||
var/list/accepted = list()
|
||||
for(var/string in proposed)
|
||||
@@ -607,34 +591,44 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
continue
|
||||
var/buffer = ""
|
||||
var/early_culling = TRUE
|
||||
for(var/pos = 1, pos <= length(string), pos++)
|
||||
var/let = copytext(string, pos, (pos + 1) % length(string))
|
||||
if(early_culling && !findtext(let,GLOB.is_alphanumeric))
|
||||
var/lentext = length(string)
|
||||
var/let = ""
|
||||
|
||||
for(var/pos = 1, pos <= lentext, pos += length(let))
|
||||
let = string[pos]
|
||||
if(!findtext(let, GLOB.is_alphanumeric))
|
||||
continue
|
||||
early_culling = FALSE
|
||||
buffer += let
|
||||
if(!findtext(buffer,GLOB.is_alphanumeric))
|
||||
buffer = copytext(string, pos)
|
||||
break
|
||||
if(early_culling) //Never found any letters! Bail!
|
||||
continue
|
||||
|
||||
var/punctbuffer = ""
|
||||
var/cutoff = length(buffer)
|
||||
for(var/pos = length(buffer), pos >= 0, pos--)
|
||||
var/let = copytext(buffer, pos, (pos + 1) % length(buffer))
|
||||
if(findtext(let,GLOB.is_alphanumeric))
|
||||
var/cutoff = 0
|
||||
lentext = length_char(buffer)
|
||||
for(var/pos = 1, pos <= lentext, pos++)
|
||||
let = copytext_char(buffer, -pos, -pos + 1)
|
||||
if(!findtext(let, GLOB.is_punctuation)) //This won't handle things like Nyaaaa!~ but that's fine
|
||||
break
|
||||
if(findtext(let,GLOB.is_punctuation))
|
||||
punctbuffer = let + punctbuffer //Note this isn't the same thing as using +=
|
||||
cutoff = pos
|
||||
punctbuffer += let
|
||||
cutoff += length(let)
|
||||
if(punctbuffer) //We clip down excessive punctuation to get the letter count lower and reduce repeats. It's not perfect but it helps.
|
||||
var/exclaim = FALSE
|
||||
var/question = FALSE
|
||||
var/periods = 0
|
||||
for(var/pos = length(punctbuffer), pos >= 0, pos--)
|
||||
var/punct = copytext(punctbuffer, pos, (pos + 1) % length(punctbuffer))
|
||||
if(!exclaim && findtext(punct,"!"))
|
||||
lentext = length(punctbuffer)
|
||||
for(var/pos = 1, pos <= lentext, pos += length(let))
|
||||
let = punctbuffer[pos]
|
||||
if(!exclaim && findtext(let, "!"))
|
||||
exclaim = TRUE
|
||||
if(!question && findtext(punct,"?"))
|
||||
if(question)
|
||||
break
|
||||
if(!question && findtext(let, "?"))
|
||||
question = TRUE
|
||||
if(!exclaim && !question && findtext(punct,"."))
|
||||
if(exclaim)
|
||||
break
|
||||
if(!exclaim && !question && findtext(let, ".")) //? and ! take priority over periods
|
||||
periods += 1
|
||||
if(exclaim)
|
||||
if(question)
|
||||
@@ -643,15 +637,13 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
punctbuffer = "!"
|
||||
else if(question)
|
||||
punctbuffer = "?"
|
||||
else if(periods)
|
||||
if(periods > 1)
|
||||
punctbuffer = "..."
|
||||
else
|
||||
punctbuffer = "" //Grammer nazis be damned
|
||||
buffer = copytext(buffer, 1, cutoff) + punctbuffer
|
||||
if(!findtext(buffer,GLOB.is_alphanumeric))
|
||||
continue
|
||||
if(!buffer || length(buffer) > 280 || length(buffer) <= cullshort || buffer in accepted)
|
||||
else if(periods > 1)
|
||||
punctbuffer = "..."
|
||||
else
|
||||
punctbuffer = "" //Grammer nazis be damned
|
||||
buffer = copytext(buffer, 1, -cutoff) + punctbuffer
|
||||
lentext = length_char(buffer)
|
||||
if(!buffer || lentext > 280 || lentext <= cullshort || (buffer in accepted))
|
||||
continue
|
||||
|
||||
accepted += buffer
|
||||
@@ -688,7 +680,7 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
|
||||
var/leng = length(string)
|
||||
|
||||
var/next_space = findtext(string, " ", next_backslash + 1)
|
||||
var/next_space = findtext(string, " ", next_backslash + length(string[next_backslash]))
|
||||
if(!next_space)
|
||||
next_space = leng - next_backslash
|
||||
|
||||
@@ -696,8 +688,8 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
return string
|
||||
|
||||
var/base = next_backslash == 1 ? "" : copytext(string, 1, next_backslash)
|
||||
var/macro = lowertext(copytext(string, next_backslash + 1, next_space))
|
||||
var/rest = next_backslash > leng ? "" : copytext(string, next_space + 1)
|
||||
var/macro = lowertext(copytext(string, next_backslash + length(string[next_space]), next_space))
|
||||
var/rest = next_backslash > leng ? "" : copytext(string, next_space + length(string[next_space]))
|
||||
|
||||
//See https://secure.byond.com/docs/ref/info.html#/DM/text/macros
|
||||
switch(macro)
|
||||
@@ -769,28 +761,24 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
|
||||
return "[number]\th"
|
||||
|
||||
/proc/unintelligize(message)
|
||||
var/prefix=copytext(message,1,2)
|
||||
var/regex/word_boundaries = regex(@"\b[\S]+\b", "g")
|
||||
var/prefix = message[1]
|
||||
if(prefix == ";")
|
||||
message = copytext(message,2)
|
||||
else if(prefix in list(":","#"))
|
||||
prefix += copytext(message,2,3)
|
||||
message = copytext(message,3)
|
||||
message = copytext(message, 1 + length(prefix))
|
||||
else if(prefix in list(":", "#"))
|
||||
prefix += message[1 + length(prefix)]
|
||||
message = copytext(message, length(prefix))
|
||||
else
|
||||
prefix=""
|
||||
prefix = ""
|
||||
|
||||
var/list/words = splittext(message," ")
|
||||
var/list/rearranged = list()
|
||||
for(var/i=1;i<=words.len;i++)
|
||||
var/cword = pick(words)
|
||||
words.Remove(cword)
|
||||
var/suffix = copytext(cword,length(cword)-1,length(cword))
|
||||
while(length(cword)>0 && suffix in list(".",",",";","!",":","?"))
|
||||
cword = copytext(cword,1 ,length(cword)-1)
|
||||
suffix = copytext(cword,length(cword)-1,length(cword) )
|
||||
while(word_boundaries.Find(message))
|
||||
var/cword = word_boundaries.match
|
||||
if(length(cword))
|
||||
rearranged += cword
|
||||
message = "[prefix][jointext(rearranged," ")]"
|
||||
. = message
|
||||
shuffle_inplace(rearranged)
|
||||
return "[prefix][jointext(rearranged, " ")]"
|
||||
|
||||
|
||||
#define is_alpha(X) ((text2ascii(X) <= 122) && (text2ascii(X) >= 97))
|
||||
#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))
|
||||
#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))
|
||||
|
||||
@@ -8,14 +8,15 @@
|
||||
index = findtext(t, char)
|
||||
return t
|
||||
|
||||
proc/TextPreview(var/string,var/len=40)
|
||||
if(length(string) <= len)
|
||||
if(!length(string))
|
||||
/proc/TextPreview(string, len = 40)
|
||||
var/char_len = length_char(string)
|
||||
if(char_len <= len)
|
||||
if(char_len)
|
||||
return "\[...\]"
|
||||
else
|
||||
return string
|
||||
else
|
||||
return "[copytext(string, 1, 37)]..."
|
||||
return "[copytext_char(string, 1, 37)]..."
|
||||
|
||||
GLOBAL_LIST_EMPTY(mentorlog)
|
||||
GLOBAL_PROTECT(mentorlog)
|
||||
|
||||
@@ -542,17 +542,17 @@
|
||||
|
||||
//assumes format #RRGGBB #rrggbb
|
||||
/proc/color_hex2num(A)
|
||||
if(!A)
|
||||
if(!A || length(A) != length_char(A))
|
||||
return 0
|
||||
var/R = hex2num(copytext(A,2,4))
|
||||
var/G = hex2num(copytext(A,4,6))
|
||||
var/B = hex2num(copytext(A,6,0))
|
||||
var/R = hex2num(copytext(A, 2, 4))
|
||||
var/G = hex2num(copytext(A, 4, 6))
|
||||
var/B = hex2num(copytext(A, 6, 0))
|
||||
return R+G+B
|
||||
|
||||
//word of warning: using a matrix like this as a color value will simplify it back to a string after being set
|
||||
/proc/color_hex2color_matrix(string)
|
||||
var/length = length(string)
|
||||
if(length != 7 && length != 9)
|
||||
if((length != 7 && length != 9) || length != length_char(string))
|
||||
return color_matrix_identity()
|
||||
var/r = hex2num(copytext(string, 2, 4))/255
|
||||
var/g = hex2num(copytext(string, 4, 6))/255
|
||||
|
||||
+99
-36
@@ -6,25 +6,18 @@
|
||||
|
||||
//Inverts the colour of an HTML string
|
||||
/proc/invertHTML(HTMLstring)
|
||||
|
||||
if (!( istext(HTMLstring) ))
|
||||
if(!istext(HTMLstring))
|
||||
CRASH("Given non-text argument!")
|
||||
return
|
||||
else
|
||||
if (length(HTMLstring) != 7)
|
||||
CRASH("Given non-HTML argument!")
|
||||
return
|
||||
else if(length(HTMLstring) != 7)
|
||||
CRASH("Given non-HTML argument!")
|
||||
return
|
||||
else if(length_char(HTMLstring) != 7)
|
||||
CRASH("Given non-hex symbols in argument!")
|
||||
var/textr = copytext(HTMLstring, 2, 4)
|
||||
var/textg = copytext(HTMLstring, 4, 6)
|
||||
var/textb = copytext(HTMLstring, 6, 8)
|
||||
var/r = hex2num(textr)
|
||||
var/g = hex2num(textg)
|
||||
var/b = hex2num(textb)
|
||||
textr = num2hex(255 - r, 2)
|
||||
textg = num2hex(255 - g, 2)
|
||||
textb = num2hex(255 - b, 2)
|
||||
return text("#[][][]", textr, textg, textb)
|
||||
return
|
||||
return rgb(255 - hex2num(textr), 255 - hex2num(textg), 255 - hex2num(textb))
|
||||
|
||||
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
|
||||
if(!start || !end)
|
||||
@@ -184,15 +177,15 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
//Returns whether or not a player is a guest using their ckey as an input
|
||||
/proc/IsGuestKey(key)
|
||||
if (findtext(key, "Guest-", 1, 7) != 1) //was findtextEx
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/i, ch, len = length(key)
|
||||
|
||||
for (i = 7, i <= len, ++i)
|
||||
for (i = 7, i <= len, ++i) //we know the first 6 chars are Guest-
|
||||
ch = text2ascii(key, i)
|
||||
if (ch < 48 || ch > 57)
|
||||
return 0
|
||||
return 1
|
||||
if (ch < 48 || ch > 57) //0-9
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//Generalised helper proc for letting mobs rename themselves. Used to be clname() and ainame()
|
||||
/mob/proc/apply_pref_name(role, client/C)
|
||||
@@ -457,36 +450,35 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
|
||||
/atom/proc/GetAllContents(var/T)
|
||||
var/list/processing_list = list(src)
|
||||
var/list/assembled = list()
|
||||
if(T)
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
processing_list.Cut(1, 2)
|
||||
. = list()
|
||||
var/i = 0
|
||||
while(i < length(processing_list))
|
||||
var/atom/A = processing_list[++i]
|
||||
//Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed
|
||||
//This is also why we don't need to check against assembled as we go along
|
||||
processing_list += A.contents
|
||||
if(istype(A,T))
|
||||
assembled += A
|
||||
. += A
|
||||
else
|
||||
while(processing_list.len)
|
||||
var/atom/A = processing_list[1]
|
||||
processing_list.Cut(1, 2)
|
||||
var/i = 0
|
||||
while(i < length(processing_list))
|
||||
var/atom/A = processing_list[++i]
|
||||
processing_list += A.contents
|
||||
assembled += A
|
||||
return assembled
|
||||
return processing_list
|
||||
|
||||
/atom/proc/GetAllContentsIgnoring(list/ignore_typecache)
|
||||
if(!length(ignore_typecache))
|
||||
return GetAllContents()
|
||||
var/list/processing = list(src)
|
||||
var/list/assembled = list()
|
||||
while(processing.len)
|
||||
var/atom/A = processing[1]
|
||||
processing.Cut(1,2)
|
||||
. = list()
|
||||
var/i = 0
|
||||
while(i < length(processing))
|
||||
var/atom/A = processing[++i]
|
||||
if(!ignore_typecache[A.type])
|
||||
processing += A.contents
|
||||
assembled += A
|
||||
return assembled
|
||||
. += A
|
||||
|
||||
|
||||
//Step-towards method of determining whether one atom can see another. Similar to viewers()
|
||||
/proc/can_see(atom/source, atom/target, length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate.
|
||||
@@ -1315,7 +1307,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
/proc/GUID()
|
||||
var/const/GUID_VERSION = "b"
|
||||
var/const/GUID_VARIANT = "d"
|
||||
var/node_id = copytext(md5("[rand()*rand(1,9999999)][world.name][world.hub][world.hub_password][world.internet_address][world.address][world.contents.len][world.status][world.port][rand()*rand(1,9999999)]"), 1, 13)
|
||||
var/node_id = copytext_char(md5("[rand()*rand(1,9999999)][world.name][world.hub][world.hub_password][world.internet_address][world.address][world.contents.len][world.status][world.port][rand()*rand(1,9999999)]"), 1, 13)
|
||||
|
||||
var/time_high = "[num2hex(text2num(time2text(world.realtime,"YYYY")), 2)][num2hex(world.realtime, 6)]"
|
||||
|
||||
@@ -1502,3 +1494,74 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
return -1
|
||||
else
|
||||
return 0
|
||||
|
||||
// Converts browser keycodes to BYOND keycodes.
|
||||
/proc/browser_keycode_to_byond(keycode)
|
||||
keycode = text2num(keycode)
|
||||
switch(keycode)
|
||||
// letters and numbers
|
||||
if(65 to 90, 48 to 57)
|
||||
return ascii2text(keycode)
|
||||
if(17)
|
||||
return "Ctrl"
|
||||
if(18)
|
||||
return "Alt"
|
||||
if(16)
|
||||
return "Shift"
|
||||
if(37)
|
||||
return "West"
|
||||
if(38)
|
||||
return "North"
|
||||
if(39)
|
||||
return "East"
|
||||
if(40)
|
||||
return "South"
|
||||
if(45)
|
||||
return "Insert"
|
||||
if(46)
|
||||
return "Delete"
|
||||
if(36)
|
||||
return "Northwest"
|
||||
if(35)
|
||||
return "Southwest"
|
||||
if(33)
|
||||
return "Northeast"
|
||||
if(34)
|
||||
return "Southeast"
|
||||
if(112 to 123)
|
||||
return "F[keycode-111]"
|
||||
if(96 to 105)
|
||||
return "Numpad[keycode-96]"
|
||||
if(188)
|
||||
return ","
|
||||
if(190)
|
||||
return "."
|
||||
if(189)
|
||||
return "-"
|
||||
|
||||
/proc/generate_items_inside(list/items_list, where_to)
|
||||
for(var/each_item in items_list)
|
||||
for(var/i in 1 to items_list[each_item])
|
||||
new each_item(where_to)
|
||||
|
||||
//sends a message to chat
|
||||
//config_setting should be one of the following
|
||||
//null - noop
|
||||
//empty string - use TgsTargetBroadcast with admin_only = FALSE
|
||||
//other string - use TgsChatBroadcast with the tag that matches config_setting, only works with TGS4, if using TGS3 the above method is used
|
||||
/proc/send2chat(message, config_setting)
|
||||
if(config_setting == null || !world.TgsAvailable())
|
||||
return
|
||||
var/datum/tgs_version/version = world.TgsVersion()
|
||||
if(config_setting == "" || version.suite == 3)
|
||||
world.TgsTargetedChatBroadcast(message, FALSE)
|
||||
return
|
||||
|
||||
var/list/channels_to_use = list()
|
||||
for(var/I in world.TgsChatChannelInfo())
|
||||
var/datum/tgs_chat_channel/channel = I
|
||||
if(channel.tag == config_setting)
|
||||
channels_to_use += channel
|
||||
|
||||
if(channels_to_use.len)
|
||||
world.TgsChatBroadcast()
|
||||
@@ -0,0 +1,57 @@
|
||||
// Basic geometry things.
|
||||
|
||||
/datum/vector/
|
||||
var/x = 0
|
||||
var/y = 0
|
||||
|
||||
/datum/vector/New(var/x, var/y)
|
||||
src.x = x
|
||||
src.y = y
|
||||
|
||||
/datum/vector/proc/duplicate()
|
||||
return new /datum/vector(x, y)
|
||||
|
||||
/datum/vector/proc/euclidian_norm()
|
||||
return sqrt(x*x + y*y)
|
||||
|
||||
/datum/vector/proc/squared_norm()
|
||||
return x*x + y*y
|
||||
|
||||
/datum/vector/proc/normalize()
|
||||
var/norm = euclidian_norm()
|
||||
x = x/norm
|
||||
y = y/norm
|
||||
return src
|
||||
|
||||
/datum/vector/proc/chebyshev_norm()
|
||||
return max(abs(x), abs(y))
|
||||
|
||||
/datum/vector/proc/chebyshev_normalize()
|
||||
var/norm = chebyshev_norm()
|
||||
x = x/norm
|
||||
y = y/norm
|
||||
return src
|
||||
|
||||
/datum/vector/proc/is_integer()
|
||||
return ISINTEGER(x) && ISINTEGER(y)
|
||||
|
||||
/atom/movable/proc/vector_translate(var/datum/vector/V, var/delay)
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/destination = locate(T.x + V.x, T.y + V.y, z)
|
||||
var/datum/vector/V_norm = V.duplicate()
|
||||
V_norm.chebyshev_normalize()
|
||||
if (!V_norm.is_integer())
|
||||
return
|
||||
var/turf/destination_temp
|
||||
while (destination_temp != destination)
|
||||
destination_temp = locate(T.x + V_norm.x, T.y + V_norm.y, z)
|
||||
forceMove(destination_temp)
|
||||
T = get_turf(src)
|
||||
sleep(delay + world.tick_lag) // Shortest possible time to sleep
|
||||
|
||||
/atom/proc/get_translated_turf(var/datum/vector/V)
|
||||
var/turf/T = get_turf(src)
|
||||
return locate(T.x + V.x, T.y + V.y, z)
|
||||
|
||||
/proc/atoms2vector(var/atom/A, var/atom/B)
|
||||
return new /datum/vector((B.x - A.x), (B.y - A.y)) // Vector from A -> B
|
||||
@@ -39,6 +39,26 @@
|
||||
#error You need version 512 or higher
|
||||
#endif
|
||||
|
||||
//Compatability -- These procs were added in 513.1493, not 513.1490
|
||||
//Which really shoulda bumped us up to 514 right then and there but instead Lummox is a dumb dumb
|
||||
#if DM_BUILD < 1493
|
||||
#define length_char(args...) length(args)
|
||||
#define text2ascii_char(args...) text2ascii(args)
|
||||
#define copytext_char(args...) copytext(args)
|
||||
#define splittext_char(args...) splittext(args)
|
||||
#define spantext_char(args...) spantext(args)
|
||||
#define nonspantext_char(args...) nonspantext(args)
|
||||
#define findtext_char(args...) findtext(args)
|
||||
#define findtextEx_char(args...) findtextEx(args)
|
||||
#define findlasttext_char(args...) findlasttext(args)
|
||||
#define findlasttextEx_char(args...) findlasttextEx(args)
|
||||
#define replacetext_char(args...) replacetext(args)
|
||||
#define replacetextEx_char(args...) replacetextEx(args)
|
||||
// /regex procs
|
||||
#define Find_char(args...) Find(args)
|
||||
#define Replace_char(args...) Replace(args)
|
||||
#endif
|
||||
|
||||
//Additional code for the above flags.
|
||||
#ifdef TESTING
|
||||
#warn compiling in TESTING mode. testing() debug messages will be visible.
|
||||
|
||||
@@ -214,5 +214,18 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
"CAN_MASTURBATE_WITH" = CAN_MASTURBATE_WITH,
|
||||
"MASTURBATE_LINKED_ORGAN" = MASTURBATE_LINKED_ORGAN,
|
||||
"CAN_CLIMAX_WITH" = CAN_CLIMAX_WITH
|
||||
)
|
||||
))
|
||||
|
||||
),
|
||||
"mob_biotypes" = list (
|
||||
"MOB_ORGANIC" = MOB_ORGANIC,
|
||||
"MOB_MINERAL" = MOB_MINERAL,
|
||||
"MOB_ROBOTIC" = MOB_ROBOTIC,
|
||||
"MOB_UNDEAD" = MOB_UNDEAD,
|
||||
"MOB_HUMANOID" = MOB_HUMANOID,
|
||||
"MOB_BUG" = MOB_BUG,
|
||||
"MOB_BEAST" = MOB_BEAST,
|
||||
"MOB_EPIC" = MOB_EPIC,
|
||||
"MOB_REPTILE" = MOB_REPTILE,
|
||||
"MOB_SPIRIT" = MOB_SPIRIT
|
||||
)
|
||||
))
|
||||
|
||||
@@ -91,13 +91,7 @@ GLOBAL_LIST_INIT(all_types_bloods,list(
|
||||
"BUG"
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(blood_types, list(
|
||||
"blood",
|
||||
"jellyblood"
|
||||
GLOBAL_LIST_INIT(blood_reagent_types, list(
|
||||
/datum/reagent/blood,
|
||||
/datum/reagent/blood/jellyblood
|
||||
))
|
||||
|
||||
GLOBAL_LIST_INIT(blood_id_types, list(
|
||||
"blood" = /datum/reagent/blood,
|
||||
"jellyblood" = /datum/reagent/blood/jellyblood
|
||||
))
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ GLOBAL_VAR(world_map_error_log)
|
||||
GLOBAL_PROTECT(world_map_error_log)
|
||||
GLOBAL_VAR(subsystem_log)
|
||||
GLOBAL_PROTECT(subsystem_log)
|
||||
GLOBAL_VAR(reagent_log)
|
||||
GLOBAL_PROTECT(reagent_log)
|
||||
GLOBAL_VAR(world_crafting_log)
|
||||
GLOBAL_PROTECT(world_crafting_log)
|
||||
|
||||
@@ -44,6 +46,9 @@ GLOBAL_PROTECT(lastsignalers)
|
||||
GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was
|
||||
GLOBAL_PROTECT(lawchanges)
|
||||
|
||||
GLOBAL_VAR(tgui_log)
|
||||
GLOBAL_PROTECT(tgui_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(combatlog)
|
||||
GLOBAL_PROTECT(combatlog)
|
||||
GLOBAL_LIST_EMPTY(IClog)
|
||||
|
||||
+2
-8
@@ -140,10 +140,7 @@
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
|
||||
if(locked)
|
||||
bolt_raise(usr)
|
||||
else
|
||||
bolt_drop(usr)
|
||||
toggle_bolt(usr)
|
||||
|
||||
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
|
||||
if(obj_flags & EMAGGED)
|
||||
@@ -165,10 +162,7 @@
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
|
||||
if(!emergency)
|
||||
emergency_on(usr)
|
||||
else
|
||||
emergency_off(usr)
|
||||
toggle_emergency(usr)
|
||||
|
||||
/* APC */
|
||||
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
|
||||
|
||||
@@ -319,9 +319,11 @@
|
||||
/mob/proc/ShiftClickOn(atom/A)
|
||||
A.ShiftClick(src)
|
||||
return
|
||||
|
||||
/atom/proc/ShiftClick(mob/user)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK_SHIFT, user)
|
||||
user.examinate(src)
|
||||
var/flags = SEND_SIGNAL(src, COMSIG_CLICK_SHIFT, user)
|
||||
if(!(flags & COMPONENT_DENY_EXAMINATE) && user.client && (user.client.eye == user || user.client.eye == user.loc || flags & COMPONENT_ALLOW_EXAMINATE))
|
||||
user.examinate(src)
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -50,11 +50,6 @@
|
||||
zone_select.update_icon()
|
||||
static_inventory += zone_select
|
||||
|
||||
using = new /obj/screen/craft
|
||||
using.icon = ui_style
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/area_creator
|
||||
using.icon = ui_style
|
||||
using.hud = src
|
||||
|
||||
@@ -91,13 +91,6 @@
|
||||
var/obj/screen/using
|
||||
var/obj/screen/inventory/inv_box
|
||||
|
||||
using = new /obj/screen/craft
|
||||
using.icon = ui_style
|
||||
if(!widescreenlayout) // CIT CHANGE
|
||||
using.screen_loc = ui_boxcraft // CIT CHANGE
|
||||
using.hud = src
|
||||
static_inventory += using
|
||||
|
||||
using = new/obj/screen/language_menu
|
||||
using.icon = ui_style
|
||||
if(!widescreenlayout) // CIT CHANGE
|
||||
|
||||
@@ -66,12 +66,6 @@
|
||||
icon_state = "craft"
|
||||
screen_loc = ui_crafting
|
||||
|
||||
/obj/screen/craft/Click()
|
||||
var/mob/living/M = usr
|
||||
if(isobserver(usr))
|
||||
return
|
||||
M.OpenCraftingMenu()
|
||||
|
||||
/obj/screen/area_creator
|
||||
name = "create new area"
|
||||
icon = 'icons/mob/screen_midnight.dmi'
|
||||
@@ -297,6 +291,9 @@
|
||||
icon_state = "internal0"
|
||||
else
|
||||
if(!C.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
|
||||
if(HAS_TRAIT(C, TRAIT_NO_INTERNALS))
|
||||
to_chat(C, "<span class='warning'>Due to cumbersome equipment or anatomy, you are currently unable to use internals!</span>")
|
||||
return
|
||||
var/obj/item/clothing/check
|
||||
var/internals = FALSE
|
||||
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
|
||||
/**
|
||||
*This is the proc that handles the order of an item_attack.
|
||||
*The order of procs called is:
|
||||
*tool_act on the target. If it returns TRUE, the chain will be stopped.
|
||||
*pre_attack() on src. If this returns TRUE, the chain will be stopped.
|
||||
*attackby on the target. If it returns TRUE, the chain will be stopped.
|
||||
*and lastly
|
||||
*afterattack. The return value does not matter.
|
||||
*/
|
||||
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
|
||||
if(!tool_attack_chain(user, target) && pre_attack(target, user, params))
|
||||
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
|
||||
var/resolved = target.attackby(src, user, params)
|
||||
if(!resolved && target && !QDELETED(src))
|
||||
afterattack(target, user, 1, params) // 1: clicking something Adjacent
|
||||
|
||||
|
||||
//Checks if the item can work as a tool, calling the appropriate tool behavior on the target
|
||||
/obj/item/proc/tool_attack_chain(mob/user, atom/target)
|
||||
if(!tool_behaviour)
|
||||
return FALSE
|
||||
|
||||
return target.tool_act(user, src, tool_behaviour)
|
||||
|
||||
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
|
||||
return
|
||||
if(pre_attack(target, user, params))
|
||||
return
|
||||
if(target.attackby(src,user, params))
|
||||
return
|
||||
if(QDELETED(src) || QDELETED(target))
|
||||
return
|
||||
afterattack(target, user, TRUE, params)
|
||||
|
||||
// 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)
|
||||
@@ -23,8 +26,8 @@
|
||||
|
||||
/obj/item/proc/pre_attack(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_NO_ATTACK)
|
||||
return FALSE
|
||||
return TRUE //return FALSE to avoid calling attackby after this proc does stuff
|
||||
return TRUE
|
||||
return FALSE //return TRUE to avoid calling attackby after this proc does stuff
|
||||
|
||||
// No comment
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
@@ -112,7 +115,7 @@
|
||||
send_item_attack_message(I, user)
|
||||
if(I.force)
|
||||
apply_damage(totitemdamage, I.damtype) //CIT CHANGE - replaces I.force with totitemdamage
|
||||
if(I.damtype == BRUTE && !HAS_TRAIT(src, TRAIT_NOMARROW))
|
||||
if(I.damtype == BRUTE && !HAS_TRAIT(src, TRAIT_NOMARROW))
|
||||
if(prob(33))
|
||||
I.add_mob_blood(src)
|
||||
var/turf/location = get_turf(src)
|
||||
|
||||
@@ -171,7 +171,8 @@
|
||||
key_name = copytext(str_val, 1, key_pos)
|
||||
if(lowercase)
|
||||
key_name = lowertext(key_name)
|
||||
key_value = copytext(str_val, key_pos + 1)
|
||||
if(key_pos)
|
||||
key_value = copytext(str_val, key_pos + length(str_val[key_pos]))
|
||||
var/new_key
|
||||
var/new_value
|
||||
var/continue_check_value
|
||||
|
||||
@@ -109,13 +109,13 @@
|
||||
if(!L)
|
||||
continue
|
||||
|
||||
var/firstchar = copytext(L, 1, 2)
|
||||
var/firstchar = L[1]
|
||||
if(firstchar == "#")
|
||||
continue
|
||||
|
||||
var/lockthis = firstchar == "@"
|
||||
if(lockthis)
|
||||
L = copytext(L, 2)
|
||||
L = copytext(L, length(firstchar) + 1)
|
||||
|
||||
var/pos = findtext(L, " ")
|
||||
var/entry = null
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
if(pos)
|
||||
entry = lowertext(copytext(L, 1, pos))
|
||||
value = copytext(L, pos + 1)
|
||||
value = copytext(L, pos + length(L[pos]))
|
||||
else
|
||||
entry = lowertext(L)
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
continue
|
||||
else if(copytext(t, 1, 2) == "#")
|
||||
else if(t[1] == "#")
|
||||
continue
|
||||
|
||||
var/pos = findtext(t, " ")
|
||||
@@ -278,7 +278,7 @@
|
||||
|
||||
if(pos)
|
||||
command = lowertext(copytext(t, 1, pos))
|
||||
data = copytext(t, pos + 1)
|
||||
data = copytext(t, pos + length(t[pos]))
|
||||
else
|
||||
command = lowertext(t)
|
||||
|
||||
@@ -364,6 +364,29 @@
|
||||
runnable_modes[M] = final_weight
|
||||
return runnable_modes
|
||||
|
||||
/datum/controller/configuration/proc/get_runnable_storytellers()
|
||||
var/list/datum/dynamic_storyteller/runnable_storytellers = new
|
||||
var/list/probabilities = Get(/datum/config_entry/keyed_list/storyteller_weight)
|
||||
var/list/repeated_mode_adjust = Get(/datum/config_entry/number_list/repeated_mode_adjust)
|
||||
for(var/T in storyteller_cache)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
var/config_tag = initial(S.config_tag)
|
||||
var/final_weight = initial(S.weight)
|
||||
if(probabilities[config_tag]<=0)
|
||||
continue
|
||||
final_weight = probabilities[config_tag]
|
||||
if(SSpersistence.saved_storytellers.len == 3 && repeated_mode_adjust.len == 3)
|
||||
var/name = initial(S.name)
|
||||
var/recent_round = min(SSpersistence.saved_storytellers.Find(name),3)
|
||||
var/adjustment = 0
|
||||
while(recent_round)
|
||||
adjustment += repeated_mode_adjust[recent_round]
|
||||
recent_round = SSpersistence.saved_modes.Find(name,recent_round+1,0)
|
||||
final_weight *= ((100-adjustment)/100)
|
||||
runnable_storytellers[S] = final_weight
|
||||
return runnable_storytellers
|
||||
|
||||
|
||||
/datum/controller/configuration/proc/get_runnable_midround_modes(crew)
|
||||
var/list/datum/game_mode/runnable_modes = new
|
||||
var/list/probabilities = Get(/datum/config_entry/keyed_list/probability)
|
||||
|
||||
@@ -88,3 +88,7 @@
|
||||
/datum/config_entry/number/dynamic_warops_cost
|
||||
config_entry_value = 10
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/keyed_list/storyteller_weight
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/datum/config_entry/flag/auto_profile // Automatically start profiler on server start
|
||||
|
||||
/datum/config_entry/flag/autoadmin // if autoadmin is enabled
|
||||
protection = CONFIG_ENTRY_LOCKED
|
||||
|
||||
@@ -267,6 +269,9 @@
|
||||
|
||||
/datum/config_entry/flag/tgstyle_maprotation
|
||||
|
||||
/datum/config_entry/string/map_vote_type
|
||||
config_entry_value = "SCORE"
|
||||
|
||||
/datum/config_entry/number/maprotatechancedelta
|
||||
config_entry_value = 0.75
|
||||
min_val = 0
|
||||
@@ -389,6 +394,13 @@
|
||||
config_entry_value = 50
|
||||
|
||||
/datum/config_entry/flag/irc_announce_new_game
|
||||
deprecated_by = /datum/config_entry/string/chat_announce_new_game
|
||||
|
||||
/datum/config_entry/flag/irc_announce_new_game/DeprecationUpdate(value)
|
||||
return "" //default broadcast
|
||||
|
||||
/datum/config_entry/string/chat_announce_new_game
|
||||
config_entry_value = null
|
||||
|
||||
/datum/config_entry/flag/debug_admin_hrefs
|
||||
|
||||
@@ -431,3 +443,7 @@
|
||||
/datum/config_entry/flag/log_pictures
|
||||
|
||||
/datum/config_entry/flag/picture_logging_camera
|
||||
|
||||
/datum/config_entry/number/max_bunker_days
|
||||
config_entry_value = 7
|
||||
min_val = 1
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/datum/config_entry/number/snowflake_plushie_prob
|
||||
config_entry_value = 50
|
||||
|
||||
/datum/config_entry/keyed_list/snowflake_plushies
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_TEXT
|
||||
@@ -239,7 +239,6 @@ SUBSYSTEM_DEF(air)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
|
||||
active_turfs -= T
|
||||
SSair_turfs.currentrun -= T
|
||||
@@ -257,7 +256,7 @@ SUBSYSTEM_DEF(air)
|
||||
#ifdef VISUALIZE_ACTIVE_TURFS
|
||||
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
|
||||
#endif
|
||||
T.excited = 1
|
||||
T.excited = TRUE
|
||||
active_turfs |= T
|
||||
SSair_turfs.currentrun |= T
|
||||
if(blockchanges && T.excited_group)
|
||||
|
||||
@@ -11,7 +11,6 @@ SUBSYSTEM_DEF(air_turfs)
|
||||
|
||||
/datum/controller/subsystem/air_turfs/fire(resumed = 0)
|
||||
var/fire_count = times_fired
|
||||
//cache for sanic speed
|
||||
if (!resumed)
|
||||
src.currentrun = SSair.active_turfs.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
|
||||
@@ -31,16 +31,18 @@ SUBSYSTEM_DEF(fail2topic)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/fail2topic/fire()
|
||||
for(var/i in 1 to length(rate_limiting))
|
||||
var/ip = rate_limiting[i]
|
||||
var/last_attempt = rate_limiting[ip]
|
||||
|
||||
if (world.time - last_attempt > rate_limit)
|
||||
rate_limiting -= ip
|
||||
fail_counts -= ip
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
if(length(rate_limiting))
|
||||
var/i = 1
|
||||
while(i <= length(rate_limiting))
|
||||
var/ip = rate_limiting[i]
|
||||
var/last_attempt = rate_limiting[ip]
|
||||
if(world.time - last_attempt > rate_limit)
|
||||
rate_limiting -= ip
|
||||
fail_counts -= ip
|
||||
else //if we remove that, and the next element is in its place. check that instead of incrementing.
|
||||
++i
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/fail2topic/Shutdown()
|
||||
DropFirewallRule()
|
||||
|
||||
@@ -114,6 +114,6 @@ SUBSYSTEM_DEF(input)
|
||||
|
||||
/datum/controller/subsystem/input/fire()
|
||||
var/list/clients = GLOB.clients // Let's sing the list cache song
|
||||
for(var/i in 1 to clients.len)
|
||||
for(var/i in 1 to length(clients))
|
||||
var/client/C = clients[i]
|
||||
C.keyLoop()
|
||||
|
||||
@@ -37,6 +37,8 @@ SUBSYSTEM_DEF(mapping)
|
||||
var/datum/space_level/empty_space
|
||||
var/num_of_res_levels = 1
|
||||
|
||||
var/stat_map_name = "Loading..."
|
||||
|
||||
//dlete dis once #39770 is resolved
|
||||
/datum/controller/subsystem/mapping/proc/HACK_LoadMapConfig()
|
||||
if(!config)
|
||||
@@ -45,6 +47,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
#else
|
||||
config = load_map_config(error_if_missing = FALSE)
|
||||
#endif
|
||||
stat_map_name = config.map_name
|
||||
|
||||
/datum/controller/subsystem/mapping/Initialize(timeofday)
|
||||
HACK_LoadMapConfig()
|
||||
@@ -330,7 +333,10 @@ GLOBAL_LIST_EMPTY(the_station_areas)
|
||||
return
|
||||
|
||||
next_map_config = VM
|
||||
return TRUE
|
||||
|
||||
. = TRUE
|
||||
|
||||
stat_map_name = "[config.map_name] (Next: [next_map_config.map_name])"
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/preloadTemplates(path = "_maps/templates/") //see master controller setup
|
||||
var/list/filelist = flist(path)
|
||||
|
||||
@@ -26,7 +26,7 @@ SUBSYSTEM_DEF(nightshift)
|
||||
/datum/controller/subsystem/nightshift/proc/check_nightshift()
|
||||
var/emergency = GLOB.security_level >= SEC_LEVEL_RED
|
||||
var/announcing = TRUE
|
||||
var/time = STATION_TIME(FALSE)
|
||||
var/time = STATION_TIME(FALSE, world.time)
|
||||
var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time)
|
||||
if(high_security_mode != emergency)
|
||||
high_security_mode = emergency
|
||||
|
||||
@@ -39,34 +39,34 @@ SUBSYSTEM_DEF(pai)
|
||||
|
||||
switch(option)
|
||||
if("name")
|
||||
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
|
||||
t = reject_bad_name(stripped_input(usr, "Enter a name for your pAI", "pAI Name", candidate.name, MAX_NAME_LEN), TRUE)
|
||||
if(t)
|
||||
candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN)
|
||||
candidate.name = t
|
||||
if("desc")
|
||||
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
|
||||
t = stripped_multiline_input(usr, "Enter a description for your pAI", "pAI Description", candidate.description, MAX_MESSAGE_LEN)
|
||||
if(t)
|
||||
candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.description = t
|
||||
if("role")
|
||||
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
|
||||
t = stripped_input(usr, "Enter a role for your pAI", "pAI Role", candidate.role, MAX_MESSAGE_LEN)
|
||||
if(t)
|
||||
candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.role = t
|
||||
if("ooc")
|
||||
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
|
||||
t = stripped_multiline_input(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.comments, MAX_MESSAGE_LEN)
|
||||
if(t)
|
||||
candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
candidate.comments = t
|
||||
if("save")
|
||||
candidate.savefile_save(usr)
|
||||
if("load")
|
||||
candidate.savefile_load(usr)
|
||||
//In case people have saved unsanitized stuff.
|
||||
if(candidate.name)
|
||||
candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN)
|
||||
candidate.name = copytext_char(sanitize(candidate.name),1,MAX_NAME_LEN)
|
||||
if(candidate.description)
|
||||
candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
|
||||
candidate.description = copytext_char(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
|
||||
if(candidate.role)
|
||||
candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
|
||||
candidate.role = copytext_char(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
|
||||
if(candidate.comments)
|
||||
candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
|
||||
candidate.comments = copytext_char(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
|
||||
|
||||
if("submit")
|
||||
if(isobserver(usr))
|
||||
|
||||
@@ -13,7 +13,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
var/list/saved_messages = list()
|
||||
var/list/saved_modes = list(1,2,3)
|
||||
var/list/saved_dynamic_rules = list(list(),list(),list())
|
||||
var/list/saved_storytellers = list("foo","bar","baz","foo again","bar again")
|
||||
var/list/saved_storytellers = list("foo","bar","baz")
|
||||
var/list/saved_maps
|
||||
var/list/saved_trophies = list()
|
||||
var/list/spawned_objects = list()
|
||||
@@ -39,6 +39,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
if(CONFIG_GET(flag/use_antag_rep))
|
||||
LoadAntagReputation()
|
||||
LoadRandomizedRecipes()
|
||||
LoadPanicBunker()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadSatchels()
|
||||
@@ -190,6 +191,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
if(!json)
|
||||
return
|
||||
saved_storytellers = json["data"]
|
||||
saved_storytellers.len = 3
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadRecentMaps()
|
||||
var/json_file = file("data/RecentMaps.json")
|
||||
@@ -259,6 +261,16 @@ SUBSYSTEM_DEF(persistence)
|
||||
if(CONFIG_GET(flag/use_antag_rep))
|
||||
CollectAntagReputation()
|
||||
SaveRandomizedRecipes()
|
||||
SavePanicBunker()
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadPanicBunker()
|
||||
var/bunker_path = file("data/bunker_passthrough.json")
|
||||
if(fexists(bunker_path))
|
||||
var/list/json = json_decode(file2text(bunker_path))
|
||||
GLOB.bunker_passthrough = json["data"]
|
||||
for(var/ckey in GLOB.bunker_passthrough)
|
||||
if(daysSince(GLOB.bunker_passthrough[ckey]) >= CONFIG_GET(number/max_bunker_days))
|
||||
GLOB.bunker_passthrough -= ckey
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/GetPhotoAlbums()
|
||||
var/album_path = file("data/photo_albums.json")
|
||||
@@ -381,6 +393,13 @@ SUBSYSTEM_DEF(persistence)
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/SavePanicBunker()
|
||||
var/json_file = file("data/bunker_passthrough.json")
|
||||
var/list/file_data = list()
|
||||
file_data["data"] = GLOB.bunker_passthrough
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file,json_encode(file_data))
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/remove_duplicate_trophies(list/trophies)
|
||||
var/list/ukeys = list()
|
||||
. = list()
|
||||
@@ -411,9 +430,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/CollectStoryteller(var/datum/game_mode/dynamic/mode)
|
||||
saved_storytellers.len = 5
|
||||
saved_storytellers[5] = saved_storytellers[4]
|
||||
saved_storytellers[4] = saved_storytellers[3]
|
||||
saved_storytellers.len = 3
|
||||
saved_storytellers[3] = saved_storytellers[2]
|
||||
saved_storytellers[2] = saved_storytellers[1]
|
||||
saved_storytellers[1] = mode.storyteller.name
|
||||
|
||||
@@ -46,6 +46,6 @@ PROCESSING_SUBSYSTEM_DEF(networks)
|
||||
var/hex = md5(string)
|
||||
if(!hex)
|
||||
return //errored
|
||||
. = "[copytext(hex, 1, 9)]" //16 ^ 8 possibilities I think.
|
||||
. = "[copytext_char(hex, 1, 9)]" //16 ^ 8 possibilities I think.
|
||||
if(interfaces_by_id[.])
|
||||
return resolve_collisions? make_address("[num2text(rand(HID_RESTRICTED_END, 999999999), 12)]"):null
|
||||
|
||||
@@ -35,7 +35,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
var/list/my_quirks = cli.prefs.all_quirks.Copy()
|
||||
var/list/cut
|
||||
if(job?.blacklisted_quirks)
|
||||
cut = filter_quirks(my_quirks, job)
|
||||
cut = filter_quirks(my_quirks, job.blacklisted_quirks)
|
||||
for(var/V in my_quirks)
|
||||
var/datum/quirk/Q = quirks[V]
|
||||
if(Q)
|
||||
@@ -63,11 +63,11 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
for(var/i in quirk_names)
|
||||
. += quirk_points_by_name(i)
|
||||
|
||||
/datum/controller/subsystem/processing/quirks/proc/filter_quirks(list/our_quirks, datum/job/job)
|
||||
/datum/controller/subsystem/processing/quirks/proc/filter_quirks(list/our_quirks, list/blacklisted_quirks)
|
||||
var/list/cut = list()
|
||||
var/list/banned_names = list()
|
||||
var/pointscut = 0
|
||||
for(var/i in job.blacklisted_quirks)
|
||||
for(var/i in blacklisted_quirks)
|
||||
var/name = quirk_name_by_path(i)
|
||||
if(name)
|
||||
banned_names += name
|
||||
|
||||
+7
-16
@@ -4,25 +4,16 @@
|
||||
#define END_STAGE 4
|
||||
|
||||
//Used for all kinds of weather, ex. lavaland ash storms.
|
||||
SUBSYSTEM_DEF(weather)
|
||||
PROCESSING_SUBSYSTEM_DEF(weather)
|
||||
name = "Weather"
|
||||
flags = SS_BACKGROUND
|
||||
wait = 10
|
||||
runlevels = RUNLEVEL_GAME
|
||||
var/list/processing = list()
|
||||
var/list/eligible_zlevels = list()
|
||||
var/list/next_hit_by_zlevel = list() //Used by barometers to know when the next storm is coming
|
||||
|
||||
/datum/controller/subsystem/weather/fire()
|
||||
// process active weather
|
||||
for(var/V in processing)
|
||||
var/datum/weather/W = V
|
||||
if(W.aesthetic || W.stage != MAIN_STAGE)
|
||||
continue
|
||||
for(var/i in GLOB.mob_living_list)
|
||||
var/mob/living/L = i
|
||||
if(W.can_weather_act(L))
|
||||
W.weather_act(L)
|
||||
/datum/controller/subsystem/processing/weather/fire()
|
||||
. = ..() //Active weather is handled by . = ..() processing subsystem base fire().
|
||||
|
||||
// start random weather on relevant levels
|
||||
for(var/z in eligible_zlevels)
|
||||
@@ -34,7 +25,7 @@ SUBSYSTEM_DEF(weather)
|
||||
addtimer(CALLBACK(src, .proc/make_eligible, z, possible_weather), randTime + initial(W.weather_duration_upper), TIMER_UNIQUE) //Around 5-10 minutes between weathers
|
||||
next_hit_by_zlevel["[z]"] = world.time + randTime + initial(W.telegraph_duration)
|
||||
|
||||
/datum/controller/subsystem/weather/Initialize(start_timeofday)
|
||||
/datum/controller/subsystem/processing/weather/Initialize(start_timeofday)
|
||||
for(var/V in subtypesof(/datum/weather))
|
||||
var/datum/weather/W = V
|
||||
var/probability = initial(W.probability)
|
||||
@@ -47,7 +38,7 @@ SUBSYSTEM_DEF(weather)
|
||||
eligible_zlevels["[z]"][W] = probability
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/weather/proc/run_weather(datum/weather/weather_datum_type, z_levels)
|
||||
/datum/controller/subsystem/processing/weather/proc/run_weather(datum/weather/weather_datum_type, z_levels)
|
||||
if (istext(weather_datum_type))
|
||||
for (var/V in subtypesof(/datum/weather))
|
||||
var/datum/weather/W = V
|
||||
@@ -69,11 +60,11 @@ SUBSYSTEM_DEF(weather)
|
||||
var/datum/weather/W = new weather_datum_type(z_levels)
|
||||
W.telegraph()
|
||||
|
||||
/datum/controller/subsystem/weather/proc/make_eligible(z, possible_weather)
|
||||
/datum/controller/subsystem/processing/weather/proc/make_eligible(z, possible_weather)
|
||||
eligible_zlevels[z] = possible_weather
|
||||
next_hit_by_zlevel["[z]"] = null
|
||||
|
||||
/datum/controller/subsystem/weather/proc/get_weather(z, area/active_area)
|
||||
/datum/controller/subsystem/processing/weather/proc/get_weather(z, area/active_area)
|
||||
var/datum/weather/A
|
||||
for(var/V in processing)
|
||||
var/datum/weather/W = V
|
||||
@@ -0,0 +1,63 @@
|
||||
#define PROFILER_FILENAME "profiler.json"
|
||||
|
||||
SUBSYSTEM_DEF(profiler)
|
||||
name = "Profiler"
|
||||
init_order = INIT_ORDER_PROFILER
|
||||
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
||||
wait = 3000
|
||||
flags = SS_NO_TICK_CHECK
|
||||
var/fetch_cost = 0
|
||||
var/write_cost = 0
|
||||
|
||||
/datum/controller/subsystem/profiler/stat_entry(msg)
|
||||
msg += "F:[round(fetch_cost,1)]ms"
|
||||
msg += "|W:[round(write_cost,1)]ms"
|
||||
..(msg)
|
||||
|
||||
/datum/controller/subsystem/profiler/Initialize()
|
||||
if(CONFIG_GET(flag/auto_profile))
|
||||
StartProfiling()
|
||||
else
|
||||
StopProfiling() //Stop the early start from world/New
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/profiler/fire()
|
||||
if(CONFIG_GET(flag/auto_profile))
|
||||
DumpFile()
|
||||
|
||||
/datum/controller/subsystem/profiler/Shutdown()
|
||||
if(CONFIG_GET(flag/auto_profile))
|
||||
DumpFile()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/profiler/proc/StartProfiling()
|
||||
#if DM_BUILD < 1506 || DM_VERSION < 513
|
||||
stack_trace("Auto profiling unsupported on this byond version")
|
||||
CONFIG_SET(flag/auto_profile, FALSE)
|
||||
#else
|
||||
world.Profile(PROFILE_START)
|
||||
#endif
|
||||
|
||||
/datum/controller/subsystem/profiler/proc/StopProfiling()
|
||||
#if DM_BUILD >= 1506 && DM_VERSION >= 513
|
||||
world.Profile(PROFILE_STOP)
|
||||
#endif
|
||||
|
||||
/datum/controller/subsystem/profiler/proc/DumpFile()
|
||||
#if DM_BUILD < 1506 || DM_VERSION < 513
|
||||
stack_trace("Auto profiling unsupported on this byond version")
|
||||
CONFIG_SET(flag/auto_profile, FALSE)
|
||||
#else
|
||||
var/timer = TICK_USAGE_REAL
|
||||
var/current_profile_data = world.Profile(PROFILE_REFRESH,format="json")
|
||||
fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
||||
CHECK_TICK
|
||||
if(!length(current_profile_data)) //Would be nice to have explicit proc to check this
|
||||
stack_trace("Warning, profiling stopped manually before dump.")
|
||||
var/json_file = file("[GLOB.log_directory]/[PROFILER_FILENAME]")
|
||||
if(fexists(json_file))
|
||||
fdel(json_file)
|
||||
timer = TICK_USAGE_REAL
|
||||
WRITE_FILE(json_file, current_profile_data)
|
||||
write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
||||
#endif
|
||||
@@ -81,8 +81,8 @@ SUBSYSTEM_DEF(server_maint)
|
||||
co.ehjax_send(data = "roundrestart")
|
||||
if(server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
|
||||
C << link("byond://[server]")
|
||||
var/tgsversion = world.TgsVersion()
|
||||
var/datum/tgs_version/tgsversion = world.TgsVersion()
|
||||
if(tgsversion)
|
||||
SSblackbox.record_feedback("text", "server_tools", 1, tgsversion)
|
||||
SSblackbox.record_feedback("text", "server_tools", 1, tgsversion.raw_parameter)
|
||||
|
||||
#undef PING_BUFFER_TIME
|
||||
|
||||
@@ -30,6 +30,7 @@ SUBSYSTEM_DEF(shuttle)
|
||||
var/list/hostileEnvironments = list() //Things blocking escape shuttle from leaving
|
||||
var/list/tradeBlockade = list() //Things blocking cargo from leaving.
|
||||
var/supplyBlocked = FALSE
|
||||
var/emergency_shuttle_stat_text
|
||||
|
||||
//supply shuttle stuff
|
||||
var/obj/docking_port/mobile/supply/supply
|
||||
@@ -118,6 +119,9 @@ SUBSYSTEM_DEF(shuttle)
|
||||
points += point_gain
|
||||
//Cargo stuff end
|
||||
|
||||
var/esETA = emergency?.getModeStr()
|
||||
emergency_shuttle_stat_text = "[esETA? "[esETA] [emergency.getTimerStr()]" : ""]"
|
||||
|
||||
if(!SSmapping.clearing_reserved_turfs)
|
||||
while(transit_requesters.len)
|
||||
var/requester = popleft(transit_requesters)
|
||||
|
||||
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
var/basehtml // The HTML base used for all UIs.
|
||||
|
||||
/datum/controller/subsystem/tgui/PreInit()
|
||||
basehtml = file2text('tgui/tgui.html')
|
||||
basehtml = file2text('tgui-next/packages/tgui/public/tgui-main.html')
|
||||
|
||||
/datum/controller/subsystem/tgui/Shutdown()
|
||||
close_all_uis()
|
||||
|
||||
@@ -68,6 +68,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
var/modevoted = FALSE //Have we sent a vote for the gamemode?
|
||||
|
||||
var/station_integrity = 100 // stored at roundend for use in some antag goals
|
||||
|
||||
/datum/controller/subsystem/ticker/Initialize(timeofday)
|
||||
load_mode()
|
||||
|
||||
@@ -156,8 +158,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
for(var/client/C in GLOB.clients)
|
||||
window_flash(C, ignorepref = TRUE) //let them know lobby has opened up.
|
||||
to_chat(world, "<span class='boldnotice'>Welcome to [station_name()]!</span>")
|
||||
if(CONFIG_GET(flag/irc_announce_new_game))
|
||||
world.TgsTargetedChatBroadcast("New round starting on [SSmapping.config.map_name]!", FALSE)
|
||||
send2chat("New round starting on [SSmapping.config.map_name]!", CONFIG_GET(string/chat_announce_new_game))
|
||||
current_state = GAME_STATE_PREGAME
|
||||
//Everyone who wants to be an observer is now spawned
|
||||
create_observers()
|
||||
@@ -363,7 +364,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
var/turf/epi = bomb.loc
|
||||
qdel(bomb)
|
||||
if(epi)
|
||||
explosion(epi, 0, 256, 512, 0, TRUE, TRUE, 0, TRUE)
|
||||
explosion(epi, 512, 0, 0, 0, TRUE, TRUE, 0, TRUE)
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/create_characters()
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
@@ -475,7 +476,18 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(CONFIG_GET(flag/tgstyle_maprotation))
|
||||
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
|
||||
else
|
||||
SSvote.initiate_vote("map","server",TRUE)
|
||||
var/vote_type = CONFIG_GET(string/map_vote_type)
|
||||
switch(vote_type)
|
||||
if("PLURALITY")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE)
|
||||
if("APPROVAL")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = APPROVAL_VOTING)
|
||||
if("IRV")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = INSTANT_RUNOFF_VOTING)
|
||||
if("SCORE")
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE,votesystem = MAJORITY_JUDGEMENT_VOTING)
|
||||
// fallback
|
||||
SSvote.initiate_vote("map","server",hideresults=TRUE)
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
|
||||
return current_state >= GAME_STATE_PLAYING
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SUBSYSTEM_DEF(time_track)
|
||||
name = "Time Tracking"
|
||||
wait = 600
|
||||
wait = 1 SECONDS
|
||||
flags = SS_NO_INIT|SS_NO_TICK_CHECK
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
@@ -16,23 +16,33 @@ SUBSYSTEM_DEF(time_track)
|
||||
var/last_tick_byond_time = 0
|
||||
var/last_tick_tickcount = 0
|
||||
|
||||
var/last_measurement = 0
|
||||
var/measurement_delay = 60
|
||||
|
||||
var/stat_time_text
|
||||
var/time_dilation_text
|
||||
|
||||
/datum/controller/subsystem/time_track/fire()
|
||||
stat_time_text = "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]\n\nRound Time: [WORLDTIME2TEXT("hh:mm:ss")]\n\nStation Time: [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]\n\n[time_dilation_text]"
|
||||
|
||||
var/current_realtime = REALTIMEOFDAY
|
||||
var/current_byondtime = world.time
|
||||
var/current_tickcount = world.time/world.tick_lag
|
||||
if(++last_measurement == measurement_delay)
|
||||
last_measurement = 0
|
||||
var/current_realtime = REALTIMEOFDAY
|
||||
var/current_byondtime = world.time
|
||||
var/current_tickcount = world.time/world.tick_lag
|
||||
|
||||
if (!first_run)
|
||||
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
|
||||
if (!first_run)
|
||||
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
|
||||
|
||||
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
|
||||
time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100
|
||||
|
||||
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
|
||||
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
|
||||
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
|
||||
else
|
||||
first_run = FALSE
|
||||
last_tick_realtime = current_realtime
|
||||
last_tick_byond_time = current_byondtime
|
||||
last_tick_tickcount = current_tickcount
|
||||
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
|
||||
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
|
||||
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
|
||||
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
|
||||
else
|
||||
first_run = FALSE
|
||||
last_tick_realtime = current_realtime
|
||||
last_tick_byond_time = current_byondtime
|
||||
last_tick_tickcount = current_tickcount
|
||||
SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]")))
|
||||
time_dilation_text = "Time Dilation: [round(time_dilation_current,1)]% AVG:([round(time_dilation_avg_fast,1)]%, [round(time_dilation_avg,1)]%, [round(time_dilation_avg_slow,1)]%)"
|
||||
|
||||
@@ -188,22 +188,47 @@ SUBSYSTEM_DEF(vote)
|
||||
choices[score_name]++
|
||||
|
||||
/datum/controller/subsystem/vote/proc/calculate_scores(var/blackbox_text)
|
||||
var/list/scores_by_choice = list()
|
||||
for(var/choice in choices)
|
||||
scores_by_choice += "[choice]"
|
||||
scores_by_choice["[choice]"] = list()
|
||||
scores += "[choice]"
|
||||
scores["[choice]"] = 0
|
||||
for(var/ckey in voted)
|
||||
var/list/this_vote = voted[ckey]
|
||||
for(var/choice in choices)
|
||||
if("[choice]" in this_vote && "[choice]" in scores_by_choice)
|
||||
sorted_insert(scores_by_choice["[choice]"],this_vote["[choice]"],/proc/cmp_numeric_asc)
|
||||
var/middle_score = round(GLOB.vote_score_options.len/2,1)
|
||||
for(var/score_name in scores_by_choice)
|
||||
var/list/score = scores_by_choice[score_name]
|
||||
for(var/S in score)
|
||||
scores[score_name] += S-middle_score
|
||||
for(var/choice in this_vote)
|
||||
scores["[choice]"] += this_vote["[choice]"]
|
||||
var/min_score = 100
|
||||
var/max_score = -100
|
||||
for(var/score_name in scores) // normalize the scores from 0-1
|
||||
max_score=max(max_score,scores[score_name])
|
||||
min_score=min(min_score,scores[score_name])
|
||||
for(var/score_name in scores)
|
||||
if(max_score == min_score)
|
||||
scores[score_name] = 1
|
||||
else
|
||||
scores[score_name] = (scores[score_name]-min_score)/(max_score-min_score)
|
||||
SSblackbox.record_feedback("nested tally","voting",scores[score_name],list(blackbox_text,"Total scores",score_name))
|
||||
|
||||
/datum/controller/subsystem/vote/proc/get_runoff_results(var/blackbox_text)
|
||||
var/already_lost_runoff = list()
|
||||
var/list/cur_choices = choices.Copy()
|
||||
for(var/ckey in voted)
|
||||
choices[choices[voted[ckey][1]]]++ // jesus christ how horrifying
|
||||
for(var/_this_var_unused_ignore_it in 1 to choices.len) // if it takes more than this something REALLY wrong happened
|
||||
for(var/ckey in voted)
|
||||
cur_choices[cur_choices[voted[ckey][1]]]++ // jesus christ how horrifying
|
||||
var/least_vote = 100000
|
||||
var/least_voted
|
||||
for(var/i in 1 to cur_choices.len)
|
||||
var/option = cur_choices[i]
|
||||
if(cur_choices[option] > voted.len/2)
|
||||
return list(option)
|
||||
else if(cur_choices[option] < least_vote && !(option in already_lost_runoff))
|
||||
least_vote = cur_choices[option]
|
||||
least_voted = i
|
||||
already_lost_runoff += cur_choices[least_voted]
|
||||
for(var/ckey in voted)
|
||||
voted[ckey] -= least_voted
|
||||
for(var/option in cur_choices)
|
||||
cur_choices[option] = 0
|
||||
|
||||
/datum/controller/subsystem/vote/proc/announce_result()
|
||||
var/vote_title_text
|
||||
@@ -214,32 +239,29 @@ SUBSYSTEM_DEF(vote)
|
||||
else
|
||||
text += "<b>[capitalize(mode)] Vote</b>"
|
||||
vote_title_text = "[capitalize(mode)] Vote"
|
||||
if(vote_system == RANKED_CHOICE_VOTING)
|
||||
if(vote_system == SCHULZE_VOTING)
|
||||
calculate_condorcet_votes(vote_title_text)
|
||||
if(vote_system == SCORE_VOTING)
|
||||
calculate_majority_judgement_vote(vote_title_text)
|
||||
calculate_scores(vote_title_text)
|
||||
var/list/winners = get_result()
|
||||
if(vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
calculate_majority_judgement_vote(vote_title_text) // nothing uses this at the moment
|
||||
var/list/winners = vote_system == INSTANT_RUNOFF_VOTING ? get_runoff_results() : get_result()
|
||||
var/was_roundtype_vote = mode == "roundtype" || mode == "dynamic"
|
||||
if(winners.len > 0)
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes = list()
|
||||
if(!obfuscated && vote_system == RANKED_CHOICE_VOTING)
|
||||
text += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
|
||||
if(mode == "mode tiers")
|
||||
for(var/score_name in scores)
|
||||
var/score = scores[score_name]
|
||||
if(!score)
|
||||
score = 0
|
||||
text = "\n<b>[score_name]:</b> [obfuscated ? "???" : score]"
|
||||
else
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes[choices[i]] = votes
|
||||
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
|
||||
if(!obfuscated)
|
||||
if(vote_system == SCHULZE_VOTING)
|
||||
text += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
|
||||
if(vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
text += "\nIt should be noted that this is not a raw tally of votes but the number of runoffs done by majority judgement!"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes)
|
||||
votes = 0
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes[choices[i]] = votes
|
||||
text += "\n<b>[choices[i]]:</b> [obfuscated ? "???" : votes]" //CIT CHANGE - adds obfuscated votes
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1 && !obfuscated) //CIT CHANGE - adds obfuscated votes
|
||||
text = "\n<b>Vote Tied Between:</b>"
|
||||
@@ -249,6 +271,15 @@ SUBSYSTEM_DEF(vote)
|
||||
text += "\n<b>Vote Result: [obfuscated ? "???" : .]</b>" //CIT CHANGE - adds obfuscated votes
|
||||
else
|
||||
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
|
||||
else if(vote_system == SCORE_VOTING)
|
||||
for(var/score_name in scores)
|
||||
var/score = scores[score_name]
|
||||
if(!score)
|
||||
score = 0
|
||||
if(was_roundtype_vote)
|
||||
stored_gamemode_votes[score_name] = score
|
||||
text = "\n<b>[score_name]:</b> [obfuscated ? "???" : score]"
|
||||
. = 1
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
log_vote(text)
|
||||
@@ -258,7 +289,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(APPROVAL_VOTING,PLURALITY_VOTING)
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
SSblackbox.record_feedback("nested tally","voting",choices[choices[i]],list(vote_title_text,choices[i]))
|
||||
if(RANKED_CHOICE_VOTING)
|
||||
if(SCHULZE_VOTING,INSTANT_RUNOFF_VOTING)
|
||||
for(var/i=1,i<=voted.len,i++)
|
||||
var/list/myvote = voted[voted[i]]
|
||||
if(islist(myvote))
|
||||
@@ -266,13 +297,18 @@ SUBSYSTEM_DEF(vote)
|
||||
SSblackbox.record_feedback("nested tally","voting",1,list(vote_title_text,"[j]\th",choices[myvote[j]]))
|
||||
if(obfuscated) //CIT CHANGE - adds obfuscated votes. this messages admins with the vote's true results
|
||||
var/admintext = "Obfuscated results"
|
||||
if(vote_system == RANKED_CHOICE_VOTING)
|
||||
admintext += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
|
||||
else if(vote_system == SCORE_VOTING)
|
||||
admintext += "\nIt should be noted that this is not a raw tally of votes but the number of runoffs done by majority judgement!"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
admintext += "\n<b>[choices[i]]:</b> [votes]"
|
||||
if(vote_system != SCORE_VOTING)
|
||||
if(vote_system == SCHULZE_VOTING)
|
||||
admintext += "\nIt should be noted that this is not a raw tally of votes (impossible in ranked choice) but the score determined by the schulze method of voting, so the numbers will look weird!"
|
||||
else if(vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
admintext += "\nIt should be noted that this is not a raw tally of votes but the number of runoffs done by majority judgement!"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
admintext += "\n<b>[choices[i]]:</b> [votes]"
|
||||
else
|
||||
for(var/i=1,i<=scores.len,i++)
|
||||
var/score = scores[scores[i]]
|
||||
admintext += "\n<b>[scores[i]]:</b> [score]"
|
||||
message_admins(admintext)
|
||||
return .
|
||||
|
||||
@@ -316,15 +352,13 @@ SUBSYSTEM_DEF(vote)
|
||||
if("dynamic")
|
||||
if(SSticker.current_state > GAME_STATE_PREGAME)//Don't change the mode if the round already started.
|
||||
return message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.")
|
||||
if(. == "Secret")
|
||||
GLOB.master_mode = "secret"
|
||||
SSticker.save_mode(.)
|
||||
message_admins("The gamemode has been voted for, and has been changed to: [GLOB.master_mode]")
|
||||
log_admin("Gamemode has been voted for and switched to: [GLOB.master_mode].")
|
||||
else
|
||||
GLOB.master_mode = "dynamic"
|
||||
var/datum/dynamic_storyteller/S = config.pick_storyteller(.)
|
||||
GLOB.dynamic_storyteller_type = S
|
||||
GLOB.master_mode = "dynamic"
|
||||
var/list/runnable_storytellers = config.get_runnable_storytellers()
|
||||
for(var/T in runnable_storytellers)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
runnable_storytellers[S] *= scores[initial(S.name)]
|
||||
var/datum/dynamic_storyteller/S = pickweightAllowZero(runnable_storytellers)
|
||||
GLOB.dynamic_storyteller_type = S
|
||||
if("map")
|
||||
var/datum/map_config/VM = config.maplist[.]
|
||||
message_admins("The map has been voted for and will change to: [VM.map_name]")
|
||||
@@ -375,7 +409,7 @@ SUBSYSTEM_DEF(vote)
|
||||
voted[usr.ckey] = list(vote)
|
||||
choices[choices[vote]]++
|
||||
return vote
|
||||
if(RANKED_CHOICE_VOTING)
|
||||
if(SCHULZE_VOTING,INSTANT_RUNOFF_VOTING)
|
||||
if(usr.ckey in voted)
|
||||
if(vote in voted[usr.ckey])
|
||||
voted[usr.ckey] -= vote
|
||||
@@ -384,7 +418,7 @@ SUBSYSTEM_DEF(vote)
|
||||
voted[usr.ckey] = list()
|
||||
voted[usr.ckey] += vote
|
||||
saved -= usr.ckey
|
||||
if(SCORE_VOTING)
|
||||
if(SCORE_VOTING,MAJORITY_JUDGEMENT_VOTING)
|
||||
if(!(usr.ckey in voted))
|
||||
voted += usr.ckey
|
||||
voted[usr.ckey] = list()
|
||||
@@ -444,19 +478,16 @@ SUBSYSTEM_DEF(vote)
|
||||
if("dynamic")
|
||||
for(var/T in config.storyteller_cache)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
var/recent_rounds = 0
|
||||
for(var/i in 1 to SSpersistence.saved_storytellers.len)
|
||||
if(SSpersistence.saved_storytellers[i] == initial(S.name))
|
||||
recent_rounds++
|
||||
if(recent_rounds < initial(S.weight))
|
||||
var/list/probabilities = CONFIG_GET(keyed_list/storyteller_weight)
|
||||
if(probabilities[initial(S.config_tag)] > 0)
|
||||
choices.Add(initial(S.name))
|
||||
choice_descs.Add(initial(S.desc))
|
||||
choices.Add("Secret")
|
||||
choice_descs.Add("Standard secret. Switches mode if it wins.")
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question)
|
||||
return 0
|
||||
var/system_string = input(usr,"Which voting type?",GLOB.vote_type_names[1]) in GLOB.vote_type_names
|
||||
vote_system = GLOB.vote_type_names[system_string]
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish"))
|
||||
if(!option || mode || !usr.client)
|
||||
@@ -514,9 +545,9 @@ SUBSYSTEM_DEF(vote)
|
||||
. += "<h3>Vote one.</h3>"
|
||||
if(APPROVAL_VOTING)
|
||||
. += "<h3>Vote any number of choices.</h3>"
|
||||
if(RANKED_CHOICE_VOTING)
|
||||
if(SCHULZE_VOTING,INSTANT_RUNOFF_VOTING)
|
||||
. += "<h3>Vote by order of preference. Revoting will demote to the bottom. 1 is your favorite, and higher numbers are worse.</h3>"
|
||||
if(SCORE_VOTING)
|
||||
if(SCORE_VOTING,MAJORITY_JUDGEMENT_VOTING)
|
||||
. += "<h3>Grade the candidates by how much you like them.</h3>"
|
||||
. += "<h3>No-votes have no power--your opinion is only heard if you vote!</h3>"
|
||||
. += "Time Left: [DisplayTimeText(end_time-world.time)]<hr><ul>"
|
||||
@@ -536,7 +567,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(choice_descs.len >= i)
|
||||
. += "<li>[choice_descs[i]]</li>"
|
||||
. += "</ul><hr>"
|
||||
if(RANKED_CHOICE_VOTING)
|
||||
if(SCHULZE_VOTING,INSTANT_RUNOFF_VOTING)
|
||||
var/list/myvote = voted[C.ckey]
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/vote = (islist(myvote) ? (myvote.Find(i)) : 0)
|
||||
@@ -553,7 +584,7 @@ SUBSYSTEM_DEF(vote)
|
||||
. += "(Saved!)"
|
||||
. += "(<a href='?src=[REF(src)];vote=load'>Load vote from save</a>)"
|
||||
. += "(<a href='?src=[REF(src)];vote=reset'>Reset votes</a>)"
|
||||
if(SCORE_VOTING)
|
||||
if(SCORE_VOTING,MAJORITY_JUDGEMENT_VOTING)
|
||||
var/list/myvote = voted[C.ckey]
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
. += "<li><b>[choices[i]]</b>"
|
||||
@@ -656,7 +687,7 @@ SUBSYSTEM_DEF(vote)
|
||||
voted[usr.ckey] = SSpersistence.saved_votes[usr.ckey][mode]
|
||||
if(islist(voted[usr.ckey]))
|
||||
var/malformed = FALSE
|
||||
if(vote_system == SCORE_VOTING)
|
||||
if(vote_system == SCORE_VOTING || vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
for(var/thing in voted[usr.ckey])
|
||||
if(!(thing in choices))
|
||||
malformed = TRUE
|
||||
@@ -670,7 +701,7 @@ SUBSYSTEM_DEF(vote)
|
||||
to_chat(usr,"Your saved vote was malformed! Start over!")
|
||||
voted -= usr.ckey
|
||||
else
|
||||
if(vote_system == SCORE_VOTING)
|
||||
if(vote_system == SCORE_VOTING || vote_system == MAJORITY_JUDGEMENT_VOTING)
|
||||
submit_vote(round(text2num(href_list["vote"])),round(text2num(href_list["score"])))
|
||||
else
|
||||
submit_vote(round(text2num(href_list["vote"])))
|
||||
|
||||
@@ -544,6 +544,70 @@
|
||||
cooldown = world.time
|
||||
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
||||
|
||||
/datum/action/item_action/removeAPCs
|
||||
name = "Relinquish APC"
|
||||
desc = "Let go of an APC, relinquish control back to the station."
|
||||
icon_icon = 'icons/obj/implants.dmi'
|
||||
button_icon_state = "hijackx"
|
||||
|
||||
/datum/action/item_action/removeAPCs/Trigger()
|
||||
var/list/areas = list()
|
||||
for (var/area/a in owner.siliconaccessareas)
|
||||
areas[a.name] = a
|
||||
var/removeAPC = input("Select an APC to remove:","Remove APC Control",1) as null|anything in areas
|
||||
if (!removeAPC)
|
||||
return
|
||||
var/area/area = areas[removeAPC]
|
||||
var/obj/machinery/power/apc/apc = area.get_apc()
|
||||
if (!apc || !(area in owner.siliconaccessareas))
|
||||
return
|
||||
apc.hijacker = null
|
||||
apc.update_icon()
|
||||
apc.set_hijacked_lighting()
|
||||
owner.toggleSiliconAccessArea(area)
|
||||
|
||||
/datum/action/item_action/accessAPCs
|
||||
name = "Access APC Interface"
|
||||
desc = "Open the APC's interface."
|
||||
icon_icon = 'icons/obj/implants.dmi'
|
||||
button_icon_state = "hijacky"
|
||||
|
||||
/datum/action/item_action/accessAPCs/Trigger()
|
||||
var/list/areas = list()
|
||||
for (var/area/a in owner.siliconaccessareas)
|
||||
areas[a.name] = a
|
||||
var/accessAPC = input("Select an APC to access:","Access APC Interface",1) as null|anything in areas
|
||||
if (!accessAPC)
|
||||
return
|
||||
var/area/area = areas[accessAPC]
|
||||
var/obj/machinery/power/apc/apc = area.get_apc()
|
||||
if (!apc || !(area in owner.siliconaccessareas))
|
||||
return
|
||||
apc.ui_interact(owner)
|
||||
|
||||
/datum/action/item_action/stealthmodetoggle
|
||||
name = "Toggle Stealth Mode"
|
||||
desc = "Toggles the stealth mode on the hijack implant."
|
||||
icon_icon = 'icons/obj/implants.dmi'
|
||||
button_icon_state = "hijackz"
|
||||
|
||||
/datum/action/item_action/stealthmodetoggle/Trigger()
|
||||
var/obj/item/implant/hijack/H = target
|
||||
if (!istype(H))
|
||||
return
|
||||
if (H.stealthcooldown > world.time)
|
||||
to_chat(owner,"<span class='warning'>The hijack implant's stealth mode toggle is still rebooting!</span>")
|
||||
return
|
||||
H.stealthmode = !H.stealthmode
|
||||
for (var/area/area in H.imp_in.siliconaccessareas)
|
||||
var/obj/machinery/power/apc/apc = area.get_apc()
|
||||
if (apc)
|
||||
apc.set_hijacked_lighting()
|
||||
apc.update_icon()
|
||||
H.stealthcooldown = world.time + 15 SECONDS
|
||||
H.toggle_eyes()
|
||||
to_chat(owner,"<span class='notice'>You toggle the hijack implant's stealthmode [H.stealthmode ? "on" : "off"].</span>")
|
||||
|
||||
/datum/action/item_action/flash
|
||||
name = "Flash"
|
||||
|
||||
@@ -756,3 +820,11 @@
|
||||
target.layer = old_layer
|
||||
target.plane = old_plane
|
||||
current_button.appearance_cache = target.appearance
|
||||
|
||||
/proc/get_action_of_type(mob/M, var/action_type)
|
||||
if(!M.actions || !ispath(action_type, /datum/action))
|
||||
return
|
||||
for(var/datum/action/A in M.actions)
|
||||
if(istype(A, action_type))
|
||||
return A
|
||||
return
|
||||
@@ -14,7 +14,7 @@
|
||||
var/can_gain = TRUE
|
||||
var/random_gain = TRUE //can this be gained through random traumas?
|
||||
var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure?
|
||||
var/clonable = TRUE // will this transfer if the brain is cloned?
|
||||
var/clonable = TRUE // will this transfer if the brain is cloned? - currently has no effect
|
||||
|
||||
/datum/brain_trauma/Destroy()
|
||||
if(brain && brain.traumas)
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
to_chat(src, compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source))
|
||||
|
||||
/mob/camera/imaginary_friend/proc/friend_talk(message)
|
||||
message = capitalize(trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)))
|
||||
message = capitalize(trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN)))
|
||||
|
||||
if(!message)
|
||||
return
|
||||
|
||||
@@ -199,13 +199,16 @@
|
||||
var/list/new_message = list()
|
||||
|
||||
for(var/word in message_split)
|
||||
var/suffix = copytext(word,-1)
|
||||
var/suffix = ""
|
||||
var/suffix_foundon = 0
|
||||
for(var/potential_suffix in list("." , "," , ";" , "!" , ":" , "?"))
|
||||
suffix_foundon = findtext(word, potential_suffix, -length(potential_suffix))
|
||||
if(suffix_foundon)
|
||||
suffix = potential_suffix
|
||||
break
|
||||
|
||||
// Check if we have a suffix and break it out of the word
|
||||
if(suffix in list("." , "," , ";" , "!" , ":" , "?"))
|
||||
word = copytext(word,1,-1)
|
||||
else
|
||||
suffix = ""
|
||||
if(suffix_foundon)
|
||||
word = copytext(word, 1, suffix_foundon)
|
||||
|
||||
word = html_decode(word)
|
||||
|
||||
@@ -216,10 +219,9 @@
|
||||
new_message += pick("uh","erm")
|
||||
break
|
||||
else
|
||||
var/list/charlist = string2charlist(word) // Stupid shit code
|
||||
var/list/charlist = text2charlist(word)
|
||||
shuffle_inplace(charlist)
|
||||
charlist.len = round(charlist.len * 0.5,1)
|
||||
new_message += html_encode(jointext(charlist,"")) + suffix
|
||||
new_message += jointext(charlist, "") + suffix
|
||||
|
||||
message = jointext(new_message, " ")
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
//title_image = ntitle_image
|
||||
|
||||
/datum/browser/proc/add_stylesheet(name, file)
|
||||
stylesheets["[ckey(name)].css"] = file
|
||||
register_asset("[ckey(name)].css", file)
|
||||
|
||||
/datum/browser/proc/add_script(name, file)
|
||||
scripts["[ckey(name)].js"] = file
|
||||
register_asset("[ckey(name)].js", file)
|
||||
if(istype(name, /datum/asset/spritesheet))
|
||||
var/datum/asset/spritesheet/sheet = name
|
||||
stylesheets["spritesheet_[sheet.name].css"] = "data/spritesheets/[sheet.name]"
|
||||
else
|
||||
stylesheets["[ckey(name)].css"] = file
|
||||
register_asset("[ckey(name)].css", file)
|
||||
|
||||
/datum/browser/proc/set_content(ncontent)
|
||||
content = ncontent
|
||||
|
||||
@@ -1,39 +1,51 @@
|
||||
/datum/personal_crafting
|
||||
/datum/component/personal_crafting/Initialize()
|
||||
if(!ismob(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
RegisterSignal(parent, COMSIG_MOB_CLIENT_LOGIN, .proc/create_mob_button)
|
||||
|
||||
/datum/component/personal_crafting/proc/create_mob_button(mob/user, client/CL)
|
||||
var/datum/hud/H = user.hud_used
|
||||
var/obj/screen/craft/C = new()
|
||||
C.icon = H.ui_style
|
||||
H.static_inventory += C
|
||||
CL.screen += C
|
||||
RegisterSignal(C, COMSIG_CLICK, .proc/component_ui_interact)
|
||||
|
||||
/datum/component/personal_crafting
|
||||
var/busy
|
||||
var/viewing_category = 1 //typical powergamer starting on the Weapons tab
|
||||
var/viewing_subcategory = 1
|
||||
var/list/categories = list(
|
||||
CAT_WEAPONRY,
|
||||
CAT_ROBOT,
|
||||
CAT_MISC,
|
||||
CAT_PRIMAL,
|
||||
CAT_FOOD,
|
||||
CAT_CLOTHING)
|
||||
var/list/subcategories = list(
|
||||
list( //Weapon subcategories
|
||||
CAT_WEAPON,
|
||||
CAT_AMMO),
|
||||
CAT_NONE, //Robot subcategories
|
||||
CAT_NONE, //Misc subcategories
|
||||
CAT_NONE, //Tribal subcategories
|
||||
list( //Food subcategories
|
||||
CAT_BREAD,
|
||||
CAT_BURGER,
|
||||
CAT_CAKE,
|
||||
CAT_EGG,
|
||||
CAT_FISH,
|
||||
CAT_ICE, //Called Frozen
|
||||
CAT_MEAT,
|
||||
CAT_MISCFOOD,
|
||||
CAT_PASTRY,
|
||||
CAT_PIE,
|
||||
CAT_PIZZA,
|
||||
CAT_SALAD,
|
||||
CAT_SANDWICH,
|
||||
CAT_SOUP,
|
||||
CAT_SPAGHETTI),
|
||||
CAT_NONE) //Clothing subcategories
|
||||
CAT_WEAPONRY = list(
|
||||
CAT_WEAPON,
|
||||
CAT_AMMO,
|
||||
),
|
||||
CAT_ROBOT = CAT_NONE,
|
||||
CAT_MISC = CAT_NONE,
|
||||
CAT_PRIMAL = CAT_NONE,
|
||||
CAT_FOOD = list(
|
||||
CAT_BREAD,
|
||||
CAT_BURGER,
|
||||
CAT_CAKE,
|
||||
CAT_EGG,
|
||||
CAT_FISH,
|
||||
CAT_ICE,
|
||||
CAT_MEAT,
|
||||
CAT_MISCFOOD,
|
||||
CAT_PASTRY,
|
||||
CAT_PIE,
|
||||
CAT_PIZZA,
|
||||
CAT_SALAD,
|
||||
CAT_SANDWICH,
|
||||
CAT_SOUP,
|
||||
CAT_SPAGHETTI,
|
||||
),
|
||||
CAT_DRINK = CAT_NONE,
|
||||
CAT_CLOTHING = CAT_NONE,
|
||||
)
|
||||
|
||||
var/cur_category = CAT_NONE
|
||||
var/cur_subcategory = CAT_NONE
|
||||
var/datum/action/innate/crafting/button
|
||||
var/display_craftable_only = FALSE
|
||||
var/display_compact = TRUE
|
||||
@@ -52,29 +64,50 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/personal_crafting/proc/check_contents(datum/crafting_recipe/R, list/contents)
|
||||
/**
|
||||
* Check that the contents of the recipe meet the requirements.
|
||||
*
|
||||
* user: The /mob that initated the crafting.
|
||||
* R: The /datum/crafting_recipe being attempted.
|
||||
* contents: List of items to search for R's reqs.
|
||||
*/
|
||||
/datum/component/personal_crafting/proc/check_contents(mob/user, datum/crafting_recipe/R, list/contents)
|
||||
var/list/item_instances = contents["instances"]
|
||||
contents = contents["other"]
|
||||
main_loop:
|
||||
for(var/A in R.reqs)
|
||||
var/needed_amount = R.reqs[A]
|
||||
for(var/B in contents)
|
||||
if(ispath(B, A))
|
||||
if(contents[B] >= R.reqs[A])
|
||||
continue main_loop
|
||||
else
|
||||
needed_amount -= contents[B]
|
||||
if(needed_amount <= 0)
|
||||
continue main_loop
|
||||
else
|
||||
continue
|
||||
return 0
|
||||
for(var/A in R.chem_catalysts)
|
||||
if(contents[A] < R.chem_catalysts[A])
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/personal_crafting/proc/get_environment(mob/user)
|
||||
var/list/requirements_list = list()
|
||||
|
||||
// Process all requirements
|
||||
for(var/requirement_path in R.reqs)
|
||||
// Check we have the appropriate amount available in the contents list
|
||||
var/needed_amount = R.reqs[requirement_path]
|
||||
for(var/content_item_path in contents)
|
||||
// Right path and not blacklisted
|
||||
if(!ispath(content_item_path, requirement_path) || R.blacklist.Find(requirement_path))
|
||||
continue
|
||||
|
||||
needed_amount -= contents[content_item_path]
|
||||
if(needed_amount <= 0)
|
||||
break
|
||||
|
||||
if(needed_amount > 0)
|
||||
return FALSE
|
||||
|
||||
// Store the instances of what we will use for R.check_requirements() for requirement_path
|
||||
var/list/instances_list = list()
|
||||
for(var/instance_path in item_instances)
|
||||
if(ispath(instance_path, requirement_path))
|
||||
instances_list += item_instances[instance_path]
|
||||
|
||||
requirements_list[requirement_path] = instances_list
|
||||
|
||||
for(var/requirement_path in R.chem_catalysts)
|
||||
if(contents[requirement_path] < R.chem_catalysts[requirement_path])
|
||||
return FALSE
|
||||
|
||||
return R.check_requirements(user, requirements_list)
|
||||
|
||||
/datum/component/personal_crafting/proc/get_environment(mob/user)
|
||||
. = list()
|
||||
for(var/obj/item/I in user.held_items)
|
||||
. += I
|
||||
@@ -89,14 +122,21 @@
|
||||
if(AM.flags_1 & HOLOGRAM_1)
|
||||
continue
|
||||
. += AM
|
||||
for(var/slot in list(SLOT_R_STORE, SLOT_L_STORE))
|
||||
. += user.get_item_by_slot(slot)
|
||||
|
||||
/datum/personal_crafting/proc/get_surroundings(mob/user)
|
||||
/datum/component/personal_crafting/proc/get_surroundings(mob/user)
|
||||
. = list()
|
||||
.["tool_behaviour"] = list()
|
||||
.["other"] = list()
|
||||
.["instances"] = list()
|
||||
for(var/obj/item/I in get_environment(user))
|
||||
if(I.flags_1 & HOLOGRAM_1)
|
||||
continue
|
||||
if(.["instances"][I.type])
|
||||
.["instances"][I.type] += I
|
||||
else
|
||||
.["instances"][I.type] = list(I)
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
.["other"][I.type] += S.amount
|
||||
@@ -111,7 +151,7 @@
|
||||
.["other"][A.type] += A.volume
|
||||
.["other"][I.type] += 1
|
||||
|
||||
/datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
|
||||
/datum/component/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
|
||||
if(!R.tools.len)
|
||||
return TRUE
|
||||
var/list/possible_tools = list()
|
||||
@@ -142,23 +182,25 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
|
||||
/datum/component/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
|
||||
var/list/contents = get_surroundings(user)
|
||||
var/send_feedback = 1
|
||||
if(check_contents(R, contents))
|
||||
if(check_contents(user, R, contents))
|
||||
if(check_tools(user, R, contents))
|
||||
if(do_after(user, R.time, target = user))
|
||||
contents = get_surroundings(user)
|
||||
if(!check_contents(R, contents))
|
||||
if(!check_contents(user, R, contents))
|
||||
return ", missing component."
|
||||
if(!check_tools(user, R, contents))
|
||||
return ", missing tool."
|
||||
var/list/parts = del_reqs(R, user)
|
||||
var/atom/movable/I = new R.result (get_turf(user.loc))
|
||||
I.CheckParts(parts, R)
|
||||
if(isitem(I))
|
||||
user.put_in_hands(I)
|
||||
if(send_feedback)
|
||||
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
|
||||
log_craft("[I] crafted by [user] at [loc_name(I.loc)]")
|
||||
log_craft("[I] crafted by [user] at [loc_name(I.loc)]")
|
||||
return 0
|
||||
return "."
|
||||
return ", missing tool."
|
||||
@@ -189,7 +231,7 @@
|
||||
del_reqs return the list of parts resulting object will receive as argument of CheckParts proc, on the atom level it will add them all to the contents, on all other levels it calls ..() and does whatever is needed afterwards but from contents list already
|
||||
*/
|
||||
|
||||
/datum/personal_crafting/proc/del_reqs(datum/crafting_recipe/R, mob/user)
|
||||
/datum/component/personal_crafting/proc/del_reqs(datum/crafting_recipe/R, mob/user)
|
||||
var/list/surroundings
|
||||
var/list/Deletion = list()
|
||||
. = list()
|
||||
@@ -287,122 +329,106 @@
|
||||
Deletion.Cut(Deletion.len)
|
||||
qdel(DL)
|
||||
|
||||
/datum/component/personal_crafting/proc/component_ui_interact(obj/screen/craft/image, location, control, params, user)
|
||||
if(user == parent)
|
||||
ui_interact(user)
|
||||
|
||||
/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state)
|
||||
/datum/component/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
cur_category = categories[1]
|
||||
if(islist(categories[cur_category]))
|
||||
var/list/subcats = categories[cur_category]
|
||||
cur_subcategory = subcats[1]
|
||||
else
|
||||
cur_subcategory = CAT_NONE
|
||||
ui = new(user, src, ui_key, "personal_crafting", "Crafting Menu", 700, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_data(mob/user)
|
||||
/datum/component/personal_crafting/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/subs = list()
|
||||
var/cur_subcategory = CAT_NONE
|
||||
var/cur_category = categories[viewing_category]
|
||||
if (islist(subcategories[viewing_category]))
|
||||
subs = subcategories[viewing_category]
|
||||
cur_subcategory = subs[viewing_subcategory]
|
||||
data["busy"] = busy
|
||||
data["prev_cat"] = categories[prev_cat()]
|
||||
data["prev_subcat"] = subs[prev_subcat()]
|
||||
data["category"] = cur_category
|
||||
data["subcategory"] = cur_subcategory
|
||||
data["next_cat"] = categories[next_cat()]
|
||||
data["next_subcat"] = subs[next_subcat()]
|
||||
data["display_craftable_only"] = display_craftable_only
|
||||
data["display_compact"] = display_compact
|
||||
|
||||
var/list/surroundings = get_surroundings(user)
|
||||
var/list/can_craft = list()
|
||||
var/list/cant_craft = list()
|
||||
var/list/craftability = list()
|
||||
for(var/rec in GLOB.crafting_recipes)
|
||||
var/datum/crafting_recipe/R = rec
|
||||
|
||||
if(!R.always_availible && !(R.type in user?.mind?.learned_recipes)) //User doesn't actually know how to make this.
|
||||
continue
|
||||
|
||||
if((R.category != cur_category) || (R.subcategory != cur_subcategory))
|
||||
continue
|
||||
if(check_contents(R, surroundings))
|
||||
can_craft += list(build_recipe_data(R))
|
||||
|
||||
craftability["[REF(R)]"] = check_contents(user, R, surroundings)
|
||||
|
||||
data["craftability"] = craftability
|
||||
return data
|
||||
|
||||
/datum/component/personal_crafting/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
var/list/crafting_recipes = list()
|
||||
for(var/rec in GLOB.crafting_recipes)
|
||||
var/datum/crafting_recipe/R = rec
|
||||
|
||||
if(R.name == "") //This is one of the invalid parents that sneaks in
|
||||
continue
|
||||
|
||||
if(!R.always_availible && !(R.type in user?.mind?.learned_recipes)) //User doesn't actually know how to make this.
|
||||
continue
|
||||
|
||||
if(isnull(crafting_recipes[R.category]))
|
||||
crafting_recipes[R.category] = list()
|
||||
|
||||
if(R.subcategory == CAT_NONE)
|
||||
crafting_recipes[R.category] += list(build_recipe_data(R))
|
||||
else
|
||||
cant_craft += list(build_recipe_data(R))
|
||||
data["can_craft"] = can_craft
|
||||
data["cant_craft"] = cant_craft
|
||||
if(isnull(crafting_recipes[R.category][R.subcategory]))
|
||||
crafting_recipes[R.category][R.subcategory] = list()
|
||||
crafting_recipes[R.category]["has_subcats"] = TRUE
|
||||
crafting_recipes[R.category][R.subcategory] += list(build_recipe_data(R))
|
||||
|
||||
data["crafting_recipes"] = crafting_recipes
|
||||
return data
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_act(action, params)
|
||||
/datum/component/personal_crafting/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("make")
|
||||
var/datum/crafting_recipe/TR = locate(params["recipe"])
|
||||
var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes
|
||||
busy = TRUE
|
||||
ui_interact(usr) //explicit call to show the busy display
|
||||
ui_interact(usr)
|
||||
var/fail_msg = construct_item(usr, TR)
|
||||
if(!fail_msg)
|
||||
to_chat(usr, "<span class='notice'>[TR.name] constructed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Construction failed[fail_msg]</span>")
|
||||
busy = FALSE
|
||||
ui_interact(usr)
|
||||
if("forwardCat") //Meow
|
||||
viewing_category = next_cat(FALSE)
|
||||
. = TRUE
|
||||
if("backwardCat")
|
||||
viewing_category = prev_cat(FALSE)
|
||||
. = TRUE
|
||||
if("forwardSubCat")
|
||||
viewing_subcategory = next_subcat()
|
||||
. = TRUE
|
||||
if("backwardSubCat")
|
||||
viewing_subcategory = prev_subcat()
|
||||
. = TRUE
|
||||
if("toggle_recipes")
|
||||
display_craftable_only = !display_craftable_only
|
||||
. = TRUE
|
||||
if("toggle_compact")
|
||||
display_compact = !display_compact
|
||||
. = TRUE
|
||||
if("set_category")
|
||||
if(!isnull(params["category"]))
|
||||
cur_category = params["category"]
|
||||
if(!isnull(params["subcategory"]))
|
||||
if(params["subcategory"] == "0")
|
||||
cur_subcategory = ""
|
||||
else
|
||||
cur_subcategory = params["subcategory"]
|
||||
. = TRUE
|
||||
|
||||
|
||||
//Next works nicely with modular arithmetic
|
||||
/datum/personal_crafting/proc/next_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
. = viewing_category % categories.len + 1
|
||||
|
||||
/datum/personal_crafting/proc/next_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
. = viewing_subcategory % subs.len + 1
|
||||
|
||||
|
||||
//Previous can go fuck itself
|
||||
/datum/personal_crafting/proc/prev_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
if(viewing_category == categories.len)
|
||||
. = viewing_category-1
|
||||
else
|
||||
. = viewing_category % categories.len - 1
|
||||
if(. <= 0)
|
||||
. = categories.len
|
||||
|
||||
/datum/personal_crafting/proc/prev_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
if(viewing_subcategory == subs.len)
|
||||
. = viewing_subcategory-1
|
||||
else
|
||||
. = viewing_subcategory % subs.len - 1
|
||||
if(. <= 0)
|
||||
. = subs.len
|
||||
else
|
||||
. = null
|
||||
|
||||
|
||||
/datum/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||
/datum/component/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||
var/list/data = list()
|
||||
data["name"] = R.name
|
||||
data["ref"] = "[REF(R)]"
|
||||
@@ -0,0 +1,25 @@
|
||||
/datum/crafting_recipe
|
||||
var/name = "" //in-game display name
|
||||
var/list/reqs = list() //type paths of items consumed associated with how many are needed
|
||||
var/list/blacklist = list() //type paths of items explicitly not allowed as an ingredient
|
||||
var/result //type path of item resulting from this craft
|
||||
var/list/tools = list() //type paths of items needed but not consumed
|
||||
var/time = 30 //time in deciseconds
|
||||
var/list/parts = list() //type paths of items that will be placed in the result
|
||||
var/list/chem_catalysts = list() //like tools but for reagents
|
||||
var/category = CAT_NONE //where it shows up in the crafting UI
|
||||
var/subcategory = CAT_NONE
|
||||
var/always_availible = TRUE //Set to FALSE if it needs to be learned first.
|
||||
|
||||
/datum/crafting_recipe/New()
|
||||
if(!(result in reqs))
|
||||
blacklist += result
|
||||
|
||||
/**
|
||||
* Run custom pre-craft checks for this recipe
|
||||
*
|
||||
* user: The /mob that initiated the crafting
|
||||
* collected_requirements: A list of lists of /obj/item instances that satisfy reqs. Top level list is keyed by requirement path.
|
||||
*/
|
||||
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
|
||||
return TRUE
|
||||
-21
@@ -1,10 +1,3 @@
|
||||
/datum/crafting_recipe/bonearmor
|
||||
name = "Bone Armor"
|
||||
result = /obj/item/clothing/suit/armor/bone
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 6)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonetalisman
|
||||
name = "Bone Talisman"
|
||||
result = /obj/item/clothing/accessory/talisman
|
||||
@@ -29,13 +22,6 @@
|
||||
/obj/item/stack/sheet/sinew = 1)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/skullhelm
|
||||
name = "Skull Helmet"
|
||||
result = /obj/item/clothing/head/helmet/skull
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 4)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/goliathcloak
|
||||
name = "Goliath Cloak"
|
||||
result = /obj/item/clothing/suit/hooded/cloak/goliath
|
||||
@@ -62,13 +48,6 @@
|
||||
/obj/item/stack/sheet/sinew = 2)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonedagger
|
||||
name = "Bone Dagger"
|
||||
result = /obj/item/kitchen/knife/combat/bone
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/bone = 2)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonespear
|
||||
name = "Bone Spear"
|
||||
result = /obj/item/twohanded/bonespear
|
||||
+22
@@ -8,6 +8,12 @@
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/pin_removal/check_requirements(mob/user, list/collected_requirements)
|
||||
var/obj/item/gun/G = collected_requirements[/obj/item/gun][1]
|
||||
if (G.no_pin_required || !G.pin)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/crafting_recipe/strobeshield
|
||||
name = "Strobe Shield"
|
||||
result = /obj/item/assembly/flash/shield
|
||||
@@ -18,6 +24,10 @@
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/strobeshield/New()
|
||||
..()
|
||||
blacklist |= subtypesof(/obj/item/shield/riot/)
|
||||
|
||||
/datum/crafting_recipe/makeshiftshield
|
||||
name = "Makeshift Metal Shield"
|
||||
result = /obj/item/shield/makeshift
|
||||
@@ -109,6 +119,18 @@
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/switchblade_ms
|
||||
name = "Switchblade"
|
||||
result = /obj/item/switchblade/crafted
|
||||
reqs = list(/obj/item/weaponcrafting/stock = 1,
|
||||
/obj/item/weaponcrafting/receiver = 1,
|
||||
/obj/item/kitchen/knife = 1,
|
||||
/obj/item/stack/cable_coil = 2)
|
||||
tools = list(TOOL_WELDER)
|
||||
time = 45
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
//////////////////
|
||||
///BOMB CRAFTING//
|
||||
//////////////////
|
||||
@@ -25,7 +25,7 @@
|
||||
if(isliving(parent))
|
||||
host_mob = parent
|
||||
|
||||
if(!(MOB_ORGANIC in host_mob.mob_biotypes) && !(MOB_UNDEAD in host_mob.mob_biotypes)) //Shouldn't happen, but this avoids HUD runtimes in case a silicon gets them somehow.
|
||||
if(!(host_mob.mob_biotypes & (MOB_ORGANIC|MOB_UNDEAD))) //Shouldn't happen, but this avoids HUD runtimes in case a silicon gets them somehow.
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
host_mob.hud_set_nanite_indicator()
|
||||
@@ -212,7 +212,7 @@
|
||||
NP.receive_comm_signal(comm_code, comm_message, comm_source)
|
||||
|
||||
/datum/component/nanites/proc/check_viable_biotype()
|
||||
if(!(MOB_ORGANIC in host_mob.mob_biotypes) && !(MOB_UNDEAD in host_mob.mob_biotypes))
|
||||
if(!(host_mob.mob_biotypes & (MOB_ORGANIC|MOB_UNDEAD)))
|
||||
qdel(src) //bodytype no longer sustains nanites
|
||||
|
||||
/datum/component/nanites/proc/check_access(datum/source, obj/O)
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
/datum/component/slippery/proc/Slip(datum/source, atom/movable/AM)
|
||||
var/mob/victim = AM
|
||||
if(istype(victim) && !victim.is_flying() && victim.slip(intensity, parent, lube_flags) && callback)
|
||||
if(istype(victim) && victim.slip(intensity, parent, lube_flags) && callback)
|
||||
callback.Invoke(victim)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
/obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector,
|
||||
/obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper,
|
||||
/obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini,
|
||||
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol
|
||||
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/automatic/magrifle/pistol
|
||||
))
|
||||
|
||||
/datum/component/storage/concrete/pockets/shoes/clown/Initialize()
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
var/obj/screen/storage/boxes //storage display object
|
||||
var/obj/screen/close/closer //close button object
|
||||
var/current_maxscreensize
|
||||
|
||||
var/allow_big_nesting = FALSE //allow storage objects of the same or greater size.
|
||||
|
||||
@@ -362,11 +363,15 @@
|
||||
break
|
||||
closer.screen_loc = "[screen_start_x + cols]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]"
|
||||
|
||||
/datum/component/storage/proc/show_to(mob/M)
|
||||
/datum/component/storage/proc/show_to(mob/M, set_screen_size = TRUE)
|
||||
if(!M.client)
|
||||
return FALSE
|
||||
var/list/cview = getviewsize(M.client.view)
|
||||
var/maxallowedscreensize = cview[1]-8
|
||||
if(set_screen_size)
|
||||
current_maxscreensize = maxallowedscreensize
|
||||
else if(current_maxscreensize)
|
||||
maxallowedscreensize = current_maxscreensize
|
||||
if(M.active_storage != src && (M.stat == CONSCIOUS))
|
||||
for(var/obj/item/I in accessible_items())
|
||||
if(I.on_found(M))
|
||||
@@ -547,14 +552,14 @@
|
||||
return
|
||||
A.add_fingerprint(M)
|
||||
|
||||
/datum/component/storage/proc/user_show_to_mob(mob/M, force = FALSE)
|
||||
/datum/component/storage/proc/user_show_to_mob(mob/M, force = FALSE, ghost = FALSE)
|
||||
var/atom/A = parent
|
||||
if(!istype(M))
|
||||
return FALSE
|
||||
A.add_fingerprint(M)
|
||||
if(!force && (check_locked(null, M) || !M.CanReach(parent, view_only = TRUE)))
|
||||
return FALSE
|
||||
show_to(M)
|
||||
show_to(M, !ghost)
|
||||
|
||||
/datum/component/storage/proc/mousedrop_receive(datum/source, atom/movable/O, mob/M)
|
||||
if(isitem(O))
|
||||
@@ -665,7 +670,7 @@
|
||||
return can_be_inserted(I, silent, M)
|
||||
|
||||
/datum/component/storage/proc/show_to_ghost(datum/source, mob/dead/observer/M)
|
||||
return user_show_to_mob(M, TRUE)
|
||||
return user_show_to_mob(M, TRUE, TRUE)
|
||||
|
||||
/datum/component/storage/proc/signal_show_attempt(datum/source, mob/showto, force = FALSE)
|
||||
return user_show_to_mob(showto, force)
|
||||
|
||||
@@ -25,6 +25,8 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
var/unlock_code
|
||||
var/failsafe_code
|
||||
var/datum/ui_state/checkstate
|
||||
var/compact_mode = FALSE
|
||||
var/debug = FALSE
|
||||
|
||||
/datum/component/uplink/Initialize(_owner, _lockable = TRUE, _enabled = FALSE, datum/game_mode/_gamemode, starting_tc = 20, datum/ui_state/_checkstate)
|
||||
if(!isitem(parent))
|
||||
@@ -121,7 +123,7 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
active = TRUE
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
|
||||
ui = new(user, src, ui_key, "uplink", name, 620, 580, master_ui, state)
|
||||
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
|
||||
ui.set_style("syndicate")
|
||||
ui.open()
|
||||
@@ -138,29 +140,35 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
var/list/data = list()
|
||||
data["telecrystals"] = telecrystals
|
||||
data["lockable"] = lockable
|
||||
data["compact_mode"] = compact_mode
|
||||
|
||||
return data
|
||||
|
||||
/datum/component/uplink/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["categories"] = list()
|
||||
for(var/category in uplink_items)
|
||||
var/list/cat = list(
|
||||
"name" = category,
|
||||
"items" = (category == selected_cat ? list() : null))
|
||||
if(category == selected_cat)
|
||||
for(var/item in uplink_items[category])
|
||||
var/datum/uplink_item/I = uplink_items[category][item]
|
||||
if(I.limited_stock == 0)
|
||||
for(var/item in uplink_items[category])
|
||||
var/datum/uplink_item/I = uplink_items[category][item]
|
||||
if(I.limited_stock == 0)
|
||||
continue
|
||||
if(I.restricted_roles.len)
|
||||
var/is_inaccessible = TRUE
|
||||
for(var/R in I.restricted_roles)
|
||||
if(R == user.mind.assigned_role || debug)
|
||||
is_inaccessible = FALSE
|
||||
if(is_inaccessible)
|
||||
continue
|
||||
if(I.restricted_roles.len)
|
||||
var/is_inaccessible = 1
|
||||
for(var/R in I.restricted_roles)
|
||||
if(R == user.mind.assigned_role)
|
||||
is_inaccessible = 0
|
||||
if(is_inaccessible)
|
||||
continue
|
||||
cat["items"] += list(list(
|
||||
"name" = I.name,
|
||||
"cost" = I.cost,
|
||||
"desc" = I.desc,
|
||||
))
|
||||
cat["items"] += list(list(
|
||||
"name" = I.name,
|
||||
"cost" = I.cost,
|
||||
"desc" = I.desc,
|
||||
))
|
||||
data["categories"] += list(cat)
|
||||
return data
|
||||
|
||||
@@ -188,6 +196,8 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
SStgui.close_uis(src)
|
||||
if("select")
|
||||
selected_cat = params["category"]
|
||||
if("compact_toggle")
|
||||
compact_mode = !compact_mode
|
||||
return TRUE
|
||||
|
||||
/datum/component/uplink/proc/MakePurchase(mob/user, datum/uplink_item/U)
|
||||
|
||||
@@ -945,26 +945,7 @@
|
||||
A.create_reagents(amount)
|
||||
|
||||
if(A.reagents)
|
||||
var/chosen_id
|
||||
switch(alert(usr, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky"))
|
||||
if("Search")
|
||||
var/valid_id
|
||||
while(!valid_id)
|
||||
chosen_id = input(usr, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text
|
||||
if(isnull(chosen_id)) //Get me out of here!
|
||||
break
|
||||
if(!ispath(text2path(chosen_id)))
|
||||
chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/datum/reagent)))
|
||||
if(ispath(chosen_id))
|
||||
valid_id = TRUE
|
||||
else
|
||||
valid_id = TRUE
|
||||
if(!valid_id)
|
||||
to_chat(usr, "<span class='warning'>A reagent with that ID doesn't exist!</span>")
|
||||
if("Choose from a list")
|
||||
chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent)
|
||||
if("I'm feeling lucky")
|
||||
chosen_id = pick(subtypesof(/datum/reagent))
|
||||
var/chosen_id = choose_reagent_id(usr)
|
||||
if(chosen_id)
|
||||
var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num
|
||||
if(amount)
|
||||
|
||||
@@ -17,14 +17,10 @@
|
||||
if(HasDisease(D))
|
||||
return FALSE
|
||||
|
||||
var/can_infect = FALSE
|
||||
for(var/host_type in D.infectable_biotypes)
|
||||
if(host_type in mob_biotypes)
|
||||
can_infect = TRUE
|
||||
break
|
||||
if(!can_infect)
|
||||
if(!(D.infectable_biotypes & mob_biotypes))
|
||||
return FALSE
|
||||
|
||||
|
||||
if(!(type in D.viable_mobtypes))
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
var/list/required_organs = list()
|
||||
var/needs_all_cures = TRUE
|
||||
var/list/strain_data = list() //dna_spread special bullshit
|
||||
var/list/infectable_biotypes = list(MOB_ORGANIC) //if the disease can spread on organics, synthetics, or undead
|
||||
var/infectable_biotypes = MOB_ORGANIC //if the disease can spread on organics, synthetics, or undead
|
||||
var/process_dead = FALSE //if this ticks while the host is dead
|
||||
var/copy_type = null //if this is null, copies will use the type of the instance being copied
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
// Randomly pick a symptom to activate.
|
||||
/datum/disease/advance/stage_act()
|
||||
..()
|
||||
if(carrier)
|
||||
if(carrier || QDELETED(src)) // Could be cured in parent call.
|
||||
return
|
||||
|
||||
if(symptoms && symptoms.len)
|
||||
|
||||
@@ -22,14 +22,16 @@ Bonus
|
||||
stealth = -3
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = -4
|
||||
transmittable = -2
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
threshold_desc = "<b>Stage Speed 8:</b> Causes choking more frequently.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
threshold_desc = list(
|
||||
"Stage Speed 8" = "Causes choking more frequently.",
|
||||
"Stealth 4" = "The symptom remains hidden until active."
|
||||
)
|
||||
|
||||
/datum/symptom/choking/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
@@ -99,8 +101,10 @@ Bonus
|
||||
symptom_delay_min = 14
|
||||
symptom_delay_max = 30
|
||||
var/paralysis = FALSE
|
||||
threshold_desc = "<b>Stage Speed 8:</b> Additionally synthesizes pancuronium and sodium thiopental inside the host.<br>\
|
||||
<b>Transmission 8:</b> Doubles the damage caused by the symptom."
|
||||
threshold_desc = list(
|
||||
"Stage Speed 8" = "Additionally synthesizes pancuronium and sodium thiopental inside the host.",
|
||||
"Transmission 8" = "Doubles the damage caused by the symptom."
|
||||
)
|
||||
|
||||
|
||||
/datum/symptom/asphyxiation/Start(datum/disease/advance/A)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user