This commit is contained in:
Putnam3145
2022-03-30 12:35:12 -07:00
1281 changed files with 75215 additions and 68744 deletions
+1 -1
View File
@@ -182,7 +182,7 @@
////organ defines
#define STANDARD_ORGAN_THRESHOLD 100
#define STANDARD_ORGAN_HEALING (1/(15 MINUTES / (2 SECONDS)))
#define STANDARD_ORGAN_HEALING (1/(15 MINUTES / (2 SECONDS))) / 3 //Base organ healing can be amped by a factor of up to x5 via satiety. This assumes it to be somewhat in the upper center of positive satiety as base.
#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.
+2
View File
@@ -37,6 +37,8 @@ GLOBAL_LIST_INIT(bitflags, list(
#define OVERLAY_QUEUED_1 (1<<8)
///Item has priority to check when entering or leaving.
#define ON_BORDER_1 (1<<9)
///Whether or not this atom shows screentips when hovered over
#define NO_SCREENTIPS_1 (1<<10)
///Prevent clicking things below it on the same turf eg. doors/ fulltile windows.
#define PREVENT_CLICK_UNDER_1 (1<<11)
#define HOLOGRAM_1 (1<<12)
+1
View File
@@ -16,6 +16,7 @@
#define SHOVABLE_ONTO (1<<13)//called on turf.shove_act() to consider whether an object should have a niche effect (defined in their own shove_act()) when someone is pushed onto it, or do a sanity CanPass() check.
#define EXAMINE_SKIP (1<<14) /// Makes the Examine proc not read out this item.
#define IN_STORAGE (1<<15) //is this item in the storage item, such as backpack? used for tooltips
#define HAND_ITEM (1<<16) // If an item is just your hand (circled hand, slapper) and shouldn't block things like riding
/// Integrity defines for clothing (not flags but close enough)
#define CLOTHING_PRISTINE 0 // We have no damage on the clothing
+4
View File
@@ -57,6 +57,10 @@
#define ADMIN_SET_SD_CODE "(<a href='?_src_=holder;[HrefToken(TRUE)];set_selfdestruct_code=1'>SETCODE</a>)"
#define ADMIN_FULLMONTY_NONAME(user) "[ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)] [ADMIN_INDIVIDUALLOG(user)] [ADMIN_SMITE(user)]"
#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_FULLMONTY_NONAME(user)]"
//ambition start
#define ADMIN_TPMONTY_NONAME(user) "[ADMIN_QUE(user)] [ADMIN_JMP(user)] [ADMIN_FLW(user)]"
#define ADMIN_TPMONTY(user) "[key_name_admin(user)] [ADMIN_TPMONTY_NONAME(user)]"
//ambition end
#define ADMIN_JMP(src) "(<a href='?_src_=holder;[HrefToken(TRUE)];adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)"
#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]"
#define AREACOORD(src) "[src ? "[get_area_name(src, TRUE)] ([src.x], [src.y], [src.z])" : "nonexistent location"]"
+18
View File
@@ -111,3 +111,21 @@ GLOBAL_LIST_EMPTY(living_heart_cache) //A list of all living hearts in existance
#define BLOB_SPREAD_COST 4
#define BLOB_ATTACK_REFUND 2 //blob refunds this much if it attacks and doesn't spread
#define BLOB_REFLECTOR_COST 15
/// How many telecrystals a normal traitor starts with
#define TELECRYSTALS_DEFAULT 20
/// How many telecrystals mapper/admin only "precharged" uplink implant
#define TELECRYSTALS_PRELOADED_IMPLANT 10
/// The normal cost of an uplink implant; used for calcuating how many
/// TC to charge someone if they get a free implant through choice or
/// because they have nothing else that supports an implant.
#define UPLINK_IMPLANT_TELECRYSTAL_COST 4
/// The dimensions of the antagonist preview icon. Will be scaled to this size.
#define ANTAGONIST_PREVIEW_ICON_SIZE 96
//Objectives-Ambitions Panel
#define REQUEST_NEW_OBJECTIVE "new_objective"
#define REQUEST_DEL_OBJECTIVE "del_objective"
#define REQUEST_WIN_OBJECTIVE "win_objective"
#define REQUEST_LOSE_OBJECTIVE "lose_objective"
+28
View File
@@ -68,6 +68,21 @@
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 //This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
#define SYNTH_PASSIVE_HEAT_GAIN 10 //Degrees C per handle_environment() Synths passively heat up. Mitigated by cooling efficiency. Can lead to overheating if not managed.
#define SYNTH_MAX_PASSIVE_GAIN_TEMP 250 //Degrees C that a synth can be heated up to by their internal heat gain, provided their cooling is insufficient to mitigate it.
#define SYNTH_MIN_PASSIVE_COOLING_TEMP -30 //Degrees C a synth can cool towards at very high cooling efficiency.
#define SYNTH_HEAT_EFFICIENCY_COEFF 0.005 //How quick the difference between the Synth and the environment starts to matter. The smaller the higher the difference has to be for the same change.
#define SYNTH_SINGLE_INFLUENCE_COOLING_EFFECT_CAP 3 //How big can the multiplier for heat / pressure cooling be in an optimal environment
#define SYNTH_TOTAL_ENVIRONMENT_EFFECT_CAP 2 //How big of an multiplier can the environment give in an optimal scenario (maximum efficiency in the end is at a lower cap, this mostly counters low coolant levels)
#define SYNTH_MAX_COOLING_EFFICIENCY 1.5 //The maximum possible cooling efficiency one can achieve at optimal conditions.
#define SYNTH_ACTIVE_COOLING_TEMP_BOUNDARY 10 //The minimum distance from room temperature a Synth needs to have for active cooling to actively cool.
#define SYNTH_ACTIVE_COOLING_LOW_PRESSURE_THRESHOLD 0.05 //At how much percentage of default pressure (or lower) active cooling gets a massive cost penalty.
#define SYNTH_ACTIVE_COOLING_LOW_PRESSURE_PENALTY 2.5 //By how much is active cooling cost multiplied if in a very-low-pressure environment?
#define SYNTH_ACTIVE_COOLING_MIN_ADJUSTMENT 5 //What is the minimum amount of temp you move towards the target point, even if it would be less with default calculations?
#define SYNTH_INTEGRATION_COOLANT_PENALTY 0.4 //Integrating coolant is multiplied with this for calculation of impact on passive cooling.
#define SYNTH_INTEGRATION_COOLANT_CAP 0.25 //Integrating coolant is capped at counting as current_blood * this number. This is so you can't just run on salglu or whatever.
#define SYNTH_COLD_OFFSET -125 //How much colder temps Synths can tolerate. Used in their species.
#define BODYTEMP_NORMAL 310.15 //The natural temperature for a body
#define BODYTEMP_AUTORECOVERY_DIVISOR 11 //This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
#define BODYTEMP_AUTORECOVERY_MINIMUM 12 //Minimum amount of kelvin moved toward 310K per tick. So long as abs(310.15 - bodytemp) is more than 50.
@@ -101,6 +116,7 @@
#define GLOVES_MAX_TEMP_PROTECT 1500 //For some gloves
#define SHOES_MIN_TEMP_PROTECT 2.0 //For gloves
#define SHOES_MAX_TEMP_PROTECT 1500 //For gloves
#define COAT_MAX_TEMP_PROTECT 330 //For winter coats (if they can stop you from getting cold why can't they do it the other way to a lesser extent)
#define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE
#define MAX_HIGH_PRESSURE_DAMAGE 16 // CITADEL CHANGES Max to 16, low to 8.
@@ -128,6 +144,7 @@
#define TANK_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE*3)
#define TANK_MIN_RELEASE_PRESSURE 0
#define TANK_DEFAULT_RELEASE_PRESSURE 17
#define TANK_POST_FRAGMENT_REACTIONS 5
//CANATMOSPASS
#define ATMOS_PASS_YES 1
@@ -160,6 +177,9 @@
//SNOSTATION
#define ICEMOON_DEFAULT_ATMOS "ICEMOON_ATMOS"
//FESTIVESTATION
#define FESTIVE_ATMOS "o2=22;n2=82;TEMP=266" //this goes here right putnam??
//ATMOSIA GAS MONITOR TAGS
#define ATMOS_GAS_MONITOR_INPUT_O2 "o2_in"
#define ATMOS_GAS_MONITOR_OUTPUT_O2 "o2_out"
@@ -257,6 +277,7 @@
#define GAS_HYPERNOB "nob"
#define GAS_NITROUS "n2o"
#define GAS_NITRYL "no2"
#define GAS_HYDROGEN "hydrogen"
#define GAS_TRITIUM "tritium"
#define GAS_BZ "bz"
#define GAS_STIMULUM "stim"
@@ -264,9 +285,16 @@
#define GAS_MIASMA "miasma"
#define GAS_METHANE "methane"
#define GAS_METHYL_BROMIDE "methyl_bromide"
#define GAS_BROMINE "bromine"
#define GAS_AMMONIA "ammonia"
#define GAS_FLUORINE "fluorine"
#define GAS_ETHANOL "ethanol"
#define GAS_GROUP_CHEMICALS "Chemicals"
#define GAS_FLAG_DANGEROUS (1<<0)
#define GAS_FLAG_BREATH_PROC (1<<1)
#define GAS_FLAG_CHEMICAL (1<<2)
//SUPERMATTER DEFINES
#define HEAT_PENALTY "heat penalties"
+6
View File
@@ -0,0 +1,6 @@
//different types of atom colorations
#define ADMIN_COLOUR_PRIORITY 1 //only used by rare effects like greentext coloring mobs and when admins varedit color
#define TEMPORARY_COLOUR_PRIORITY 2 //e.g. purple effect of the revenant on a mob, black effect when mob electrocuted
#define WASHABLE_COLOUR_PRIORITY 3 //color splashed onto an atom (e.g. paint on turf)
#define FIXED_COLOUR_PRIORITY 4 //color inherent to the atom (e.g. blob color)
#define COLOUR_PRIORITY_AMOUNT 4 //how many priority levels there are.
+197
View File
@@ -0,0 +1,197 @@
// This is eventually for wjohn to add more color standardization stuff like I keep asking him >:(
#define COLOR_INPUT_DISABLED "#F0F0F0"
#define COLOR_INPUT_ENABLED "#D3B5B5"
#define COLOR_DARKMODE_BACKGROUND "#202020"
#define COLOR_DARKMODE_DARKBACKGROUND "#171717"
#define COLOR_DARKMODE_TEXT "#a4bad6"
#define COLOR_WHITE "#FFFFFF"
#define COLOR_VERY_LIGHT_GRAY "#EEEEEE"
#define COLOR_SILVER "#C0C0C0"
#define COLOR_GRAY "#808080"
#define COLOR_FLOORTILE_GRAY "#8D8B8B"
#define COLOR_DARK "#454545"
#define COLOR_ALMOST_BLACK "#333333"
#define COLOR_BLACK "#000000"
#define COLOR_HALF_TRANSPARENT_BLACK "#0000007A"
#define COLOR_RED "#FF0000"
#define COLOR_MOSTLY_PURE_RED "#FF3300"
#define COLOR_DARK_RED "#A50824"
#define COLOR_RED_LIGHT "#FF3333"
#define COLOR_MAROON "#800000"
#define COLOR_VIVID_RED "#FF3232"
#define COLOR_LIGHT_GRAYISH_RED "#E4C7C5"
#define COLOR_SOFT_RED "#FA8282"
#define COLOR_BUBBLEGUM_RED "#950A0A"
#define COLOR_YELLOW "#FFFF00"
#define COLOR_VIVID_YELLOW "#FBFF23"
#define COLOR_VERY_SOFT_YELLOW "#FAE48E"
#define COLOR_OLIVE "#808000"
#define COLOR_VIBRANT_LIME "#00FF00"
#define COLOR_LIME "#32CD32"
#define COLOR_DARK_LIME "#00aa00"
#define COLOR_VERY_PALE_LIME_GREEN "#DDFFD3"
#define COLOR_VERY_DARK_LIME_GREEN "#003300"
#define COLOR_GREEN "#008000"
#define COLOR_DARK_MODERATE_LIME_GREEN "#44964A"
#define COLOR_CYAN "#00FFFF"
#define COLOR_DARK_CYAN "#00A2FF"
#define COLOR_TEAL "#008080"
#define COLOR_BLUE "#0000FF"
#define COLOR_STRONG_BLUE "#1919c8"
#define COLOR_BRIGHT_BLUE "#2CB2E8"
#define COLOR_MODERATE_BLUE "#555CC2"
#define COLOR_AMETHYST "#822BFF"
#define COLOR_BLUE_LIGHT "#33CCFF"
#define COLOR_NAVY "#000080"
#define COLOR_BLUE_GRAY "#75A2BB"
#define COLOR_PINK "#FFC0CB"
#define COLOR_LIGHT_PINK "#ff3cc8"
#define COLOR_MOSTLY_PURE_PINK "#E4005B"
#define COLOR_MAGENTA "#FF00FF"
#define COLOR_STRONG_MAGENTA "#B800B8"
#define COLOR_PURPLE "#800080"
#define COLOR_VIOLET "#B900F7"
#define COLOR_STRONG_VIOLET "#6927c5"
#define COLOR_ORANGE "#FF9900"
#define COLOR_MOSTLY_PURE_ORANGE "#ff8000"
#define COLOR_TAN_ORANGE "#FF7B00"
#define COLOR_BRIGHT_ORANGE "#E2853D"
#define COLOR_LIGHT_ORANGE "#ffc44d"
#define COLOR_PALE_ORANGE "#FFBE9D"
#define COLOR_BEIGE "#CEB689"
#define COLOR_DARK_ORANGE "#C3630C"
#define COLOR_DARK_MODERATE_ORANGE "#8B633B"
#define COLOR_BROWN "#BA9F6D"
#define COLOR_DARK_BROWN "#997C4F"
#define COLOR_ORANGE_BROWN "#a9734f"
//Color defines used by the soapstone (based on readability against grey tiles)
#define COLOR_SOAPSTONE_PLASTIC "#a19d94"
#define COLOR_SOAPSTONE_IRON "#b2b2b2"
#define COLOR_SOAPSTONE_BRONZE "#FE8001"
#define COLOR_SOAPSTONE_SILVER "#FFFFFF"
#define COLOR_SOAPSTONE_GOLD "#FFD900"
#define COLOR_SOAPSTONE_DIAMOND "#00ffee"
#define COLOR_GREEN_GRAY "#99BB76"
#define COLOR_RED_GRAY "#B4696A"
#define COLOR_PALE_BLUE_GRAY "#98C5DF"
#define COLOR_PALE_GREEN_GRAY "#B7D993"
#define COLOR_PALE_RED_GRAY "#D59998"
#define COLOR_PALE_PURPLE_GRAY "#CBB1CA"
#define COLOR_PURPLE_GRAY "#AE8CA8"
//Color defines used by the assembly detailer.
#define COLOR_ASSEMBLY_BLACK "#545454"
#define COLOR_ASSEMBLY_BGRAY "#9497AB"
#define COLOR_ASSEMBLY_WHITE "#E2E2E2"
#define COLOR_ASSEMBLY_RED "#CC4242"
#define COLOR_ASSEMBLY_ORANGE "#E39751"
#define COLOR_ASSEMBLY_BEIGE "#AF9366"
#define COLOR_ASSEMBLY_BROWN "#97670E"
#define COLOR_ASSEMBLY_GOLD "#AA9100"
#define COLOR_ASSEMBLY_YELLOW "#CECA2B"
#define COLOR_ASSEMBLY_GURKHA "#999875"
#define COLOR_ASSEMBLY_LGREEN "#789876"
#define COLOR_ASSEMBLY_GREEN "#44843C"
#define COLOR_ASSEMBLY_LBLUE "#5D99BE"
#define COLOR_ASSEMBLY_BLUE "#38559E"
#define COLOR_ASSEMBLY_PURPLE "#6F6192"
///Colors for xenobiology vatgrowing
#define COLOR_SAMPLE_YELLOW "#c0b823"
#define COLOR_SAMPLE_PURPLE "#342941"
#define COLOR_SAMPLE_GREEN "#98b944"
#define COLOR_SAMPLE_BROWN "#91542d"
#define COLOR_SAMPLE_GRAY "#5e5856"
///Main colors for UI themes
#define COLOR_THEME_MIDNIGHT "#6086A0"
#define COLOR_THEME_PLASMAFIRE "#FFB200"
#define COLOR_THEME_RETRO "#24CA00"
#define COLOR_THEME_SLIMECORE "#4FB259"
#define COLOR_THEME_OPERATIVE "#B8221F"
#define COLOR_THEME_GLASS "#75A4C4"
#define COLOR_THEME_CLOCKWORK "#CFBA47"
///Colors for eigenstates
#define COLOR_PERIWINKLEE "#9999FF"
/**
* Some defines to generalise colours used in lighting.
*
* Important note: colors can end up significantly different from the basic html picture, especially when saturated
*/
/// Bright but quickly dissipating neon green. rgb(100, 200, 100)
#define LIGHT_COLOR_GREEN "#64C864"
/// Electric green. rgb(0, 255, 0)
#define LIGHT_COLOR_ELECTRIC_GREEN "#00FF00"
/// Cold, diluted blue. rgb(100, 150, 250)
#define LIGHT_COLOR_BLUE "#6496FA"
/// Light blueish green. rgb(125, 225, 175)
#define LIGHT_COLOR_BLUEGREEN "#7DE1AF"
/// Diluted cyan. rgb(125, 225, 225)
#define LIGHT_COLOR_CYAN "#7DE1E1"
/// Electric cyan rgb(0, 255, 255)
#define LIGHT_COLOR_ELECTRIC_CYAN "#00FFFF"
/// More-saturated cyan. rgb(64, 206, 255)
#define LIGHT_COLOR_LIGHT_CYAN "#40CEFF"
/// Saturated blue. rgb(51, 117, 248)
#define LIGHT_COLOR_DARK_BLUE "#6496FA"
/// Diluted, mid-warmth pink. rgb(225, 125, 225)
#define LIGHT_COLOR_PINK "#E17DE1"
/// Dimmed yellow, leaning kaki. rgb(225, 225, 125)
#define LIGHT_COLOR_YELLOW "#E1E17D"
/// Clear brown, mostly dim. rgb(150, 100, 50)
#define LIGHT_COLOR_BROWN "#966432"
/// Mostly pure orange. rgb(250, 150, 50)
#define LIGHT_COLOR_ORANGE "#FA9632"
/// Light Purple. rgb(149, 44, 244)
#define LIGHT_COLOR_PURPLE "#952CF4"
/// Less-saturated light purple. rgb(155, 81, 255)
#define LIGHT_COLOR_LAVENDER "#9B51FF"
///slightly desaturated bright yellow.
#define LIGHT_COLOR_HOLY_MAGIC "#FFF743"
/// deep crimson
#define LIGHT_COLOR_BLOOD_MAGIC "#D00000"
/* These ones aren't a direct colour like the ones above, because nothing would fit */
/// Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
#define LIGHT_COLOR_FIRE "#FAA019"
/// Very warm yellow, leaning slightly towards orange. rgb(196, 138, 24)
#define LIGHT_COLOR_LAVA "#C48A18"
/// Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75)
#define LIGHT_COLOR_FLARE "#FA644B"
/// Weird color, between yellow and green, very slimy. rgb(175, 200, 75)
#define LIGHT_COLOR_SLIME_LAMP "#AFC84B"
/// Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175)
#define LIGHT_COLOR_TUNGSTEN "#FAE1AF"
/// Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250)
#define LIGHT_COLOR_HALOGEN "#F0FAFA"
//The GAGS greyscale_colors for each department's computer/machine circuits
#define CIRCUIT_COLOR_GENERIC "#1A7A13"
#define CIRCUIT_COLOR_COMMAND "#1B4594"
#define CIRCUIT_COLOR_SECURITY "#9A151E"
#define CIRCUIT_COLOR_SCIENCE "#BC4A9B"
#define CIRCUIT_COLOR_SERVICE "#92DCBA"
#define CIRCUIT_COLOR_MEDICAL "#00CCFF"
#define CIRCUIT_COLOR_ENGINEERING "#F8D700"
#define CIRCUIT_COLOR_SUPPLY "#C47749"
/// Colors for pride week
#define COLOR_PRIDE_RED "#FF6666"
#define COLOR_PRIDE_ORANGE "#FC9F3C"
#define COLOR_PRIDE_YELLOW "#EAFF51"
#define COLOR_PRIDE_GREEN "#41FC66"
#define COLOR_PRIDE_BLUE "#42FFF2"
#define COLOR_PRIDE_PURPLE "#5D5DFC"
+4
View File
@@ -0,0 +1,4 @@
//Luma coefficients suggested for HDTVs. If you change these, make sure they add up to 1.
#define LUMA_R 0.213
#define LUMA_G 0.715
#define LUMA_B 0.072
-62
View File
@@ -1,62 +0,0 @@
// This is eventually for wjohn to add more color standardization stuff like I keep asking him >:(
#define COLOR_INPUT_DISABLED "#F0F0F0"
#define COLOR_INPUT_ENABLED "#D3B5B5"
#define COLOR_FLOORTILE_GRAY "#8D8B8B"
#define COLOR_ALMOST_BLACK "#333333"
#define COLOR_BLACK "#000000"
#define COLOR_RED "#FF0000"
#define COLOR_RED_LIGHT "#FF3333"
#define COLOR_MAROON "#800000"
#define COLOR_YELLOW "#FFFF00"
#define COLOR_OLIVE "#808000"
#define COLOR_LIME "#32CD32"
#define COLOR_GREEN "#008000"
#define COLOR_CYAN "#00FFFF"
#define COLOR_TEAL "#008080"
#define COLOR_BLUE "#0000FF"
#define COLOR_BLUE_LIGHT "#33CCFF"
#define COLOR_NAVY "#000080"
#define COLOR_PINK "#FFC0CB"
#define COLOR_MAGENTA "#FF00FF"
#define COLOR_PURPLE "#800080"
#define COLOR_ORANGE "#FF9900"
#define COLOR_BEIGE "#CEB689"
#define COLOR_BLUE_GRAY "#75A2BB"
#define COLOR_BROWN "#BA9F6D"
#define COLOR_SOFT_RED "#FA8282"
#define COLOR_DARK_BROWN "#997C4F"
#define COLOR_DARK_ORANGE "#C3630C"
#define COLOR_GREEN_GRAY "#99BB76"
#define COLOR_RED_GRAY "#B4696A"
#define COLOR_PALE_BLUE_GRAY "#98C5DF"
#define COLOR_PALE_GREEN_GRAY "#B7D993"
#define COLOR_PALE_ORANGE "#FFC066"
#define COLOR_PALE_RED_GRAY "#D59998"
#define COLOR_PALE_PURPLE_GRAY "#CBB1CA"
#define COLOR_PURPLE_GRAY "#AE8CA8"
// Color defines used by the assembly detailer.
#define COLOR_ASSEMBLY_BLACK "#545454"
#define COLOR_ASSEMBLY_BGRAY "#9497AB"
#define COLOR_ASSEMBLY_WHITE "#E2E2E2"
#define COLOR_ASSEMBLY_RED "#CC4242"
#define COLOR_ASSEMBLY_ORANGE "#E39751"
#define COLOR_ASSEMBLY_BEIGE "#AF9366"
#define COLOR_ASSEMBLY_BROWN "#97670E"
#define COLOR_ASSEMBLY_GOLD "#AA9100"
#define COLOR_ASSEMBLY_YELLOW "#CECA2B"
#define COLOR_ASSEMBLY_GURKHA "#999875"
#define COLOR_ASSEMBLY_LGREEN "#789876"
#define COLOR_ASSEMBLY_GREEN "#44843C"
#define COLOR_ASSEMBLY_LBLUE "#5D99BE"
#define COLOR_ASSEMBLY_BLUE "#38559E"
#define COLOR_ASSEMBLY_PURPLE "#6F6192"
#define COLOR_ASSEMBLY_PINK "#ff4adc"
#define COLOR_WHITE "#FFFFFF"
#define COLOR_VERY_LIGHT_GRAY "#EEEEEE"
#define COLOR_SILVER "#C0C0C0"
#define COLOR_GRAY "#808080"
#define COLOR_HALF_TRANSPARENT_BLACK "#0000007A"
#define COLOR_BRIGHT_BLUE "#2CB2E8"
+3
View File
@@ -27,6 +27,9 @@
//INDEXES
#define COOLDOWN_EMPLOYMENT_CABINET "employment cabinet"
#define COOLDOWN_AMBITION "ambition"
#define COOLDOWN_OBJECTIVES "objectives"
#define COOLDOWN_OBJ_ADMIN_PING "obj_admin_ping"
//car cooldowns
#define COOLDOWN_CAR_HONK "car_honk"
+28
View File
@@ -31,6 +31,15 @@
/// Do not allow this random event to continue.
#define CANCEL_PRE_RANDOM_EVENT (1<<0)
/// a weather event of some kind occured
#define COMSIG_WEATHER_TELEGRAPH(event_type) "!weather_telegraph [event_type]"
#define COMSIG_WEATHER_START(event_type) "!weather_start [event_type]"
#define COMSIG_WEATHER_WINDDOWN(event_type) "!weather_winddown [event_type]"
#define COMSIG_WEATHER_END(event_type) "!weather_end [event_type]"
/// called by auxgm add_gas: (gas_id)
#define COMSIG_GLOB_NEW_GAS "!new_gas"
// signals from globally accessible objects
/// from SSsun when the sun changes position : (primary_sun, suns)
#define COMSIG_SUN_MOVED "sun_moved"
@@ -75,6 +84,8 @@
#define COMSIG_PARENT_QDELETING "parent_qdeleting"
/// generic topic handler (usr, href_list)
#define COMSIG_TOPIC "handle_topic"
/// from datum ui_act (usr, action)
#define COMSIG_UI_ACT "COMSIG_UI_ACT"
/// fires on the target datum when an element is attached to it (/datum/element)
#define COMSIG_ELEMENT_ATTACH "element_attach"
@@ -378,6 +389,9 @@
#define COMSIG_LIVING_RUN_BLOCK "living_do_run_block" //from base of mob/living/do_run_block(): (real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone)
#define COMSIG_LIVING_GET_BLOCKING_ITEMS "get_blocking_items" //from base of mob/living/get_blocking_items(): (list/items)
#define COMSIG_LIVING_RESTING "living_on_resting" //from mob/living/set_resting
#define COMSIG_LIVING_STOPPED_PULLING "living_on_stop_pulling" //from mob/living/stop_pulling
#define COMSIG_LIVING_ACTIVE_BLOCK_START "active_block_start" //from base of mob/living/keybind_start_active_blocking(): (obj/item/blocking_item, list/backup_items)
#define COMPONENT_PREVENT_BLOCK_START 1
#define COMSIG_LIVING_ACTIVE_PARRY_START "active_parry_start" //from base of mob/living/initiate_parry_sequence(): (parrying_method, datum/parrying_item_mob_or_art, list/backup_items, list/override)
@@ -445,6 +459,12 @@
///from /obj/machinery/obj_break(damage_flag): (damage_flag)
#define COMSIG_MACHINERY_BROKEN "machinery_broken"
// /obj/machinery/power/supermatter_crystal signals
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM delam reaches the point of sounding alarms
#define COMSIG_SUPERMATTER_DELAM_START_ALARM "sm_delam_start_alarm"
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM sounds an audible alarm
#define COMSIG_SUPERMATTER_DELAM_ALARM "sm_delam_alarm"
// /obj/item signals
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (/mob)
@@ -485,6 +505,14 @@
#define COMSIG_MINE_TRIGGERED "minegoboom" ///from [/obj/effect/mine/proc/triggermine]:
// Uncovered information
#define COMPONENT_DEEPSCAN_UNCOVERED_INFORMATION 1
///Called when an item is being offered, from [/obj/item/proc/on_offered(mob/living/carbon/offerer)]
#define COMSIG_ITEM_OFFERING "item_offering"
///Interrupts the offer proc
#define COMPONENT_OFFER_INTERRUPT (1<<0)
///Called when an someone tries accepting an offered item, from [/obj/item/proc/on_offer_taken(mob/living/carbon/offer, mob/living/carbon/taker)]
#define COMSIG_ITEM_OFFER_TAKEN "item_offer_taken"
///Interrupts the offer acceptance
#define COMPONENT_OFFER_TAKE_INTERRUPT (1<<0)
///from [/obj/structure/closet/supplypod/proc/endlaunch]:
#define COMSIG_SUPPLYPOD_LANDED "supplypodgoboom"
+45 -80
View File
@@ -6,87 +6,52 @@
#define STORAGE_VIEW_DEPTH 2
//ITEM INVENTORY SLOT BITMASKS
#define ITEM_SLOT_OCLOTHING (1<<0)
#define ITEM_SLOT_ICLOTHING (1<<1)
#define ITEM_SLOT_GLOVES (1<<2)
#define ITEM_SLOT_EYES (1<<3)
#define ITEM_SLOT_EARS (1<<4)
#define ITEM_SLOT_MASK (1<<5)
#define ITEM_SLOT_HEAD (1<<6)
#define ITEM_SLOT_FEET (1<<7)
#define ITEM_SLOT_ID (1<<8)
#define ITEM_SLOT_BELT (1<<9)
#define ITEM_SLOT_BACK (1<<10)
#define ITEM_SLOT_POCKET (1<<11) // this is to allow items with a w_class of WEIGHT_CLASS_NORMAL or WEIGHT_CLASS_BULKY to fit in pockets.
#define ITEM_SLOT_DENYPOCKET (1<<12) // this is to deny items with a w_class of WEIGHT_CLASS_SMALL or WEIGHT_CLASS_TINY to fit in pockets.
#define ITEM_SLOT_NECK (1<<13)
#define ITEM_SLOT_HANDS (1<<14)
#define ITEM_SLOT_BACKPACK (1<<15)
#define ITEM_SLOT_SUITSTORE (1<<16)
/// Suit slot (armors, costumes, space suits, etc.)
#define ITEM_SLOT_OCLOTHING (1<<0)
/// Jumpsuit slot
#define ITEM_SLOT_ICLOTHING (1<<1)
/// Glove slot
#define ITEM_SLOT_GLOVES (1<<2)
/// Glasses slot
#define ITEM_SLOT_EYES (1<<3)
/// Ear slot (radios, earmuffs)
#define ITEM_SLOT_EARS (1<<4)
/// Mask slot
#define ITEM_SLOT_MASK (1<<5)
/// Head slot (helmets, hats, etc.)
#define ITEM_SLOT_HEAD (1<<6)
/// Shoe slot
#define ITEM_SLOT_FEET (1<<7)
/// ID slot
#define ITEM_SLOT_ID (1<<8)
/// Belt slot
#define ITEM_SLOT_BELT (1<<9)
/// Back slot
#define ITEM_SLOT_BACK (1<<10)
/// Dextrous simplemob "hands" (used for Drones and Dextrous Guardians)
#define ITEM_SLOT_DEX_STORAGE (1<<11)
/// Neck slot (ties, bedsheets, scarves)
#define ITEM_SLOT_NECK (1<<12)
/// A character's hand slots
#define ITEM_SLOT_HANDS (1<<13)
/// Inside of a character's backpack
#define ITEM_SLOT_BACKPACK (1<<14)
/// Suit Storage slot
#define ITEM_SLOT_SUITSTORE (1<<15)
/// Left Pocket slot
#define ITEM_SLOT_LPOCKET (1<<16)
/// Right Pocket slot
#define ITEM_SLOT_RPOCKET (1<<17)
/// Handcuff slot
#define ITEM_SLOT_HANDCUFFED (1<<18)
/// Legcuff slot (bolas, beartraps)
#define ITEM_SLOT_LEGCUFFED (1<<19)
//SLOTS
#define SLOT_BACK 1
#define SLOT_WEAR_MASK 2
#define SLOT_HANDCUFFED 3
#define SLOT_HANDS 4 //wherever you provide a slot for hands you provide SLOT_HANDS
//SLOT_HANDS as a slot will pick ANY available hand
#define SLOT_BELT 5
#define SLOT_WEAR_ID 6
#define SLOT_EARS 7
#define SLOT_GLASSES 8
#define SLOT_GLOVES 9
#define SLOT_NECK 10
#define SLOT_HEAD 11
#define SLOT_SHOES 12
#define SLOT_WEAR_SUIT 13
#define SLOT_W_UNIFORM 14
#define SLOT_L_STORE 15
#define SLOT_R_STORE 16
#define SLOT_S_STORE 17
#define SLOT_IN_BACKPACK 18
#define SLOT_LEGCUFFED 19
#define SLOT_GENERC_DEXTROUS_STORAGE 20
#define SLOTS_AMT 20 // Keep this up to date!
//I hate that this has to exist
/proc/slotdefine2slotbit(slotdefine) //Keep this up to date with the value of SLOT BITMASKS and SLOTS (the two define sections above)
. = 0
switch(slotdefine)
if(SLOT_BACK)
. = ITEM_SLOT_BACK
if(SLOT_WEAR_MASK)
. = ITEM_SLOT_MASK
if(SLOT_NECK)
. = ITEM_SLOT_NECK
if(SLOT_BELT)
. = ITEM_SLOT_BELT
if(SLOT_WEAR_ID)
. = ITEM_SLOT_ID
if(SLOT_EARS)
. = ITEM_SLOT_EARS
if(SLOT_GLASSES)
. = ITEM_SLOT_EYES
if(SLOT_GLOVES)
. = ITEM_SLOT_GLOVES
if(SLOT_HEAD)
. = ITEM_SLOT_HEAD
if(SLOT_SHOES)
. = ITEM_SLOT_FEET
if(SLOT_WEAR_SUIT)
. = ITEM_SLOT_OCLOTHING
if(SLOT_W_UNIFORM)
. = ITEM_SLOT_ICLOTHING
if(SLOT_L_STORE, SLOT_R_STORE)
. = ITEM_SLOT_POCKET
if(SLOT_HANDS)
. = ITEM_SLOT_HANDS
if(SLOT_IN_BACKPACK)
. = ITEM_SLOT_BACKPACK
if(SLOT_S_STORE)
. = ITEM_SLOT_SUITSTORE
/// Total amount of slots
#define SLOTS_AMT 20 // Keep this up to date!
//SLOT GROUP HELPERS
#define ITEM_SLOT_POCKETS (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)
//Bit flags for the flags_inv variable, which determine when a piece of clothing hides another. IE a helmet hiding glasses.
#define HIDEGLOVES (1<<0)
@@ -245,4 +210,4 @@ GLOBAL_LIST_INIT(security_wintercoat_allowed, typecacheof(list(
#define GET_INTERNAL_SLOTS(C) list(C.head, C.wear_mask)
//Slots that won't trigger humans' update_genitals() on equip().
GLOBAL_LIST_INIT(no_genitals_update_slots, list(SLOT_L_STORE, SLOT_R_STORE, SLOT_S_STORE, SLOT_IN_BACKPACK, SLOT_LEGCUFFED, SLOT_HANDCUFFED, SLOT_HANDS, SLOT_GENERC_DEXTROUS_STORAGE))
GLOBAL_LIST_INIT(no_genitals_update_slots, list(ITEM_SLOT_LPOCKET, ITEM_SLOT_RPOCKET, ITEM_SLOT_SUITSTORE, ITEM_SLOT_BACKPACK, ITEM_SLOT_LEGCUFFED, ITEM_SLOT_HANDCUFFED, ITEM_SLOT_HANDS, ITEM_SLOT_DEX_STORAGE))
+1 -2
View File
@@ -76,10 +76,9 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
#define isvampire(A) (is_species(A,/datum/species/vampire))
#define isdullahan(A) (is_species(A, /datum/species/dullahan))
#define isangel(A) (is_species(A, /datum/species/angel))
#define ismush(A) (is_species(A, /datum/species/mush))
#define isshadow(A) (is_species(A, /datum/species/shadow))
#define isrobotic(A) (is_species(A, /datum/species/ipc) || is_species(A, /datum/species/synthliz))
#define isrobotic(A) (is_species(A, /datum/species/ipc) || is_species(A, /datum/species/synthliz) || is_species(A, /datum/species/mammal/synthetic))
#define isdwarf(A) (is_species(A, /datum/species/dwarf))
// Citadel specific species
+7 -2
View File
@@ -5,9 +5,10 @@
#define CLICKCATCHER_PLANE -99
#define PLANE_SPACE -95
#define PLANE_SPACE -98
#define PLANE_SPACE_RENDER_TARGET "PLANE_SPACE"
#define PLANE_SPACE_PARALLAX -90
#define PLANE_SPACE_PARALLAX -95
#define PLANE_SPACE_PARALLAX_RENDER_TARGET "PLANE_SPACE_PARALLAX"
#define OPENSPACE_LAYER 17 //Openspace layer over all
@@ -153,6 +154,10 @@
#define CAMERA_STATIC_LAYER 19
#define CAMERA_STATIC_RENDER_TARGET "CAMERA_STATIC_PLANE"
/// Plane for balloon text (text that fades up)
/// It's over lighting and every other crap because this is nearly as important as hud content and only visible to the user.
#define BALLOON_CHAT_PLANE 20
//HUD layer defines
#define FULLSCREEN_PLANE 20
-25
View File
@@ -30,31 +30,6 @@
//Important note on colors. Colors can end up significantly different from the basic html picture, especially when saturated
#define LIGHT_COLOR_WHITE "#FFFFFF"
#define LIGHT_COLOR_RED "#FA8282" //Warm but extremely diluted red. rgb(250, 130, 130)
#define LIGHT_COLOR_GREEN "#64C864" //Bright but quickly dissipating neon green. rgb(100, 200, 100)
#define LIGHT_COLOR_BLUE "#6496FA" //Cold, diluted blue. rgb(100, 150, 250)
#define LIGHT_COLOR_BLUEGREEN "#7DE1AF" //Light blueish green. rgb(125, 225, 175)
#define LIGHT_COLOR_PALEBLUE "#7DAFE1" //A pale blue-ish color. rgb(125, 175, 225)
#define LIGHT_COLOR_CYAN "#7DE1E1" //Diluted cyan. rgb(125, 225, 225)
#define LIGHT_COLOR_LIGHT_CYAN "#40CEFF" //More-saturated cyan. rgb(64, 206, 255)
#define LIGHT_COLOR_DARK_BLUE "#6496FA" //Saturated blue. rgb(51, 117, 248)
#define LIGHT_COLOR_PINK "#E17DE1" //Diluted, mid-warmth pink. rgb(225, 125, 225)
#define LIGHT_COLOR_YELLOW "#E1E17D" //Dimmed yellow, leaning kaki. rgb(225, 225, 125)
#define LIGHT_COLOR_BROWN "#966432" //Clear brown, mostly dim. rgb(150, 100, 50)
#define LIGHT_COLOR_ORANGE "#FA9632" //Mostly pure orange. rgb(250, 150, 50)
#define LIGHT_COLOR_PURPLE "#952CF4" //Light Purple. rgb(149, 44, 244)
#define LIGHT_COLOR_LAVENDER "#9B51FF" //Less-saturated light purple. rgb(155, 81, 255)
#define LIGHT_COLOR_HOLY_MAGIC "#FFF743" //slightly desaturated bright yellow.
#define LIGHT_COLOR_BLOOD_MAGIC "#D00000" //deep crimson
//These ones aren't a direct colour like the ones above, because nothing would fit
#define LIGHT_COLOR_FIRE "#FAA019" //Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
#define LIGHT_COLOR_LAVA "#C48A18" //Very warm yellow, leaning slightly towards orange. rgb(196, 138, 24)
#define LIGHT_COLOR_FLARE "#FA644B" //Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75)
#define LIGHT_COLOR_SLIME_LAMP "#AFC84B" //Weird color, between yellow and green, very slimy. rgb(175, 200, 75)
#define LIGHT_COLOR_TUNGSTEN "#FAE1AF" //Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175)
#define LIGHT_COLOR_HALOGEN "#F0FAFA" //Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250)
#define LIGHT_RANGE_FIRE 3 //How many tiles standard fires glow.
+3 -2
View File
@@ -40,15 +40,16 @@
#define LOG_ASAY (1 << 15)
#define LOG_VIRUS (1 << 16)
#define LOG_SHUTTLE (1 << 18)
#define LOG_VICTIM (1 << 19)
//Individual logging panel pages
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK | LOG_VICTIM)
#define INDIVIDUAL_SAY_LOG (LOG_SAY | LOG_WHISPER | LOG_DSAY)
#define INDIVIDUAL_EMOTE_LOG (LOG_EMOTE | LOG_SUBTLER)
#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS)
#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN)
#define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_VICTIM)
#define LOGSRC_CLIENT "Client"
#define LOGSRC_MOB "Mob"
+18 -11
View File
@@ -48,32 +48,39 @@
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"
#define MC_SIGNALER "SIGNALER"
//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
//NTNet transfer speeds, used when downloading/uploading a file/program.
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//Program bitflags
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
//Program states
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2
//Program categories
#define PROGRAM_CATEGORY_CREW "Crew"
#define PROGRAM_CATEGORY_ENGI "Engineering"
#define PROGRAM_CATEGORY_ROBO "Robotics"
#define PROGRAM_CATEGORY_SUPL "Supply"
#define PROGRAM_CATEGORY_MISC "Other"
#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
+3
View File
@@ -105,6 +105,9 @@
#define TORADIANS(degrees) ((degrees) * 0.0174532925)
/// Gets shift x that would be required the bitflag (1<<x)
#define TOBITSHIFT(bit) ( log(2, bit) )
// Will filter out extra rotations and negative rotations
// E.g: 540 becomes 180. -180 becomes 180.
#define SIMPLIFY_DEGREES(degrees) (MODULUS((degrees), 360))
+8 -13
View File
@@ -323,6 +323,7 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
#define FIRST_DIAG_STEP 1
#define SECOND_DIAG_STEP 2
#define DEADCHAT_ANNOUNCEMENT "announcement"
#define DEADCHAT_ARRIVALRATTLE "arrivalrattle"
#define DEADCHAT_DEATHRATTLE "deathrattle"
#define DEADCHAT_REGULAR "regular-deadchat"
@@ -344,18 +345,6 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
//TODO Move to a pref
#define STATION_GOAL_BUDGET 1
//Luma coefficients suggested for HDTVs. If you change these, make sure they add up to 1.
#define LUMA_R 0.213
#define LUMA_G 0.715
#define LUMA_B 0.072
//different types of atom colorations
#define ADMIN_COLOUR_PRIORITY 1 //only used by rare effects like greentext coloring mobs and when admins varedit color
#define TEMPORARY_COLOUR_PRIORITY 2 //e.g. purple effect of the revenant on a mob, black effect when mob electrocuted
#define WASHABLE_COLOUR_PRIORITY 3 //color splashed onto an atom (e.g. paint on turf)
#define FIXED_COLOUR_PRIORITY 4 //color inherent to the atom (e.g. blob color)
#define COLOUR_PRIORITY_AMOUNT 4 //how many priority levels there are.
//Endgame Results
#define NUKE_NEAR_MISS 1
#define NUKE_MISS_STATION 2
@@ -379,7 +368,8 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
#define CLOCK_SILICONS 22
#define CLOCK_PROSELYTIZATION 23
#define SHUTTLE_HIJACK 24
#define GANG_VICTORY 25
#define GANG_DESTROYED 25
#define GANG_OPERATING 26
#define FIELD_TURF 1
#define FIELD_EDGE 2
@@ -567,3 +557,8 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
#define SHOES_KNOTTED 2
#define WANTED_FILE "wanted_message.json"
// Notification action types
#define NOTIFY_JUMP "jump"
#define NOTIFY_ATTACK "attack"
#define NOTIFY_ORBIT "orbit"
+1 -1
View File
@@ -295,7 +295,7 @@
#define APPRENTICE_AGE_MIN 29 // youngest an apprentice can be
#define SHOES_SLOWDOWN 0 // How much shoes slow you down by default. Negative values speed you up
#define SHOES_SPEED_SLIGHT SHOES_SLOWDOWN - 1 // slightest speed boost to movement
#define POCKET_STRIP_DELAY 40 // time taken (in deciseconds) to search somebody's pockets
#define POCKET_STRIP_DELAY (4 SECONDS) //time taken to search somebody's pockets
#define DOOR_CRUSH_DAMAGE 15 // the amount of damage that airlocks deal when they crush you
#define HUNGER_FACTOR 0.1 // factor at which mob nutrition decreases
-10
View File
@@ -34,12 +34,6 @@
#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_LOOC|CHAT_BANKCARD)
#define PARALLAX_INSANE -1 //for show offs
#define PARALLAX_HIGH 0 //default.
#define PARALLAX_MED 1
#define PARALLAX_LOW 2
#define PARALLAX_DISABLE 3 //this option must be the highest number
#define PIXEL_SCALING_AUTO 0
#define PIXEL_SCALING_1X 1
#define PIXEL_SCALING_1_2X 1.5
@@ -50,10 +44,6 @@
#define SCALING_METHOD_DISTORT "distort"
#define SCALING_METHOD_BLUR "blur"
#define PARALLAX_DELAY_DEFAULT world.tick_lag
#define PARALLAX_DELAY_MED 1
#define PARALLAX_DELAY_LOW 2
#define SEC_DEPT_NONE "None"
#define SEC_DEPT_RANDOM "Random"
#define SEC_DEPT_ENGINEERING "Engineering"
+1 -1
View File
@@ -13,7 +13,7 @@
#define NITRYL_FORMATION_ENERGY 100000
#define TRITIUM_BURN_OXY_FACTOR 100
#define TRITIUM_BURN_TRIT_FACTOR 10
#define TRITIUM_BURN_RADIOACTIVITY_FACTOR 50000 //The neutrons gotta go somewhere. Completely arbitrary number.
#define TRITIUM_BURN_RADIOACTIVITY_FACTOR 5000 //The neutrons gotta go somewhere. Completely arbitrary number.
#define TRITIUM_MINIMUM_RADIATION_ENERGY 0.1 //minimum 0.01 moles trit or 10 moles oxygen to start producing rads
#define SUPER_SATURATION_THRESHOLD 96
#define STIMULUM_HEAT_SCALE 100000
+3
View File
@@ -63,6 +63,9 @@
#define THRESHOLD_UNHUSK 50 // health threshold for synthflesh/rezadone to unhusk someone
#define SYNTHTISSUE_BORROW_CAP 250 //The cap for synthtissue's borrowed health value when used on someone dead or already having borrowed health.
#define SYNTHTISSUE_DAMAGE_FLIP_CYCLES 45 //After how many cycles the damage will be pure toxdamage as opposed to clonedamage like initially. Gradually changes during its cycles.
//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
@@ -60,11 +60,8 @@
#define ANTAG_HUD_BROTHER 23
#define ANTAG_HUD_BLOODSUCKER 24
#define ANTAG_HUD_FUGITIVE 25
#define ANTAG_HUD_HERETIC 26
// Notification action types
#define NOTIFY_JUMP "jump"
#define NOTIFY_ATTACK "attack"
#define NOTIFY_ORBIT "orbit"
#define ANTAG_HUD_HERETIC 26
#define ANTAG_HUD_SPACECOP 27
#define ANTAG_HUD_GANGSTER 28
#define ADD_HUD_TO_COOLDOWN 20 //cooldown for being shown the images for any particular data hud
+13
View File
@@ -0,0 +1,13 @@
#define PARALLAX_DELAY_DEFAULT world.tick_lag
#define PARALLAX_DELAY_MED 1
#define PARALLAX_DELAY_LOW 2
// WARNING - client.prefs uses this, if you change these make sure to update the code in preferences!
#define PARALLAX_DISABLE 0
#define PARALLAX_LOW 1
#define PARALLAX_MED 2
#define PARALLAX_HIGH 3
#define PARALLAX_INSANE 4 // default
// keep this false until we can fix it being a seizure hazard/ugly as sin
#define PARALLAX_ROTATION_ANIMATIONS FALSE
+3 -1
View File
@@ -73,4 +73,6 @@
TECHWEB_POINT_TYPE_GENERIC = "General Research"\
)
#define TECHWEB_BOMB_POINTCAP 50000 //Adjust as needed; Stops toxins from nullifying RND progression mechanics. Current Value Cap Radius: 100
#define BOMB_TARGET_POINTS 50000 //Adjust as needed. Actual hard cap is double this, but will never be reached due to hyperbolic curve.
#define BOMB_TARGET_SIZE 175 // The shockwave radius required for a bomb to get TECHWEB_BOMB_MIDPOINT points.
#define BOMB_SUB_TARGET_EXPONENT 3 // The power of the points curve below the target size. Higher = less points for worse bombs, below target.
+3 -2
View File
@@ -36,7 +36,8 @@
#define ROLE_DEATHSQUAD "deathsquad"
#define ROLE_LAVALAND "lavaland"
#define ROLE_INTERNAL_AFFAIRS "internal affairs agent"
#define ROLE_GANG "gangster"
#define ROLE_FAMILIES "family boss"
#define ROLE_FAMILY_HEAD_ASPIRANT "family head aspirant"
#define ROLE_BLOODSUCKER "bloodsucker"
#define ROLE_SPACE_DRAGON "Space Dragon"
//#define ROLE_MONSTERHUNTER "monster hunter" Disabled for now
@@ -72,9 +73,9 @@ GLOBAL_LIST_INIT(special_roles, list(
ROLE_OVERTHROW = /datum/game_mode/overthrow,
ROLE_INTERNAL_AFFAIRS = /datum/game_mode/traitor/internal_affairs,
ROLE_SENTIENCE,
ROLE_GANG = /datum/game_mode/gang,
ROLE_HERETIC = /datum/game_mode/heretics,
ROLE_BLOODSUCKER = /datum/game_mode/bloodsucker,
ROLE_FAMILIES = /datum/game_mode/gang,
ROLE_SPACE_DRAGON
//ROLE_MONSTERHUNTER Disabled for now
))
+3
View File
@@ -86,6 +86,9 @@
#define EMOTE_OMNI 4
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
//ambition start
#define MAX_AMBITION_LEN 1024
//ambition end
#define MAX_MESSAGE_LEN 4096 //Citadel edit: What's the WORST that could happen?
#define MAX_FLAVOR_LEN 4096
#define MAX_TASTE_LEN 40 //lick... vore... ew...
-1
View File
@@ -44,7 +44,6 @@
#define SHUTTLE_TRANSIT_BORDER 10
#define PARALLAX_LOOP_TIME 25
#define HYPERSPACE_END_TIME 5
#define HYPERSPACE_WARMUP 1
+1
View File
@@ -44,6 +44,7 @@
#define span_greenannounce(str) ("<span class='greenannounce'>" + str + "</span>")
#define span_greenteamradio(str) ("<span class='greenteamradio'>" + str + "</span>")
#define span_greentext(str) ("<span class='greentext'>" + str + "</span>")
#define span_gangradio(str) ("<span class='gangradio'>" + str + "</span>")
#define span_hear(str) ("<span class='hear'>" + str + "</span>")
#define span_hidden(str) ("<span class='hidden'>" + str + "</span>")
#define span_hierophant(str) ("<span class='hierophant'>" + str + "</span>")
+11 -1
View File
@@ -3,7 +3,6 @@
#define SPECIES_ABDUCTOR "abductor"
#define SPECIES_ANDROID "android"
#define SPECIES_ANGEL "angel"
#define SPECIES_MAMMAL "mammal"
#define SPECIES_MAMMAL_SYNTHETIC "mammal_synthetic"
#define SPECIES_ARACHNID "arachnid"
@@ -53,3 +52,14 @@
#define SPECIES_CATEGORY_SHADOW "shadow"
#define SPECIES_CATEGORY_SKELETON "skeleton"
#define SPECIES_CATEGORY_UNDEAD "undead"
//Species Wing Type Defines ----------------------
#define SPECIES_WINGS_ANGEL list("Angel")
#define SPECIES_WINGS_DRAGON list("Dragon") //could also be considered demon wings or bat wings?
#define SPECIES_WINGS_ROBOT list("Robotic")
#define SPECIES_WINGS_INSECT list("Fly") //"hey when can we have something besides giant fly wings?" "when you sprite it!"
#define SPECIES_WINGS_SKELETAL list("Skeleton")
#define SPECIES_WINGS_MOTH list("Megamoth","Mothra")
#define SPECIES_WINGS_JELLY list("Angel") //no actual slime wings present right now, but I'm making this in the event someone wants to sprite slime wings.
#define SPECIES_WINGS_ALL list("Angel","Dragon","Robotic","Fly","Skeleton","Megamoth","Mothra") //keep this updated
+4
View File
@@ -136,6 +136,10 @@
#define STATUS_EFFECT_INLOVE /datum/status_effect/in_love //Displays you as being in love with someone else, and makes hearts appear around them.
#define STATUS_EFFECT_OFFERING /datum/status_effect/offering // you are offering up an item to people
#define STATUS_EFFECT_HANDSHAKE /datum/status_effect/offering/secret_handshake // you are attempting to perform a secret Family handshake
/////////////
// SLIME //
/////////////
+31
View File
@@ -0,0 +1,31 @@
// All of these must be matched in StripMenu.js.
#define STRIPPABLE_ITEM_HEAD "head"
#define STRIPPABLE_ITEM_BACK "back"
#define STRIPPABLE_ITEM_MASK "mask"
#define STRIPPABLE_ITEM_NECK "neck"
#define STRIPPABLE_ITEM_EYES "eyes"
#define STRIPPABLE_ITEM_EARS "ears"
#define STRIPPABLE_ITEM_JUMPSUIT "jumpsuit"
#define STRIPPABLE_ITEM_SUIT "suit"
#define STRIPPABLE_ITEM_GLOVES "gloves"
#define STRIPPABLE_ITEM_FEET "shoes"
#define STRIPPABLE_ITEM_SUIT_STORAGE "suit_storage"
#define STRIPPABLE_ITEM_ID "id"
#define STRIPPABLE_ITEM_BELT "belt"
#define STRIPPABLE_ITEM_LPOCKET "left_pocket"
#define STRIPPABLE_ITEM_RPOCKET "right_pocket"
#define STRIPPABLE_ITEM_LHAND "left_hand"
#define STRIPPABLE_ITEM_RHAND "right_hand"
#define STRIPPABLE_ITEM_HANDCUFFS "handcuffs"
#define STRIPPABLE_ITEM_LEGCUFFS "legcuffs"
#define STRIPPABLE_ITEM_CORGI_COLLAR "corgi_collar"
#define STRIPPABLE_ITEM_PARROT_HEADSET "parrot_headset"
/// This slot is not obscured.
#define STRIPPABLE_OBSCURING_NONE 0
/// This slot is completely obscured, and cannot be accessed.
#define STRIPPABLE_OBSCURING_COMPLETELY 1
/// This slot can't be seen, but can be accessed.
#define STRIPPABLE_OBSCURING_HIDDEN 2
+10 -6
View File
@@ -29,10 +29,10 @@
* if the arguments to addtimer are the same as an existing timer, it doesn't create a new timer,
* and returns the id of the existing timer
*/
#define TIMER_UNIQUE (1<<0)
#define TIMER_UNIQUE (1<<0)
///For unique timers: Replace the old timer rather then not start this one
#define TIMER_OVERRIDE (1<<1)
#define TIMER_OVERRIDE (1<<1)
/**
* Timing should be based on how timing progresses on clients, not the server.
@@ -41,20 +41,23 @@
* should only be used in conjuction with things that have to progress client side, such as
* animate() or sound()
*/
#define TIMER_CLIENT_TIME (1<<2)
#define TIMER_CLIENT_TIME (1<<2)
///Timer can be stopped using deltimer()
#define TIMER_STOPPABLE (1<<3)
#define TIMER_STOPPABLE (1<<3)
///prevents distinguishing identical timers with the wait variable
///
///To be used with TIMER_UNIQUE
#define TIMER_NO_HASH_WAIT (1<<4)
#define TIMER_NO_HASH_WAIT (1<<4)
///Loops the timer repeatedly until qdeleted
///
///In most cases you want a subsystem instead, so don't use this unless you have a good reason
#define TIMER_LOOP (1<<5)
#define TIMER_LOOP (1<<5)
///Delete the timer on parent datum Destroy() and when deltimer'd
#define TIMER_DELETE_ME (1<<6)
///Empty ID define
#define TIMER_ID_NULL -1
@@ -189,6 +192,7 @@
#define FIRE_PRIORITY_CALLBACKS 600
// #define FIRE_PRIORITY_EXPLOSIONS 666
#define FIRE_PRIORITY_TIMER 700
#define FIRE_PRIORITY_SOUND_LOOPS 800
#define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
// SS runlevels
+5
View File
@@ -0,0 +1,5 @@
/// Prepares a text to be used for maptext. Use this so it doesn't look hideous.
#define MAPTEXT(text) {"<span class='maptext'>[##text]</span>"}
/// Macro from Lummox used to get height from a MeasureText proc
#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1))
+3
View File
@@ -104,6 +104,7 @@
#define TRAIT_RESISTCOLD "resist_cold"
#define TRAIT_RESISTHIGHPRESSURE "resist_high_pressure"
#define TRAIT_RESISTLOWPRESSURE "resist_low_pressure"
#define TRAIT_LOWPRESSURECOOLING "low_pressure_cooling"
#define TRAIT_BOMBIMMUNE "bomb_immunity"
#define TRAIT_RADIMMUNE "rad_immunity"
#define TRAIT_GENELESS "geneless"
@@ -121,6 +122,7 @@
#define TRAIT_ROBOTIC_ORGANISM "robotic_organism"
#define TRAIT_ROBOT_RADSHIELDING "robot_radshielding"
#define TRAIT_NOBREATH "no_breath"
#define TRAIT_AUXILIARY_LUNGS "auxiliary_lungs" //Lungs not neccessary required due to nobreath, but provides some other helpful function.
#define TRAIT_ANTIMAGIC "anti_magic"
#define TRAIT_HOLY "holy"
#define TRAIT_DEPRESSION "depression"
@@ -200,6 +202,7 @@
#define TRAIT_FRIENDLY "friendly"
#define TRAIT_SNOB "snob"
#define TRAIT_MULTILINGUAL "multilingual"
#define TRAIT_HEARING_SENSITIVE "hearing_sensitive"
#define TRAIT_CULT_EYES "cult_eyes"
#define TRAIT_AUTO_CATCH_ITEM "auto_catch_item"
#define TRAIT_CLOWN_MENTALITY "clown_mentality" // The future is now, clownman.
+10
View File
@@ -0,0 +1,10 @@
// These are used in uplink_devices.dm to determine whether or not an item is purchasable.
/// This item is purchasable to traitors
#define UPLINK_TRAITORS (1 << 0)
/// This item is purchasable to nuke ops
#define UPLINK_NUKE_OPS (1 << 1)
/// This item is purchasable to clown ops
#define UPLINK_CLOWN_OPS (1 << 2)
+3
View File
@@ -5,6 +5,9 @@
#define HIGHEST_MEDIAN_VOTING "HIGHEST_MEDIAN"
#define INSTANT_RUNOFF_VOTING "IRV"
#define VOTE_TRANSFER "Initiate Crew Transfer"
#define VOTE_CONTINUE "Continue Playing"
#define SHOW_RESULTS (1<<0)
#define SHOW_VOTES (1<<1)
#define SHOW_WINNER (1<<2)
-209
View File
@@ -1,209 +0,0 @@
/*
A Star pathfinding algorithm
Returns a list of tiles forming a path from A to B, taking dense objects as well as walls, and the orientation of
windows along the route into account.
Use:
your_list = AStar(start location, end location, moving atom, distance proc, max nodes, maximum node depth, minimum distance to target, adjacent proc, atom id, turfs to exclude, check only simulated)
Optional extras to add on (in order):
Distance proc : the distance used in every A* calculation (length of path and heuristic)
MaxNodes: The maximum number of nodes the returned path can be (0 = infinite)
Maxnodedepth: The maximum number of nodes to search (default: 30, 0 = infinite)
Mintargetdist: Minimum distance to the target before path returns, could be used to get
near a target, but not right to it - for an AI mob with a gun, for example.
Adjacent proc : returns the turfs to consider around the actually processed node
Simulated only : whether to consider unsimulated turfs or not (used by some Adjacent proc)
Also added 'exclude' turf to avoid travelling over; defaults to null
Actual Adjacent procs :
/turf/proc/reachableAdjacentTurfs : returns reachable turfs in cardinal directions (uses simulated_only)
/turf/proc/reachableAdjacentAtmosTurfs : returns turfs in cardinal directions reachable via atmos
*/
#define PF_TIEBREAKER 0.005
//tiebreker weight.To help to choose between equal paths
//////////////////////
//datum/PathNode object
//////////////////////
#define MASK_ODD 85
#define MASK_EVEN 170
//A* nodes variables
/datum/PathNode
var/turf/source //turf associated with the PathNode
var/datum/PathNode/prevNode //link to the parent PathNode
var/f //A* Node weight (f = g + h)
var/g //A* movement cost variable
var/h //A* heuristic variable
var/nt //count the number of Nodes traversed
var/bf //bitflag for dir to expand.Some sufficiently advanced motherfuckery
/datum/PathNode/New(s,p,pg,ph,pnt,_bf)
source = s
prevNode = p
g = pg
h = ph
f = g + h*(1+ PF_TIEBREAKER)
nt = pnt
bf = _bf
/datum/PathNode/proc/setp(p,pg,ph,pnt)
prevNode = p
g = pg
h = ph
f = g + h*(1+ PF_TIEBREAKER)
nt = pnt
/datum/PathNode/proc/calc_f()
f = g + h
//////////////////////
//A* procs
//////////////////////
//the weighting function, used in the A* algorithm
/proc/PathWeightCompare(datum/PathNode/a, datum/PathNode/b)
return a.f - b.f
//reversed so that the Heap is a MinHeap rather than a MaxHeap
/proc/HeapPathWeightCompare(datum/PathNode/a, datum/PathNode/b)
return b.f - a.f
//wrapper that returns an empty list if A* failed to find a path
/proc/get_path_to(caller, end, dist, maxnodes, maxnodedepth = 30, mintargetdist, adjacent = /turf/proc/reachableTurftest, id=null, turf/exclude=null, simulated_only = 1)
var/l = SSpathfinder.mobs.getfree(caller)
while(!l)
stoplag(3)
l = SSpathfinder.mobs.getfree(caller)
var/list/path = AStar(caller, end, dist, maxnodes, maxnodedepth, mintargetdist, adjacent,id, exclude, simulated_only)
SSpathfinder.mobs.found(l)
if(!path)
path = list()
return path
/proc/cir_get_path_to(caller, end, dist, maxnodes, maxnodedepth = 30, mintargetdist, adjacent = /turf/proc/reachableTurftest, id=null, turf/exclude=null, simulated_only = 1)
var/l = SSpathfinder.circuits.getfree(caller)
while(!l)
stoplag(3)
l = SSpathfinder.circuits.getfree(caller)
var/list/path = AStar(caller, end, dist, maxnodes, maxnodedepth, mintargetdist, adjacent,id, exclude, simulated_only)
SSpathfinder.circuits.found(l)
if(!path)
path = list()
return path
/proc/AStar(caller, _end, dist, maxnodes, maxnodedepth = 30, mintargetdist, adjacent = /turf/proc/reachableTurftest, id=null, turf/exclude=null, simulated_only = 1)
//sanitation
var/turf/end = get_turf(_end)
var/turf/start = get_turf(caller)
if(!start || !end)
stack_trace("Invalid A* start or destination")
return 0
if( start.z != end.z || start == end ) //no pathfinding between z levels
return 0
if(maxnodes)
//if start turf is farther than maxnodes from end turf, no need to do anything
if(call(start, dist)(end) > maxnodes)
return 0
maxnodedepth = maxnodes //no need to consider path longer than maxnodes
var/datum/Heap/open = new /datum/Heap(/proc/HeapPathWeightCompare) //the open list
var/list/openc = new() //open list for node check
var/list/path = null //the returned path, if any
//initialization
var/datum/PathNode/cur = new /datum/PathNode(start,null,0,call(start,dist)(end),0,15,1)//current processed turf
open.Insert(cur)
openc[start] = cur
//then run the main loop
while(!open.IsEmpty() && !path)
cur = open.Pop() //get the lower f turf in the open list
//get the lower f node on the open list
//if we only want to get near the target, check if we're close enough
var/closeenough
if(mintargetdist)
closeenough = call(cur.source,dist)(end) <= mintargetdist
//found the target turf (or close enough), let's create the path to it
if(cur.source == end || closeenough)
path = new()
path.Add(cur.source)
while(cur.prevNode)
cur = cur.prevNode
path.Add(cur.source)
break
//get adjacents turfs using the adjacent proc, checking for access with id
if((!maxnodedepth)||(cur.nt <= maxnodedepth))//if too many steps, don't process that path
for(var/i = 0 to 3)
var/f= 1<<i //get cardinal directions.1,2,4,8
if(cur.bf & f)
var/T = get_step(cur.source,f)
if(T != exclude)
var/datum/PathNode/CN = openc[T] //current checking turf
var/r=((f & MASK_ODD)<<1)|((f & MASK_EVEN)>>1) //getting reverse direction throught swapping even and odd bits.((f & 01010101)<<1)|((f & 10101010)>>1)
var/newg = cur.g + call(cur.source,dist)(T)
if(CN)
//is already in open list, check if it's a better way from the current turf
CN.bf &= 15^r //we have no closed, so just cut off exceed dir.00001111 ^ reverse_dir.We don't need to expand to checked turf.
if((newg < CN.g) )
if(call(cur.source,adjacent)(caller, T, id, simulated_only))
CN.setp(cur,newg,CN.h,cur.nt+1)
open.ReSort(CN)//reorder the changed element in the list
else
//is not already in open list, so add it
if(call(cur.source,adjacent)(caller, T, id, simulated_only))
CN = new(T,cur,newg,call(T,dist)(end),cur.nt+1,15^r)
open.Insert(CN)
openc[T] = CN
cur.bf = 0
CHECK_TICK
//reverse the path to get it from start to finish
if(path)
for(var/i = 1 to round(0.5*path.len))
path.Swap(i,path.len-i+1)
openc = null
//cleaning after us
return path
//Returns adjacent turfs in cardinal directions that are reachable
//simulated_only controls whether only simulated turfs are considered or not
/turf/proc/reachableAdjacentTurfs(caller, ID, simulated_only)
var/list/L = new()
var/turf/T
var/static/space_type_cache = typecacheof(/turf/open/space)
for(var/k in 1 to GLOB.cardinals.len)
T = get_step(src,GLOB.cardinals[k])
if(!T || (simulated_only && space_type_cache[T.type]))
continue
if(!T.density && !LinkBlockedWithAccess(T,caller, ID))
L.Add(T)
return L
/turf/proc/reachableTurftest(caller, var/turf/T, ID, simulated_only)
if(T && !T.density && !(simulated_only && SSpathfinder.space_type_cache[T.type]) && !LinkBlockedWithAccess(T,caller, ID))
return TRUE
//Returns adjacent turfs in cardinal directions that are reachable via atmos
/turf/proc/reachableAdjacentAtmosTurfs()
return atmos_adjacent_turfs
/turf/proc/LinkBlockedWithAccess(turf/T, caller, ID)
var/adir = get_dir(src, T)
var/rdir = ((adir & MASK_ODD)<<1)|((adir & MASK_EVEN)>>1)
for(var/obj/structure/window/W in src)
if(!W.CanAStarPass(ID, adir))
return 1
for(var/obj/machinery/door/window/W in src)
if(!W.CanAStarPass(ID, adir))
return 1
for(var/obj/O in T)
if(!O.CanAStarPass(ID, rdir, caller))
return 1
return 0
+103 -50
View File
@@ -1,32 +1,50 @@
/*
* Holds procs to help with list operations
* Contains groups:
* Misc
* Sorting
* Misc
* Sorting
*/
/*
* Misc
*/
#define LAZYINITLIST(L) if (!L) L = list()
#define LAZYINITLIST(L) if (!L) { L = list(); }
#define UNSETEMPTY(L) if (L && !length(L)) L = null
#define LAZYCOPY(L) (L ? L.Copy() : list() )
///Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled
#define LAZYLISTDUPLICATE(L) (L ? L.Copy() : null )
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } }
//ambition start
#define LAZYCUT(L, S, E) if((length(L) >= S) && (E == 0 || length(L) >= (E - 1))) { L.Cut(S, E); if(!length(L)) { L = null; } }
//ambition end
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
#define LAZYOR(L, I) if(!L) { L = list(); } L |= I;
#define LAZYFIND(L, V) (L ? L.Find(V) : 0)
///returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= length(L) ? L[I] : null) : L[I]) : null)
#define LAZYSET(L, K, V) if(!L) { L = list(); } L[K] = V;
#define LAZYLEN(L) length(L)
///This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)
#define LAZYADDASSOCLIST(L, K, V) if(!L) { L = list(); } L[K] += list(V);
//Sets a list to null
#define LAZYNULL(L) L = null
#define LAZYCLEARLIST(L) if(L) L.Cut()
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
#define reverseList(L) reverseRange(L.Copy())
#define LAZYADDASSOC_TG(L, K, V) if(!L) { L = list(); } L[K] += V;
///This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)
#define LAZYADDASSOC(L, K, V) if(!L) { L = list(); } L[K] += list(V);
#define LAZYREMOVEASSOC(L, K, V) if(L) { if(L[K]) { L[K] -= V; if(!length(L[K])) L -= K; } if(!length(L)) L = null; }
#define LAZYACCESSASSOC(L, I, K) L ? L[I] ? L[I][K] ? L[I][K] : null : null : null
#define QDEL_LAZYLIST(L) for(var/I in L) qdel(I); L = null;
//These methods don't null the list
#define LAZYCOPY(L) (L ? L.Copy() : list() ) //Use LAZYLISTDUPLICATE instead if you want it to null with no entries
#define LAZYCLEARLIST(L) if(L) L.Cut() // Consider LAZYNULL instead
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
#define reverseList(L) reverseRange(L.Copy())
/// Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.
#define LAZYORASSOCLIST(lazy_list, key, value) \
LAZYINITLIST(lazy_list); \
LAZYINITLIST(lazy_list[key]); \
lazy_list[key] |= value;
/// Passed into BINARY_INSERT to compare keys
#define COMPARE_KEY __BIN_LIST[__BIN_MID]
@@ -69,7 +87,7 @@
} while(FALSE)
//Returns a list in plain english as a string
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "")
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
var/total = length(input)
switch(total)
if (0)
@@ -92,6 +110,7 @@
/**
* English_list but associative supporting. Higher overhead.
* @depricated
*/
/proc/english_list_assoc(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "")
var/total = length(input)
@@ -119,6 +138,7 @@
return "[output][and_text][input[index]]"
//Returns list element or null. Should prevent "index out of bounds" error.
/// @depricated
/proc/listgetindex(list/L, index)
if(LAZYLEN(L))
if(isnum(index) && ISINTEGER(index))
@@ -129,17 +149,19 @@
return
//Return either pick(list) or null if list is not of type /list or is empty
/// @depricated
/proc/safepick(list/L)
if(LAZYLEN(L))
return pick(L)
//Checks if the list is empty
/// @depricated
/proc/isemptylist(list/L)
if(!L.len)
return TRUE
return FALSE
//Checks for specific types in a list
//Checks for specific types in a listc
/proc/is_type_in_list(atom/A, list/L)
if(!LAZYLEN(L) || !A)
return FALSE
@@ -180,43 +202,45 @@
/proc/typecache_filter_list_reverse(list/atoms, list/typecache)
RETURN_TYPE(/list)
. = list()
for(var/atom/A as anything in atoms)
if(!typecache[A.type])
. += A
for(var/atom/atom as anything in atoms)
if(!typecache[atom.type])
. += atom
/proc/typecache_filter_multi_list_exclusion(list/atoms, list/typecache_include, list/typecache_exclude)
. = list()
for(var/atom/A as anything in atoms)
if(typecache_include[A.type] && !typecache_exclude[A.type])
. += A
for(var/atom/atom as anything in atoms)
if(typecache_include[atom.type] && !typecache_exclude[atom.type])
. += atom
//Like typesof() or subtypesof(), but returns a typecache instead of a list
///Like typesof() or subtypesof(), but returns a typecache instead of a list
/proc/typecacheof(path, ignore_root_path, only_root_path = FALSE)
if(ispath(path))
var/list/types = list()
var/list/types
var/list/output = list()
if(only_root_path)
types = list(path)
output[path] = TRUE
else
types = ignore_root_path ? subtypesof(path) : typesof(path)
var/list/L = list()
for(var/T in types)
L[T] = TRUE
return L
for(var/T in types)
output[T] = TRUE
return output
else if(islist(path))
var/list/pathlist = path
var/list/L = list()
var/list/output = list()
if(ignore_root_path)
for(var/P in pathlist)
for(var/T in subtypesof(P))
L[T] = TRUE
for(var/current_path in pathlist)
for(var/subtype in subtypesof(current_path))
output[subtype] = TRUE
return output
if(only_root_path)
for(var/current_path in pathlist)
output[current_path] = TRUE
else
for(var/P in pathlist)
if(only_root_path)
L[P] = TRUE
else
for(var/T in typesof(P))
L[T] = TRUE
return L
for(var/current_path in pathlist)
for(var/subpath in typesof(current_path))
output[subpath] = TRUE
return output
/proc/typecacheof_assoc_list(list/pathlist, ignore_root_path = FALSE)
. = list()
@@ -275,9 +299,10 @@
//Picks a random element from a list based on a weighting system:
//1. Adds up the total of weights for each element
//2. Gets the total from 0% to 100% of previous total value.
//2. Gets a number between 1 and that total
//3. For each element in the list, subtracts its weighting from that number
//4. If that makes the number 0 or less, return that element.
//Will output null sometimes if you use decimals (e.g. 0.1 instead of 10) as rand() uses integers, not floats
/proc/pickweight(list/L, base_weight = 1)
var/total = 0
var/item
@@ -286,12 +311,14 @@
L[item] = base_weight
total += L[item]
total = rand() * total
total = rand(base_weight, total)
for (item in L)
total -= L[item]
total -=L [item]
if (total <= 0)
return item
return null
/proc/pickweightAllowZero(list/L) //The original pickweight proc will sometimes pick entries with zero weight. I'm not sure if changing the original will break anything, so I left it be.
var/total = 0
var/item
@@ -363,13 +390,13 @@
//Results will have a length of quality
return results
//Pick a random element from the list and remove it from the list.
/// Pick a random element from the list and remove it from the list.
/proc/pick_n_take(list/L)
RETURN_TYPE(L[_].type)
if(L.len)
var/picked = rand(1,L.len)
. = L[picked]
L.Cut(picked,picked+1) //Cut is far more efficient that Remove()
L.Cut(picked,picked+1) //Cut is far more efficient that Remove()
//Pick a random element from the list by weight and remove it from the list.
//Result is returned as a list in the format list(key, value)
@@ -465,7 +492,7 @@
//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sortNames(list/L, order=1)
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
return sortTim(L.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
@@ -501,10 +528,12 @@
if (L[i] == val)
.++
/// Returns datum/data/record
/proc/find_record(field, value, list/L)
for(var/datum/data/record/R in L)
if(R.fields[field] == value)
return R
return null
//Move a single element from position fromIndex within a list, to position toIndex
@@ -514,10 +543,10 @@
//fromIndex and toIndex must be in the range [1,L.len+1]
//This will preserve associations ~Carnie
/proc/moveElement(list/L, fromIndex, toIndex)
if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move
if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move
return
if(fromIndex > toIndex)
++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one
++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one
L.Insert(toIndex, null)
L.Swap(fromIndex, toIndex)
@@ -529,10 +558,10 @@
//This will preserve associations ~Carnie
/proc/moveRange(list/L, fromIndex, toIndex, len=1)
var/distance = abs(toIndex - fromIndex)
if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements
if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements
if(fromIndex <= toIndex)
return //no need to move
fromIndex += len //we want to shift left instead of right
return //no need to move
fromIndex += len //we want to shift left instead of right
for(var/i=0, i<distance, ++i)
L.Insert(fromIndex, null)
@@ -552,7 +581,7 @@
//Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges ~Carnie
/proc/swapRange(list/L, fromIndex, toIndex, len=1)
var/distance = abs(toIndex - fromIndex)
if(len > distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements
if(len > distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements
if(fromIndex < toIndex)
toIndex += len
else
@@ -598,6 +627,12 @@
if(D.vars[varname] == value)
return D
//remove all nulls from a list
/proc/removeNullsFromList(list/L)
while(L.Remove(null))
continue
return L
//Copies a list, and all lists inside it recusively
//Does not copy any other reference type
/proc/deepCopyList(list/l)
@@ -630,11 +665,6 @@
used_key_list[input_key] = 1
return input_key
#if DM_VERSION > 514
#error Remie said that lummox was adding a way to get a lists
#error contents via list.values, if that is true remove this
#error otherwise, update the version and bug lummox
#endif
//Flattens a keyed list into a list of it's contents
/proc/flatten_list(list/key_list)
if(!islist(key_list))
@@ -711,6 +741,29 @@
ret += key
return ret
/proc/compare_list(list/l,list/d)
if(!islist(l) || !islist(d))
return FALSE
if(l.len != d.len)
return FALSE
for(var/i in 1 to l.len)
if(l[i] != d[i])
return FALSE
return TRUE
#define LAZY_LISTS_OR(left_list, right_list)\
( length(left_list)\
? length(right_list)\
? (left_list | right_list)\
: left_list.Copy()\
: length(right_list)\
? right_list.Copy()\
: null\
)
/proc/is_type_in_ref_list(path, list/L)
if(!ispath(path))//not a path
return
+17
View File
@@ -88,6 +88,19 @@
if (CONFIG_GET(flag/log_access))
WRITE_LOG(GLOB.world_game_log, "ACCESS: [text]")
/**
* Writes to a special log file if the log_suspicious_login config flag is set,
* which is intended to contain all logins that failed under suspicious circumstances.
*
* Mirrors this log entry to log_access when access_log_mirror is TRUE, so this proc
* doesn't need to be used alongside log_access and can replace it where appropriate.
*/
/proc/log_suspicious_login(text, access_log_mirror = TRUE)
if (CONFIG_GET(flag/log_suspicious_login))
WRITE_LOG(GLOB.world_suspicious_login_log, "SUSPICIOUS_ACCESS: [text]")
if(access_log_mirror)
log_access(text)
/proc/log_law(text)
if (CONFIG_GET(flag/log_law))
WRITE_LOG(GLOB.world_game_log, "LAW: [text]")
@@ -96,6 +109,10 @@
if (CONFIG_GET(flag/log_attack))
WRITE_LOG(GLOB.world_attack_log, "ATTACK: [text]")
/proc/log_victim(text)
if (CONFIG_GET(flag/log_victim))
WRITE_LOG(GLOB.world_victim_log, "VICTIM: [text]")
/proc/log_manifest(ckey, datum/mind/mind,mob/body, latejoin = FALSE)
if (CONFIG_GET(flag/log_manifest))
WRITE_LOG(GLOB.world_manifest_log, "[ckey] \\ [body.real_name] \\ [mind.assigned_role] \\ [mind.special_role ? mind.special_role : "NONE"] \\ [latejoin ? "LATEJOIN":"ROUNDSTART"]")
+3
View File
@@ -140,3 +140,6 @@ GLOBAL_VAR_INIT(cmp_field, "name")
/proc/cmp_typepaths_asc(A, B)
return sorttext("[B]","[A]")
/proc/cmp_playtime(list/A, list/B)
return A["playtime"] - B["playtime"]
+1 -1
View File
@@ -18,7 +18,7 @@
if(length(inhand_equipment))
for(var/path in inhand_equipment)
var/obj/item/I = new path
mannequin.equip_to_slot_if_possible(I, SLOT_HANDS, TRUE, TRUE, TRUE, TRUE)
mannequin.equip_to_slot_if_possible(I, ITEM_SLOT_HANDS, TRUE, TRUE, TRUE, TRUE)
var/icon/combined = new
+5 -1
View File
@@ -399,12 +399,16 @@
/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
if(!isobj(O))
O = new /atom/movable/screen/text()
O.maptext = maptext
O.maptext = MAPTEXT(maptext)
O.maptext_height = maptext_height
O.maptext_width = maptext_width
O.screen_loc = screen_loc
return O
/// Removes an image from a client's `.images`. Useful as a callback.
/proc/remove_image_from_client(image/image, client/remove_from)
remove_from?.images -= image
/proc/remove_images_from_clients(image/I, list/show_to)
for(var/client/C in show_to)
C.images -= I
-10
View File
@@ -86,16 +86,6 @@
// Keybindings
init_keybindings()
//Uplink Items
for(var/path in subtypesof(/datum/uplink_item))
var/datum/uplink_item/I = path
if(!initial(I.item)) //We add categories to a separate list.
GLOB.uplink_categories |= initial(I.category)
continue
GLOB.uplink_items += path
//(sub)typesof entries are listed by the order they are loaded in the code, so we'll have to rearrange them here.
GLOB.uplink_items = sortList(GLOB.uplink_items, /proc/cmp_uplink_items_dsc)
init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes)
INVOKE_ASYNC(GLOBAL_PROC, /proc/init_ref_coin_values) //so the current procedure doesn't sleep because of UNTIL()
+32 -27
View File
@@ -1,39 +1,45 @@
//////////////////////
//datum/Heap object
//datum/heap object
//////////////////////
/datum/Heap
/datum/heap
var/list/L
var/cmp
/datum/Heap/New(compare)
/datum/heap/New(compare)
L = new()
cmp = compare
/datum/Heap/proc/IsEmpty()
return !L.len
/datum/heap/Destroy(force, ...)
for(var/i in L) // because this is before the list helpers are loaded
qdel(i)
L = null
return ..()
//Insert and place at its position a new node in the heap
/datum/Heap/proc/Insert(atom/A)
/datum/heap/proc/is_empty()
return !length(L)
//insert and place at its position a new node in the heap
/datum/heap/proc/insert(atom/A)
L.Add(A)
Swim(L.len)
swim(length(L))
//removes and returns the first element of the heap
//(i.e the max or the min dependant on the comparison function)
/datum/Heap/proc/Pop()
if(!L.len)
/datum/heap/proc/pop()
if(!length(L))
return 0
. = L[1]
L[1] = L[L.len]
L.Cut(L.len)
if(L.len)
Sink(1)
L[1] = L[length(L)]
L.Cut(length(L))
if(length(L))
sink(1)
//Get a node up to its right position in the heap
/datum/Heap/proc/Swim(var/index)
/datum/heap/proc/swim(index)
var/parent = round(index * 0.5)
while(parent > 0 && (call(cmp)(L[index],L[parent]) > 0))
@@ -42,21 +48,21 @@
parent = round(index * 0.5)
//Get a node down to its right position in the heap
/datum/Heap/proc/Sink(var/index)
var/g_child = GetGreaterChild(index)
/datum/heap/proc/sink(index)
var/g_child = get_greater_child(index)
while(g_child > 0 && (call(cmp)(L[index],L[g_child]) < 0))
L.Swap(index,g_child)
index = g_child
g_child = GetGreaterChild(index)
g_child = get_greater_child(index)
//Returns the greater (relative to the comparison proc) of a node children
//or 0 if there's no child
/datum/Heap/proc/GetGreaterChild(var/index)
if(index * 2 > L.len)
/datum/heap/proc/get_greater_child(index)
if(index * 2 > length(L))
return 0
if(index * 2 + 1 > L.len)
if(index * 2 + 1 > length(L))
return index * 2
if(call(cmp)(L[index * 2],L[index * 2 + 1]) < 0)
@@ -65,12 +71,11 @@
return index * 2
//Replaces a given node so it verify the heap condition
/datum/Heap/proc/ReSort(atom/A)
/datum/heap/proc/resort(atom/A)
var/index = L.Find(A)
Swim(index)
Sink(index)
swim(index)
sink(index)
/datum/Heap/proc/List()
/datum/heap/proc/List()
. = L.Copy()
+1 -1
View File
@@ -992,7 +992,7 @@ world
letter = lowertext(letter)
var/image/text_image = new(loc = A)
text_image.maptext = "<font size = 4>[letter]</font>"
text_image.maptext = MAPTEXT("<font size = 4>[letter]</font>")
text_image.pixel_x = 7
text_image.pixel_y = 5
qdel(atom_icon)
@@ -1,85 +1,3 @@
/matrix/proc/TurnTo(old_angle, new_angle)
. = new_angle - old_angle
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
/atom/proc/SpinAnimation(speed = 10, loops = -1, clockwise = 1, segments = 3, parallel = TRUE)
if(!segments)
return
var/segment = 360/segments
if(!clockwise)
segment = -segment
var/list/matrices = list()
for(var/i in 1 to segments-1)
var/matrix/M = matrix(transform)
M.Turn(segment*i)
matrices += M
var/matrix/last = matrix(transform)
matrices += last
speed /= segments
if(parallel)
animate(src, transform = matrices[1], time = speed, loops , flags = ANIMATION_PARALLEL)
else
animate(src, transform = matrices[1], time = speed, loops)
for(var/i in 2 to segments) //2 because 1 is covered above
animate(transform = matrices[i], time = speed)
//doesn't have an object argument because this is "Stacking" with the animate call above
//3 billion% intentional
//Dumps the matrix data in format a-f
/matrix/proc/tolist()
. = list()
. += a
. += b
. += c
. += d
. += e
. += f
//Dumps the matrix data in a matrix-grid format
/*
a d 0
b e 0
c f 1
*/
/matrix/proc/togrid()
. = list()
. += a
. += d
. += 0
. += b
. += e
. += 0
. += c
. += f
. += 1
//The X pixel offset of this matrix
/matrix/proc/get_x_shift()
. = c
//The Y pixel offset of this matrix
/matrix/proc/get_y_shift()
. = f
/matrix/proc/get_x_skew()
. = b
/matrix/proc/get_y_skew()
. = d
//Skews a matrix in a particular direction
//Missing arguments are treated as no skew in that direction
//As Rotation is defined as a scale+skew, these procs will break any existing rotation
//Unless the result is multiplied against the current matrix
/matrix/proc/set_skew(x = 0, y = 0)
b = x
d = y
/////////////////////
// COLOUR MATRICES //
/////////////////////
@@ -114,12 +32,64 @@ list(0.393,0.349,0.272,0, 0.769,0.686,0.534,0, 0.189,0.168,0.131,0, 0,0,0,1, 0,0
return list(R + value,R,R,0, G,G + value,G,0, B,B,B + value,0, 0,0,0,1, 0,0,0,0)
/**
* Exxagerates or removes colors
*/
/proc/color_matrix_saturation_percent(percent)
if(percent == 0)
return color_matrix_identity()
percent = clamp(percent, -100, 100)
if(percent > 0)
percent *= 3
var/x = 1 + percent / 100
var/inv = 1 - x
var/R = LUMA_R * inv
var/G = LUMA_G * inv
var/B = LUMA_B * inv
return list(R + x,R,R, G,G + x,G, B,B,B + x)
//Changes distance colors have from rgb(127,127,127) grey
//1 is identity. 0 makes everything grey >1 blows out colors and greys
/proc/color_matrix_contrast(value)
var/add = (1 - value) / 2
return list(value,0,0,0, 0,value,0,0, 0,0,value,0, 0,0,0,1, add,add,add,0)
/**
* Exxagerates or removes brightness
*/
/proc/color_matrix_contrast_percent(percent)
var/static/list/delta_index = list(
0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11,
0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24,
0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42,
0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68,
0.71, 0.74, 0.77, 0.80, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98,
1.0, 1.06, 1.12, 1.18, 1.24, 1.30, 1.36, 1.42, 1.48, 1.54,
1.60, 1.66, 1.72, 1.78, 1.84, 1.90, 1.96, 2.0, 2.12, 2.25,
2.37, 2.50, 2.62, 2.75, 2.87, 3.0, 3.2, 3.4, 3.6, 3.8,
4.0, 4.3, 4.7, 4.9, 5.0, 5.5, 6.0, 6.5, 6.8, 7.0,
7.3, 7.5, 7.8, 8.0, 8.4, 8.7, 9.0, 9.4, 9.6, 9.8,
10.0)
percent = clamp(percent, -100, 100)
if(percent == 0)
return color_matrix_identity()
var/x = 0
if (percent < 0)
x = 127 + percent / 100 * 127;
else
x = percent % 1
if(x == 0)
x = delta_index[percent]
else
x = delta_index[percent] * (1-x) + delta_index[percent+1] * x//use linear interpolation for more granularity.
x = x * 127 + 127
var/mult = x / 127
var/add = 0.5 * (127-x) / 255
return list(mult,0,0, 0,mult,0, 0,0,mult, add,add,add)
//Moves all colors angle degrees around the color wheel while maintaining intensity of the color and not affecting greys
//0 is identity, 120 moves reds to greens, 240 moves reds to blues
/proc/color_matrix_rotate_hue(angle)
@@ -134,6 +104,26 @@ round(cos_inv_third+sqrt3_sin, 0.001), round(cos_inv_third-sqrt3_sin, 0.001), ro
0,0,0,1,
0,0,0,0)
/**
* Moves all colors angle degrees around the color wheel while maintaining intensity of the color and not affecting whites
* TODO: Need a version that only affects one color (ie shift red to blue but leave greens and blues alone)
*/
/proc/color_matrix_rotation(angle)
if(angle == 0)
return color_matrix_identity()
angle = clamp(angle, -180, 180)
var/cos = cos(angle)
var/sin = sin(angle)
var/constA = 0.143
var/constB = 0.140
var/constC = -0.283
return list(
LUMA_R + cos * (1-LUMA_R) + sin * -LUMA_R, LUMA_R + cos * -LUMA_R + sin * constA, LUMA_R + cos * -LUMA_R + sin * -(1-LUMA_R),
LUMA_G + cos * -LUMA_G + sin * -LUMA_G, LUMA_G + cos * (1-LUMA_G) + sin * constB, LUMA_G + cos * -LUMA_G + sin * LUMA_G,
LUMA_B + cos * -LUMA_B + sin * (1-LUMA_B), LUMA_B + cos * -LUMA_B + sin * constC, LUMA_B + cos * (1-LUMA_B) + sin * LUMA_B
)
//These next three rotate values about one axis only
//x is the red axis, y is the green axis, z is the blue axis.
/proc/color_matrix_rotate_x(angle)
@@ -183,3 +173,9 @@ round(cos_inv_third+sqrt3_sin, 0.001), round(cos_inv_third-sqrt3_sin, 0.001), ro
*/
/proc/rgb_construct_color_matrix(rr = 1, rg, rb, gr, gg = 1, gb, br, bg, bb = 1, cr, cg, cb)
return list(rr, rg, rb, gr, gg, gb, br, bg, bb, cr, cg, cb)
/**
* Assembles a color matrix, defaulting to identity
*/
/proc/rgba_construct_color_matrix(rr = 1, rg, rb, ra, gr, gg = 1, gb, ga, br, bg, bb = 1, ba, ar, ag, ab, aa = 1, cr, cg, cb, ca)
return list(rr, rg, rb, ra, gr, gg, gb, ga, br, bg, bb, ba, ar, ag, ab, aa, cr, cg, cb, ca)
@@ -0,0 +1,86 @@
/matrix/proc/TurnTo(old_angle, new_angle)
. = new_angle - old_angle
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
/atom/proc/SpinAnimation(speed = 10, loops = -1, clockwise = 1, segments = 3, parallel = TRUE)
if(!segments)
return
var/segment = 360/segments
if(!clockwise)
segment = -segment
var/list/matrices = list()
for(var/i in 1 to segments-1)
var/matrix/M = matrix(transform)
M.Turn(segment*i)
matrices += M
var/matrix/last = matrix(transform)
matrices += last
speed /= segments
if(parallel)
animate(src, transform = matrices[1], time = speed, loops , flags = ANIMATION_PARALLEL)
else
animate(src, transform = matrices[1], time = speed, loops)
for(var/i in 2 to segments) //2 because 1 is covered above
animate(transform = matrices[i], time = speed)
//doesn't have an object argument because this is "Stacking" with the animate call above
//3 billion% intentional
//Dumps the matrix data in format a-f
/matrix/proc/tolist()
. = list()
. += a
. += b
. += c
. += d
. += e
. += f
//Dumps the matrix data in a matrix-grid format
/*
a d 0
b e 0
c f 1
*/
/matrix/proc/togrid()
. = list()
. += a
. += d
. += 0
. += b
. += e
. += 0
. += c
. += f
. += 1
//The X pixel offset of this matrix
/matrix/proc/get_x_shift()
. = c
//The Y pixel offset of this matrix
/matrix/proc/get_y_shift()
. = f
/matrix/proc/get_x_skew()
. = b
/matrix/proc/get_y_skew()
. = d
//Skews a matrix in a particular direction
//Missing arguments are treated as no skew in that direction
//As Rotation is defined as a scale+skew, these procs will break any existing rotation
//Unless the result is multiplied against the current matrix
/matrix/proc/set_skew(x = 0, y = 0)
b = x
d = y
/**
* constructs a transform matrix, defaulting to identity
*/
/proc/transform_matrix_construct(a = 1, b, c, d = 1, e, f)
return matrix(a, b, c, d, e, f)
+15
View File
@@ -458,6 +458,21 @@ GLOBAL_LIST_EMPTY(species_datums)
if(!HAS_TRAIT(L, TRAIT_PASSTABLE))
L.pass_flags &= ~PASSTABLE
/proc/dance_rotate(atom/movable/AM, datum/callback/callperrotate, set_original_dir=FALSE)
set waitfor = FALSE
var/originaldir = AM.dir
for(var/i in list(NORTH,SOUTH,EAST,WEST,EAST,SOUTH,NORTH,SOUTH,EAST,WEST,EAST,SOUTH))
if(!AM)
return
AM.setDir(i)
callperrotate?.Invoke()
sleep(1)
if(set_original_dir)
AM.setDir(originaldir)
/// Gets the client of the mob, allowing for mocking of the client.
/// You only need to use this if you know you're going to be mocking clients somewhere else.
#define GET_CLIENT(mob) (##mob.client || ##mob.mock_client)
//check if the person is dead, not sure where to put this
#define IS_DEAD_OR_INCAP(source) (source.incapacitated() || source.stat)
+359
View File
@@ -0,0 +1,359 @@
/**
* This file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips
* over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals
* cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal.
*/
/**
* This is the proc you use whenever you want to have pathfinding more complex than "try stepping towards the thing".
* If no path was found, returns an empty list, which is important for bots like medibots who expect an empty list rather than nothing.
*
* Arguments:
* * caller: The movable atom that's trying to find the path
* * end: What we're trying to path to. It doesn't matter if this is a turf or some other atom, we're gonna just path to the turf it's on anyway
* * max_distance: The maximum number of steps we can take in a given path to search (default: 30, 0 = infinite)
* * mintargetdistance: Minimum distance to the target before path returns, could be used to get near a target, but not right to it - for an AI mob with a gun, for example.
* * id: An ID card representing what access we have and what doors we can open. Its location relative to the pathing atom is irrelevant
* * simulated_only: Whether we consider turfs without atmos simulation (AKA do we want to ignore space)
* * exclude: If we want to avoid a specific turf, like if we're a mulebot who already got blocked by some turf
* * skip_first: Whether or not to delete the first item in the path. This would be done because the first item is the starting tile, which can break movement for some creatures.
*/
/proc/get_path_to(caller, end, max_distance = 30, mintargetdist, id=null, simulated_only = TRUE, turf/exclude, skip_first=TRUE)
if(!caller || !get_turf(end))
return
var/l = SSpathfinder.mobs.getfree(caller)
while(!l)
stoplag(3)
l = SSpathfinder.mobs.getfree(caller)
var/list/path
var/datum/pathfind/pathfind_datum = new(caller, end, id, max_distance, mintargetdist, simulated_only, exclude)
path = pathfind_datum.search()
qdel(pathfind_datum)
SSpathfinder.mobs.found(l)
if(!path)
path = list()
if(length(path) > 0 && skip_first)
path.Cut(1,2)
return path
/**
* A helper macro to see if it's possible to step from the first turf into the second one, minding things like door access and directional windows.
* Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum.
* If you really want to optimize things, optimize this, cuz this gets called a lot.
*/
#define CAN_STEP(cur_turf, next) (next && !next.density && cur_turf.Adjacent(next) && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid))
/// Another helper macro for JPS, for telling when a node has forced neighbors that need expanding
#define STEP_NOT_HERE_BUT_THERE(cur_turf, dirA, dirB) ((!CAN_STEP(cur_turf, get_step(cur_turf, dirA)) && CAN_STEP(cur_turf, get_step(cur_turf, dirB))))
/// The JPS Node datum represents a turf that we find interesting enough to add to the open list and possibly search for new tiles from
/datum/jps_node
/// The turf associated with this node
var/turf/tile
/// The node we just came from
var/datum/jps_node/previous_node
/// The A* node weight (f_value = number_of_tiles + heuristic)
var/f_value
/// The A* node heuristic (a rough estimate of how far we are from the goal)
var/heuristic
/// How many steps it's taken to get here from the start (currently pulling double duty as steps taken & cost to get here, since all moves incl diagonals cost 1 rn)
var/number_tiles
/// How many steps it took to get here from the last node
var/jumps
/// Nodes store the endgoal so they can process their heuristic without a reference to the pathfind datum
var/turf/node_goal
/datum/jps_node/New(turf/our_tile, datum/jps_node/incoming_previous_node, jumps_taken, turf/incoming_goal)
tile = our_tile
jumps = jumps_taken
if(incoming_goal) // if we have the goal argument, this must be the first/starting node
node_goal = incoming_goal
else if(incoming_previous_node) // if we have the parent, this is from a direct lateral/diagonal scan, we can fill it all out now
previous_node = incoming_previous_node
number_tiles = previous_node.number_tiles + jumps
node_goal = previous_node.node_goal
heuristic = get_dist(tile, node_goal)
f_value = number_tiles + heuristic
// otherwise, no parent node means this is from a subscan lateral scan, so we just need the tile for now until we call [datum/jps/proc/update_parent] on it
/datum/jps_node/Destroy(force, ...)
previous_node = null
return ..()
/datum/jps_node/proc/update_parent(datum/jps_node/new_parent)
previous_node = new_parent
node_goal = previous_node.node_goal
jumps = get_dist(tile, previous_node.tile)
number_tiles = previous_node.number_tiles + jumps
heuristic = get_dist(tile, node_goal)
f_value = number_tiles + heuristic
/// TODO: Macro this to reduce proc overhead
/proc/HeapPathWeightCompare(datum/jps_node/a, datum/jps_node/b)
return b.f_value - a.f_value
/// The datum used to handle the JPS pathfinding, completely self-contained
/datum/pathfind
/// The thing that we're actually trying to path for
var/atom/movable/caller
/// The turf where we started at
var/turf/start
/// The turf we're trying to path to (note that this won't track a moving target)
var/turf/end
/// The open list/stack we pop nodes out from (TODO: make this a normal list and macro-ize the heap operations to reduce proc overhead)
var/datum/heap/open
///An assoc list that serves as the closed list & tracks what turfs came from where. Key is the turf, and the value is what turf it came from
var/list/sources
/// The list we compile at the end if successful to pass back
var/list/path
// general pathfinding vars/args
/// An ID card representing what access we have and what doors we can open. Its location relative to the pathing atom is irrelevant
var/obj/item/card/id/id
/// How far away we have to get to the end target before we can call it quits
var/mintargetdist = 0
/// I don't know what this does vs , but they limit how far we can search before giving up on a path
var/max_distance = 30
/// Space is big and empty, if this is TRUE then we ignore pathing through unsimulated tiles
var/simulated_only
/// A specific turf we're avoiding, like if a mulebot is being blocked by someone t-posing in a doorway we're trying to get through
var/turf/avoid
/datum/pathfind/New(atom/movable/caller, atom/goal, id, max_distance, mintargetdist, simulated_only, avoid)
src.caller = caller
end = get_turf(goal)
open = new /datum/heap(/proc/HeapPathWeightCompare)
sources = new()
src.id = id
src.max_distance = max_distance
src.mintargetdist = mintargetdist
src.simulated_only = simulated_only
src.avoid = avoid
/**
* search() is the proc you call to kick off and handle the actual pathfinding, and kills the pathfind datum instance when it's done.
*
* If a valid path was found, it's returned as a list. If invalid or cross-z-level params are entered, or if there's no valid path found, we
* return null, which [/proc/get_path_to] translates to an empty list (notable for simple bots, who need empty lists)
*/
/datum/pathfind/proc/search()
start = get_turf(caller)
if(!start || !end)
stack_trace("Invalid A* start or destination")
return
if(start.z != end.z || start == end ) //no pathfinding between z levels
return
if(max_distance && (max_distance < get_dist(start, end))) //if start turf is farther than max_distance from end turf, no need to do anything
return
//initialization
var/datum/jps_node/current_processed_node = new (start, -1, 0, end)
open.insert(current_processed_node)
sources[start] = start // i'm sure this is fine
//then run the main loop
while(!open.is_empty() && !path)
if(!caller)
return
current_processed_node = open.pop() //get the lower f_value turf in the open list
if(max_distance && (current_processed_node.number_tiles > max_distance))//if too many steps, don't process that path
continue
var/turf/current_turf = current_processed_node.tile
for(var/scan_direction in list(EAST, WEST, NORTH, SOUTH))
lateral_scan_spec(current_turf, scan_direction, current_processed_node)
for(var/scan_direction in list(NORTHEAST, SOUTHEAST, NORTHWEST, SOUTHWEST))
diag_scan_spec(current_turf, scan_direction, current_processed_node)
CHECK_TICK
//we're done! reverse the path to get it from start to finish
if(path)
for(var/i = 1 to round(0.5 * length(path)))
path.Swap(i, length(path) - i + 1)
sources = null
qdel(open)
return path
/// Called when we've hit the goal with the node that represents the last tile, then sets the path var to that path so it can be returned by [datum/pathfind/proc/search]
/datum/pathfind/proc/unwind_path(datum/jps_node/unwind_node)
path = new()
var/turf/iter_turf = unwind_node.tile
path.Add(iter_turf)
while(unwind_node.previous_node)
var/dir_goal = get_dir(iter_turf, unwind_node.previous_node.tile)
for(var/i = 1 to unwind_node.jumps)
iter_turf = get_step(iter_turf,dir_goal)
path.Add(iter_turf)
unwind_node = unwind_node.previous_node
/**
* For performing lateral scans from a given starting turf.
*
* These scans are called from both the main search loop, as well as subscans for diagonal scans, and they treat finding interesting turfs slightly differently.
* If we're doing a normal lateral scan, we already have a parent node supplied, so we just create the new node and immediately insert it into the heap, ezpz.
* If we're part of a subscan, we still need for the diagonal scan to generate a parent node, so we return a node datum with just the turf and let the diag scan
* proc handle transferring the values and inserting them into the heap.
*
* Arguments:
* * original_turf: What turf did we start this scan at?
* * heading: What direction are we going in? Obviously, should be cardinal
* * parent_node: Only given for normal lateral scans, if we don't have one, we're a diagonal subscan.
*/
/datum/pathfind/proc/lateral_scan_spec(turf/original_turf, heading, datum/jps_node/parent_node)
var/steps_taken = 0
var/turf/current_turf = original_turf
var/turf/lag_turf = original_turf
while(TRUE)
if(path)
return
lag_turf = current_turf
current_turf = get_step(current_turf, heading)
steps_taken++
if(!CAN_STEP(lag_turf, current_turf))
return
if(current_turf == end || (mintargetdist && (get_dist(current_turf, end) <= mintargetdist)))
var/datum/jps_node/final_node = new(current_turf, parent_node, steps_taken)
sources[current_turf] = original_turf
if(parent_node) // if this is a direct lateral scan we can wrap up, if it's a subscan from a diag, we need to let the diag make their node first, then finish
unwind_path(final_node)
return final_node
else if(sources[current_turf]) // already visited, essentially in the closed list
return
else
sources[current_turf] = original_turf
if(parent_node && parent_node.number_tiles + steps_taken > max_distance)
return
var/interesting = FALSE // have we found a forced neighbor that would make us add this turf to the open list?
switch(heading)
if(NORTH)
if(STEP_NOT_HERE_BUT_THERE(current_turf, WEST, NORTHWEST) || STEP_NOT_HERE_BUT_THERE(current_turf, EAST, NORTHEAST))
interesting = TRUE
if(SOUTH)
if(STEP_NOT_HERE_BUT_THERE(current_turf, WEST, SOUTHWEST) || STEP_NOT_HERE_BUT_THERE(current_turf, EAST, SOUTHEAST))
interesting = TRUE
if(EAST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, NORTH, NORTHEAST) || STEP_NOT_HERE_BUT_THERE(current_turf, SOUTH, SOUTHEAST))
interesting = TRUE
if(WEST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, NORTH, NORTHWEST) || STEP_NOT_HERE_BUT_THERE(current_turf, SOUTH, SOUTHWEST))
interesting = TRUE
if(interesting)
var/datum/jps_node/newnode = new(current_turf, parent_node, steps_taken)
if(parent_node) // if we're a diagonal subscan, we'll handle adding ourselves to the heap in the diag
open.insert(newnode)
return newnode
/**
* For performing diagonal scans from a given starting turf.
*
* Unlike lateral scans, these only are called from the main search loop, so we don't need to worry about returning anything,
* though we do need to handle the return values of our lateral subscans of course.
*
* Arguments:
* * original_turf: What turf did we start this scan at?
* * heading: What direction are we going in? Obviously, should be diagonal
* * parent_node: We should always have a parent node for diagonals
*/
/datum/pathfind/proc/diag_scan_spec(turf/original_turf, heading, datum/jps_node/parent_node)
var/steps_taken = 0
var/turf/current_turf = original_turf
var/turf/lag_turf = original_turf
while(TRUE)
if(path)
return
lag_turf = current_turf
current_turf = get_step(current_turf, heading)
steps_taken++
if(!CAN_STEP(lag_turf, current_turf))
return
if(current_turf == end || (mintargetdist && (get_dist(current_turf, end) <= mintargetdist)))
var/datum/jps_node/final_node = new(current_turf, parent_node, steps_taken)
sources[current_turf] = original_turf
unwind_path(final_node)
return
else if(sources[current_turf]) // already visited, essentially in the closed list
return
else
sources[current_turf] = original_turf
if(parent_node.number_tiles + steps_taken > max_distance)
return
var/interesting = FALSE // have we found a forced neighbor that would make us add this turf to the open list?
var/datum/jps_node/possible_child_node // otherwise, did one of our lateral subscans turn up something?
switch(heading)
if(NORTHWEST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, EAST, NORTHEAST) || STEP_NOT_HERE_BUT_THERE(current_turf, SOUTH, SOUTHWEST))
interesting = TRUE
else
possible_child_node = (lateral_scan_spec(current_turf, WEST) || lateral_scan_spec(current_turf, NORTH))
if(NORTHEAST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, WEST, NORTHWEST) || STEP_NOT_HERE_BUT_THERE(current_turf, SOUTH, SOUTHEAST))
interesting = TRUE
else
possible_child_node = (lateral_scan_spec(current_turf, EAST) || lateral_scan_spec(current_turf, NORTH))
if(SOUTHWEST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, EAST, SOUTHEAST) || STEP_NOT_HERE_BUT_THERE(current_turf, NORTH, NORTHWEST))
interesting = TRUE
else
possible_child_node = (lateral_scan_spec(current_turf, SOUTH) || lateral_scan_spec(current_turf, WEST))
if(SOUTHEAST)
if(STEP_NOT_HERE_BUT_THERE(current_turf, WEST, SOUTHWEST) || STEP_NOT_HERE_BUT_THERE(current_turf, NORTH, NORTHEAST))
interesting = TRUE
else
possible_child_node = (lateral_scan_spec(current_turf, SOUTH) || lateral_scan_spec(current_turf, EAST))
if(interesting || possible_child_node)
var/datum/jps_node/newnode = new(current_turf, parent_node, steps_taken)
open.insert(newnode)
if(possible_child_node)
possible_child_node.update_parent(newnode)
open.insert(possible_child_node)
if(possible_child_node.tile == end || (mintargetdist && (get_dist(possible_child_node.tile, end) <= mintargetdist)))
unwind_path(possible_child_node)
return
/**
* For seeing if we can actually move between 2 given turfs while accounting for our access and the caller's pass_flags
*
* Arguments:
* * caller: The movable, if one exists, being used for mobility checks to see what tiles it can reach
* * ID: An ID card that decides if we can gain access to doors that would otherwise block a turf
* * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space?
*/
/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID)
var/actual_dir = get_dir(src, destination_turf)
for(var/obj/structure/window/iter_window in src)
if(!iter_window.CanAStarPass(ID, actual_dir))
return TRUE
for(var/obj/machinery/door/window/iter_windoor in src)
if(!iter_windoor.CanAStarPass(ID, actual_dir))
return TRUE
var/reverse_dir = get_dir(destination_turf, src)
for(var/obj/iter_object in destination_turf)
if(!iter_object.CanAStarPass(ID, reverse_dir, caller))
return TRUE
return FALSE
#undef CAN_STEP
#undef STEP_NOT_HERE_BUT_THERE
+6 -2
View File
@@ -57,13 +57,17 @@
SScommunications.send_message(M)
/proc/minor_announce(message, title = "Attention:", alert)
/proc/minor_announce(message, title = "Attention:", alert, html_encode = TRUE)
if(!message)
return
if (html_encode)
title = html_encode(title)
message = html_encode(message)
for(var/mob/M in GLOB.player_list)
if(!isnewplayer(M) && M.can_hear())
to_chat(M, "<span class='big bold'><font color = red>[html_encode(title)]</font color><BR>[html_encode(message)]</span><BR>")
to_chat(M, "[span_minorannounce("<font color = red>[title]</font color><BR>[message]")]<BR>")
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
if(alert)
SEND_SOUND(M, sound('sound/misc/notice1.ogg'))
+9 -9
View File
@@ -203,62 +203,62 @@
/mob/living/carbon/human/p_they(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_their(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_them(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_have(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_are(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_were(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_do(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_s(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
/mob/living/carbon/human/p_es(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
+17 -3
View File
@@ -1,4 +1,4 @@
// Ensure the frequency is within bounds of what it should be sending/receiving at
/// Ensure the frequency is within bounds of what it should be sending/receiving at
/proc/sanitize_frequency(frequency, free = FALSE)
frequency = round(frequency)
if(free)
@@ -8,12 +8,26 @@
if(!(. % 2)) // Ensure the last digit is an odd number
. += 1
// Format frequency by moving the decimal.
/// Format frequency by moving the decimal.
/proc/format_frequency(frequency)
frequency = text2num(frequency)
return "[round(frequency / 10)].[frequency % 10]"
//Opposite of format, returns as a number
///Opposite of format, returns as a number
/proc/unformat_frequency(frequency)
frequency = text2num(frequency)
return frequency * 10
///returns a random unused frequency between MIN_FREE_FREQ & MAX_FREE_FREQ if free = TRUE, and MIN_FREQ & MAX_FREQ if FALSE
/proc/return_unused_frequency(free = FALSE)
var/start = free ? MIN_FREE_FREQ : MIN_FREQ
var/end = free ? MAX_FREE_FREQ : MAX_FREQ
var/freq_to_check = 0
do
freq_to_check = rand(start, end)
if(!(freq_to_check % 2)) // Ensure the last digit is an odd number
freq_to_check++
while((freq_to_check == 0) || ("[freq_to_check]" in GLOB.reverseradiochannels))
return freq_to_check
+6 -2
View File
@@ -590,8 +590,8 @@
var/list/all_teams = list()
var/list/all_antagonists = list()
// for(var/datum/team/A in GLOB.antagonist_teams)
// all_teams |= A
for(var/datum/team/A in GLOB.antagonist_teams)
all_teams |= A
for(var/datum/antagonist/A in GLOB.antagonists)
if(!A.owner)
@@ -624,6 +624,10 @@
currrent_category = A.roundend_category
previous_category = A
result += A.roundend_report()
//ambition start
for(var/count in 1 to LAZYLEN(A.owner.ambitions))
result += "<br><B>Ambition #[count]</B>: [A.owner.ambitions[count]]"
//ambition end
result += "<br><br>"
CHECK_TICK
+22 -22
View File
@@ -412,25 +412,25 @@
/proc/slot2body_zone(slot)
switch(slot)
if(SLOT_BACK, SLOT_WEAR_SUIT, SLOT_W_UNIFORM, SLOT_BELT, SLOT_WEAR_ID)
if(ITEM_SLOT_BACK, ITEM_SLOT_OCLOTHING, ITEM_SLOT_ICLOTHING, ITEM_SLOT_BELT, ITEM_SLOT_ID)
return BODY_ZONE_CHEST
if(SLOT_GLOVES, SLOT_HANDS, SLOT_HANDCUFFED)
if(ITEM_SLOT_GLOVES, ITEM_SLOT_HANDS, ITEM_SLOT_HANDCUFFED)
return pick(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND)
if(SLOT_HEAD, SLOT_NECK, SLOT_NECK, SLOT_EARS)
if(ITEM_SLOT_HEAD, ITEM_SLOT_NECK, ITEM_SLOT_NECK, ITEM_SLOT_EARS)
return BODY_ZONE_HEAD
if(SLOT_WEAR_MASK)
if(ITEM_SLOT_MASK)
return BODY_ZONE_PRECISE_MOUTH
if(SLOT_GLASSES)
if(ITEM_SLOT_EYES)
return BODY_ZONE_PRECISE_EYES
if(SLOT_SHOES)
if(ITEM_SLOT_FEET)
return pick(BODY_ZONE_PRECISE_R_FOOT, BODY_ZONE_PRECISE_L_FOOT)
if(SLOT_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
//adapted from http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
@@ -591,9 +591,9 @@
switch(child)
if(/datum)
return null
if(/obj || /mob)
if(/obj, /mob)
return /atom/movable
if(/area || /turf)
if(/area, /turf)
return /atom
else
return /datum
@@ -652,31 +652,31 @@
/proc/slot_to_string(slot)
switch(slot)
if(SLOT_BACK)
if(ITEM_SLOT_BACK)
return "Backpack"
if(SLOT_WEAR_MASK)
if(ITEM_SLOT_MASK)
return "Mask"
if(SLOT_HANDS)
if(ITEM_SLOT_HANDS)
return "Hands"
if(SLOT_BELT)
if(ITEM_SLOT_BELT)
return "Belt"
if(SLOT_EARS)
if(ITEM_SLOT_EARS)
return "Ears"
if(SLOT_GLASSES)
if(ITEM_SLOT_EYES)
return "Glasses"
if(SLOT_GLOVES)
if(ITEM_SLOT_GLOVES)
return "Gloves"
if(SLOT_NECK)
if(ITEM_SLOT_NECK)
return "Neck"
if(SLOT_HEAD)
if(ITEM_SLOT_HEAD)
return "Head"
if(SLOT_SHOES)
if(ITEM_SLOT_FEET)
return "Shoes"
if(SLOT_WEAR_SUIT)
if(ITEM_SLOT_OCLOTHING)
return "Suit"
if(SLOT_W_UNIFORM)
if(ITEM_SLOT_ICLOTHING)
return "Uniform"
if(SLOT_IN_BACKPACK)
if(ITEM_SLOT_BACKPACK)
return "In backpack"
/proc/tg_ui_icon_to_cit_ui(ui_style)
+24 -13
View File
@@ -357,16 +357,27 @@ Turf and target are separate in case you want to teleport some distance from a t
if(M.ckey == key)
return M
//Returns the atom sitting on the turf.
//For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
//Optional arg 'type' to stop once it reaches a specific type instead of a turf.
/proc/get_atom_on_turf(atom/movable/M, stop_type)
var/atom/loc = M
while(loc && loc.loc && !isturf(loc.loc))
loc = loc.loc
if(stop_type && istype(loc, stop_type))
/**
* Returns the top-most atom sitting on the turf.
* For example, using this on a disk, which is in a bag, on a mob,
* will return the mob because it's on the turf.
*
* Arguments
* * something_in_turf - a movable within the turf, somewhere.
* * stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found).
**/
/proc/get_atom_on_turf(atom/movable/something_in_turf, stop_type)
if(!istype(something_in_turf))
CRASH("get_atom_on_turf was not passed an /atom/movable! Got [isnull(something_in_turf) ? "null":"type: [something_in_turf.type]"]")
var/atom/movable/topmost_thing = something_in_turf
while(topmost_thing?.loc && !isturf(topmost_thing.loc))
topmost_thing = topmost_thing.loc
if(stop_type && istype(topmost_thing, stop_type))
break
return loc
return topmost_thing
//Returns a list of all locations the target is within.
/proc/get_nested_locs(atom/movable/M, include_turf = FALSE)
@@ -663,10 +674,10 @@ Turf and target are separate in case you want to teleport some distance from a t
return locate(final_x, final_y, T.z)
//Finds the distance between two atoms, in pixels
//centered = 0 counts from turf edge to edge
//centered = 1 counts from turf center to turf center
//centered = FALSE counts from turf edge to edge
//centered = TRUE counts from turf center to turf center
//of course mathematically this is just adding world.icon_size on again
/proc/getPixelDistance(atom/A, atom/B, centered = 1)
/proc/getPixelDistance(atom/A, atom/B, centered = TRUE)
if(!istype(A)||!istype(B))
return 0
. = bounds_dist(A, B) + sqrt((((A.pixel_x+B.pixel_x)**2) + ((A.pixel_y+B.pixel_y)**2)))
@@ -1600,7 +1611,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
if(!iscarbon(target))
return TRUE
if(check_neck)
if(istype(target.get_item_by_slot(SLOT_NECK), /obj/item/clothing/neck/garlic_necklace))
if(istype(target.get_item_by_slot(ITEM_SLOT_NECK), /obj/item/clothing/neck/garlic_necklace))
return FALSE
if(check_blood)
if(target.reagents.has_reagent(/datum/reagent/consumable/garlic))
+1
View File
@@ -160,6 +160,7 @@ GLOBAL_LIST_INIT(bitfields, list(
"HOLOGRAM_1" = HOLOGRAM_1,
"SHOCKED_1" = SHOCKED_1,
"INITIALIZED_1" = INITIALIZED_1,
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
"ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1,
"BLOCK_FACE_ATOM_1" = BLOCK_FACE_ATOM_1,
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1
+7 -1
View File
@@ -216,7 +216,13 @@ GLOBAL_LIST_INIT(jumpsuitlist, list(PREF_SUIT, PREF_SKIRT))
#define UPLINK_PDA "PDA"
#define UPLINK_RADIO "Radio"
#define UPLINK_PEN "Pen" //like a real spy!
GLOBAL_LIST_INIT(uplink_spawn_loc_list, list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN))
#define UPLINK_IMPLANT "Implant"
#define UPLINK_IMPLANT_WITH_PRICE "[UPLINK_IMPLANT] (-[UPLINK_IMPLANT_TELECRYSTAL_COST] TC)"
// What we show to the user
GLOBAL_LIST_INIT(uplink_spawn_loc_list, list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN, UPLINK_IMPLANT_WITH_PRICE))
// What is actually saved; if the uplink implant price changes, it won't affect save files then
GLOBAL_LIST_INIT(uplink_spawn_loc_list_save, list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN, UPLINK_IMPLANT))
//List of cached alpha masked icons.
GLOBAL_LIST_EMPTY(alpha_masked_worn_icons)
+2
View File
@@ -52,6 +52,8 @@ GLOBAL_LIST_EMPTY(current_observers_list)
//Dynamic Port
GLOBAL_LIST_EMPTY(new_player_list) //all /mob/dead/new_player, in theory all should have clients and those that don't are in the process of spawning and get deleted when done.
//Family Port
GLOBAL_LIST_EMPTY(pre_setup_antags) //minds that have been picked as antag by the gamemode. removed as antag datums are set.
/proc/update_config_movespeed_type_lookup(update_mobs = TRUE)
// NOTE: This is entirely based on the fact that byond typesof/subtypesof gets longer/deeper paths before shallower ones.
+2 -1
View File
@@ -16,10 +16,11 @@ GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the stati
GLOBAL_LIST_EMPTY(grounding_rods) //list of all grounding rods on the station
GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
GLOBAL_LIST(drink_reactions_list) //list of all /datum/chemical_reaction datums where the output is of type /datum/reagent/consumable for bartender PDA
GLOBAL_LIST(normalized_chemical_reactions_list) //list of all /datum/chemical_reaction datums with actual sane indexing for chemistry PDA
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id.
GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path.
GLOBAL_LIST_EMPTY(uplink_items) //list of all uplink item typepaths, ascendingly sorted by their initial name.
GLOBAL_LIST_EMPTY(uplink_categories) //list of all uplink categories, listed by the order they are loaded in code. Be careful.
GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes
GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices.
+5
View File
@@ -2,12 +2,17 @@ GLOBAL_VAR(log_directory)
GLOBAL_PROTECT(log_directory)
GLOBAL_VAR(world_game_log)
GLOBAL_PROTECT(world_game_log)
/// Log associated with [/proc/log_suspicious_login()] - Intended to hold all logins that failed due to suspicious circumstances such as ban detection, CID randomisation etc.
GLOBAL_VAR(world_suspicious_login_log)
GLOBAL_PROTECT(world_suspicious_login_log)
GLOBAL_VAR(world_runtime_log)
GLOBAL_PROTECT(world_runtime_log)
GLOBAL_VAR(world_qdel_log)
GLOBAL_PROTECT(world_qdel_log)
GLOBAL_VAR(world_attack_log)
GLOBAL_PROTECT(world_attack_log)
GLOBAL_VAR(world_victim_log)
GLOBAL_PROTECT(world_victim_log)
// GLOBAL_VAR(world_econ_log)
// GLOBAL_PROTECT(world_econ_log)
GLOBAL_VAR(world_href_log)
+1
View File
@@ -0,0 +1 @@
GLOBAL_DATUM(changelog_tgui, /datum/changelog)
+2
View File
@@ -38,6 +38,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_RESISTCOLD" = TRAIT_RESISTCOLD,
"TRAIT_RESISTHIGHPRESSURE" = TRAIT_RESISTHIGHPRESSURE,
"TRAIT_RESISTLOWPRESSURE" = TRAIT_RESISTLOWPRESSURE,
"TRAIT_LOWPRESSURECOOLING" = TRAIT_LOWPRESSURECOOLING,
"TRAIT_BOMBIMMUNE" = TRAIT_BOMBIMMUNE,
"TRAIT_RADIMMUNE" = TRAIT_RADIMMUNE,
"TRAIT_GENELESS" = TRAIT_GENELESS,
@@ -55,6 +56,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_ROBOTIC_ORGANISM" = TRAIT_ROBOTIC_ORGANISM,
"TRAIT_ROBOT_RADSHIELDING" = TRAIT_ROBOT_RADSHIELDING,
"TRAIT_NOBREATH" = TRAIT_NOBREATH,
"TRAIT_AUXILIARY_LUNGS" = TRAIT_AUXILIARY_LUNGS,
"TRAIT_ANTIMAGIC" = TRAIT_ANTIMAGIC,
"TRAIT_HOLY" = TRAIT_HOLY,
"TRAIT_DEPRESSION" = TRAIT_DEPRESSION,
-45
View File
@@ -470,51 +470,6 @@
else
setDir(WEST, ismousemovement)
//debug
/atom/movable/screen/proc/scale_to(x1,y1)
if(!y1)
y1 = x1
var/matrix/M = new
M.Scale(x1,y1)
transform = M
/atom/movable/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = MOUSE_OPACITY_OPAQUE
screen_loc = "CENTER"
#define MAX_SAFE_BYOND_ICON_SCALE_TILES (MAX_SAFE_BYOND_ICON_SCALE_PX / world.icon_size)
#define MAX_SAFE_BYOND_ICON_SCALE_PX (33 * 32) //Not using world.icon_size on purpose.
/atom/movable/screen/click_catcher/proc/UpdateGreed(view_size_x = 15, view_size_y = 15)
var/icon/newicon = icon('icons/mob/screen_gen.dmi', "catcher")
var/ox = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_x)
var/oy = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_y)
var/px = view_size_x * world.icon_size
var/py = view_size_y * world.icon_size
var/sx = min(MAX_SAFE_BYOND_ICON_SCALE_PX, px)
var/sy = min(MAX_SAFE_BYOND_ICON_SCALE_PX, py)
newicon.Scale(sx, sy)
icon = newicon
screen_loc = "CENTER-[(ox-1)*0.5],CENTER-[(oy-1)*0.5]"
var/matrix/M = new
M.Scale(px/sx, py/sy)
transform = M
/atom/movable/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && iscarbon(usr))
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = params2turf(modifiers["screen-loc"], get_turf(usr.client ? usr.client.eye : usr), usr.client)
params += "&catcher=1"
if(T)
T.Click(location, control, params)
. = 1
/* MouseWheelOn */
/mob/proc/MouseWheelOn(atom/A, delta_x, delta_y, params)
+2 -3
View File
@@ -176,9 +176,6 @@
#define ui_ghost_mafia "SOUTH: 6, CENTER+2:24"
#define ui_ghost_spawners "SOUTH: 6, CENTER+1:24" // LEGACY. SAME LOC AS PAI
// #define ui_wanted_lvl "NORTH,11"
//UI position overrides for 1:1 screen layout. (default is 7:5)
#define ui_stamina "EAST-1:28,CENTER:17" // replacing internals button
#define ui_overridden_resist "EAST-3:24,SOUTH+1:7"
@@ -190,3 +187,5 @@
#define ui_boxarea "EAST-4:6,SOUTH+1:6"
#define ui_boxlang "EAST-5:22,SOUTH+1:6"
#define ui_boxvore "EAST-5:22,SOUTH+1:6"
#define ui_wanted_lvl "NORTH,11"
+130 -45
View File
@@ -2,9 +2,6 @@
//PUBLIC - call these wherever you want
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
/* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already
category is a text string. Each mob may only have one alert per category; the previous one will be replaced
path is a type path of the actual alert type to throw
@@ -14,6 +11,7 @@
Clicks are forwarded to master
Override makes it so the alert is not replaced until cleared by a clear_alert with clear_override, and it's used for hallucinations.
*/
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
if(!category || QDELETED(src))
return
@@ -42,7 +40,7 @@
thealert.override_alerts = override
if(override)
thealert.timeout = null
thealert.mob_viewer = src
thealert.owner = src
if(new_master)
var/old_layer = new_master.layer
@@ -97,8 +95,10 @@
var/severity = 0
var/alerttooltipstyle = ""
var/override_alerts = FALSE //If it is overriding other alerts of the same type
var/mob/mob_viewer //the mob viewing this alert
var/mob/owner //Alert owner
/// Boolean. If TRUE, the Click() proc will attempt to Click() on the master first if there is a master.
var/click_master = TRUE
/atom/movable/screen/alert/MouseEntered(location,control,params)
if(!QDELETED(src))
@@ -251,6 +251,8 @@ or something covering your eyes."
/atom/movable/screen/alert/mind_control/Click()
var/mob/living/L = usr
if(L != owner)
return
to_chat(L, "<span class='mind_control'>[command]</span>")
/atom/movable/screen/alert/hypnosis
@@ -271,7 +273,7 @@ If you're feeling frisky, examine yourself and click the underlined item to pull
icon_state = "embeddedobject"
/atom/movable/screen/alert/embeddedobject/Click()
if(isliving(usr))
if(isliving(usr) && usr == owner)
var/mob/living/carbon/M = usr
return M.help_shake_act(M)
@@ -300,7 +302,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
/atom/movable/screen/alert/fire/Click()
var/mob/living/L = usr
if(!istype(L) || !L.can_resist())
if(!istype(L) || !L.can_resist() || L != owner)
return
L.MarkResistTime()
if(CHECK_MOBILITY(L, MOBILITY_MOVE))
@@ -308,37 +310,110 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
/atom/movable/screen/alert/give // information set when the give alert is made
icon_state = "default"
var/mob/living/carbon/giver
var/mob/living/carbon/offerer
var/obj/item/receiving
/**
* Handles assigning most of the variables for the alert that pops up when an item is offered
*
* Handles setting the name, description and icon of the alert and tracking the person giving
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the giver
* Arguments:
* * taker - The person receiving the alert
* * giver - The person giving the alert and item
* * receiving - The item being given by the giver
*/
/atom/movable/screen/alert/give/proc/setup(mob/living/carbon/taker, mob/living/carbon/giver, obj/item/receiving)
name = "[giver] is offering [receiving]"
desc = "[giver] is offering [receiving]. Click this alert to take it."
* Handles assigning most of the variables for the alert that pops up when an item is offered
*
* Handles setting the name, description and icon of the alert and tracking the person giving
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the offerer
* Arguments:
* * taker - The person receiving the alert
* * offerer - The person giving the alert and item
* * receiving - The item being given by the offerer
*/
/atom/movable/screen/alert/give/proc/setup(mob/living/carbon/taker, mob/living/carbon/offerer, obj/item/receiving)
name = "[offerer] is offering [receiving]"
desc = "[offerer] is offering [receiving]. Click this alert to take it."
icon_state = "template"
cut_overlays()
add_overlay(receiving)
src.receiving = receiving
src.giver = giver
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/removeAlert)
/atom/movable/screen/alert/give/proc/removeAlert()
to_chat(usr, "<span class='warning'>You moved out of range of [giver]!</span>")
usr.clear_alert("[giver]")
src.offerer = offerer
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/check_in_range, override = TRUE) //Override to prevent runtimes when people offer a item multiple times
/atom/movable/screen/alert/give/Click(location, control, params)
. = ..()
var/mob/living/carbon/C = usr
C.take(giver, receiving)
if(!.)
return
if(!iscarbon(usr))
CRASH("User for [src] is of type \[[usr.type]\]. This should never happen.")
handle_transfer()
/// An overrideable proc used simply to hand over the item when claimed, this is a proc so that high-fives can override them since nothing is actually transferred
/atom/movable/screen/alert/give/proc/handle_transfer()
var/mob/living/carbon/taker = owner
taker.take(offerer, receiving)
/// Simply checks if the other person is still in range
/atom/movable/screen/alert/give/proc/check_in_range(atom/taker)
SIGNAL_HANDLER
if(!offerer.CanReach(taker))
to_chat(owner, span_warning("You moved out of range of [offerer]!"))
owner.clear_alert("[offerer]")
/atom/movable/screen/alert/give/highfive/setup(mob/living/carbon/taker, mob/living/carbon/offerer, obj/item/receiving)
. = ..()
name = "[offerer] is offering a high-five!"
desc = "[offerer] is offering a high-five! Click this alert to slap it."
RegisterSignal(offerer, COMSIG_PARENT_EXAMINE_MORE, .proc/check_fake_out)
/atom/movable/screen/alert/give/highfive/handle_transfer()
var/mob/living/carbon/taker = owner
if(receiving && (receiving in offerer.held_items))
receiving.on_offer_taken(offerer, taker)
return
too_slow_p1()
/// If the person who offered the high five no longer has it when we try to accept it, we get pranked hard
/atom/movable/screen/alert/give/highfive/proc/too_slow_p1()
var/mob/living/carbon/rube = owner
if(!rube || !offerer)
qdel(src)
return
offerer.visible_message(span_notice("[rube] rushes in to high-five [offerer], but-"), span_nicegreen("[rube] falls for your trick just as planned, lunging for a high-five that no longer exists! Classic!"), ignored_mobs=rube)
to_chat(rube, span_nicegreen("You go in for [offerer]'s high-five, but-"))
addtimer(CALLBACK(src, .proc/too_slow_p2, offerer, rube), 0.5 SECONDS)
/// Part two of the ultimate prank
/atom/movable/screen/alert/give/highfive/proc/too_slow_p2()
var/mob/living/carbon/rube = owner
if(!rube || !offerer)
qdel(src)
return
offerer.visible_message(span_danger("[offerer] pulls away from [rube]'s slap at the last second, dodging the high-five entirely!"), span_nicegreen("[rube] fails to make contact with your hand, making an utter fool of [rube.p_them()]self!"), span_hear("You hear a disappointing sound of flesh not hitting flesh!"), ignored_mobs=rube)
var/all_caps_for_emphasis = uppertext("NO! [offerer] PULLS [offerer.p_their()] HAND AWAY FROM YOURS! YOU'RE TOO SLOW!")
to_chat(rube, span_userdanger("[all_caps_for_emphasis]"))
playsound(offerer, 'sound/weapons/thudswoosh.ogg', 100, TRUE, 1)
rube.Knockdown(1 SECONDS)
SEND_SIGNAL(offerer, COMSIG_ADD_MOOD_EVENT, "high_five", /datum/mood_event/down_low)
SEND_SIGNAL(rube, COMSIG_ADD_MOOD_EVENT, "high_five", /datum/mood_event/too_slow)
qdel(src)
/// If someone examine_more's the offerer while they're trying to pull a too-slow, it'll tip them off to the offerer's trickster ways
/atom/movable/screen/alert/give/highfive/proc/check_fake_out(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER
if(!receiving)
examine_list += "[span_warning("[offerer]'s arm appears tensed up, as if [offerer.p_they()] plan on pulling it back suddenly...")]\n"
/// Families handshakes
/atom/movable/screen/alert/give/secret_handshake
icon_state = "default"
/atom/movable/screen/alert/give/secret_handshake/setup(mob/living/carbon/taker, mob/living/carbon/offerer, obj/item/receiving)
name = "[offerer] is offering a Handshake"
desc = "[offerer] wants to teach you the Secret Handshake for their Family and induct you! Click on this alert to accept."
icon_state = "template"
cut_overlays()
add_overlay(receiving)
src.receiving = receiving
src.offerer = offerer
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/check_in_range, override = TRUE) //Override to prevent runtimes when people offer a item multiple times
//ALIENS
@@ -393,10 +468,10 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
/atom/movable/screen/alert/bloodsense/process()
var/atom/blood_target
if(!mob_viewer.mind)
if(!owner.mind)
return
var/datum/antagonist/cult/antag = mob_viewer.mind.has_antag_datum(/datum/antagonist/cult,TRUE)
var/datum/antagonist/cult/antag = owner.mind.has_antag_datum(/datum/antagonist/cult,TRUE)
if(!antag?.cult_team)
return
var/datum/objective/sacrifice/sac_objective = locate() in antag.cult_team.objectives
@@ -433,7 +508,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
add_overlay(narnar)
return
var/turf/P = get_turf(blood_target)
var/turf/Q = get_turf(mob_viewer)
var/turf/Q = get_turf(owner)
if(!P || !Q || (P.z != Q.z)) //The target is on a different Z level, we cannot sense that far.
icon_state = "runed_sense2"
desc = "You can no longer sense your target's presence."
@@ -497,7 +572,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
for(var/mob/living/L in GLOB.alive_mob_list)
if(is_servant_of_ratvar(L))
servants++
var/datum/antagonist/clockcult/C = mob_viewer.mind.has_antag_datum(/datum/antagonist/clockcult,TRUE)
var/datum/antagonist/clockcult/C = owner.mind.has_antag_datum(/datum/antagonist/clockcult,TRUE)
if(C && C.clock_team)
textlist += "[C.clock_team.eminence ? "There is an Eminence." : "<b>There is no Eminence! Get one ASAP!</b>"]<br>"
textlist += "There are currently <b>[servants]</b> servant[servants > 1 ? "s" : ""] of Ratvar.<br>"
@@ -595,7 +670,7 @@ so as to remain in compliance with the most up-to-date laws."
var/atom/target = null
/atom/movable/screen/alert/hackingapc/Click()
if(!usr || !usr.client)
if(!usr || !usr.client || usr != owner)
return
if(!target)
return
@@ -621,7 +696,7 @@ so as to remain in compliance with the most up-to-date laws."
timeout = 300
/atom/movable/screen/alert/notify_cloning/Click()
if(!usr || !usr.client)
if(!usr || !usr.client || usr != owner)
return
var/mob/dead/observer/G = usr
G.reenter_corpse()
@@ -635,7 +710,7 @@ so as to remain in compliance with the most up-to-date laws."
var/action = NOTIFY_JUMP
/atom/movable/screen/alert/notify_action/Click()
if(!usr || !usr.client)
if(!usr || !usr.client || usr != owner)
return
if(!target)
return
@@ -669,14 +744,14 @@ so as to remain in compliance with the most up-to-date laws."
/atom/movable/screen/alert/restrained/Click()
var/mob/living/L = usr
if(!istype(L) || !L.can_resist())
if(!istype(L) || !L.can_resist() || L != owner)
return
L.MarkResistTime()
return L.resist_restraints()
/atom/movable/screen/alert/restrained/buckled/Click()
var/mob/living/L = usr
if(!istype(L) || !L.can_resist())
if(!istype(L) || !L.can_resist() || L != owner)
return
L.MarkResistTime()
return L.resist_buckle()
@@ -693,7 +768,7 @@ so as to remain in compliance with the most up-to-date laws."
/atom/movable/screen/alert/shoes/Click()
var/mob/living/carbon/C = usr
if(!istype(C) || !C.can_resist() || C != mob_viewer || !C.shoes)
if(!istype(C) || !C.can_resist() || C != owner || !C.shoes)
return
C.MarkResistTime()
C.shoes.handle_tying(C)
@@ -701,11 +776,14 @@ so as to remain in compliance with the most up-to-date laws."
// PRIVATE = only edit, use, or override these if you're editing the system as a whole
// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there
/datum/hud/proc/reorganize_alerts()
/datum/hud/proc/reorganize_alerts(mob/viewmob)
var/mob/screenmob = viewmob || mymob
if(!screenmob.client)
return
var/list/alerts = mymob.alerts
if(!hud_shown)
for(var/i = 1, i <= alerts.len, i++)
mymob.client.screen -= alerts[alerts[i]]
screenmob.client.screen -= alerts[alerts[i]]
return 1
for(var/i = 1, i <= alerts.len, i++)
var/atom/movable/screen/alert/alert = alerts[alerts[i]]
@@ -725,22 +803,29 @@ so as to remain in compliance with the most up-to-date laws."
else
. = ""
alert.screen_loc = .
mymob.client.screen |= alert
screenmob.client.screen |= alert
if(!viewmob)
for(var/M in mymob.observers)
reorganize_alerts(M)
return 1
/atom/movable/screen/alert/Click(location, control, params)
if(!usr || !usr.client)
return
return FALSE
if(usr != owner)
return FALSE
var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
to_chat(usr, "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>")
return
if(master)
return FALSE
if(master && click_master)
return usr.client.Click(master, location, control, params)
return TRUE
/atom/movable/screen/alert/Destroy()
. = ..()
severity = 0
master = null
mob_viewer = null
owner = null
screen_loc = ""
+1 -1
View File
@@ -117,7 +117,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
/datum/hud/alien/persistent_inventory_update()
+1 -1
View File
@@ -44,7 +44,7 @@
icon = I
parent = P
icon_state = credited
maptext = credited
maptext = MAPTEXT(credited)
maptext_x = world.icon_size + 8
maptext_y = (world.icon_size / 2) - 4
maptext_width = world.icon_size * 3
+3 -3
View File
@@ -8,7 +8,7 @@
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_storage
inv_box.slot_id = SLOT_GENERC_DEXTROUS_STORAGE
inv_box.slot_id = ITEM_SLOT_DEX_STORAGE
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -17,13 +17,13 @@
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_head
inv_box.slot_id = SLOT_HEAD
inv_box.slot_id = ITEM_SLOT_HEAD
static_inventory += inv_box
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
+27
View File
@@ -0,0 +1,27 @@
/atom/movable/screen/wanted
name = "Space Police Alertness"
desc = "Shows the current level of hostility the space police is planning to rain down on you. Better be careful."
icon = 'icons/obj/gang/wanted_160x32.dmi'
icon_state = "wanted_0"
screen_loc = ui_wanted_lvl
/// Wanted level, affects the hud icon. Level 0 is default, and the level 0 icon is blank, so in case of no families gamemode (and thus no wanted level), this HUD element will never appear.
level = 2
/// Boolean, have the cops arrived? If so, the icon stops changing and remains the same.
var/cops_arrived = 0
/atom/movable/screen/wanted/New()
return ..()
/atom/movable/screen/wanted/Initialize()
. = ..()
update_icon()
/atom/movable/screen/wanted/MouseEntered(location,control,params)
openToolTip(usr,src,params,title = name,content = desc, theme = "alerttooltipstyle")
/atom/movable/screen/wanted/MouseExited()
closeToolTip(usr)
/atom/movable/screen/wanted/update_icon_state()
. = ..()
icon_state = "wanted_[level][cops_arrived ? "_active" : ""]"
-186
View File
@@ -1,186 +0,0 @@
/mob/proc/overlay_fullscreen(category, type, severity)
var/atom/movable/screen/fullscreen/screen = screens[category]
if (!screen || screen.type != type)
// needs to be recreated
clear_fullscreen(category, FALSE)
screens[category] = screen = new type()
else if ((!severity || severity == screen.severity) && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view))
// doesn't need to be updated
return screen
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
if (client && screen.should_show_to(src))
screen.update_for_view(client.view)
client.screen += screen
return screen
/mob/proc/clear_fullscreen(category, animated = 10)
var/atom/movable/screen/fullscreen/screen = screens[category]
if(!screen)
return
screens -= category
if(animated)
animate(screen, alpha = 0, time = animated)
addtimer(CALLBACK(src, .proc/clear_fullscreen_after_animate, screen), animated, TIMER_CLIENT_TIME)
else
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreen_after_animate(atom/movable/screen/fullscreen/screen)
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreens()
for(var/category in screens)
clear_fullscreen(category)
/mob/proc/hide_fullscreens()
if(client)
for(var/category in screens)
client.screen -= screens[category]
/mob/proc/reload_fullscreen()
if(client)
var/atom/movable/screen/fullscreen/screen
for(var/category in screens)
screen = screens[category]
if(screen.should_show_to(src))
screen.update_for_view(client.view)
client.screen |= screen
else
client.screen -= screen
/atom/movable/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = FULLSCREEN_LAYER
plane = FULLSCREEN_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/view = 7
var/severity = 0
var/show_when_dead = FALSE
/atom/movable/screen/fullscreen/proc/update_for_view(client_view)
if (screen_loc == "CENTER-7,CENTER-7" && view != client_view)
var/list/actualview = getviewsize(client_view)
view = client_view
transform = matrix(actualview[1]/FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2]/FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)
/atom/movable/screen/fullscreen/proc/should_show_to(mob/mymob)
if(!show_when_dead && mymob.stat == DEAD)
return FALSE
return TRUE
/atom/movable/screen/fullscreen/Destroy()
severity = 0
. = ..()
/atom/movable/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/crit/vision
icon_state = "oxydamageoverlay"
layer = BLIND_LAYER
/atom/movable/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/curse
icon_state = "curse"
layer = CURSE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/impaired
icon_state = "impairedoverlay"
/atom/movable/screen/fullscreen/blurry
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "blurry"
/atom/movable/screen/fullscreen/flash
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/atom/movable/screen/fullscreen/flash/static
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"
/atom/movable/screen/fullscreen/high
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
/atom/movable/screen/fullscreen/color_vision
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
alpha = 80
/atom/movable/screen/fullscreen/color_vision/green
color = "#00ff00"
/atom/movable/screen/fullscreen/color_vision/red
color = "#ff0000"
/atom/movable/screen/fullscreen/color_vision/blue
color = "#0000ff"
/atom/movable/screen/fullscreen/cinematic_backdrop
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
plane = SPLASHSCREEN_PLANE
layer = SPLASHSCREEN_LAYER - 1
color = "#000000"
show_when_dead = TRUE
/atom/movable/screen/fullscreen/lighting_backdrop
icon = 'icons/mob/screen_gen.dmi'
icon_state = "flash"
transform = matrix(200, 0, 0, 0, 200, 0)
plane = LIGHTING_PLANE
blend_mode = BLEND_OVERLAY
show_when_dead = TRUE
//Provides darkness to the back of the lighting plane
/atom/movable/screen/fullscreen/lighting_backdrop/lit
invisibility = INVISIBILITY_LIGHTING
layer = BACKGROUND_LAYER+21
color = "#000"
show_when_dead = TRUE
//Provides whiteness in case you don't see lights so everything is still visible
/atom/movable/screen/fullscreen/lighting_backdrop/unlit
layer = BACKGROUND_LAYER+20
show_when_dead = TRUE
/atom/movable/screen/fullscreen/see_through_darkness
icon_state = "nightvision"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
blend_mode = BLEND_ADD
show_when_dead = TRUE
+1 -1
View File
@@ -60,7 +60,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
/datum/hud/dextrous/persistent_inventory_update()
+7
View File
@@ -93,3 +93,10 @@
screenmob.client.screen -= static_inventory
else
screenmob.client.screen += static_inventory
//We should only see observed mob alerts.
/datum/hud/ghost/reorganize_alerts(mob/viewmob)
var/mob/dead/observer/O = mymob
if (istype(O) && O.observetarget)
return
. = ..()
+1 -1
View File
@@ -43,7 +43,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.screen_loc = ui_id
inv_box.slot_id = SLOT_GENERC_DEXTROUS_STORAGE
inv_box.slot_id = ITEM_SLOT_DEX_STORAGE
static_inventory += inv_box
using = new /atom/movable/screen/guardian/Communicate()
+28 -3
View File
@@ -35,6 +35,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/atom/movable/screen/devil/soul_counter/devilsouldisplay
var/atom/movable/screen/synth/coolant_counter/coolant_display
var/atom/movable/screen/action_intent
var/atom/movable/screen/zone_select
var/atom/movable/screen/pull_icon
@@ -51,6 +53,22 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/list/hand_slots // /atom/movable/screen/inventory/hand objects, assoc list of "[held_index]" = object
var/list/atom/movable/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object
///UI for screentips that appear when you mouse over things
var/atom/movable/screen/screentip/screentip_text
/// Whether or not screentips are enabled.
/// This is updated by the preference for cheaper reads than would be
/// had with a proc call, especially on one of the hottest procs in the
/// game (MouseEntered).
var/screentips_enabled = TRUE
/// The color to use for the screentips.
/// This is updated by the preference for cheaper reads than would be
/// had with a proc call, especially on one of the hottest procs in the
/// game (MouseEntered).
var/screentip_color
var/atom/movable/screen/movable/action_button/hide_toggle/hide_actions_toggle
var/action_buttons_hidden = FALSE
@@ -58,6 +76,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/atom/movable/screen/healthdoll
var/atom/movable/screen/internals
var/atom/movable/screen/wanted/wanted_lvl
// subtypes can override this to force a specific UI style
var/ui_style
@@ -80,6 +99,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
plane_masters["[instance.plane]"] = instance
instance.backdrop(mymob)
screentip_text = new(null, src)
static_inventory += screentip_text
/datum/hud/Destroy()
if(mymob.hud_used == src)
mymob.hud_used = null
@@ -100,6 +122,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
healths = null
healthdoll = null
wanted_lvl = null
internals = null
lingchemdisplay = null
devilsouldisplay = null
@@ -112,6 +135,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
QDEL_LIST(screenoverlays)
mymob = null
QDEL_NULL(screentip_text)
return ..()
@@ -131,7 +156,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
return FALSE
screenmob.client.screen = list()
screenmob.client.apply_clickcatcher()
screenmob.client.update_clickcatcher()
var/display_hud_version = version
if(!display_hud_version) //If 0 or blank, display the next hud version
@@ -191,8 +216,6 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
persistent_inventory_update(screenmob)
screenmob.update_action_buttons(1)
reorganize_alerts()
screenmob.reload_fullscreen()
update_parallax_pref(screenmob)
// ensure observers get an accurate and up-to-date view
if (!viewmob)
@@ -202,6 +225,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
else if (viewmob.hud_used)
viewmob.hud_used.plane_masters_update()
screenmob.reload_rendering()
return TRUE
/datum/hud/proc/plane_masters_update()
+113 -17
View File
@@ -80,9 +80,101 @@
icon_state = "power_display"
screen_loc = ui_lingchemdisplay
#define ui_coolant_display "EAST,SOUTH+3:15"
/atom/movable/screen/synth
invisibility = INVISIBILITY_ABSTRACT
/atom/movable/screen/synth/proc/clear()
invisibility = INVISIBILITY_ABSTRACT
/atom/movable/screen/synth/proc/update_counter(mob/living/carbon/human/owner)
invisibility = 0
/atom/movable/screen/synth/coolant_counter
icon = 'icons/mob/screen_synth.dmi'
name = "Coolant System Readout"
icon_state = "coolant-3-1"
screen_loc = ui_coolant_display
var/jammed = 0
/atom/movable/screen/synth/coolant_counter/update_counter(mob/living/carbon/owner)
..()
var/valuecolor = "#ff2525"
if(owner.stat == DEAD)
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>ERR-0F</font></div>"
icon_state = "coolant-3-1"
return
var/coolant_efficiency
var/coolant
if(!jammed)
coolant_efficiency = owner.get_cooling_efficiency()
coolant = owner.blood_volume
else
coolant_efficiency = rand(1, 15) / 10
coolant = rand(1, 600)
jammed--
if(coolant > BLOOD_VOLUME_SAFE * owner.blood_ratio) //I unfortunately have to use this else-if stack because switch doesn't support variables.
valuecolor = "#4bbd34"
else if(coolant > BLOOD_VOLUME_OKAY * owner.blood_ratio)
valuecolor = "#dabb0d"
else if(coolant > BLOOD_VOLUME_BAD * owner.blood_ratio)
valuecolor = "#dd8109"
else if(coolant > BLOOD_VOLUME_SURVIVE * owner.blood_ratio)
valuecolor = "#e7520d"
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>[round((coolant / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 1)]</font></div>"
var/efficiency_suffix
var/state_suffix
switch(coolant_efficiency)
if(-INFINITY to 0.4)
efficiency_suffix = "1"
if(0.4 to 0.75)
efficiency_suffix = "2"
if(0.75 to 0.95)
efficiency_suffix = "3"
if(0.95 to 1.3)
efficiency_suffix = "4"
else
efficiency_suffix = "5"
var/obj/item/organ/lungs/ipc/L = owner.getorganslot(ORGAN_SLOT_LUNGS)
if(istype(L) && L.is_cooling)
state_suffix = "2"
else
state_suffix = "1"
icon_state = "coolant-[efficiency_suffix]-[state_suffix]"
/atom/movable/screen/synth/coolant_counter/examine(mob/user)
. = ..()
var/mob/living/carbon/human/owner = hud.mymob
if(owner.stat == DEAD)
return
var/coolant
var/total_efficiency
var/environ_efficiency
var/suitlink_efficiency
if(!jammed)
coolant = owner.blood_volume
total_efficiency = owner.get_cooling_efficiency()
environ_efficiency = owner.get_environment_cooling_efficiency()
suitlink_efficiency = owner.check_suitlinking()
else
coolant = rand(1, 600)
total_efficiency = rand(1, 15) / 10
environ_efficiency = rand(1, 20) / 10
. += "<span class='notice'>Performing internal cooling system diagnostics:</span>"
. += "<span class='notice'>Coolant level: [coolant] units, [round((coolant / (BLOOD_VOLUME_NORMAL * owner.blood_ratio)) * 100, 0.1)] percent</span>"
. += "<span class='notice'>Current Cooling Efficiency: [round(total_efficiency * 100, 0.1)] percent, [suitlink_efficiency ? "<font color='green'>active suitlink detected</font>, guaranteeing <font color='green'>[suitlink_efficiency * 100]%</font> environmental cooling efficiency." : "environment viability: [round(environ_efficiency * 100, 0.1)] percent."]</span>"
/atom/movable/screen/synth/coolant_counter/proc/jam(amount, cap = 20)
if(jammed > cap) //Preserve previous more impactful event.
return
jammed = min(jammed + amount, cap)
/datum/hud/human/New(mob/living/carbon/human/owner)
..()
owner.overlay_fullscreen("see_through_darkness", /atom/movable/screen/fullscreen/see_through_darkness)
owner.overlay_fullscreen("see_through_darkness", /atom/movable/screen/fullscreen/special/see_through_darkness)
var/widescreenlayout = FALSE //CIT CHANGE - adds support for different hud layouts depending on widescreen pref
if(owner.client && owner.client.prefs && owner.client.prefs.widescreenpref) //CIT CHANGE - ditto
@@ -141,7 +233,7 @@
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "i_clothing"
inv_box.icon = ui_style
inv_box.slot_id = SLOT_W_UNIFORM
inv_box.slot_id = ITEM_SLOT_ICLOTHING
inv_box.icon_state = "uniform"
inv_box.screen_loc = ui_iclothing
toggleable_inventory += inv_box
@@ -149,7 +241,7 @@
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "o_clothing"
inv_box.icon = ui_style
inv_box.slot_id = SLOT_WEAR_SUIT
inv_box.slot_id = ITEM_SLOT_OCLOTHING
inv_box.icon_state = "suit"
inv_box.screen_loc = ui_oclothing
toggleable_inventory += inv_box
@@ -175,7 +267,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "id"
inv_box.screen_loc = ui_id
inv_box.slot_id = SLOT_WEAR_ID
inv_box.slot_id = ITEM_SLOT_ID
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -183,7 +275,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "mask"
inv_box.screen_loc = ui_mask
inv_box.slot_id = SLOT_WEAR_MASK
inv_box.slot_id = ITEM_SLOT_MASK
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -191,7 +283,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "neck"
inv_box.screen_loc = ui_neck
inv_box.slot_id = SLOT_NECK
inv_box.slot_id = ITEM_SLOT_NECK
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -199,7 +291,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.screen_loc = ui_back
inv_box.slot_id = SLOT_BACK
inv_box.slot_id = ITEM_SLOT_BACK
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -207,7 +299,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = SLOT_L_STORE
inv_box.slot_id = ITEM_SLOT_LPOCKET
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -215,7 +307,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = SLOT_R_STORE
inv_box.slot_id = ITEM_SLOT_RPOCKET
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -223,7 +315,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = SLOT_S_STORE
inv_box.slot_id = ITEM_SLOT_SUITSTORE
static_inventory += inv_box
using = new /atom/movable/screen/resist()
@@ -256,7 +348,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
inv_box.screen_loc = ui_gloves
inv_box.slot_id = SLOT_GLOVES
inv_box.slot_id = ITEM_SLOT_GLOVES
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -264,7 +356,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
inv_box.screen_loc = ui_glasses
inv_box.slot_id = SLOT_GLASSES
inv_box.slot_id = ITEM_SLOT_EYES
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -272,7 +364,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "ears"
inv_box.screen_loc = ui_ears
inv_box.slot_id = SLOT_EARS
inv_box.slot_id = ITEM_SLOT_EARS
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -280,7 +372,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "head"
inv_box.screen_loc = ui_head
inv_box.slot_id = SLOT_HEAD
inv_box.slot_id = ITEM_SLOT_HEAD
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -288,7 +380,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
inv_box.screen_loc = ui_shoes
inv_box.slot_id = SLOT_SHOES
inv_box.slot_id = ITEM_SLOT_FEET
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -297,7 +389,7 @@
inv_box.icon_state = "belt"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_belt
inv_box.slot_id = SLOT_BELT
inv_box.slot_id = ITEM_SLOT_BELT
static_inventory += inv_box
throw_icon = new /atom/movable/screen/throw_catch()
@@ -359,6 +451,10 @@
sunlight_display.hud = src
infodisplay += sunlight_display
coolant_display = new /atom/movable/screen/synth/coolant_counter //Coolant & cooling efficiency readouts for Synths.
coolant_display.hud = src
infodisplay += coolant_display
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
@@ -368,7 +464,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
update_locked_slots()
+5 -5
View File
@@ -50,7 +50,7 @@
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = SLOT_WEAR_MASK
inv_box.slot_id = ITEM_SLOT_MASK
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -59,7 +59,7 @@
inv_box.icon_state = "neck"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_neck
inv_box.slot_id = SLOT_NECK
inv_box.slot_id = ITEM_SLOT_NECK
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -68,7 +68,7 @@
inv_box.icon_state = "head"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_head
inv_box.slot_id = SLOT_HEAD
inv_box.slot_id = ITEM_SLOT_HEAD
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
@@ -76,7 +76,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.screen_loc = ui_monkey_back
inv_box.slot_id = SLOT_BACK
inv_box.slot_id = ITEM_SLOT_BACK
static_inventory += inv_box
throw_icon = new /atom/movable/screen/throw_catch()
@@ -126,7 +126,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
/datum/hud/monkey/persistent_inventory_update()
-322
View File
@@ -1,322 +0,0 @@
/datum/hud/proc/create_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
if (!apply_parallax_pref(viewmob)) //don't want shit computers to crash when specing someone with insane parallax, so use the viewer's pref
return
if(!length(C.parallax_layers_cached))
C.parallax_layers_cached = list()
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_1(null, C.view)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_2(null, C.view)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/planet(null, C.view)
if(SSparallax.random_layer)
C.parallax_layers_cached += new SSparallax.random_layer
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_3(null, C.view)
C.parallax_layers = C.parallax_layers_cached.Copy()
if (length(C.parallax_layers) > C.parallax_layers_max)
C.parallax_layers.len = C.parallax_layers_max
C.screen |= (C.parallax_layers)
var/atom/movable/screen/plane_master/PM = screenmob.hud_used.plane_masters["[PLANE_SPACE]"]
if(screenmob != mymob)
C.screen -= locate(/atom/movable/screen/plane_master/parallax_white) in C.screen
C.screen += PM
PM.color = list(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0
)
/datum/hud/proc/remove_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
C.screen -= (C.parallax_layers_cached)
var/atom/movable/screen/plane_master/PM = screenmob.hud_used.plane_masters["[PLANE_SPACE]"]
if(screenmob != mymob)
C.screen -= locate(/atom/movable/screen/plane_master/parallax_white) in C.screen
C.screen += PM
PM.color = initial(PM.color)
C.parallax_layers = null
/datum/hud/proc/apply_parallax_pref(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
if(C.prefs)
var/pref = C.prefs.parallax
if (isnull(pref))
pref = PARALLAX_HIGH
switch(C.prefs.parallax)
if (PARALLAX_INSANE)
C.parallax_throttle = FALSE
C.parallax_layers_max = 5
return TRUE
if (PARALLAX_MED)
C.parallax_throttle = PARALLAX_DELAY_MED
C.parallax_layers_max = 3
return TRUE
if (PARALLAX_LOW)
C.parallax_throttle = PARALLAX_DELAY_LOW
C.parallax_layers_max = 1
return TRUE
if (PARALLAX_DISABLE)
return FALSE
//This is high parallax.
C.parallax_throttle = PARALLAX_DELAY_DEFAULT
C.parallax_layers_max = 4
return TRUE
/datum/hud/proc/update_parallax_pref(mob/viewmob)
remove_parallax(viewmob)
create_parallax(viewmob)
update_parallax()
// This sets which way the current shuttle is moving (returns true if the shuttle has stopped moving so the caller can append their animation)
/datum/hud/proc/set_parallax_movedir(new_parallax_movedir, skip_windups)
. = FALSE
var/client/C = mymob.client
if(new_parallax_movedir == C.parallax_movedir)
return
var/animatedir = new_parallax_movedir
if(new_parallax_movedir == FALSE)
var/animate_time = 0
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
L.icon_state = initial(L.icon_state)
L.update_o(C.view)
var/T = PARALLAX_LOOP_TIME / L.speed
if (T > animate_time)
animate_time = T
C.dont_animate_parallax = world.time + min(animate_time, PARALLAX_LOOP_TIME)
animatedir = C.parallax_movedir
var/matrix/newtransform
switch(animatedir)
if(NORTH)
newtransform = matrix(1, 0, 0, 0, 1, 480)
if(SOUTH)
newtransform = matrix(1, 0, 0, 0, 1,-480)
if(EAST)
newtransform = matrix(1, 0, 480, 0, 1, 0)
if(WEST)
newtransform = matrix(1, 0,-480, 0, 1, 0)
var/shortesttimer
if(!skip_windups)
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
var/T = PARALLAX_LOOP_TIME / L.speed
if (isnull(shortesttimer))
shortesttimer = T
if (T < shortesttimer)
shortesttimer = T
L.transform = newtransform
animate(L, transform = matrix(), time = T, easing = QUAD_EASING | (new_parallax_movedir ? EASE_IN : EASE_OUT), flags = ANIMATION_END_NOW)
if (new_parallax_movedir)
L.transform = newtransform
animate(transform = matrix(), time = T) //queue up another animate so lag doesn't create a shutter
C.parallax_movedir = new_parallax_movedir
if (C.parallax_animate_timer)
deltimer(C.parallax_animate_timer)
var/datum/callback/CB = CALLBACK(src, .proc/update_parallax_motionblur, C, animatedir, new_parallax_movedir, newtransform)
if(skip_windups)
CB.InvokeAsync()
else
C.parallax_animate_timer = addtimer(CB, min(shortesttimer, PARALLAX_LOOP_TIME), TIMER_CLIENT_TIME|TIMER_STOPPABLE)
/datum/hud/proc/update_parallax_motionblur(client/C, animatedir, new_parallax_movedir, matrix/newtransform)
if(!C)
return
C.parallax_animate_timer = FALSE
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
if (!new_parallax_movedir)
animate(L)
continue
var/newstate = initial(L.icon_state)
var/T = PARALLAX_LOOP_TIME / L.speed
if (newstate in icon_states(L.icon))
L.icon_state = newstate
L.update_o(C.view)
L.transform = newtransform
animate(L, transform = matrix(), time = T, loop = -1, flags = ANIMATION_END_NOW)
/datum/hud/proc/update_parallax()
var/client/C = mymob.client
var/turf/posobj = get_turf(C.eye)
if(!posobj)
return
var/area/areaobj = posobj.loc
// Update the movement direction of the parallax if necessary (for shuttles)
set_parallax_movedir(areaobj.parallax_movedir, FALSE)
var/force
if(!C.previous_turf || (C.previous_turf.z != posobj.z))
C.previous_turf = posobj
force = TRUE
if (!force && world.time < C.last_parallax_shift+C.parallax_throttle)
return
//Doing it this way prevents parallax layers from "jumping" when you change Z-Levels.
var/offset_x = posobj.x - C.previous_turf.x
var/offset_y = posobj.y - C.previous_turf.y
if(!offset_x && !offset_y && !force)
return
var/last_delay = world.time - C.last_parallax_shift
last_delay = min(last_delay, C.parallax_throttle)
C.previous_turf = posobj
C.last_parallax_shift = world.time
for(var/thing in C.parallax_layers)
var/atom/movable/screen/parallax_layer/L = thing
L.update_status(mymob)
if (L.view_sized != C.view)
L.update_o(C.view)
var/change_x
var/change_y
if(L.absolute)
L.offset_x = -(posobj.x - SSparallax.planet_x_offset) * L.speed
L.offset_y = -(posobj.y - SSparallax.planet_y_offset) * L.speed
else
change_x = offset_x * L.speed
L.offset_x -= change_x
change_y = offset_y * L.speed
L.offset_y -= change_y
if(L.offset_x > 240)
L.offset_x -= 480
if(L.offset_x < -240)
L.offset_x += 480
if(L.offset_y > 240)
L.offset_y -= 480
if(L.offset_y < -240)
L.offset_y += 480
if(!areaobj.parallax_movedir && C.dont_animate_parallax <= world.time && (offset_x || offset_y) && abs(offset_x) <= max(C.parallax_throttle/world.tick_lag+1,1) && abs(offset_y) <= max(C.parallax_throttle/world.tick_lag+1,1) && (round(abs(change_x)) > 1 || round(abs(change_y)) > 1))
L.transform = matrix(1, 0, offset_x*L.speed, 0, 1, offset_y*L.speed)
animate(L, transform=matrix(), time = last_delay)
L.screen_loc = "CENTER-7:[round(L.offset_x,1)],CENTER-7:[round(L.offset_y,1)]"
/atom/movable/proc/update_parallax_contents()
if(length(client_mobs_in_contents))
for(var/thing in client_mobs_in_contents)
var/mob/M = thing
if(M?.client && M.hud_used && length(M.client.parallax_layers))
M.hud_used.update_parallax()
/mob/proc/update_parallax_teleport() //used for arrivals shuttle
if(client?.eye && hud_used && length(client.parallax_layers))
var/area/areaobj = get_area(client.eye)
hud_used.set_parallax_movedir(areaobj.parallax_movedir, TRUE)
/atom/movable/screen/parallax_layer
icon = 'icons/effects/parallax.dmi'
var/speed = 1
var/offset_x = 0
var/offset_y = 0
var/view_sized
var/absolute = FALSE
blend_mode = BLEND_ADD
plane = PLANE_SPACE_PARALLAX
screen_loc = "CENTER-7,CENTER-7"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/atom/movable/screen/parallax_layer/Initialize(mapload, view)
. = ..()
if (!view)
view = world.view
update_o(view)
/atom/movable/screen/parallax_layer/proc/update_o(view)
if (!view)
view = world.view
var/list/viewscales = getviewsize(view)
var/countx = CEILING((viewscales[1]/2)/(480/world.icon_size), 1)+1
var/county = CEILING((viewscales[2]/2)/(480/world.icon_size), 1)+1
var/list/new_overlays = new
for(var/x in -countx to countx)
for(var/y in -county to county)
if(x == 0 && y == 0)
continue
var/mutable_appearance/texture_overlay = mutable_appearance(icon, icon_state)
texture_overlay.transform = matrix(1, 0, x*480, 0, 1, y*480)
new_overlays += texture_overlay
cut_overlays()
add_overlay(new_overlays)
view_sized = view
/atom/movable/screen/parallax_layer/proc/update_status(mob/M)
return
/atom/movable/screen/parallax_layer/layer_1
icon_state = "layer1"
speed = 0.6
layer = 1
/atom/movable/screen/parallax_layer/layer_2
icon_state = "layer2"
speed = 1
layer = 2
/atom/movable/screen/parallax_layer/layer_3
icon_state = "layer3"
speed = 1.4
layer = 3
/atom/movable/screen/parallax_layer/random
blend_mode = BLEND_OVERLAY
speed = 3
layer = 3
/atom/movable/screen/parallax_layer/random/space_gas
icon_state = "space_gas"
/atom/movable/screen/parallax_layer/random/space_gas/Initialize(mapload, view)
. = ..()
src.add_atom_colour(SSparallax.random_parallax_color, ADMIN_COLOUR_PRIORITY)
/atom/movable/screen/parallax_layer/random/asteroids
icon_state = "asteroids"
/atom/movable/screen/parallax_layer/planet
icon_state = "planet"
blend_mode = BLEND_OVERLAY
absolute = TRUE //Status of seperation
speed = 3
layer = 30
/atom/movable/screen/parallax_layer/planet/update_status(mob/M)
var/client/C = M.client
var/turf/posobj = get_turf(C.eye)
if(!posobj)
return
invisibility = is_station_level(posobj.z) ? 0 : INVISIBILITY_ABSTRACT
/atom/movable/screen/parallax_layer/planet/update_o()
return //Shit won't move
+4 -5
View File
@@ -124,8 +124,8 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/atom/movable/screen/plane_master/lighting/backdrop(mob/mymob)
mymob.overlay_fullscreen("lighting_backdrop_lit", /atom/movable/screen/fullscreen/lighting_backdrop/lit)
mymob.overlay_fullscreen("lighting_backdrop_unlit", /atom/movable/screen/fullscreen/lighting_backdrop/unlit)
mymob.overlay_fullscreen("lighting_backdrop_lit", /atom/movable/screen/fullscreen/special/lighting_backdrop/lit)
mymob.overlay_fullscreen("lighting_backdrop_unlit", /atom/movable/screen/fullscreen/special/lighting_backdrop/unlit)
/*!
* This system works by exploiting BYONDs color matrix filter to use layers to handle emissive blockers.
@@ -143,7 +143,6 @@
add_filter("emissives", 1, alpha_mask_filter(render_source = EMISSIVE_RENDER_TARGET, flags = MASK_INVERSE))
add_filter("object_lighting", 2, alpha_mask_filter(render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE))
/**
* Handles emissive overlays and emissive blockers.
*/
@@ -163,9 +162,10 @@
plane = PLANE_SPACE_PARALLAX
blend_mode = BLEND_MULTIPLY
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_target = PLANE_SPACE_PARALLAX_RENDER_TARGET
/atom/movable/screen/plane_master/parallax_white
name = "parallax whitifier plane master"
name = "parallax backdrop/space turf plane master"
plane = PLANE_SPACE
/atom/movable/screen/plane_master/camera_static
@@ -174,7 +174,6 @@
appearance_flags = PLANE_MASTER
blend_mode = BLEND_OVERLAY
//Reserved to chat messages, so they are still displayed above the field of vision masking.
/atom/movable/screen/plane_master/chat_messages
name = "runechat plane master"
+70 -66
View File
@@ -9,7 +9,6 @@
/atom/movable/screen
name = ""
icon = 'icons/mob/screen_gen.dmi'
layer = HUD_LAYER
plane = HUD_PLANE
animate_movement = SLIDE_STEPS
speech_span = SPAN_ROBOT
@@ -56,16 +55,12 @@
maptext_width = 480
/atom/movable/screen/swap_hand
layer = HUD_LAYER
plane = HUD_PLANE
name = "swap hand"
/atom/movable/screen/swap_hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
// if(world.time <= usr.next_move)
// return 1
if(usr.incapacitated())
return 1
@@ -74,6 +69,17 @@
M.swap_hand()
return 1
// /atom/movable/screen/skills
// name = "skills"
// icon = 'icons/mob/screen_midnight.dmi'
// icon_state = "skills"
// screen_loc = ui_skill_menu
// /atom/movable/screen/skills/Click()
// if(ishuman(usr))
// var/mob/living/carbon/human/H = usr
// H.mind.print_levels(H)
/atom/movable/screen/craft
name = "crafting menu"
icon = 'icons/mob/screen_midnight.dmi'
@@ -91,7 +97,7 @@
return TRUE
var/area/A = get_area(usr)
if(!A.outdoors)
to_chat(usr, "<span class='warning'>There is already a defined structure here.</span>")
to_chat(usr, span_warning("There is already a defined structure here."))
return TRUE
create_area(usr)
@@ -114,15 +120,12 @@
/// Icon when contains an item. For now used only by humans.
var/icon_full
/// The overlay when hovering over with an item in your hand
var/list/object_overlays = list()
layer = HUD_LAYER
var/image/object_overlay
plane = HUD_PLANE
/atom/movable/screen/inventory/Click(location, control, params)
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
// if(world.time <= usr.next_move)
// return TRUE
if(usr.incapacitated()) // ignore_stasis = TRUE
return TRUE
@@ -138,42 +141,23 @@
usr.update_inv_hands()
return TRUE
/atom/movable/screen/inventory/MouseEntered()
..()
/atom/movable/screen/inventory/MouseEntered(location, control, params)
. = ..()
add_overlays()
//Apply the outline affect
add_stored_outline()
/atom/movable/screen/inventory/MouseExited()
..()
cut_overlay(object_overlays)
object_overlays.Cut()
remove_stored_outline()
/atom/movable/screen/inventory/proc/add_stored_outline()
if(hud?.mymob && slot_id)
var/obj/item/inv_item = hud.mymob.get_item_by_slot(slot_id)
if(inv_item)
if(hud?.mymob.incapacitated() || (slot_id in hud?.mymob.check_obscured_slots()) || !hud?.mymob.canUnEquip(inv_item))
inv_item.apply_outline(_size = 3)
else
inv_item.apply_outline()
/atom/movable/screen/inventory/proc/remove_stored_outline()
if(hud?.mymob && slot_id)
var/obj/item/inv_item = hud.mymob.get_item_by_slot(slot_id)
if(inv_item)
inv_item.remove_outline()
cut_overlay(object_overlay)
QDEL_NULL(object_overlay)
/atom/movable/screen/inventory/update_icon_state()
if(!icon_empty)
icon_empty = icon_state
if(hud?.mymob && slot_id && icon_full)
if(hud.mymob.get_item_by_slot(slot_id))
icon_state = icon_full
else
icon_state = icon_empty
if(!hud?.mymob || !slot_id || !icon_full)
return ..()
icon_state = hud.mymob.get_item_by_slot(slot_id) ? icon_full : icon_empty
return ..()
/atom/movable/screen/inventory/proc/add_overlays()
var/mob/user = hud?.mymob
@@ -189,14 +173,14 @@
var/image/item_overlay = image(holding)
item_overlay.alpha = 92
if(!user.can_equip(holding, slot_id, TRUE, TRUE))
if(!user.can_equip(holding, slot_id, disable_warning = TRUE, bypass_equip_delay_self = TRUE))
item_overlay.color = "#FF0000"
else
item_overlay.color = "#00ff00"
cut_overlay(object_overlays)
// object_overlay = item_overlay
add_overlay(object_overlays)
cut_overlay(object_overlay)
object_overlay = item_overlay
add_overlay(object_overlay)
/atom/movable/screen/inventory/hand
var/mutable_appearance/handcuff_overlay
@@ -232,8 +216,6 @@
var/mob/user = hud?.mymob
if(usr != user)
return TRUE
// if(world.time <= user.next_move)
// return TRUE
if(user.incapacitated())
return TRUE
if (ismecha(user.loc)) // stops inventory actions in a mech
@@ -247,12 +229,24 @@
user.swap_hand(held_index)
return TRUE
// /atom/movable/screen/close
// name = "close"
// plane = ABOVE_HUD_PLANE
// icon_state = "backpack_close"
// /atom/movable/screen/close/Initialize(mapload, new_master)
// . = ..()
// master = new_master
// /atom/movable/screen/close/Click()
// var/datum/component/storage/S = master
// S.hide_from(usr)
// return TRUE
/atom/movable/screen/drop
name = "drop"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_drop"
layer = HUD_LAYER
plane = HUD_PLANE
/atom/movable/screen/drop/Click()
@@ -308,12 +302,12 @@
if(C.internal)
C.internal = null
to_chat(C, "<span class='notice'>You are no longer running on internals.</span>")
to_chat(C, span_notice("You are no longer running on internals."))
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>")
to_chat(C, span_warning("Due to cumbersome equipment or anatomy, you are currently unable to use internals!"))
return
var/obj/item/clothing/check
var/internals = FALSE
@@ -326,37 +320,37 @@
if((check.clothing_flags & ALLOWINTERNALS))
internals = TRUE
if(!internals)
to_chat(C, "<span class='warning'>You are not wearing an internals mask!</span>")
to_chat(C, span_warning("You are not wearing an internals mask!"))
return
var/obj/item/I = C.is_holding_item_of_type(/obj/item/tank)
if(I)
to_chat(C, "<span class='notice'>You are now running on internals from [I] in your [C.get_held_index_name(C.get_held_index_of_item(I))].</span>")
to_chat(C, span_notice("You are now running on internals from [I] in your [C.get_held_index_name(C.get_held_index_of_item(I))]."))
C.internal = I
else if(ishuman(C))
var/mob/living/carbon/human/H = C
if(istype(H.s_store, /obj/item/tank))
to_chat(H, "<span class='notice'>You are now running on internals from [H.s_store] on your [H.wear_suit.name].</span>")
to_chat(H, span_notice("You are now running on internals from [H.s_store] on your [H.wear_suit.name]."))
H.internal = H.s_store
else if(istype(H.belt, /obj/item/tank))
to_chat(H, "<span class='notice'>You are now running on internals from [H.belt] on your belt.</span>")
to_chat(H, span_notice("You are now running on internals from [H.belt] on your belt."))
H.internal = H.belt
else if(istype(H.l_store, /obj/item/tank))
to_chat(H, "<span class='notice'>You are now running on internals from [H.l_store] in your left pocket.</span>")
to_chat(H, span_notice("You are now running on internals from [H.l_store] in your left pocket."))
H.internal = H.l_store
else if(istype(H.r_store, /obj/item/tank))
to_chat(H, "<span class='notice'>You are now running on internals from [H.r_store] in your right pocket.</span>")
to_chat(H, span_notice("You are now running on internals from [H.r_store] in your right pocket."))
H.internal = H.r_store
//Separate so CO2 jetpacks are a little less cumbersome.
if(!C.internal && istype(C.back, /obj/item/tank))
to_chat(C, "<span class='notice'>You are now running on internals from [C.back] on your back.</span>")
to_chat(C, span_notice("You are now running on internals from [C.back] on your back."))
C.internal = C.back
if(C.internal)
icon_state = "internal1"
else
to_chat(C, "<span class='warning'>You don't have an oxygen tank!</span>")
to_chat(C, span_warning("You don't have an oxygen tank!"))
return
C.update_action_buttons_icon()
@@ -378,6 +372,7 @@
icon_state = CONFIG_GET(flag/sprint_enabled)? "walking" : "walking_nosprint"
if(MOVE_INTENT_RUN)
icon_state = CONFIG_GET(flag/sprint_enabled)? "running" : "running_nosprint"
return ..()
/atom/movable/screen/mov_intent/proc/toggle(mob/user)
if(isobserver(user))
@@ -399,12 +394,12 @@
icon_state = "pull"
else
icon_state = "pull0"
return ..()
/atom/movable/screen/resist
name = "resist"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_resist"
layer = HUD_LAYER
plane = HUD_PLANE
/atom/movable/screen/resist/Click()
@@ -416,7 +411,6 @@
name = "rest"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_rest"
layer = HUD_LAYER
plane = HUD_PLANE
/atom/movable/screen/rest/Click()
@@ -427,11 +421,12 @@
/atom/movable/screen/rest/update_icon_state()
var/mob/living/user = hud?.mymob
if(!istype(user))
return
return ..()
if(!user.resting)
icon_state = "act_rest"
else
icon_state = "act_rest0"
return ..()
/atom/movable/screen/throw_catch
name = "throw/catch"
@@ -455,9 +450,9 @@
if(isobserver(usr))
return
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
var/icon_y = text2num(PL["icon-y"])
var/list/modifiers = params2list(params)
var/icon_x = text2num(LAZYACCESS(modifiers, "icon-x"))
var/icon_y = text2num(LAZYACCESS(modifiers, "icon-y"))
var/choice = get_zone_at(icon_x, icon_y)
if (!choice)
return 1
@@ -465,15 +460,16 @@
return set_selected_zone(choice, usr)
/atom/movable/screen/zone_sel/MouseEntered(location, control, params)
. = ..()
MouseMove(location, control, params)
/atom/movable/screen/zone_sel/MouseMove(location, control, params)
if(isobserver(usr))
return
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
var/icon_y = text2num(PL["icon-y"])
var/list/modifiers = params2list(params)
var/icon_x = text2num(LAZYACCESS(modifiers, "icon-x"))
var/icon_y = text2num(LAZYACCESS(modifiers, "icon-y"))
var/choice = get_zone_at(icon_x, icon_y)
if(hovering == choice)
@@ -493,7 +489,6 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
alpha = 128
anchored = TRUE
layer = ABOVE_HUD_LAYER
plane = ABOVE_HUD_PLANE
/atom/movable/screen/zone_sel/MouseExited(location, control, params)
@@ -545,7 +540,7 @@
if(choice != hud.mymob.zone_selected)
hud.mymob.zone_selected = choice
update_icon()
update_appearance()
return TRUE
@@ -562,7 +557,6 @@
/atom/movable/screen/zone_sel/robot
icon = 'icons/mob/screen_cyborg.dmi'
/atom/movable/screen/flash
name = "flash"
icon_state = "blank"
@@ -651,6 +645,11 @@
name = "health doll"
screen_loc = ui_healthdoll
/atom/movable/screen/healthdoll/Click()
if (iscarbon(usr))
var/mob/living/carbon/C = usr
C.check_self_for_injuries()
/atom/movable/screen/healthdoll/living
icon_state = "fullhealth0"
screen_loc = ui_living_healthdoll
@@ -661,6 +660,9 @@
icon_state = "mood5"
screen_loc = ui_mood
/atom/movable/screen/mood/attack_tk()
return
/atom/movable/screen/splash
icon = 'icons/blank_title.png'
icon_state = ""
@@ -671,6 +673,8 @@
/atom/movable/screen/splash/New(client/C, visible, use_previous_title) //TODO: Make this use INITIALIZE_IMMEDIATE, except its not easy
. = ..()
if(!istype(C))
return
holder = C
+19
View File
@@ -0,0 +1,19 @@
/atom/movable/screen/screentip
icon = null
icon_state = null
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
screen_loc = "TOP,LEFT"
maptext_height = 480
maptext_width = 480
maptext = ""
/atom/movable/screen/screentip/Initialize(mapload, _hud)
. = ..()
hud = _hud
update_view()
/atom/movable/screen/screentip/proc/update_view(datum/source)
SIGNAL_HANDLER
if(!hud || !hud.mymob.client.view_size) //Might not have been initialized by now
return
maptext_width = getviewsize(hud.mymob.client.view_size.getView())[1] * world.icon_size
-1
View File
@@ -11,7 +11,6 @@
// Otherwise jump
else if(A.loc)
forceMove(get_turf(A))
update_parallax_contents()
/mob/dead/observer/ClickOn(var/atom/A, var/params)
if(check_click_intercept(params,A))
+1 -1
View File
@@ -101,7 +101,7 @@
//stops TK grabs being equipped anywhere but into hands
/obj/item/tk_grab/equipped(mob/user, slot)
if(slot == SLOT_HANDS)
if(slot == ITEM_SLOT_HANDS)
return ..()
qdel(src)
@@ -124,9 +124,3 @@ GLOBAL_LIST_INIT(huds, list(
/mob/dead/new_player/reload_huds()
return
/mob/proc/add_click_catcher()
client.screen += client.void
/mob/dead/new_player/add_click_catcher()
return
@@ -0,0 +1,74 @@
/atom/movable/screen/click_catcher
icon = 'icons/screen/clickcatcher.dmi'
icon_state = "catcher"
appearance_flags = TILE_BOUND | NO_CLIENT_COLOR | RESET_TRANSFORM | RESET_COLOR | RESET_ALPHA
plane = CLICKCATCHER_PLANE
plane = CLICKCATCHER_PLANE
mouse_opacity = MOUSE_OPACITY_OPAQUE
screen_loc = "CENTER"
/*
#define MAX_SAFE_BYOND_ICON_SCALE_TILES (MAX_SAFE_BYOND_ICON_SCALE_PX / world.icon_size)
#define MAX_SAFE_BYOND_ICON_SCALE_PX (33 * 32) //Not using world.icon_size on purpose.
/atom/movable/screen/click_catcher/proc/UpdateFill(view_size_x = 15, view_size_y = 15)
var/icon/newicon = icon('icons/mob/screen_gen.dmi', "catcher")
var/ox = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_x)
var/oy = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_y)
var/px = view_size_x * world.icon_size
var/py = view_size_y * world.icon_size
var/sx = min(MAX_SAFE_BYOND_ICON_SCALE_PX, px)
var/sy = min(MAX_SAFE_BYOND_ICON_SCALE_PX, py)
newicon.Scale(sx, sy)
icon = newicon
screen_loc = "CENTER-[(ox-1)*0.5],CENTER-[(oy-1)*0.5]"
var/matrix/M = new
M.Scale(px/sx, py/sy)
transform = M
#undef MAX_SAFE_BYOND_ICON_SCALE_TILES
#undef MAX_SAFE_BYOND_ICON_SCALE_PX
*/
/atom/movable/screen/click_catcher/proc/UpdateFill(view_size_x, view_size_y)
screen_loc = "1,1 to [view_size_x],[view_size_y]"
/atom/movable/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && iscarbon(usr))
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = Parse(modifiers["screen-loc"], get_turf(usr.client?.eye || usr), usr.client)
params += "&catcher=1"
if(T)
T.Click(location, control, params)
return TRUE
/atom/movable/screen/click_catcher/proc/Parse(scr_loc, turf/origin, client/C)
// screen-loc: Pixel coordinates in screen_loc format ("[tile_x]:[pixel_x],[tile_y]:[pixel_y]")
if(!scr_loc)
return null
var/tX = splittext(scr_loc, ",")
var/tY = splittext(tX[2], ":")
var/tZ = origin.z
tY = tY[1]
tX = splittext(tX[1], ":")
tX = tX[1]
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = clamp(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
tY = clamp(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
return locate(tX, tY, tZ)
/**
* Makes a clickcatcher if necessary, and ensures it's fit to our size.
*/
/client/proc/update_clickcatcher(list/view_override)
if(!click_catcher)
click_catcher = new
screen |= click_catcher
if(view_override)
click_catcher.UpdateFill(view_override[1], view_override[2])
else
var/list/view_list = getviewsize(view)
click_catcher.UpdateFill(view_list[1], view_list[2])
+234
View File
@@ -0,0 +1,234 @@
/**
* Adds a fullscreen overlay
*
* @params
* - category - string - must exist. will overwrite any other screen in this category. defaults to type.
* - type - the typepath of the screen
* - severity - severity - different screen objects have differing severities
*/
/mob/proc/overlay_fullscreen(category, type, severity)
ASSERT(type)
if(!category)
category = type
var/atom/movable/screen/fullscreen/screen = fullscreens[category]
if (!screen || screen.type != type)
// needs to be recreated
clear_fullscreen(category, 0)
fullscreens[category] = screen = new type
screen.SetSeverity(severity)
if(client && screen.ShouldShow(src))
screen.SetView(client.view)
client.screen += screen
return screen
/**
* Wipes a fullscreen of a certain category
*
* Second argument is for animation delay.
*/
/mob/proc/clear_fullscreen(category, animated = 10)
if(!fullscreens)
return
var/atom/movable/screen/fullscreen/screen = fullscreens[category]
fullscreens -= category
if(!screen)
return
if(animated > 0)
animate(screen, alpha = 0, time = animated)
addtimer(CALLBACK(src, .proc/_remove_fullscreen_direct, screen), animated, TIMER_CLIENT_TIME)
else
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/_remove_fullscreen_direct(atom/movable/screen/fullscreen/screen)
if(client)
client.screen -= screen
qdel(screen)
/**
* Wipes all fullscreens
*/
/mob/proc/wipe_fullscreens()
for(var/category in fullscreens)
clear_fullscreen(category)
/**
* Removes fullscreens from client but not the mob
*/
/mob/proc/hide_fullscreens()
if(client)
for(var/category in fullscreens)
client.screen -= fullscreens[category]
/**
* Ensures all fullscreens are on client.
*/
/mob/proc/reload_fullscreen()
if(client)
var/atom/movable/screen/fullscreen/screen
for(var/category in fullscreens)
screen = fullscreens[category]
if(screen.ShouldShow(src))
screen.SetView(client.view)
client.screen |= screen
else
client.screen -= screen
/atom/movable/screen/fullscreen
icon = 'icons/screen/fullscreen_15x15.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = FULLSCREEN_LAYER
plane = FULLSCREEN_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/// current view we're adapted to
var/view_current
/// min severity
var/severity_min = 0
/// max severity
var/severity_max = INFINITY
/// current severity
var/severity = 0
/// show this while dead
var/show_when_dead = FALSE
/atom/movable/screen/fullscreen/proc/SetSeverity(severity)
src.severity = clamp(severity, severity_min, severity_max)
icon_state = "[initial(icon_state)][severity]"
/atom/movable/screen/fullscreen/proc/SetView(client_view)
view_current = client_view
/atom/movable/screen/fullscreen/proc/ShouldShow(mob/M)
if(!show_when_dead && M.stat == DEAD)
return FALSE
return TRUE
/atom/movable/screen/fullscreen/Destroy()
SetSeverity(0)
return ..()
/atom/movable/screen/fullscreen/scaled
icon = 'icons/screen/fullscreen_15x15.dmi'
screen_loc = "CENTER-7,CENTER-7"
/// size of sprite in tiles
var/size_x = 15
/// size of sprite in tiles
var/size_y = 15
/atom/movable/screen/fullscreen/scaled/SetView(client_view)
if(view_current != client_view)
var/list/actualview = getviewsize(client_view)
view_current = client_view
transform = matrix(actualview[1] / size_x, 0, 0, 0, actualview[2] / size_y, 0)
return ..()
/atom/movable/screen/fullscreen/scaled/brute
icon_state = "brutedamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/scaled/oxy
icon_state = "oxydamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/scaled/crit
icon_state = "passage"
layer = CRIT_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/scaled/crit/vision
icon_state = "oxydamageoverlay"
layer = BLIND_LAYER
/atom/movable/screen/fullscreen/scaled/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/scaled/curse
icon_state = "curse"
layer = CURSE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/scaled/impaired
icon_state = "impairedoverlay"
/atom/movable/screen/fullscreen/scaled/emergency_meeting
icon_state = "emergency_meeting"
show_when_dead = TRUE
layer = CURSE_LAYER
plane = SPLASHSCREEN_PLANE
/atom/movable/screen/fullscreen/tiled/blurry
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "cloudy"
/atom/movable/screen/fullscreen/tiled/flash
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/atom/movable/screen/fullscreen/tiled/flash/static
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"
/atom/movable/screen/fullscreen/tiled/high
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
/atom/movable/screen/fullscreen/tiled/color_vision
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
alpha = 80
/atom/movable/screen/fullscreen/tiled/color_vision/green
color = "#00ff00"
/atom/movable/screen/fullscreen/tiled/color_vision/red
color = "#ff0000"
/atom/movable/screen/fullscreen/tiled/color_vision/blue
color = "#0000ff"
/atom/movable/screen/fullscreen/tiled/cinematic_backdrop
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
plane = SPLASHSCREEN_PLANE
layer = SPLASHSCREEN_LAYER - 1
color = "#000000"
show_when_dead = TRUE
/atom/movable/screen/fullscreen/special/lighting_backdrop
icon = 'icons/mob/screen_gen.dmi'
icon_state = "flash"
transform = matrix(200, 0, 0, 0, 200, 0)
plane = LIGHTING_PLANE
blend_mode = BLEND_OVERLAY
show_when_dead = TRUE
//Provides darkness to the back of the lighting plane
/atom/movable/screen/fullscreen/special/lighting_backdrop/lit
invisibility = INVISIBILITY_LIGHTING
layer = BACKGROUND_LAYER+21
color = "#000"
show_when_dead = TRUE
//Provides whiteness in case you don't see lights so everything is still visible
/atom/movable/screen/fullscreen/special/lighting_backdrop/unlit
layer = BACKGROUND_LAYER+20
show_when_dead = TRUE
/atom/movable/screen/fullscreen/special/see_through_darkness
icon_state = "nightvision"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
blend_mode = BLEND_ADD
show_when_dead = TRUE
+21
View File
@@ -0,0 +1,21 @@
/**
* initializes screen rendering. call on mob new
*/
/mob/proc/init_rendering()
/**
* loads screen rendering. call on mob login
*/
/mob/proc/reload_rendering()
if(!client.parallax_holder)
client.CreateParallax()
else
client.parallax_holder.Reset(force = TRUE)
client.update_clickcatcher()
reload_fullscreen()
/**
* destroys screen rendering. call on mob del
*/
/mob/proc/dispose_rendering()
wipe_fullscreens()
+28
View File
@@ -0,0 +1,28 @@
/**
* Holds parallax information.
*/
/datum/parallax
/// List of parallax objects - these are cloned to a parallax holder using Clone on each.
var/list/atom/movable/screen/parallax_layer/objects
/// Parallax layers
var/layers = 0
/datum/parallax/New(create_objects = TRUE)
if(create_objects)
objects = CreateObjects()
layers = objects.len
/datum/parallax/Destroy()
QDEL_LIST(objects)
return ..()
/**
* Gets a new version of the objects inside - used when applying to a holder.
*/
/datum/parallax/proc/GetObjects()
. = list()
for(var/atom/movable/screen/parallax_layer/layer in objects)
. += layer.Clone()
/datum/parallax/proc/CreateObjects()
. = objects = list()
+311
View File
@@ -0,0 +1,311 @@
/**
* # Parallax holders
*
* Holds all the information about a client's parallax
*
* Not on mob because parallax is area based, not mob based.
*
* How parallax works:
* - Layers - normal layers, scroll with movement to relative position, can scroll
* - Absolute - absolute layers, scroll with movement to absolute position, cannot scroll
* - Vis - vis_contents-like model - things in this are directly applied and get no processing whatsoever. Things like overmap ships can use this.
*/
/datum/parallax_holder
/// Client that owns us
var/client/owner
/// The parallax object we're currently rendering
var/datum/parallax/parallax
/// Eye we were last anchored to - used to detect eye changes
var/atom/cached_eye
/// force this eye as the "real" eye - useful for secondary maps
var/atom/forced_eye
/// last turf loc
var/turf/last
/// last area - for parallax scrolling/loop animations
var/area/last_area
/// Holder object for vis
var/atom/movable/screen/parallax_vis/vis_holder
/// are we not on the main map? if so, put map id here
var/secondary_map
/// all layers
var/list/atom/movable/screen/parallax_layer/layers
/// vis contents
var/list/atom/movable/vis
/// currently scrolling?
var/scrolling = FALSE
/// current scroll speed in DS per scroll
var/scroll_speed
/// current scroll turn - applied after angle. if angle is 0 (picture moving north) and turn is 90, it would be like if you turned your viewport 90 deg clockwise.
var/scroll_turn
/// override planemaster we manipulate for turning and other effects
var/atom/movable/screen/plane_master/parallax/planemaster_override
/datum/parallax_holder/New(client/C, secondary_map, forced_eye, planemaster_override)
owner = C
if(!owner)
CRASH("No client")
src.secondary_map = secondary_map
src.forced_eye = forced_eye
src.planemaster_override = planemaster_override
Reset()
/datum/parallax_holder/Destroy()
if(owner)
if(owner.parallax_holder == src)
owner.parallax_holder = null
Remove()
HardResetAnimations()
QDEL_NULL(vis_holder)
QDEL_NULL(parallax)
layers = null
vis = null
last = null
forced_eye = cached_eye = null
owner = null
return ..()
/datum/parallax_holder/proc/Reset(auto_z_change, force)
if(!(cached_eye = Eye()))
// if no eye, tear down
last = cached_eye = last_area = null
SetParallax(null, null, auto_z_change)
return
// first, check loc
var/turf/T = get_turf(cached_eye)
if(!T)
// if in nullspace, tear down
last = cached_eye = last_area = null
SetParallax(null, null, auto_z_change)
return
// set last loc and eye
last = T
last_area = T.loc
// rebuild parallax
SetParallax(SSparallax.get_parallax_datum(T.z), null, auto_z_change, force)
// hard reset positions to correct positions
for(var/atom/movable/screen/parallax_layer/L in layers)
L.ResetPosition(T.x, T.y)
// better updates via client_mobs_in_contents can be created again when important recursive contents is ported!
/datum/parallax_holder/proc/Update(full)
if(!full && !cached_eye || (get_turf(cached_eye) == last))
return
if(!owner) // why are we here
if(!QDELETED(src))
qdel(src)
return
if(cached_eye != Eye())
// eye mismatch, reset
Reset()
return
var/turf/T = get_turf(cached_eye)
if(!last || T.z != last.z)
// z mismatch, reset
Reset()
return
// get rel offsets
var/rel_x = T.x - last.x
var/rel_y = T.y - last.y
// set last
last = T
// move
for(var/atom/movable/screen/parallax_layer/L in layers)
L.RelativePosition(T.x, T.y, rel_x, rel_y)
// process scrolling/movedir
if(last_area != T.loc)
last_area = T.loc
UpdateMotion()
/**
* Gets the eye we should be centered on
*/
/datum/parallax_holder/proc/Eye()
return forced_eye || owner?.eye
/**
* Gets the base parallax planemaster for things like turning
*/
/datum/parallax_holder/proc/GetPlaneMaster()
return planemaster_override || (owner && (locate(/atom/movable/screen/plane_master/parallax) in owner?.screen))
/**
* Syncs us to our parallax objects. Does NOT check if we should have those objects, that's Reset()'s job.
*
* Doesn't move/update positions/screen locs either.
*
* Also ensures movedirs are correct for the eye's pos.
*/
/datum/parallax_holder/proc/Sync(auto_z_change, force)
layers = list()
for(var/atom/movable/screen/parallax_layer/L in parallax.objects)
layers += L
L.map_id = secondary_map
if(!istype(vis_holder))
vis_holder = new /atom/movable/screen/parallax_vis
var/turf/T = get_turf(cached_eye)
vis_holder.vis_contents = vis = T? SSparallax.get_parallax_vis_contents(T.z) : list()
UpdateMotion(auto_z_change, force)
/**
* Updates motion if needed
*/
/datum/parallax_holder/proc/UpdateMotion(auto_z_change, force)
var/turf/T = get_turf(cached_eye)
if(!T)
if(scroll_speed || scroll_turn)
HardResetAnimations()
return
var/list/ret = SSparallax.get_parallax_motion(T.z)
if(ret)
Animation(ret[1], ret[2], auto_z_change? 0 : ret[3], auto_z_change? 0 : ret[4], force)
else
var/area/A = T.loc
Animation(A.parallax_move_speed, A.parallax_move_angle, auto_z_change? 0 : null, auto_z_change? 0 : null, force)
/datum/parallax_holder/proc/Apply(client/C = owner)
if(QDELETED(C))
return
. = list()
for(var/atom/movable/screen/parallax_layer/L in layers)
if(L.parallax_intensity > owner.prefs.parallax)
continue
if(!L.ShouldSee(C, last))
continue
L.SetView(C.view, TRUE)
. |= L
C.screen |= .
if(!secondary_map && (owner.prefs.parallax != PARALLAX_DISABLE))
var/atom/movable/screen/plane_master/parallax_white/PM = locate() in C.screen
if(PM)
PM.color = list(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0
)
/datum/parallax_holder/proc/Remove(client/C = owner)
if(QDELETED(C))
return
C.screen -= layers
if(!secondary_map)
var/atom/movable/screen/plane_master/parallax_white/PM = locate() in C.screen
if(PM)
PM.color = initial(PM.color)
/datum/parallax_holder/proc/SetParallaxType(path)
if(!ispath(path, /datum/parallax))
CRASH("Invalid path")
SetParallax(new path)
/datum/parallax_holder/proc/SetParallax(datum/parallax/P, delete_old = TRUE, auto_z_change, force)
if(P == parallax)
return
Remove()
if(delete_old && istype(parallax) && !QDELETED(parallax))
qdel(parallax)
HardResetAnimations()
parallax = P
if(!parallax)
return
Sync(auto_z_change, force)
Apply()
/**
* Runs a modifier to parallax as an animation.
*
* @params
* speed - ds per loop
* turn - angle clockwise from north to turn the motion to
* windup - ds to spend on windups. 0 for immediate.
* turn_speed - ds to spend on turning. 0 for immediate.
*/
/datum/parallax_holder/proc/Animation(speed = 25, turn = 0, windup = speed, turn_speed = speed, force)
// Parallax doesn't currently use this method of rotating.
// #if !PARALLAX_ROTATION_ANIMATIONS
// turn_speed = 0
// #endif
if(speed == 0)
StopScrolling(turn = turn, time = windup)
return
// if(turn != scroll_turn && GetPlaneMaster())
// // first handle turn. we turn the planemaster
// var/matrix/turn_transform = matrix()
// turn_transform.Turn(turn)
// scroll_turn = turn
// animate(GetPlaneMaster(), transform = turn_transform, time = turn_speed, easing = QUAD_EASING | EASE_IN, flags = ANIMATION_END_NOW | ANIMATION_LINEAR_TRANSFORM)
if(scroll_speed == speed && !force)
// we're done
return
// speed diff?
scroll_speed = speed
scrolling = TRUE
// always scroll from north; turn handles everything
for(var/atom/movable/screen/parallax_layer/P in layers)
if(P.absolute)
continue
var/matrix/translate_matrix = matrix()
translate_matrix.Translate(cos(turn) * 480, sin(turn) * 480)
var/matrix/target_matrix = matrix()
var/move_speed = speed * P.speed
// do the first segment by shifting down one screen
P.transform = translate_matrix
animate(P, transform = target_matrix, time = move_speed, easing = QUAD_EASING|EASE_IN, flags = ANIMATION_END_NOW)
// queue up another incase lag makes QueueLoop not fire on time, this time by shifting up
animate(transform = translate_matrix, time = 0)
animate(transform = target_matrix, time = move_speed)
P.QueueLoop(move_speed, speed * P.speed, translate_matrix, target_matrix)
/**
* Smoothly stops the animation, turning to a certain angle as needed.
*/
/datum/parallax_holder/proc/StopScrolling(turn = 0, time = 30)
// reset turn
if(turn != scroll_turn && GetPlaneMaster())
var/matrix/turn_transform = matrix()
turn_transform.Turn(turn)
scroll_turn = turn
animate(GetPlaneMaster(), transform = turn_transform, time = time, easing = QUAD_EASING | EASE_OUT, flags = ANIMATION_END_NOW | ANIMATION_LINEAR_TRANSFORM)
if(scroll_speed == 0)
// we're done
scrolling = FALSE
scroll_speed = 0
return
scrolling = FALSE
scroll_speed = 0
// someone can do the math for "stop after a smooth iteration" later.
for(var/atom/movable/screen/parallax_layer/P in layers)
if(P.absolute)
continue
P.CancelAnimation()
var/matrix/translate_matrix = matrix()
translate_matrix.Translate(cos(turn) * 480, sin(turn) * 480)
P.transform = translate_matrix
animate(P, transform = matrix(), time = time, easing = QUAD_EASING | EASE_OUT)
/**
* fully resets animation state
*/
/datum/parallax_holder/proc/HardResetAnimations()
// reset vars
scroll_turn = 0
scroll_speed = 0
scrolling = FALSE
// reset turn
if(GetPlaneMaster())
animate(GetPlaneMaster(), transform = matrix(), time = 0, flags = ANIMATION_END_NOW)
// reset objects
for(var/atom/movable/screen/parallax_layer/P in layers)
if(P.absolute)
continue
P.CancelAnimation()
animate(P, transform = matrix(), time = 0, flags = ANIMATION_END_NOW)
/client/proc/CreateParallax()
if(!parallax_holder)
parallax_holder = new(src)
/atom/movable/screen/parallax_vis
screen_loc = "CENTER,CENTER"
+137
View File
@@ -0,0 +1,137 @@
/atom/movable/screen/parallax_layer
icon = 'icons/screen/parallax.dmi'
blend_mode = BLEND_ADD
plane = PLANE_SPACE_PARALLAX
screen_loc = "CENTER-7,CENTER-7"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
appearance_flags = PIXEL_SCALE | KEEP_TOGETHER
// notice - all parallax layers are 15x15 tiles. They roll over every 240 pixels.
/// pixel x/y shift per real x/y
var/speed = 1
/// current cached offset x
var/offset_x = 0
/// current cached offset y
var/offset_y = 0
/// normal centered x
var/center_x = 0
/// normal centered y
var/center_y = 0
/// absolute - always determine shift x/y as a function of real x/y instead of allowing for relative scroll.
var/absolute = FALSE
/// parallax level required to see this
var/parallax_intensity = PARALLAX_INSANE
/// current view we're adapted to
var/view_current
/// dynamic self tile - tile to our view size. set this to false for static parallax layers.
var/dynamic_self_tile = TRUE
/// map id
var/map_id
/// queued animation timerid
var/queued_animation
/atom/movable/screen/parallax_layer/proc/ResetPosition(x, y)
// remember that our offsets/directiosn are relative to the player's viewport
// this means we need to scroll reverse to them.
offset_x = -(center_x + speed * x)
offset_y = -(center_y + speed * y)
if(!absolute)
if(offset_x > 240)
offset_x -= 480
if(offset_x < -240)
offset_x += 480
if(offset_y > 240)
offset_y -= 480
if(offset_y < -240)
offset_y += 480
screen_loc = "[map_id && "[map_id]:"]CENTER-7:[round(offset_x,1)],CENTER-7:[round(offset_y,1)]"
/atom/movable/screen/parallax_layer/proc/RelativePosition(x, y, rel_x, rel_y)
if(absolute)
return ResetPosition(x, y)
offset_x -= rel_x * speed
offset_y -= rel_y * speed
if(offset_x > 240)
offset_x -= 480
if(offset_x < -240)
offset_x += 480
if(offset_y > 240)
offset_y -= 480
if(offset_y < -240)
offset_y += 480
screen_loc = "[map_id && "[map_id]:"]CENTER-7:[round(offset_x,1)],CENTER-7:[round(offset_y,1)]"
/atom/movable/screen/parallax_layer/proc/SetView(client_view = world.view, force_update = FALSE)
if(view_current == client_view && !force_update)
return
view_current = client_view
if(!dynamic_self_tile)
return
var/list/real_view = getviewsize(client_view)
var/count_x = CEILING((real_view[1] / 2) / 15, 1) + 1
var/count_y = CEILING((real_view[2] / 2) / 15, 1) + 1
var/list/new_overlays = GetOverlays()
for(var/x in -count_x to count_x)
for(var/y in -count_y to count_y)
if(!x && !y)
continue
var/mutable_appearance/clone = new
// appearance clone
clone.icon = icon
clone.icon_state = icon_state
clone.overlays = GetOverlays()
// do NOT inherit our overlays! parallax layers should never have overlays,
// because if it inherited us it'll result in exponentially increasing overlays
// due to cut_overlays() above over there being a queue operation and not instant!
// clone.overlays = list()
// currently instantly using overlays =.
// clone.blend_mode = blend_mode
// clone.mouse_opacity = mouse_opacity
// clone.plane = plane
// clone.layer = layer
// shift to position
clone.transform = matrix(1, 0, x * 480, 0, 1, y * 480)
new_overlays += clone
overlays = new_overlays
/atom/movable/screen/parallax_layer/proc/ShouldSee(client/C, atom/location)
return TRUE
/**
* Return "natural" overlays, as we're goin to do some fuckery to overlays above.
*/
/atom/movable/screen/parallax_layer/proc/GetOverlays()
return list()
/atom/movable/screen/parallax_layer/proc/Clone()
var/atom/movable/screen/parallax_layer/layer = new type
layer.speed = speed
layer.offset_x = offset_x
layer.offset_y = offset_y
layer.absolute = absolute
layer.parallax_intensity = parallax_intensity
layer.view_current = view_current
layer.appearance = appearance
/atom/movable/screen/parallax_layer/proc/default_x()
return center_x
/atom/movable/screen/parallax_layer/proc/default_y()
return center_y
/atom/movable/screen/parallax_layer/proc/QueueLoop(delay, speed, matrix/translate_matrix, matrix/target_matrix)
if(queued_animation)
CancelAnimation()
queued_animation = addtimer(CALLBACK(src, .proc/_loop, speed, translate_matrix, target_matrix), delay, TIMER_STOPPABLE)
/atom/movable/screen/parallax_layer/proc/_loop(speed, matrix/translate_matrix = matrix(1, 0, 0, 0, 1, 480), matrix/target_matrix = matrix())
transform = translate_matrix
animate(src, transform = target_matrix, time = speed, loop = -1)
animate(transform = translate_matrix, time = 0)
queued_animation = null
/atom/movable/screen/parallax_layer/proc/CancelAnimation()
if(queued_animation)
deltimer(queued_animation)
queued_animation = null
+66
View File
@@ -0,0 +1,66 @@
/datum/parallax/space
var/static/planet_offset_x = rand(100, 160)
var/static/planet_offset_y = rand(100, 160)
var/static/random_layer = pickweightAllowZero(list(
/atom/movable/screen/parallax_layer/space/random/asteroids = 35,
/atom/movable/screen/parallax_layer/space/random/space_gas = 35,
null = 30
))
var/static/random_gas_color = pick(COLOR_TEAL, COLOR_GREEN, COLOR_YELLOW, COLOR_CYAN, COLOR_ORANGE, COLOR_PURPLE)
/datum/parallax/space/CreateObjects()
. = ..()
. += new /atom/movable/screen/parallax_layer/space/layer_1
. += new /atom/movable/screen/parallax_layer/space/layer_2
. += new /atom/movable/screen/parallax_layer/space/layer_3
var/atom/movable/screen/parallax_layer/space/planet/P = new
P.pixel_x = planet_offset_x
P.pixel_y = planet_offset_y
. += P
if(ispath(random_layer, /atom/movable/screen/parallax_layer))
. += new random_layer
if(ispath(random_layer, /atom/movable/screen/parallax_layer/space/random/space_gas))
var/atom/movable/screen/parallax_layer/space/random/space_gas/SG = locate(random_layer) in objects
SG.add_atom_colour(random_gas_color, ADMIN_COLOUR_PRIORITY)
/atom/movable/screen/parallax_layer/space/layer_1
icon_state = "layer1"
speed = 0.6
layer = 1
parallax_intensity = PARALLAX_LOW
/atom/movable/screen/parallax_layer/space/layer_2
icon_state = "layer2"
speed = 1
layer = 2
parallax_intensity = PARALLAX_MED
/atom/movable/screen/parallax_layer/space/layer_3
icon_state = "layer3"
speed = 1.4
layer = 3
parallax_intensity = PARALLAX_HIGH
/atom/movable/screen/parallax_layer/space/random
blend_mode = BLEND_OVERLAY
speed = 3
layer = 3
parallax_intensity = PARALLAX_INSANE
/atom/movable/screen/parallax_layer/space/random/space_gas
icon_state = "space_gas"
/atom/movable/screen/parallax_layer/space/random/asteroids
icon_state = "asteroids"
/atom/movable/screen/parallax_layer/space/planet
icon_state = "planet"
blend_mode = BLEND_OVERLAY
absolute = TRUE //Status of seperation
speed = 3
layer = 30
dynamic_self_tile = FALSE
/atom/movable/screen/parallax_layer/space/planet/ShouldSee(client/C, atom/location)
var/turf/T = get_turf(location)
return ..() && T && is_station_level(T.z)
@@ -94,6 +94,10 @@
config_entry_value = 10
min_val = 0
/datum/config_entry/keyed_list/dynamic_mode_days
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_FLAG
/datum/config_entry/keyed_list/storyteller_weight
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
@@ -347,3 +347,11 @@
default = FALSE
/datum/config_entry/flag/dynamic_config_enabled
/datum/config_entry/flag/station_name_needs_approval
//ambition start
/datum/config_entry/number/max_ambitions // Maximum number of ambitions a mind can store.
config_entry_value = 5
//ambition end
@@ -1,84 +1,119 @@
/datum/config_entry/flag/log_ooc // log OOC channel
/// log OOC channel
/datum/config_entry/flag/log_ooc
config_entry_value = TRUE
/datum/config_entry/flag/log_access // log login/logout
/// log login/logout
/datum/config_entry/flag/log_access
config_entry_value = TRUE
/datum/config_entry/flag/log_say // log client say
/// Config entry which special logging of failed logins under suspicious circumstances.
/datum/config_entry/flag/log_suspicious_login
config_entry_value = TRUE
/datum/config_entry/flag/log_admin // log admin actions
/// log client say
/datum/config_entry/flag/log_say
config_entry_value = TRUE
/// log admin actions
/datum/config_entry/flag/log_admin
protection = CONFIG_ENTRY_LOCKED
config_entry_value = TRUE
/datum/config_entry/flag/log_prayer // log prayers
/// log prayers
/datum/config_entry/flag/log_prayer
config_entry_value = TRUE
/datum/config_entry/flag/log_law // log lawchanges
/// log lawchanges
/datum/config_entry/flag/log_law
config_entry_value = TRUE
/datum/config_entry/flag/log_game // log game events
/// log game events
/datum/config_entry/flag/log_game
config_entry_value = TRUE
/datum/config_entry/flag/log_virus // log virology data
/// log virology data
/datum/config_entry/flag/log_virus
config_entry_value = TRUE
/datum/config_entry/flag/log_vote // log voting
/// log voting
/datum/config_entry/flag/log_vote
config_entry_value = TRUE
/datum/config_entry/flag/log_craft // log crafting
/// log crafting
/datum/config_entry/flag/log_craft
config_entry_value = TRUE
/datum/config_entry/flag/log_whisper // log client whisper
/// log client whisper
/datum/config_entry/flag/log_whisper
config_entry_value = TRUE
/datum/config_entry/flag/log_attack // log attack messages
/// log attack messages
/datum/config_entry/flag/log_attack
config_entry_value = TRUE
/datum/config_entry/flag/log_emote // log emotes
/// log attack messages
/datum/config_entry/flag/log_victim
config_entry_value = TRUE
/datum/config_entry/flag/log_adminchat // log admin chat messages
/// log emotes
/datum/config_entry/flag/log_emote
config_entry_value = TRUE
/// log admin chat messages
/datum/config_entry/flag/log_adminchat
protection = CONFIG_ENTRY_LOCKED
/datum/config_entry/flag/log_shuttle // log shuttle related actions, ie shuttle computers, shuttle manipulator, emergency console
/// log shuttle related actions, ie shuttle computers, shuttle manipulator, emergency console
/datum/config_entry/flag/log_shuttle
config_entry_value = TRUE
/datum/config_entry/flag/log_pda // log pda messages
/// log pda messages
/datum/config_entry/flag/log_pda
config_entry_value = TRUE
/datum/config_entry/flag/log_telecomms // log telecomms messages
/// log telecomms messages
/datum/config_entry/flag/log_telecomms
config_entry_value = TRUE
/datum/config_entry/flag/log_twitter // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.
/// log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.
/datum/config_entry/flag/log_twitter
config_entry_value = TRUE
/datum/config_entry/flag/log_world_topic // log all world.Topic() calls
/// log all world.Topic() calls
/datum/config_entry/flag/log_world_topic
config_entry_value = TRUE
/datum/config_entry/flag/log_manifest // log crew manifest to seperate file
/// log crew manifest to seperate file
/datum/config_entry/flag/log_manifest
config_entry_value = TRUE
/datum/config_entry/flag/log_job_debug // log roundstart divide occupations debug information to a file
/// log roundstart divide occupations debug information to a file
/datum/config_entry/flag/log_job_debug
config_entry_value = TRUE
/// log photos taken by players with a camera
/datum/config_entry/flag/log_pictures
/// This is... shitcode, literally same as above, if one of them is inactive, won't log at all, PLEASE FUCKING REMOVE THIS.
/datum/config_entry/flag/picture_logging_camera
/// forces log_href for tgui
/datum/config_entry/flag/emergency_tgui_logging
config_entry_value = FALSE
/datum/config_entry/number/error_cooldown // The "cooldown" time for each occurrence of a unique error
/// The "cooldown" time for each occurrence of a unique error
/datum/config_entry/number/error_cooldown
config_entry_value = 600
min_val = 0
/datum/config_entry/number/error_limit // How many occurrences before the next will silence them
/// How many occurrences before the next will silence them
/datum/config_entry/number/error_limit
config_entry_value = 50
/datum/config_entry/number/error_silence_time // How long a unique error will be silenced for
/// How long a unique error will be silenced for
/datum/config_entry/number/error_silence_time
config_entry_value = 6000
/datum/config_entry/number/error_msg_delay // How long to wait between messaging admins about occurrences of a unique error
/// How long to wait between messaging admins about occurrences of a unique error
/datum/config_entry/number/error_msg_delay
config_entry_value = 50
+15 -7
View File
@@ -116,6 +116,11 @@ SUBSYSTEM_DEF(air)
/datum/controller/subsystem/air/proc/auxtools_update_reactions()
/datum/controller/subsystem/air/proc/add_reaction(datum/gas_reaction/r)
gas_reactions += r
sortTim(gas_reactions, /proc/cmp_gas_reaction)
auxtools_update_reactions()
/proc/reset_all_air()
SSair.can_fire = 0
message_admins("Air reset begun.")
@@ -391,12 +396,15 @@ SUBSYSTEM_DEF(air)
*/
/datum/controller/subsystem/air/proc/run_delay_heuristics()
if(!equalize_enabled)
cost_equalize = 0
if(should_do_equalization)
eq_cooldown--
if(eq_cooldown <= 0)
equalize_enabled = TRUE
if(should_do_equalization)
if(!equalize_enabled)
cost_equalize = 0
if(should_do_equalization)
eq_cooldown--
if(eq_cooldown <= 0)
equalize_enabled = TRUE
else
equalize_enabled = FALSE
var/total_thread_time = cost_turfs + cost_equalize + cost_groups + cost_post_process
if(total_thread_time)
var/wait_ms = wait * 100
@@ -405,7 +413,7 @@ SUBSYSTEM_DEF(air)
eq_cooldown += (1-delay_threshold) * (cost_equalize / total_thread_time) * 2
if(eq_cooldown > 0.5)
equalize_enabled = FALSE
excited_group_pressure_goal = max(0,excited_group_pressure_goal_target * (1 - delay_threshold))
excited_group_pressure_goal = max(0,excited_group_pressure_goal_target * delay_threshold)
/datum/controller/subsystem/air/proc/process_turfs(resumed = 0)
+17
View File
@@ -14,6 +14,9 @@ SUBSYSTEM_DEF(atoms)
var/list/BadInitializeCalls = list()
/// Atoms that will be deleted once the subsystem is initialized
var/list/queued_deletions = list()
initialized = INITIALIZATION_INSSATOMS
/datum/controller/subsystem/atoms/Initialize(timeofday)
@@ -62,6 +65,12 @@ SUBSYSTEM_DEF(atoms)
testing("Late initialized [late_loaders.len] atoms")
late_loaders.Cut()
for (var/queued_deletion in queued_deletions)
qdel(queued_deletion)
testing("[queued_deletions.len] atoms were queued for deletion.")
queued_deletions.Cut()
/// Init this specific atom
/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments)
var/the_type = A.type
@@ -151,6 +160,14 @@ SUBSYSTEM_DEF(atoms)
if(fails & BAD_INIT_SLEPT)
. += "- Slept during Initialize()\n"
/// Prepares an atom to be deleted once the atoms SS is initialized.
/datum/controller/subsystem/atoms/proc/prepare_deletion(atom/target)
if (initialized == INITIALIZATION_INNEW_REGULAR)
// Atoms SS has already completed, just kill it now.
qdel(target)
else
queued_deletions += WEAKREF(target)
/datum/controller/subsystem/atoms/Shutdown()
var/initlog = InitLog()
if(initlog)

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