diff --git a/_maps/kilostation.json b/_maps/kilostation.json index 70e4b8a9b0c..72a537c74fa 100644 --- a/_maps/kilostation.json +++ b/_maps/kilostation.json @@ -2,6 +2,7 @@ "map_name": "Kilo Station", "map_path": "map_files/KiloStation", "map_file": "KiloStation.dmm", + "space_ruin_levels": 4, "shuttles": { "emergency": "emergency_kilo", "ferry": "ferry_kilo", diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index e6c8211cb09..04242823456 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -16,7 +16,7 @@ #define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage)) #define PERCENT(val) (round((val)*100, 0.1)) -#define CLAMP01(x) (CLAMP(x, 0, 1)) +#define CLAMP01(x) (clamp(x, 0, 1)) //time of day but automatically adjusts to the server going into the next day within the same round. //for when you need a reliable time number that doesn't depend on byond time. @@ -30,18 +30,14 @@ // round() acts like floor(x, 1) by default but can't handle other values #define FLOOR(x, y) ( round((x) / (y)) * (y) ) -#define CLAMP(CLVALUE,CLMIN,CLMAX) clamp(CLVALUE, CLMIN, CLMAX) - // Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive #define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ) // Real modulus that handles decimals #define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) ) -// Tangent -#define TAN(x) tan(x) // Cotangent -#define COT(x) (1 / TAN(x)) +#define COT(x) (1 / tan(x)) // Secant #define SEC(x) (1 / cos(x)) @@ -179,8 +175,8 @@ while(pixel_y < -16) pixel_y += 32 new_y-- - new_x = CLAMP(new_x, 0, world.maxx) - new_y = CLAMP(new_y, 0, world.maxy) + new_x = clamp(new_x, 0, world.maxx) + new_y = clamp(new_y, 0, world.maxy) return locate(new_x, new_y, starting.z) // Returns a list where [1] is all x values and [2] is all y values that overlap between the given pair of rectangles @@ -205,7 +201,7 @@ #define EXP_DISTRIBUTION(desired_mean) ( -(1/(1/desired_mean)) * log(rand(1, 1000) * 0.001) ) -#define LORENTZ_DISTRIBUTION(x, s) ( s*TAN(TODEGREES(PI*(rand()-0.5))) + x ) +#define LORENTZ_DISTRIBUTION(x, s) ( s*tan(TODEGREES(PI*(rand()-0.5))) + x ) #define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 ) #define RULE_OF_THREE(a, b, x) ((a*x)/b) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 89097b48e3f..0160aecb034 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -266,6 +266,7 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) #define FIRST_DIAG_STEP 1 #define SECOND_DIAG_STEP 2 +#define DEADCHAT_ANNOUNCEMENT "announcement" #define DEADCHAT_ARRIVALRATTLE "arrivalrattle" #define DEADCHAT_DEATHRATTLE "deathrattle" #define DEADCHAT_LAWCHANGE "lawchange" diff --git a/code/__DEFINES/robots.dm b/code/__DEFINES/robots.dm index e45ba3d2bb2..8da9a806493 100644 --- a/code/__DEFINES/robots.dm +++ b/code/__DEFINES/robots.dm @@ -4,11 +4,11 @@ //Bot defines, placed here so they can be read by other things! #define BOT_STEP_DELAY 4 //Delay between movemements -#define BOT_STEP_MAX_RETRIES 5 //Maximum times a bot will retry to step from its position +#define BOT_STEP_MAX_RETRIES 5 //Maximum times a bot will retry to step from its position #define DEFAULT_SCAN_RANGE 7 //default view range for finding targets. -//Mode defines +//Mode defines. If you add a new one make sure you update mode_name in /mob/living/simple_animal/bot #define BOT_IDLE 0 // idle #define BOT_HUNT 1 // found target, hunting #define BOT_PREP_ARREST 2 // at target, preparing to arrest @@ -27,6 +27,7 @@ #define BOT_NAV 15 // computing navigation #define BOT_WAIT_FOR_NAV 16 // waiting for nav computation #define BOT_NO_ROUTE 17 // no destination beacon found (or no route) +#define BOT_SHOWERSTANCE 18 // cleaning unhygienic humans //Bot types #define SEC_BOT (1<<0) // Secutritrons (Beepsky) and ED-209s @@ -36,6 +37,7 @@ #define MED_BOT (1<<4) // Medibots #define HONK_BOT (1<<5) // Honkbots & ED-Honks #define FIRE_BOT (1<<6) // Firebots +#define HYGIENE_BOT (1<<7) // Hygienebots //AI notification defines #define NEW_BORG 1 diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index b0e42aff3fc..605bd0d3aab 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -425,7 +425,7 @@ GLOBAL_LIST_EMPTY(species_list) var/override = FALSE if(M.client.holder && (chat_toggles & CHAT_DEAD)) override = TRUE - if(HAS_TRAIT(M, TRAIT_SIXTHSENSE)) + if(HAS_TRAIT(M, TRAIT_SIXTHSENSE) && message_type == DEADCHAT_REGULAR) override = TRUE if(isnewplayer(M) && !override) continue diff --git a/code/__HELPERS/radio.dm b/code/__HELPERS/radio.dm index 1d3c9bf3441..a8baf3a1d7d 100644 --- a/code/__HELPERS/radio.dm +++ b/code/__HELPERS/radio.dm @@ -2,9 +2,9 @@ /proc/sanitize_frequency(frequency, free = FALSE) frequency = round(frequency) if(free) - . = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ) + . = clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ) else - . = CLAMP(frequency, MIN_FREQ, MAX_FREQ) + . = clamp(frequency, MIN_FREQ, MAX_FREQ) if(!(. % 2)) // Ensure the last digit is an odd number . += 1 diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 88f5d5130e8..70a24287f3a 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -850,8 +850,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list( 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) + 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) /proc/screen_loc2turf(text, turf/origin, client/C) @@ -864,8 +864,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list( tX = text2num(tX[2]) tZ = origin.z var/list/actual_view = getviewsize(C ? C.view : world.view) - tX = CLAMP(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx) - tY = CLAMP(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy) + tX = clamp(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx) + tY = clamp(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy) return locate(tX, tY, tZ) /proc/IsValidSrc(datum/D) diff --git a/code/_globalvars/lists/maintenance_loot.dm b/code/_globalvars/lists/maintenance_loot.dm index d70564bc151..b48c311c692 100644 --- a/code/_globalvars/lists/maintenance_loot.dm +++ b/code/_globalvars/lists/maintenance_loot.dm @@ -216,6 +216,7 @@ GLOBAL_LIST_INIT(uncommon_loot, list(//uncommon: useful items list(//food /obj/item/reagent_containers/food/snacks/canned/peaches/maint = 1, + /obj/item/storage/box/gum/happiness = 1, /obj/item/storage/box/donkpockets = 1, list(//Donk Varieties /obj/item/storage/box/donkpockets/donkpocketspicy = 1, diff --git a/code/_onclick/hud/picture_in_picture.dm b/code/_onclick/hud/picture_in_picture.dm index e028212e96b..5e474331f61 100644 --- a/code/_onclick/hud/picture_in_picture.dm +++ b/code/_onclick/hud/picture_in_picture.dm @@ -102,8 +102,8 @@ add_overlay(standard_background) /obj/screen/movable/pic_in_pic/proc/set_view_size(width, height, do_refresh = TRUE) - width = CLAMP(width, 0, max_dimensions) - height = CLAMP(height, 0, max_dimensions) + width = clamp(width, 0, max_dimensions) + height = clamp(height, 0, max_dimensions) src.width = width src.height = height diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index ddb8aedad18..d8a1281df82 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -47,7 +47,7 @@ /obj/screen/plane_master/floor/backdrop(mob/mymob) filters = list() if(istype(mymob) && mymob.eye_blurry) - filters += GAUSSIAN_BLUR(CLAMP(mymob.eye_blurry*0.1,0.6,3)) + filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3)) /obj/screen/plane_master/game_world name = "game world plane master" @@ -60,7 +60,7 @@ if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion) filters += AMBIENT_OCCLUSION if(istype(mymob) && mymob.eye_blurry) - filters += GAUSSIAN_BLUR(CLAMP(mymob.eye_blurry*0.1,0.6,3)) + filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3)) /obj/screen/plane_master/lighting name = "lighting plane master" diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 47bf212c768..4dc2da3f741 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -129,9 +129,9 @@ /obj/item/proc/get_clamped_volume() if(w_class) if(force) - return CLAMP((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100 + return clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100 else - return CLAMP(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100 + return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100 /mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area) var/message_verb = "attacked" diff --git a/code/controllers/configuration/config_entry.dm b/code/controllers/configuration/config_entry.dm index 0115d5cb975..b6245085b38 100644 --- a/code/controllers/configuration/config_entry.dm +++ b/code/controllers/configuration/config_entry.dm @@ -98,7 +98,7 @@ return FALSE var/temp = text2num(trim(str_val)) if(!isnull(temp)) - config_entry_value = CLAMP(integer ? round(temp) : temp, min_val, max_val) + config_entry_value = clamp(integer ? round(temp) : temp, min_val, max_val) if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED)) log_config("Changing [name] from [temp] to [config_entry_value]!") return TRUE diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 8966f85d2f9..1a8d7d4e2d8 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -235,7 +235,7 @@ SUBSYSTEM_DEF(shuttle) var/area/A = get_area(user) log_shuttle("[key_name(user)] has called the emergency shuttle.") - deadchat_broadcast(" has called the shuttle at [A.name].", "[user.real_name]", user) + deadchat_broadcast(" has called the shuttle at [A.name].", "[user.real_name]", user, message_type=DEADCHAT_ANNOUNCEMENT) if(call_reason) SSblackbox.record_feedback("text", "shuttle_reason", 1, "[call_reason]") log_shuttle("Shuttle call reason: [call_reason]") @@ -273,7 +273,7 @@ SUBSYSTEM_DEF(shuttle) emergency.cancel(get_area(user)) log_shuttle("[key_name(user)] has recalled the shuttle.") message_admins("[ADMIN_LOOKUPFLW(user)] has recalled the shuttle.") - deadchat_broadcast(" has recalled the shuttle from [get_area_name(user, TRUE)].", "[user.real_name]", user) + deadchat_broadcast(" has recalled the shuttle from [get_area_name(user, TRUE)].", "[user.real_name]", user, message_type=DEADCHAT_ANNOUNCEMENT) return 1 /datum/controller/subsystem/shuttle/proc/canRecall() diff --git a/code/datums/components/butchering.dm b/code/datums/components/butchering.dm index 98d519dd6a8..6a964029b47 100644 --- a/code/datums/components/butchering.dm +++ b/code/datums/components/butchering.dm @@ -55,7 +55,7 @@ log_combat(user, H, "starts slicing the throat of") playsound(H.loc, butcher_sound, 50, TRUE, -1) - if(do_mob(user, H, CLAMP(500 / source.force, 30, 100)) && H.Adjacent(source)) + if(do_mob(user, H, clamp(500 / source.force, 30, 100)) && H.Adjacent(source)) if(H.has_status_effect(/datum/status_effect/neck_slice)) user.show_message("[H]'s neck has already been already cut, you can't make the bleeding any worse!", MSG_VISUAL, \ "Their neck has already been already cut, you can't make the bleeding any worse!") @@ -65,7 +65,7 @@ "[user] slits your throat...") log_combat(user, H, "finishes slicing the throat of") H.apply_damage(source.force, BRUTE, BODY_ZONE_HEAD) - H.bleed_rate = CLAMP(H.bleed_rate + 20, 0, 30) + H.bleed_rate = clamp(H.bleed_rate + 20, 0, 30) H.apply_status_effect(/datum/status_effect/neck_slice) /datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat) diff --git a/code/datums/components/fantasy/prefixes.dm b/code/datums/components/fantasy/prefixes.dm index 11705540cb2..7445ab582bf 100644 --- a/code/datums/components/fantasy/prefixes.dm +++ b/code/datums/components/fantasy/prefixes.dm @@ -54,7 +54,7 @@ /datum/fantasy_affix/pyromantic/apply(datum/component/fantasy/comp, newName) var/obj/item/master = comp.parent - comp.appliedComponents += master.AddComponent(/datum/component/igniter, CLAMP(comp.quality, 1, 10)) + comp.appliedComponents += master.AddComponent(/datum/component/igniter, clamp(comp.quality, 1, 10)) return "pyromantic [newName]" /datum/fantasy_affix/vampiric diff --git a/code/datums/components/gps.dm b/code/datums/components/gps.dm index 890a854694c..d3f1a91b117 100644 --- a/code/datums/components/gps.dm +++ b/code/datums/components/gps.dm @@ -88,7 +88,7 @@ GLOBAL_LIST_EMPTY(GPS_list) if(!ui) // Variable window height, depending on how many GPS units there are // to show, clamped to relatively safe range. - var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700) + var/gps_window_height = clamp(325 + GLOB.GPS_list.len * 14, 325, 700) ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height ui.open() diff --git a/code/datums/components/mirage_border.dm b/code/datums/components/mirage_border.dm index d5d32010cd1..a366f4b822f 100644 --- a/code/datums/components/mirage_border.dm +++ b/code/datums/components/mirage_border.dm @@ -14,8 +14,8 @@ var/x = target.x var/y = target.y var/z = target.z - var/turf/southwest = locate(CLAMP(x - (direction & WEST ? range : 0), 1, world.maxx), CLAMP(y - (direction & SOUTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz)) - var/turf/northeast = locate(CLAMP(x + (direction & EAST ? range : 0), 1, world.maxx), CLAMP(y + (direction & NORTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz)) + var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz)) + var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz)) //holder.vis_contents += block(southwest, northeast) // This doesnt work because of beta bug memes for(var/i in block(southwest, northeast)) holder.vis_contents += i diff --git a/code/datums/components/nanites.dm b/code/datums/components/nanites.dm index 64870dfca6d..15b5169bba3 100644 --- a/code/datums/components/nanites.dm +++ b/code/datums/components/nanites.dm @@ -176,7 +176,7 @@ return (nanite_volume > 0) /datum/component/nanites/proc/adjust_nanites(datum/source, amount) - nanite_volume = CLAMP(nanite_volume + amount, 0, max_nanites) + nanite_volume = clamp(nanite_volume + amount, 0, max_nanites) if(nanite_volume <= 0) //oops we ran out qdel(src) @@ -188,7 +188,7 @@ if(remove || stealth) return //bye icon var/nanite_percent = (nanite_volume / max_nanites) * 100 - nanite_percent = CLAMP(CEILING(nanite_percent, 10), 10, 100) + nanite_percent = clamp(CEILING(nanite_percent, 10), 10, 100) holder.icon_state = "nanites[nanite_percent]" /datum/component/nanites/proc/on_emp(datum/source, severity) @@ -250,13 +250,13 @@ return FALSE /datum/component/nanites/proc/set_volume(datum/source, amount) - nanite_volume = CLAMP(amount, 0, max_nanites) + nanite_volume = clamp(amount, 0, max_nanites) /datum/component/nanites/proc/set_max_volume(datum/source, amount) max_nanites = max(1, max_nanites) /datum/component/nanites/proc/set_cloud(datum/source, amount) - cloud_id = CLAMP(amount, 0, 100) + cloud_id = clamp(amount, 0, 100) /datum/component/nanites/proc/set_cloud_sync(datum/source, method) switch(method) @@ -268,7 +268,7 @@ cloud_active = TRUE /datum/component/nanites/proc/set_safety(datum/source, amount) - safety_threshold = CLAMP(amount, 0, max_nanites) + safety_threshold = clamp(amount, 0, max_nanites) /datum/component/nanites/proc/set_regen(datum/source, amount) regen_rate = amount diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 1e12ff9fd33..840893d906b 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -335,8 +335,8 @@ numbered_contents = _process_numerical_display() adjusted_contents = numbered_contents.len - var/columns = CLAMP(max_items, 1, screen_max_columns) - var/rows = CLAMP(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows) + var/columns = clamp(max_items, 1, screen_max_columns) + var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows) standard_orient_objs(rows, columns, numbered_contents) //This proc draws out the inventory and places the items on it. It uses the standard position. diff --git a/code/datums/components/wet_floor.dm b/code/datums/components/wet_floor.dm index fd2a82ce042..c138a2a377f 100644 --- a/code/datums/components/wet_floor.dm +++ b/code/datums/components/wet_floor.dm @@ -177,7 +177,7 @@ /datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum) var/time = 0 if(LAZYACCESS(time_left_list, "[type]")) - time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum) + time = clamp(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum) else time = min(duration_minimum, duration_maximum) LAZYSET(time_left_list, "[type]", time) diff --git a/code/datums/dash_weapon.dm b/code/datums/dash_weapon.dm index 60ecc62f766..0e22a4f350f 100644 --- a/code/datums/dash_weapon.dm +++ b/code/datums/dash_weapon.dm @@ -43,7 +43,7 @@ addtimer(CALLBACK(src, .proc/charge), charge_rate) /datum/action/innate/dash/proc/charge() - current_charges = CLAMP(current_charges + 1, 0, max_charges) + current_charges = clamp(current_charges + 1, 0, max_charges) holder.update_action_buttons_icon() if(recharge_sound) playsound(dashing_item, recharge_sound, 50, TRUE) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index b6b1b55a8cd..9d269370c7c 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -248,7 +248,7 @@ SetSpread(DISEASE_SPREAD_BLOOD) permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1) - cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20 + cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20 stage_prob = max(properties["stage_rate"], 2) SetSeverity(properties["severity"]) GenerateCure(properties) @@ -303,7 +303,7 @@ // Will generate a random cure, the more resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure() if(properties && properties.len) - var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) + var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) if(res == oldres) return cures = list(pick(advance_cures[res])) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index d6db4de908f..4cd81eaa973 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -607,7 +607,7 @@ if(elligible_organs.len) var/obj/item/organ/O = pick(elligible_organs) O.Remove(src) - visible_message("[src] vomits up their [O.name]!", "You vomit up your [O.name]") //no "vomit up your the heart" + visible_message("[src] vomits up their [O.name]!", "You vomit up your [O.name]") //no "vomit up your the heart" O.forceMove(drop_location()) if(prob(20)) O.animate_atom_living() diff --git a/code/datums/elements/selfknockback.dm b/code/datums/elements/selfknockback.dm index ae918de9ea1..5e153579d6a 100644 --- a/code/datums/elements/selfknockback.dm +++ b/code/datums/elements/selfknockback.dm @@ -14,12 +14,12 @@ clamping the Knockback_Force value below. */ RegisterSignal(target, COMSIG_ITEM_AFTERATTACK, .proc/Item_SelfKnockback) else if(isprojectile(target)) RegisterSignal(target, COMSIG_PROJECTILE_FIRE, .proc/Projectile_SelfKnockback) - else + else return ELEMENT_INCOMPATIBLE - + override_throw_val = throw_amount override_speed_val = speed_amount - + /datum/element/selfknockback/Detach(datum/source, force) . = ..() UnregisterSignal(source, list(COMSIG_ITEM_AFTERATTACK, COMSIG_PROJECTILE_FIRE)) @@ -40,8 +40,8 @@ clamping the Knockback_Force value below. */ if(isturf(attacktarget) && !attacktarget.density) return if(proximity_flag || (get_dist(attacktarget, usertarget) <= I.reach)) - var/knockback_force = Get_Knockback_Force(CLAMP(CEILING((I.force / 10), 1), 1, 5)) - var/knockback_speed = Get_Knockback_Speed(CLAMP(knockback_force, 1, 5)) + var/knockback_force = Get_Knockback_Force(clamp(CEILING((I.force / 10), 1), 1, 5)) + var/knockback_speed = Get_Knockback_Speed(clamp(knockback_force, 1, 5)) var/target_angle = Get_Angle(attacktarget, usertarget) var/move_target = get_ranged_target_turf(usertarget, angle2dir(target_angle), knockback_force) @@ -52,8 +52,8 @@ clamping the Knockback_Force value below. */ if(!P.firer) return - var/knockback_force = Get_Knockback_Force(CLAMP(CEILING((P.damage / 10), 1), 1, 5)) - var/knockback_speed = Get_Knockback_Speed(CLAMP(knockback_force, 1, 5)) + var/knockback_force = Get_Knockback_Force(clamp(CEILING((P.damage / 10), 1), 1, 5)) + var/knockback_speed = Get_Knockback_Speed(clamp(knockback_force, 1, 5)) var/atom/movable/knockback_target = P.firer var/move_target = get_edge_target_turf(knockback_target, angle2dir(P.original_angle+180)) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index b748d1d3bfa..f751de8bc86 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -121,14 +121,14 @@ GLOBAL_LIST_EMPTY(explosions) if(dist <= round(max_range + world.view - 2, 1)) M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound) if(baseshakeamount > 0) - shake_camera(M, 25, CLAMP(baseshakeamount, 0, 10)) + shake_camera(M, 25, clamp(baseshakeamount, 0, 10)) // You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station. else if(dist <= far_dist) - var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist + var/far_volume = clamp(far_dist, 30, 50) // Volume is based on explosion size and dist far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion M.playsound_local(epicenter, null, far_volume, 1, frequency, falloff = 5, S = far_explosion_sound) if(baseshakeamount > 0) - shake_camera(M, 10, CLAMP(baseshakeamount*0.25, 0, 2.5)) + shake_camera(M, 10, clamp(baseshakeamount*0.25, 0, 2.5)) EX_PREPROCESS_CHECK_TICK //postpone processing for a bit diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index dc95d24ea37..e67b30b3915 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -106,7 +106,7 @@ to_chat(A, "You pound [D] on the chest!") playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, TRUE, -1) if(D.losebreath <= 10) - D.losebreath = CLAMP(D.losebreath + 5, 0, 10) + D.losebreath = clamp(D.losebreath + 5, 0, 10) D.adjustOxyLoss(10) log_combat(A, D, "quickchoked") return 1 @@ -118,7 +118,7 @@ playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, TRUE, -1) D.apply_damage(5, A.dna.species.attack_type) if(D.silent <= 10) - D.silent = CLAMP(D.silent + 10, 0, 10) + D.silent = clamp(D.silent + 10, 0, 10) log_combat(A, D, "neck chopped") return 1 diff --git a/code/datums/mood_events/drug_events.dm b/code/datums/mood_events/drug_events.dm index 15102a0cfe8..5b30b521837 100644 --- a/code/datums/mood_events/drug_events.dm +++ b/code/datums/mood_events/drug_events.dm @@ -11,7 +11,7 @@ description = "I hate that brand of cigarettes.\n" mood_change = -2 timeout = 6 MINUTES - + /datum/mood_event/overdose mood_change = -8 timeout = 5 MINUTES @@ -44,7 +44,7 @@ description = "[drug_name]! [drug_name]! [drug_name]!\n" /datum/mood_event/happiness_drug - description = "I can't feel anything and I never want this to end.\n" + description = "Can't feel a thing...\n" mood_change = 50 /datum/mood_event/happiness_drug_good_od diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm index ac4bf863a73..1d27c35e776 100644 --- a/code/datums/mutations/actions.dm +++ b/code/datums/mutations/actions.dm @@ -342,11 +342,11 @@ chems = new chems.transfered = embedded_mob chems.spikey = src - to_chat(fired_by, "Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!") + to_chat(fired_by, "Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!") chems.Grant(fired_by) /obj/item/hardened_spike/chem/unembedded() - to_chat(fired_by, "Link lost!") + to_chat(fired_by, "Link lost!") QDEL_NULL(chems) ..() diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index 183b2235be3..2d3ad4551f2 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -42,7 +42,7 @@ if (user.client) user.client.images += bar - progress = CLAMP(progress, 0, goal) + progress = clamp(progress, 0, goal) last_progress = progress bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]" if (!shown) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f5845c25252..9ea7c421fe3 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -862,6 +862,22 @@ color = C return + +///Proc for being washed by a shower +/atom/proc/washed(var/atom/washer) + . = SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) + remove_atom_colour(WASHABLE_COLOUR_PRIORITY) + + var/datum/component/radioactive/healthy_green_glow = GetComponent(/datum/component/radioactive) + if(!healthy_green_glow || QDELETED(healthy_green_glow)) + return + var/strength = healthy_green_glow.strength + if(strength <= RAD_BACKGROUND_RADIATION) + qdel(healthy_green_glow) + return + healthy_green_glow.strength -= max(0, (healthy_green_glow.strength - (RAD_BACKGROUND_RADIATION * 2)) * 0.2) + + /** * call back when a var is edited on this atom * diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index 36f29b5ae8c..574df08d169 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -290,10 +290,10 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) generate_threat() var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min) - latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time + latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min) - midround_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time + midround_injection_cooldown = round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time log_game("DYNAMIC: Dynamic Mode initialized with a Threat Level of... [threat_level]!") return TRUE @@ -624,7 +624,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) // Somehow it managed to trigger midround multiple times so this was moved here. // There is no way this should be able to trigger an injection twice now. var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min) - midround_injection_cooldown = (round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time) + midround_injection_cooldown = (round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time) // Time to inject some threat into the round if(EMERGENCY_ESCAPED_OR_ENDGAMED) // Unless the shuttle is gone @@ -753,7 +753,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) if (drafted_rules.len > 0 && picking_midround_latejoin_rule(drafted_rules)) var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min) - latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time + latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time /// Refund threat, but no more than threat_level. /datum/game_mode/dynamic/proc/refund_threat(regain) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index a8ecc841597..e64700d8084 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -651,6 +651,6 @@ if (prob(meteorminutes/2)) wavetype = GLOB.meteors_catastrophic - var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10) + var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10) spawn_meteors(ramp_up_final, wavetype) diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 8bcbb3669b5..3b88abfb83b 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -26,7 +26,7 @@ if (prob(meteorminutes/2)) wavetype = GLOB.meteors_catastrophic - var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10) + var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10) spawn_meteors(ramp_up_final, wavetype) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 8179e7f227c..05780c4e776 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -174,7 +174,7 @@ var/multiplier = text2num(href_list["multiplier"]) var/is_stack = ispath(being_built.build_path, /obj/item/stack) - multiplier = CLAMP(multiplier,1,50) + multiplier = clamp(multiplier,1,50) ///////////////// diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 69118856363..10994a9f4c2 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -152,7 +152,7 @@ return log_activity("changed greater than charge filter to \"[new_filter]\"") if(new_filter) - new_filter = CLAMP(new_filter, 0, 100) + new_filter = clamp(new_filter, 0, 100) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) result_filters["Charge Above"] = new_filter if(href_list["below_filter"]) @@ -162,7 +162,7 @@ return log_activity("changed lesser than charge filter to \"[new_filter]\"") if(new_filter) - new_filter = CLAMP(new_filter, 0, 100) + new_filter = clamp(new_filter, 0, 100) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) result_filters["Charge Below"] = new_filter if(href_list["access_filter"]) diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index a2e3efb9e5c..7c4222a07ea 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -307,7 +307,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers) if("rate") var/target = text2num(params["rate"]) if(!isnull(target)) - target = CLAMP(target, 0, MAX_TRANSFER_RATE) + target = clamp(target, 0, MAX_TRANSFER_RATE) signal.data += list("tag" = input_tag, "set_volume_rate" = target) . = TRUE if("output") @@ -316,7 +316,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers) if("pressure") var/target = text2num(params["pressure"]) if(!isnull(target)) - target = CLAMP(target, 0, 4500) + target = clamp(target, 0, 4500) signal.data += list("tag" = output_tag, "set_internal_pressure" = target) . = TRUE radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index f45cd30ae0e..02cb0af50e9 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -109,7 +109,7 @@ var/security_level = get_security_level() log_game("[key_name(usr)] has changed the security level to [security_level] with [src] at [AREACOORD(usr)].") message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [security_level] with [src] at [AREACOORD(usr)].") - deadchat_broadcast(" has changed the security level to [security_level] with [src] at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" has changed the security level to [security_level] with [src] at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) tmp_alertlevel = 0 else to_chat(usr, "You are not authorized to do this!") @@ -144,7 +144,7 @@ minor_announce(input, title = "Outgoing message to allied station") usr.log_talk(input, LOG_SAY, tag="message to the other server") message_admins("[ADMIN_LOOKUPFLW(usr)] has sent a message to the other server.") - deadchat_broadcast(" has sent an outgoing message to the other station(s).", "[usr.real_name]", usr) + deadchat_broadcast(" has sent an outgoing message to the other station(s).", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) CM.lastTimeUsed = world.time if("purchase_menu") @@ -250,13 +250,13 @@ make_maint_all_access() log_game("[key_name(usr)] enabled emergency maintenance access.") message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.") - deadchat_broadcast(" enabled emergency maintenance access at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" enabled emergency maintenance access at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) state = STATE_DEFAULT if("disableemergency") revoke_maint_all_access() log_game("[key_name(usr)] disabled emergency maintenance access.") message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.") - deadchat_broadcast(" disabled emergency maintenance access at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" disabled emergency maintenance access at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) state = STATE_DEFAULT // Status display stuff @@ -290,7 +290,7 @@ CentCom_announce(input, usr) to_chat(usr, "Message transmitted to Central Command.") usr.log_talk(input, LOG_SAY, tag="CentCom announcement") - deadchat_broadcast(" has messaged CentCom, \"[input]\" at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" has messaged CentCom, \"[input]\" at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) CM.lastTimeUsed = world.time // OMG SYNDICATE ...LETTERHEAD @@ -307,7 +307,7 @@ Syndicate_announce(input, usr) to_chat(usr, "SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.") usr.log_talk(input, LOG_SAY, tag="Syndicate announcement") - deadchat_broadcast(" has messaged the Syndicate, \"[input]\" at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" has messaged the Syndicate, \"[input]\" at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) CM.lastTimeUsed = world.time if("RestoreBackup") @@ -392,7 +392,7 @@ var/security_level = get_security_level() log_game("[key_name(usr)] has changed the security level to [security_level] from [src] at [AREACOORD(usr)].") message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [security_level] from [src] at [AREACOORD(usr)].") - deadchat_broadcast(" has changed the security level to [security_level] from [src] at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" has changed the security level to [security_level] from [src] at [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) tmp_alertlevel = 0 aistate = STATE_DEFAULT if("ai-changeseclevel") @@ -403,13 +403,13 @@ make_maint_all_access() log_game("[key_name(usr)] enabled emergency maintenance access.") message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.") - deadchat_broadcast(" enabled emergency maintenance access.", "[usr.real_name]", usr) + deadchat_broadcast(" enabled emergency maintenance access.", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) aistate = STATE_DEFAULT if("ai-disableemergency") revoke_maint_all_access() log_game("[key_name(usr)] disabled emergency maintenance access.") message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.") - deadchat_broadcast(" disabled emergency maintenance access.", "[usr.real_name]", usr) + deadchat_broadcast(" disabled emergency maintenance access.", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) aistate = STATE_DEFAULT updateUsrDialog() @@ -715,7 +715,7 @@ else input = user.treat_message(input) //Adds slurs and so on. Someone should make this use languages too. SScommunications.make_announcement(user, is_silicon, input) - deadchat_broadcast(" made a priority announcement from [get_area_name(usr, TRUE)].", "[user.real_name]", user) + deadchat_broadcast(" made a priority announcement from [get_area_name(usr, TRUE)].", "[user.real_name]", user, message_type=DEADCHAT_ANNOUNCEMENT) /obj/machinery/computer/communications/proc/post_status(command, data1, data2) diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 4f1334cd37d..5fea233e655 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -604,13 +604,13 @@ if("setbufferlabel") var/text = sanitize(input(usr, "Input a new label:", "Input a Text", null) as text|null) if(num && text) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[num] if(istype(buffer_slot)) buffer_slot["label"] = text if("setbuffer") if(num && viable_occupant) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) buffer[num] = list( "label"="Buffer[num]:[viable_occupant.real_name]", "UI"=viable_occupant.dna.uni_identity, @@ -620,7 +620,7 @@ ) if("clearbuffer") if(num) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[num] if(istype(buffer_slot)) buffer_slot.Cut() @@ -635,7 +635,7 @@ apply_buffer(SCANNER_ACTION_MIXED,num) if("injector") if(num && injectorready < world.time) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[num] if(istype(buffer_slot)) var/obj/item/dnainjector/timed/I @@ -662,11 +662,11 @@ injectorready = world.time + INJECTOR_TIMEOUT if("loaddisk") if(num && diskette && diskette.fields) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) buffer[num] = diskette.fields.Copy() if("savedisk") if(num && diskette && !diskette.read_only) - num = CLAMP(num, 1, NUMBER_OF_BUFFERS) + num = clamp(num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[num] if(istype(buffer_slot)) diskette.name = "data disk \[[buffer_slot["label"]]\]" @@ -955,7 +955,7 @@ return viable_occupant /obj/machinery/computer/scan_consolenew/proc/apply_buffer(action,buffer_num) - buffer_num = CLAMP(buffer_num, 1, NUMBER_OF_BUFFERS) + buffer_num = clamp(buffer_num, 1, NUMBER_OF_BUFFERS) var/list/buffer_slot = buffer[buffer_num] var/mob/living/carbon/viable_occupant = get_viable_occupant() if(istype(buffer_slot)) diff --git a/code/game/machinery/computer/prisoner/gulag_teleporter.dm b/code/game/machinery/computer/prisoner/gulag_teleporter.dm index 40d9434ce3d..9da901cd20e 100644 --- a/code/game/machinery/computer/prisoner/gulag_teleporter.dm +++ b/code/game/machinery/computer/prisoner/gulag_teleporter.dm @@ -97,7 +97,7 @@ return if(!new_goal) new_goal = default_goal - contained_id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points + contained_id.goal = clamp(new_goal, 0, 1000) //maximum 1000 points return TRUE if("toggle_open") if(teleporter.locked) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 356cd54c990..a9573e2a1ee 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -33,7 +33,7 @@ to_chat(user, "You begin repairing [src]...") if(I.use_tool(src, user, 40, volume=40)) - obj_integrity = CLAMP(obj_integrity + 20, 0, max_integrity) + obj_integrity = clamp(obj_integrity + 20, 0, max_integrity) else return ..() diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 38aca8e7e74..4e5fa5f48ae 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -138,7 +138,7 @@ . /= 10 /obj/machinery/door_timer/proc/set_timer(value) - var/new_time = CLAMP(value,0,MAX_TIMER) + var/new_time = clamp(value,0,MAX_TIMER) . = new_time == timer_duration //return 1 on no change timer_duration = new_time diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm index 8ef69e39322..265832a6a74 100644 --- a/code/game/machinery/launch_pad.dm +++ b/code/game/machinery/launch_pad.dm @@ -102,9 +102,9 @@ if(teleporting) return if(!isnull(x)) - x_offset = CLAMP(x, -range, range) + x_offset = clamp(x, -range, range) if(!isnull(y)) - y_offset = CLAMP(y, -range, range) + y_offset = clamp(y, -range, range) update_indicator() /obj/machinery/launchpad/proc/doteleport(mob/user, sending) diff --git a/code/game/machinery/medipen_refiller.dm b/code/game/machinery/medipen_refiller.dm index 1182440f2d0..3dc2090260e 100644 --- a/code/game/machinery/medipen_refiller.dm +++ b/code/game/machinery/medipen_refiller.dm @@ -66,9 +66,9 @@ ..() /obj/machinery/medipen_refiller/plunger_act(obj/item/plunger/P, mob/living/user, reinforced) - to_chat(user, "You start furiously plunging [name].") + to_chat(user, "You start furiously plunging [name].") if(do_after(user, 30, target = src)) - to_chat(user, "You finish plunging the [name].") + to_chat(user, "You finish plunging the [name].") reagents.reaction(get_turf(src), TOUCH) reagents.clear_reagents() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index e64ef7aba17..5b72ef26844 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -55,9 +55,9 @@ new /obj/item/pipe_meter(loc) wait = world.time + 15 if(href_list["layer_up"]) - piping_layer = CLAMP(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX) + piping_layer = clamp(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX) if(href_list["layer_down"]) - piping_layer = CLAMP(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX) + piping_layer = clamp(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX) return /obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 351c432b8f2..783da0c5eaa 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -245,13 +245,13 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) to_department = GLOB.req_console_ckey_departments[to_department] message = new_message screen = REQ_SCREEN_AUTHENTICATE - priority = CLAMP(text2num(href_list["priority"]), REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY) + priority = clamp(text2num(href_list["priority"]), REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY) if(href_list["writeAnnouncement"]) var/new_message = reject_bad_text(stripped_input(usr, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN)) if(new_message) message = new_message - priority = CLAMP(text2num(href_list["priority"]) || REQ_NORMAL_MESSAGE_PRIORITY, REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY) + priority = clamp(text2num(href_list["priority"]) || REQ_NORMAL_MESSAGE_PRIORITY, REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY) else message = "" announceAuth = FALSE @@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null) usr.log_talk(message, LOG_SAY, tag="station announcement from [src]") message_admins("[ADMIN_LOOKUPFLW(usr)] has made a station announcement from [src] at [AREACOORD(usr)].") - deadchat_broadcast(" made a station announcement from [get_area_name(usr, TRUE)].", "[usr.real_name]", usr) + deadchat_broadcast(" made a station announcement from [get_area_name(usr, TRUE)].", "[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT) announceAuth = FALSE message = "" screen = REQ_SCREEN_MAIN @@ -324,7 +324,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) //Handle screen switching if(href_list["setScreen"]) - var/set_screen = CLAMP(text2num(href_list["setScreen"]) || 0, REQ_SCREEN_MAIN, REQ_SCREEN_ANNOUNCE) + var/set_screen = clamp(text2num(href_list["setScreen"]) || 0, REQ_SCREEN_MAIN, REQ_SCREEN_ANNOUNCE) switch(set_screen) if(REQ_SCREEN_MAIN) to_department = "" diff --git a/code/game/machinery/roulette_machine.dm b/code/game/machinery/roulette_machine.dm index bb17ba0a4e0..6407b0e8b62 100644 --- a/code/game/machinery/roulette_machine.dm +++ b/code/game/machinery/roulette_machine.dm @@ -95,7 +95,7 @@ anchored = !anchored . = TRUE if("ChangeBetAmount") - chosen_bet_amount = CLAMP(text2num(params["amount"]), 10, 500) + chosen_bet_amount = clamp(text2num(params["amount"]), 10, 500) . = TRUE if("ChangeBetType") chosen_bet_type = params["type"] diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index 398c3d8243e..fb3880b90b6 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -216,7 +216,7 @@ . = TRUE if("set_nanite_cloud") var/new_cloud = text2num(params["new_cloud"]) - nanite_cloud = CLAMP(round(new_cloud, 1), 1, 100) + nanite_cloud = clamp(round(new_cloud, 1), 1, 100) . = TRUE //Some species are not scannable, like abductors (too unknown), androids (too artificial) or skeletons (too magic) if("set_target_species") diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 95f73e76490..454dedaf125 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -131,7 +131,7 @@ settableTemperatureRange = cap * 30 efficiency = (cap + 1) * 10000 - targetTemperature = CLAMP(targetTemperature, + targetTemperature = clamp(targetTemperature, max(settableTemperatureMedian - settableTemperatureRange, TCMB), settableTemperatureMedian + settableTemperatureRange) @@ -234,7 +234,7 @@ target= text2num(target) + T0C . = TRUE if(.) - targetTemperature = CLAMP(round(target), + targetTemperature = clamp(round(target), max(settableTemperatureMedian - settableTemperatureRange, TCMB), settableTemperatureMedian + settableTemperatureRange) if("eject") diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index cfc23656d8f..545e2d9ab63 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -192,12 +192,12 @@ /obj/machinery/syndicatebomb/proc/settings(mob/user) var/new_timer = input(user, "Please set the timer.", "Timer", "[timer_set]") as num|null - + if (isnull(new_timer)) return - + if(in_range(src, user) && isliving(user)) //No running off and setting bombs from across the station - timer_set = CLAMP(new_timer, minimum_timer, maximum_timer) + timer_set = clamp(new_timer, minimum_timer, maximum_timer) loc.visible_message("[icon2html(src, viewers(src))] timer set for [timer_set] seconds.") if(alert(user,"Would you like to start the countdown now?",,"Yes","No") == "Yes" && in_range(src, user) && isliving(user)) if(!active) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 7f19c69ca78..7ac11a09af7 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -65,7 +65,7 @@ /obj/machinery/mecha_part_fabricator/examine(mob/user) . = ..() if(in_range(user, src) || isobserver(user)) - . += "The status display reads: Storing up to [rmat.local_size] material units.
Material consumption at [component_coeff*100]%.
Build time reduced by [100-time_coeff*100]%." + . += "The status display reads: Storing up to [rmat.local_size] material units.
Material consumption at [component_coeff*100]%.
Build time reduced by [100-time_coeff*100]%.
" /obj/machinery/mecha_part_fabricator/emag_act() if(obj_flags & EMAGGED) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index b197c758c97..c6f8422c6cf 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -100,6 +100,9 @@ S.blood_state = blood_state update_icon() H.update_inv_shoes() +/atom/effect/decal/cleanable/washed(atom/washer) + . = ..() + qdel(src) /obj/effect/decal/cleanable/proc/can_bloodcrawl_in() if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY)) diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm index 082e02c587b..c385be7b793 100644 --- a/code/game/objects/items/chrono_eraser.dm +++ b/code/game/objects/items/chrono_eraser.dm @@ -203,7 +203,7 @@ /obj/structure/chrono_field/update_icon() var/ttk_frame = 1 - (tickstokill / initial(tickstokill)) - ttk_frame = CLAMP(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT) + ttk_frame = clamp(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT) if(ttk_frame != RPpos) RPpos = ttk_frame mob_underlay.icon_state = "frame[RPpos]" diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 0f9cdfbb014..1d5102bbaf1 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -702,7 +702,7 @@ if(!new_cost || (loc != user)) to_chat(user, "You must hold the circuitboard to change its cost!") return - custom_cost = CLAMP(round(new_cost, 1), 10, 1000) + custom_cost = clamp(round(new_cost, 1), 10, 1000) to_chat(user, "The cost is now set to [custom_cost].") /obj/item/circuitboard/machine/medical_kiosk/examine(mob/user) @@ -883,7 +883,7 @@ if(!new_cloud || (loc != user)) to_chat(user, "You must hold the circuitboard to change its Cloud ID!") return - cloud_id = CLAMP(round(new_cloud, 1), 1, 100) + cloud_id = clamp(round(new_cloud, 1), 1, 100) /obj/item/circuitboard/machine/public_nanite_chamber/examine(mob/user) . = ..() diff --git a/code/game/objects/items/crab17.dm b/code/game/objects/items/crab17.dm index 6cb0a22b5d4..1c6ad593585 100644 --- a/code/game/objects/items/crab17.dm +++ b/code/game/objects/items/crab17.dm @@ -210,7 +210,7 @@ bogdanoff = user addtimer(CALLBACK(src, .proc/startLaunch), 100) sound_to_playing_players('sound/items/dump_it.ogg', 20) - deadchat_broadcast("Protocol CRAB-17 has been activated. A space-coin market has been launched at the station!", turf_target = get_turf(src)) + deadchat_broadcast("Protocol CRAB-17 has been activated. A space-coin market has been launched at the station!", turf_target = get_turf(src), message_type=DEADCHAT_ANNOUNCEMENT) /obj/effect/dumpeetTarget/proc/startLaunch() DF = new /obj/effect/dumpeetFall(drop_location()) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 5219a3032fd..b89a60a326d 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -335,8 +335,8 @@ var/clicky if(click_params && click_params["icon-x"] && click_params["icon-y"]) - clickx = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) - clicky = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) + clickx = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) + clicky = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) if(!instant) to_chat(user, "You start drawing a [temp] on the [target.name]...") diff --git a/code/game/objects/items/devices/desynchronizer.dm b/code/game/objects/items/devices/desynchronizer.dm index d9735dea15b..f5b7cd58fdd 100644 --- a/code/game/objects/items/devices/desynchronizer.dm +++ b/code/game/objects/items/devices/desynchronizer.dm @@ -38,7 +38,7 @@ var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num if(new_duration) new_duration = new_duration SECONDS - new_duration = CLAMP(new_duration, 50, max_duration) + new_duration = clamp(new_duration, 50, max_duration) duration = new_duration to_chat(user, "You set the duration to [DisplayTimeText(duration)].") diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 8fe7c4b711b..e52cecc227c 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -276,11 +276,7 @@ STOP_PROCESSING(SSobj, src) /obj/item/flashlight/flare/ignition_effect(atom/A, mob/user) - if(fuel && on) - . = "[user] lights [A] with [src] like a real \ - badass." - else - . = "" + . = fuel && on ? "[user] lights [A] with [src] like a real badass." : "" /obj/item/flashlight/flare/proc/turn_off() on = FALSE diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 2ba67135243..de808acbd90 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -165,7 +165,7 @@ // Negative numbers will subtract /obj/item/lightreplacer/proc/AddUses(amount = 1) - uses = CLAMP(uses + amount, 0, max_uses) + uses = clamp(uses + amount, 0, max_uses) /obj/item/lightreplacer/proc/AddShards(amount = 1, user) bulb_shards += amount diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 24abd8fdc00..3a3bdec7ff2 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -250,7 +250,7 @@ effective or pretty fucking useless. charge = max(0,charge - 25)//Quick decrease in light else charge = min(max_charge,charge + 50) //Charge in the dark - animate(user,alpha = CLAMP(255 - charge,0,255),time = 10) + animate(user,alpha = clamp(255 - charge,0,255),time = 10) /obj/item/jammer diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 5b012089f8e..a30a22b6777 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -7,12 +7,14 @@ righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi' desc = "Regulates the transfer of air between two tanks." w_class = WEIGHT_CLASS_BULKY + var/ui_x = 310 + var/ui_y = 320 var/obj/item/tank/tank_one var/obj/item/tank/tank_two var/obj/item/assembly/attached_device var/mob/attacher = null var/valve_open = FALSE - var/toggle = 1 + var/toggle = TRUE /obj/item/transfer_valve/IsAssemblyHolder() return TRUE @@ -54,7 +56,7 @@ attacher = user return -//Attached device memes +//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction. /obj/item/transfer_valve/Move() . = ..() if(attached_device) @@ -74,58 +76,14 @@ if(attached_device) attached_device.Crossed(AM) -/obj/item/transfer_valve/attack_hand()//Triggers mousetraps +//Triggers mousetraps +/obj/item/transfer_valve/attack_hand() . = ..() if(.) return if(attached_device) attached_device.attack_hand() -//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction. - - -/obj/item/transfer_valve/attack_self(mob/user) - user.set_machine(src) - var/dat = {" Valve properties: -
Attachment one: [tank_one] [tank_one ? "Remove" : ""] -
Attachment two: [tank_two] [tank_two ? "Remove" : ""] -
Valve attachment: [attached_device ? "[attached_device]" : "None"] [attached_device ? "Remove" : ""] -
Valve status: [ valve_open ? "Closed Open" : "Closed Open"]"} - - var/datum/browser/popup = new(user, "trans_valve", name) - popup.set_content(dat) - popup.open() - return - -/obj/item/transfer_valve/Topic(href, href_list) - ..() - if(!usr.canUseTopic(src, BE_CLOSE)) - return - if(tank_one && href_list["tankone"]) - split_gases() - valve_open = FALSE - tank_one.forceMove(drop_location()) - tank_one = null - update_icon() - else if(tank_two && href_list["tanktwo"]) - split_gases() - valve_open = FALSE - tank_two.forceMove(drop_location()) - tank_two = null - update_icon() - else if(href_list["open"]) - toggle_valve() - else if(attached_device) - if(href_list["rem_device"]) - attached_device.on_detach() - attached_device = null - update_icon() - if(href_list["device"]) - attached_device.attack_self(usr) - - attack_self(usr) - add_fingerprint(usr) - /obj/item/transfer_valve/proc/process_activation(obj/item/D) if(toggle) toggle = FALSE @@ -186,11 +144,10 @@ tank_one.air_contents.merge(temp) tank_two.air_contents.volume -= tank_one.air_contents.volume - /* +/* Exadv1: I know this isn't how it's going to work, but this was just to check it explodes properly when it gets a signal (and it does). - */ - +*/ /obj/item/transfer_valve/proc/toggle_valve() if(!valve_open && tank_one && tank_two) valve_open = TRUE @@ -216,7 +173,6 @@ admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]" bomber_message = " - Last touched by: [key_name_admin(bomber)]" - var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]" GLOB.bombers += admin_bomb_message message_admins(admin_bomb_message) @@ -230,8 +186,58 @@ split_gases() valve_open = FALSE update_icon() - -// this doesn't do anything but the timer etc. expects it to be here -// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs +/* + This doesn't do anything but the timer etc. expects it to be here + eventually maybe have it update icon to show state (timer, prox etc.) like old bombs +*/ /obj/item/transfer_valve/proc/c_state() return + +/obj/item/transfer_valve/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "transfer_valve", name, ui_x, ui_y, master_ui, state) + ui.open() + +/obj/item/transfer_valve/ui_data(mob/user) + var/list/data = list() + data["tank_one"] = tank_one + data["tank_two"] = tank_two + data["attached_device"] = attached_device + data["valve"] = valve_open + return data + +/obj/item/transfer_valve/ui_act(action, params) + if(..()) + return + + switch(action) + if("tankone") + if(tank_one) + split_gases() + valve_open = FALSE + tank_one.forceMove(drop_location()) + tank_one = null + . = TRUE + if("tanktwo") + if(tank_two) + split_gases() + valve_open = FALSE + tank_two.forceMove(drop_location()) + tank_two = null + . = TRUE + if("toggle") + toggle_valve() + . = TRUE + if("device") + if(attached_device) + attached_device.attack_self(usr) + . = TRUE + if("remove_device") + if(attached_device) + attached_device.on_detach() + attached_device = null + . = TRUE + + update_icon() diff --git a/code/game/objects/items/dice.dm b/code/game/objects/items/dice.dm index 0e15f306885..25210566996 100644 --- a/code/game/objects/items/dice.dm +++ b/code/game/objects/items/dice.dm @@ -189,7 +189,7 @@ obj/item/dice/d6/ebony /obj/item/dice/proc/diceroll(mob/user) result = roll(sides) if(rigged != DICE_NOT_RIGGED && result != rigged_value) - if(rigged == DICE_BASICALLY_RIGGED && prob(CLAMP(1/(sides - 1) * 100, 25, 80))) + if(rigged == DICE_BASICALLY_RIGGED && prob(clamp(1/(sides - 1) * 100, 25, 80))) result = rigged_value else if(rigged == DICE_TOTALLY_RIGGED) result = rigged_value diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index e07d42edfce..ae5fc2dc426 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -273,7 +273,7 @@ var/newspread = text2num(stripped_input(user, "Please enter a new spread amount", name)) if (newspread != null && user.canUseTopic(src, BE_CLOSE)) newspread = round(newspread) - unit_spread = CLAMP(newspread, 5, 100) + unit_spread = clamp(newspread, 5, 100) to_chat(user, "You set the time release to [unit_spread] units per detonation.") if (newspread != unit_spread) to_chat(user, "The new value is out of bounds. Minimum spread is 5 units, maximum is 100 units.") diff --git a/code/game/objects/items/grenades/festive.dm b/code/game/objects/items/grenades/festive.dm index 4e35987cdd3..a7ae03bd125 100644 --- a/code/game/objects/items/grenades/festive.dm +++ b/code/game/objects/items/grenades/festive.dm @@ -89,12 +89,12 @@ obj/item/grenade/firecracker/wirecutter_act(mob/living/user, obj/item/I) return if(det_time) det_time -= 10 - to_chat(user, "You shorten the fuse of [src] with [I].") + to_chat(user, "You shorten the fuse of [src] with [I].") playsound(src, 'sound/items/wirecutter.ogg', 20, TRUE) icon_state = initial(icon_state) + "_[det_time]" update_icon() else - to_chat(user, "You've already removed all of the fuse!") + to_chat(user, "You've already removed all of the fuse!") obj/item/grenade/firecracker/preprime(mob/user, delayoverride, msg = TRUE, volume = 80) var/turf/T = get_turf(src) diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm index 4871a90f1ee..68b8cc0b943 100644 --- a/code/game/objects/items/grenades/grenade.dm +++ b/code/game/objects/items/grenades/grenade.dm @@ -103,7 +103,7 @@ if(time != null) if(time < 3) time = 3 - det_time = round(CLAMP(time * 10, 0, 50)) + det_time = round(clamp(time * 10, 0, 50)) else var/previous_time = det_time switch(det_time) diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 2830f08755d..4c1555a95a1 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -72,7 +72,7 @@ return if(user.get_active_held_item() == src) - newtime = CLAMP(newtime, 10, 60000) + newtime = clamp(newtime, 10, 60000) det_time = newtime to_chat(user, "Timer set for [det_time] seconds.") diff --git a/code/game/objects/items/his_grace.dm b/code/game/objects/items/his_grace.dm index 57339451237..802efc2fcf5 100644 --- a/code/game/objects/items/his_grace.dm +++ b/code/game/objects/items/his_grace.dm @@ -196,9 +196,9 @@ /obj/item/his_grace/proc/adjust_bloodthirst(amt) prev_bloodthirst = bloodthirst if(prev_bloodthirst < HIS_GRACE_CONSUME_OWNER && !ascended) - bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER) + bloodthirst = clamp(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER) else if(!ascended) - bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP) + bloodthirst = clamp(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP) update_stats() /obj/item/his_grace/proc/update_stats() diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index aa7a20480d8..50ca27defc3 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -77,7 +77,7 @@ L.SetImmobilized(0) L.SetParalyzed(0) L.SetUnconscious(0) - L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck! + L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, clamp(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck! colorize(L) /obj/item/hot_potato/examine(mob/user) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index a9bcae025ae..3774bb79bfd 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -174,7 +174,7 @@ fire_items(T, user) if(pressureSetting >= 3 && iscarbon(user)) var/mob/living/carbon/C = user - C.visible_message("[C] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!") + C.visible_message("[C] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!") C.Paralyze(60) /obj/item/pneumatic_cannon/proc/fire_items(turf/target, mob/user) @@ -212,8 +212,8 @@ return target var/x_o = (target.x - starting.x) var/y_o = (target.y - starting.y) - var/new_x = CLAMP((starting.x + (x_o * range_multiplier)), 0, world.maxx) - var/new_y = CLAMP((starting.y + (y_o * range_multiplier)), 0, world.maxy) + var/new_x = clamp((starting.x + (x_o * range_multiplier)), 0, world.maxx) + var/new_y = clamp((starting.y + (y_o * range_multiplier)), 0, world.maxy) var/turf/newtarget = locate(new_x, new_y, starting.z) return newtarget diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index a546f68dc01..6987b5093de 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -390,7 +390,7 @@ var/obj/item/reagent_containers/food/snacks/L switch(mode) if(DISPENSE_LOLLIPOP_MODE) - L = new /obj/item/reagent_containers/food/snacks/lollipop(T) + L = new /obj/item/reagent_containers/food/snacks/chewable/lollipop(T) if(DISPENSE_ICECREAM_MODE) L = new /obj/item/reagent_containers/food/snacks/icecream(T) var/obj/item/reagent_containers/food/snacks/icecream/I = L @@ -517,13 +517,13 @@ name = "lollipop" desc = "Oh noes! A fast-moving lollipop!" icon_state = "lollipop_1" - ammo_type = /obj/item/reagent_containers/food/snacks/lollipop/cyborg + ammo_type = /obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg var/color2 = rgb(0, 0, 0) nodamage = TRUE /obj/projectile/bullet/reusable/lollipop/Initialize() . = ..() - var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(src) + var/obj/item/reagent_containers/food/snacks/chewable/lollipop/S = new ammo_type(src) color2 = S.headcolor var/mutable_appearance/head = mutable_appearance('icons/obj/projectiles.dmi', "lollipop_2") head.color = color2 @@ -532,7 +532,7 @@ /obj/projectile/bullet/reusable/lollipop/handle_drop() if(!dropped) var/turf/T = get_turf(src) - var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(T) + var/obj/item/reagent_containers/food/snacks/chewable/lollipop/S = new ammo_type(T) S.change_head_color(color2) dropped = TRUE @@ -653,7 +653,7 @@ continue usage += projectile_tick_speed_ecost usage += (tracked[I] * projectile_damage_tick_ecost_coefficient) - energy = CLAMP(energy - usage, 0, maxenergy) + energy = clamp(energy - usage, 0, maxenergy) if(energy <= 0) deactivate_field() visible_message("[src] blinks \"ENERGY DEPLETED\".") @@ -663,7 +663,7 @@ if(iscyborg(host.loc)) host = host.loc else - energy = CLAMP(energy + energy_recharge, 0, maxenergy) + energy = clamp(energy + energy_recharge, 0, maxenergy) return if(host.cell && (host.cell.charge >= (host.cell.maxcharge * cyborg_cell_critical_percentage)) && (energy < maxenergy)) host.cell.use(energy_recharge*energy_recharge_cyborg_drain_coefficient) diff --git a/code/game/objects/items/sharpener.dm b/code/game/objects/items/sharpener.dm index e93d6502a74..da4ce62437c 100644 --- a/code/game/objects/items/sharpener.dm +++ b/code/game/objects/items/sharpener.dm @@ -35,15 +35,15 @@ if(TH.force_wielded > initial(TH.force_wielded)) to_chat(user, "[TH] has already been refined before. It cannot be sharpened further!") return - TH.force_wielded = CLAMP(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay + TH.force_wielded = clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay if(I.force > initial(I.force)) to_chat(user, "[I] has already been refined before. It cannot be sharpened further!") return user.visible_message("[user] sharpens [I] with [src]!", "You sharpen [I], making it much more deadly than before.") playsound(src, 'sound/items/unsheath.ogg', 25, TRUE) I.sharpness = IS_SHARP_ACCURATE - I.force = CLAMP(I.force + increment, 0, max) - I.throwforce = CLAMP(I.throwforce + increment, 0, max) + I.force = clamp(I.force + increment, 0, max) + I.throwforce = clamp(I.throwforce + increment, 0, max) I.name = "[prefix] [I.name]" name = "worn out [name]" desc = "[desc] At least, it used to." diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index aa21eb24460..92f8c6a691d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -77,9 +77,9 @@ /obj/item/stack/proc/update_weight() if(amount <= (max_amount * (1/3))) - w_class = CLAMP(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class) + w_class = clamp(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class) else if (amount <= (max_amount * (2/3))) - w_class = CLAMP(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class) + w_class = clamp(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class) else w_class = full_w_class diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 93cac7e6b45..423f8405f49 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -1270,3 +1270,47 @@ /obj/item/storage/box/sparklers/PopulateContents() for(var/i in 1 to 7) new/obj/item/sparkler(src) + +/obj/item/storage/box/gum + name = "bubblegum packet" + desc = "The packaging is entirely in japanese, apparently. You can't make out a single word of it." + icon_state = "bubblegum_generic" + illustration = null + foldable = null + custom_price = 120 + +/obj/item/storage/box/gum/ComponentInitialize() + . = ..() + var/datum/component/storage/STR = GetComponent(/datum/component/storage) + STR.set_holdable(list(/obj/item/storage/box/gum)) + STR.max_items = 4 + +/obj/item/storage/box/gum/PopulateContents() + for(var/i in 1 to 4) + new/obj/item/reagent_containers/food/snacks/chewable/bubblegum(src) + +/obj/item/storage/box/gum/nicotine + name = "nicotine gum packet" + desc = "Designed to help with nicotine addiction and oral fixation all at once without destroying your lungs in the process. Mint flavored!" + icon_state = "bubblegum_nicotine" + custom_premium_price = 275 + +/obj/item/storage/box/gum/nicotine/PopulateContents() + for(var/i in 1 to 4) + new/obj/item/reagent_containers/food/snacks/chewable/bubblegum/nicotine(src) + +/obj/item/storage/box/gum/happiness + name = "HP+ gum packet" + desc = "A seemingly homemade packaging with an odd smell. It has a weird drawing of a smiling face sticking out its tongue." + icon_state = "bubblegum_happiness" + custom_price = 300 + custom_premium_price = 300 + +/obj/item/storage/box/gum/happiness/Initialize() + . = ..() + if (prob(25)) + desc += "You can faintly make out the word 'Hemopagopril' was once scribbled on it." + +/obj/item/storage/box/gum/happiness/PopulateContents() + for(var/i in 1 to 4) + new/obj/item/reagent_containers/food/snacks/chewable/bubblegum/happiness(src) diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index 88968a6f78a..0a4c7609479 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -435,14 +435,6 @@ for(var/i in 1 to 7) new /obj/item/reagent_containers/pill/psicodine(src) -/obj/item/storage/pill_bottle/happiness - name = "happiness pill bottle" - desc = "The label is long gone, in its place an 'H' written with a marker." - -/obj/item/storage/pill_bottle/happiness/PopulateContents() - for(var/i in 1 to 5) - new /obj/item/reagent_containers/pill/happiness(src) - /obj/item/storage/pill_bottle/penacid name = "bottle of pentetic acid pills" desc = "Contains pills to expunge radiation and toxins." diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 9105c7ec258..16283852de7 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -190,7 +190,7 @@ pressure = text2num(pressure) . = TRUE if(.) - distribute_pressure = CLAMP(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE) + distribute_pressure = clamp(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE) /obj/item/tank/remove_air(amount) return air_contents.remove(amount) @@ -212,7 +212,7 @@ return null var/tank_pressure = air_contents.return_pressure() - var/actual_distribute_pressure = CLAMP(tank_pressure, 0, distribute_pressure) + var/actual_distribute_pressure = clamp(tank_pressure, 0, distribute_pressure) var/moles_needed = actual_distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index eebcb395b61..bd57f992544 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -33,7 +33,7 @@ if(damage_flag) armor_protection = armor.getRating(damage_flag) if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor. - armor_protection = CLAMP(armor_protection - armour_penetration, min(armor_protection, 0), 100) + armor_protection = clamp(armor_protection - armour_penetration, min(armor_protection, 0), 100) return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION) ///the sound played when the obj is damaged. @@ -206,7 +206,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(T.intact && level == 1) //fire can't damage things hidden below the floor. return if(exposed_temperature && !(resistance_flags & FIRE_PROOF)) - take_damage(CLAMP(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0) + take_damage(clamp(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0) if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE) && !(resistance_flags & FIRE_PROOF)) resistance_flags |= ON_FIRE SSfire_burning.processing[src] = src @@ -242,7 +242,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(has_buckled_mobs()) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - buckled_mob.electrocute_act((CLAMP(round(strength/400), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA) + buckled_mob.electrocute_act((clamp(round(strength/400), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA) /obj/proc/reset_shocked() obj_flags &= ~BEING_SHOCKED diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 246e4234e10..facf0d301fb 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -235,7 +235,7 @@ if(brain.force_replace_ai_name) A.fully_replace_character_name(A.name, brain.replacement_ai_name()) SSblackbox.record_feedback("amount", "ais_created", 1) - deadchat_broadcast(" has been brought online at [get_area_name(A, TRUE)].", "[A]", follow_target=A) + deadchat_broadcast(" has been brought online at [get_area_name(A, TRUE)].", "[A]", follow_target=A, message_type=DEADCHAT_ANNOUNCEMENT) qdel(src) else state = AI_READY_CORE diff --git a/code/game/objects/structures/fireplace.dm b/code/game/objects/structures/fireplace.dm index 2803df4c786..e761ae2dbc4 100644 --- a/code/game/objects/structures/fireplace.dm +++ b/code/game/objects/structures/fireplace.dm @@ -129,7 +129,7 @@ if(burn_time_remaining() < MAXIMUM_BURN_TIMER) flame_expiry_timer = world.time + MAXIMUM_BURN_TIMER else - fuel_added = CLAMP(fuel_added + amount, 0, MAXIMUM_BURN_TIMER) + fuel_added = clamp(fuel_added + amount, 0, MAXIMUM_BURN_TIMER) /obj/structure/fireplace/proc/burn_time_remaining() if(lit) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 83e368b13a2..aa2bb8b6148 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -125,7 +125,7 @@ else cur_oct[cur_note] = text2num(ni) if(user.dizziness > 0 && prob(user.dizziness / 2)) - cur_note = CLAMP(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7) + cur_note = clamp(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7) if(user.dizziness > 0 && prob(user.dizziness / 5)) if(prob(30)) cur_acc[cur_note] = "#" diff --git a/code/game/objects/structures/shower.dm b/code/game/objects/structures/shower.dm index 67298ec9b49..20e48a7efbb 100644 --- a/code/game/objects/structures/shower.dm +++ b/code/game/objects/structures/shower.dm @@ -98,102 +98,12 @@ wash_atom(AM) /obj/machinery/shower/proc/wash_atom(atom/A) - SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) + A.washed(src) reagents.reaction(A, TOUCH, reaction_volume) - if(isobj(A)) - wash_obj(A) - else if(isturf(A)) - wash_turf(A) - else if(isliving(A)) - wash_mob(A) + if(isliving(A)) check_heat(A) - contamination_cleanse(A) - -/obj/machinery/shower/proc/wash_obj(obj/O) - . = SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) - O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - - -/obj/machinery/shower/proc/wash_turf(turf/tile) - SEND_SIGNAL(tile, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) - tile.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - for(var/obj/effect/E in tile) - if(is_cleanable(E)) - qdel(E) - - -/obj/machinery/shower/proc/wash_mob(mob/living/L) - SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) - L.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "shower", /datum/mood_event/nice_shower) - if(iscarbon(L)) - var/mob/living/carbon/M = L - . = TRUE - - for(var/obj/item/I in M.held_items) - wash_obj(I) - - if(M.back && wash_obj(M.back)) - M.update_inv_back(0) - - var/list/obscured = M.check_obscured_slots() - - if(M.head && wash_obj(M.head)) - M.update_inv_head() - - if(M.glasses && !(ITEM_SLOT_EYES in obscured) && wash_obj(M.glasses)) - M.update_inv_glasses() - - if(M.wear_mask && !(ITEM_SLOT_MASK in obscured) && wash_obj(M.wear_mask)) - M.update_inv_wear_mask() - - if(M.ears && !(HIDEEARS in obscured) && wash_obj(M.ears)) - M.update_inv_ears() - - if(M.wear_neck && !(ITEM_SLOT_NECK in obscured) && wash_obj(M.wear_neck)) - M.update_inv_neck() - - if(M.shoes && !(HIDESHOES in obscured) && wash_obj(M.shoes)) - M.update_inv_shoes() - - var/washgloves = FALSE - if(M.gloves && !(HIDEGLOVES in obscured)) - washgloves = TRUE - - if(ishuman(M)) - var/mob/living/carbon/human/H = M - - if(H.wear_suit && wash_obj(H.wear_suit)) - H.update_inv_wear_suit() - else if(H.w_uniform && wash_obj(H.w_uniform)) - H.update_inv_w_uniform() - - if(washgloves) - SEND_SIGNAL(H, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) - - if(!H.is_mouth_covered()) - H.lip_style = null - H.update_body() - - if(H.belt && wash_obj(H.belt)) - H.update_inv_belt() - else - SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) - else - SEND_SIGNAL(L, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) - -/obj/machinery/shower/proc/contamination_cleanse(atom/thing) - var/datum/component/radioactive/healthy_green_glow = thing.GetComponent(/datum/component/radioactive) - if(!healthy_green_glow || QDELETED(healthy_green_glow)) - return - var/strength = healthy_green_glow.strength - if(strength <= RAD_BACKGROUND_RADIATION) - qdel(healthy_green_glow) - return - healthy_green_glow.strength -= max(0, (healthy_green_glow.strength - (RAD_BACKGROUND_RADIATION * 2)) * 0.2) - /obj/machinery/shower/process() if(on) wash_atom(loc) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 092eda73383..4207dfc413f 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -182,8 +182,8 @@ if(!click_params || !click_params["icon-x"] || !click_params["icon-y"]) return //Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf) - I.pixel_x = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) - I.pixel_y = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) + I.pixel_x = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) + I.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) AfterPutItemOnTable(I, user) return TRUE else diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 7561b06746f..0de4b556219 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -257,9 +257,9 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( if(depth) var/list/target_baseturfs if(length(copytarget.baseturfs)) - // with default inputs this would be Copy(CLAMP(2, -INFINITY, baseturfs.len)) + // with default inputs this would be Copy(clamp(2, -INFINITY, baseturfs.len)) // Don't forget a lower index is lower in the baseturfs stack, the bottom is baseturfs[1] - target_baseturfs = copytarget.baseturfs.Copy(CLAMP(1 + ignore_bottom, 1 + copytarget.baseturfs.len - depth, copytarget.baseturfs.len)) + target_baseturfs = copytarget.baseturfs.Copy(clamp(1 + ignore_bottom, 1 + copytarget.baseturfs.len - depth, copytarget.baseturfs.len)) else if(!ignore_bottom) target_baseturfs = list(copytarget.baseturfs) if(target_baseturfs) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index a13c0d09737..cc293829f1d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -679,7 +679,7 @@ var/path = preparsed[1] var/amount = 1 if(preparsed.len > 1) - amount = CLAMP(text2num(preparsed[2]),1,ADMIN_SPAWN_CAP) + amount = clamp(text2num(preparsed[2]),1,ADMIN_SPAWN_CAP) var/chosen = pick_closest_path(path) if(!chosen) diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index 64ce709dfab..b5fb625cbd4 100644 --- a/code/modules/admin/sound_emitter.dm +++ b/code/modules/admin/sound_emitter.dm @@ -93,7 +93,7 @@ var/new_volume = input(user, "Choose a volume.", "Sound Emitter", sound_volume) as null|num if(isnull(new_volume)) return - new_volume = CLAMP(new_volume, 0, 100) + new_volume = clamp(new_volume, 0, 100) sound_volume = new_volume to_chat(user, "Volume set to [sound_volume]%.") if(href_list["edit_mode"]) @@ -116,7 +116,7 @@ var/new_radius = input(user, "Choose a radius.", "Sound Emitter", sound_volume) as null|num if(isnull(new_radius)) return - new_radius = CLAMP(new_radius, 0, 127) + new_radius = clamp(new_radius, 0, 127) play_radius = new_radius to_chat(user, "Audible radius set to [play_radius].") if(href_list["play"]) diff --git a/code/modules/admin/sql_message_system.dm b/code/modules/admin/sql_message_system.dm index c47328807db..2b8d021ed86 100644 --- a/code/modules/admin/sql_message_system.dm +++ b/code/modules/admin/sql_message_system.dm @@ -393,7 +393,7 @@ var/nsd = CONFIG_GET(number/note_stale_days) var/nfd = CONFIG_GET(number/note_fresh_days) if (agegate && type == "note" && isnum(nsd) && isnum(nfd) && nsd > nfd) - var/alpha = CLAMP(100 - (age - nfd) * (85 / (nsd - nfd)), 15, 100) + var/alpha = clamp(100 - (age - nfd) * (85 / (nsd - nfd)), 15, 100) if (alpha < 100) if (alpha <= 15) if (skipped) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 704f720ad9b..c39f568809d 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1619,7 +1619,7 @@ return var/list/offset = splittext(href_list["offset"],",") - var/number = CLAMP(text2num(href_list["object_count"]), 1, ADMIN_SPAWN_CAP) + var/number = clamp(text2num(href_list["object_count"]), 1, ADMIN_SPAWN_CAP) var/X = offset.len > 0 ? text2num(offset[1]) : 0 var/Y = offset.len > 1 ? text2num(offset[2]) : 0 var/Z = offset.len > 2 ? text2num(offset[3]) : 0 diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index 520ce8ede8c..47767560936 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -85,7 +85,7 @@ if ("set_charge") var/newcharge = input("New charge (0-[borg.cell.maxcharge]):", borg.name, borg.cell.charge) as num|null if (newcharge) - borg.cell.charge = CLAMP(newcharge, 0, borg.cell.maxcharge) + borg.cell.charge = clamp(newcharge, 0, borg.cell.maxcharge) message_admins("[key_name_admin(user)] set the charge of [ADMIN_LOOKUPFLW(borg)] to [borg.cell.charge].") log_admin("[key_name(user)] set the charge of [key_name(borg)] to [borg.cell.charge].") if ("remove_cell") diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 1fa7be8e9ee..1df7fc62fde 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -8,7 +8,7 @@ var/vol = input(usr, "What volume would you like the sound to play at?",, 100) as null|num if(!vol) return - vol = CLAMP(vol, 1, 100) + vol = clamp(vol, 1, 100) var/sound/admin_sound = new() admin_sound.file = S diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 5cc9ce2ce0a..7a0d5de0972 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -373,10 +373,8 @@ /obj/item/firing_pin/abductor name = "alien firing pin" icon_state = "firing_pin_ayy" - desc = "This firing pin is slimy and warm; you can swear you feel it \ - constantly trying to mentally probe you." - fail_message = "\ - Firing error, please contact Command." + desc = "This firing pin is slimy and warm; you can swear you feel it constantly trying to mentally probe you." + fail_message = "Firing error, please contact Command." /obj/item/firing_pin/abductor/pin_auth(mob/living/user) . = isabductor(user) diff --git a/code/modules/antagonists/blob/blob_mobs.dm b/code/modules/antagonists/blob/blob_mobs.dm index 462a73f07ea..93c18c56313 100644 --- a/code/modules/antagonists/blob/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob_mobs.dm @@ -42,7 +42,7 @@ /mob/living/simple_animal/hostile/blob/fire_act(exposed_temperature, exposed_volume) ..() if(exposed_temperature) - adjustFireLoss(CLAMP(0.01 * exposed_temperature, 1, 5)) + adjustFireLoss(clamp(0.01 * exposed_temperature, 1, 5)) else adjustFireLoss(5) diff --git a/code/modules/antagonists/blob/overmind.dm b/code/modules/antagonists/blob/overmind.dm index 2e8bd26ad2b..e2567e091cc 100644 --- a/code/modules/antagonists/blob/overmind.dm +++ b/code/modules/antagonists/blob/overmind.dm @@ -201,7 +201,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) B.hud_used.blobpwrdisplay.maptext = "
[round(blob_core.obj_integrity)]
" /mob/camera/blob/proc/add_points(points) - blob_points = CLAMP(blob_points + points, 0, max_blob_points) + blob_points = clamp(blob_points + points, 0, max_blob_points) hud_used.blobpwrdisplay.maptext = "
[round(blob_points)]
" /mob/camera/blob/say(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) diff --git a/code/modules/antagonists/brainwashing/brainwashing.dm b/code/modules/antagonists/brainwashing/brainwashing.dm index 807ec65b7e0..c81ba816ec5 100644 --- a/code/modules/antagonists/brainwashing/brainwashing.dm +++ b/code/modules/antagonists/brainwashing/brainwashing.dm @@ -21,7 +21,7 @@ var/obj_message = english_list(directives) var/end_message = "." var/rendered = begin_message + obj_message + end_message - deadchat_broadcast(rendered, "[L]", follow_target = L, turf_target = get_turf(L), message_type=DEADCHAT_REGULAR) + deadchat_broadcast(rendered, "[L]", follow_target = L, turf_target = get_turf(L), message_type=DEADCHAT_ANNOUNCEMENT) if(prob(1) || SSevents.holidays && SSevents.holidays[APRIL_FOOLS]) L.say("You son of a bitch! I'm in.", forced = "That son of a bitch! They're in.") diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm index 7911ec7ef0d..9e0b19f6e15 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm @@ -362,7 +362,7 @@ if(NUKEUI_AWAIT_TIMER) var/number_value = text2num(numeric_input) if(number_value) - timer_set = CLAMP(number_value, minimum_timer_set, maximum_timer_set) + timer_set = clamp(number_value, minimum_timer_set, maximum_timer_set) playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE) set_safety() . = TRUE diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 4e0c5a92eb2..7fb5a7fefe4 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -16,7 +16,8 @@ throwforce = 2 throw_speed = 3 throw_range = 7 - + drop_sound = 'sound/items/handling/component_drop.ogg' + pickup_sound = 'sound/items/handling/component_pickup.ogg' var/is_position_sensitive = FALSE //set to true if the device has different icons for each position. //This will prevent things such as visible lasers from facing the incorrect direction when transformed by assembly_holder's update_icon() var/secured = TRUE @@ -25,24 +26,23 @@ var/wire_type = WIRE_RECEIVE | WIRE_PULSE var/attachable = FALSE // can this be attached to wires var/datum/wires/connected = null - var/next_activate = 0 //When we're next allowed to activate - for spam control - drop_sound = 'sound/items/handling/component_drop.ogg' - pickup_sound = 'sound/items/handling/component_pickup.ogg' /obj/item/assembly/get_part_rating() return 1 /obj/item/assembly/proc/on_attach() -/obj/item/assembly/proc/on_detach() //call this when detaching it from a device. handles any special functions that need to be updated ex post facto +//Call this when detaching it from a device. handles any special functions that need to be updated ex post facto +/obj/item/assembly/proc/on_detach() if(!holder) return FALSE forceMove(holder.drop_location()) holder = null return TRUE -/obj/item/assembly/proc/holder_movement() //Called when the holder is moved +//Called when the holder is moved +/obj/item/assembly/proc/holder_movement() if(!holder) return FALSE setDir(holder.dir) @@ -54,7 +54,6 @@ return FALSE return TRUE - //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs /obj/item/assembly/proc/pulsed(radio = FALSE) if(wire_type & WIRE_RECEIVE) @@ -63,7 +62,6 @@ INVOKE_ASYNC(src, .proc/activate) return TRUE - //Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct /obj/item/assembly/proc/pulse(radio = FALSE) if(connected && wire_type) @@ -75,7 +73,6 @@ holder.process_activation(src, 0, 1) return TRUE - // What the device does when turned on /obj/item/assembly/proc/activate() if(QDELETED(src) || !secured || (next_activate > world.time)) @@ -83,13 +80,11 @@ next_activate = world.time + 30 return TRUE - /obj/item/assembly/proc/toggle_secure() secured = !secured update_icon() return secured - /obj/item/assembly/attackby(obj/item/W, mob/user, params) if(isassembly(W)) var/obj/item/assembly/A = W @@ -116,7 +111,6 @@ . = ..() . += "\The [src] [secured? "is secured and ready to be used!" : "can be attached to other things."]" - /obj/item/assembly/attack_self(mob/user) if(!user) return FALSE @@ -126,3 +120,8 @@ /obj/item/assembly/interact(mob/user) return ui_interact(user) + +/obj/item/assembly/ui_host(mob/user) + if(holder) + return holder + return src diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm index e5ca43d4c46..55f5d50f2e1 100644 --- a/code/modules/assembly/igniter.dm +++ b/code/modules/assembly/igniter.dm @@ -39,7 +39,6 @@ add_fingerprint(user) /obj/item/assembly/igniter/ignition_effect(atom/A, mob/user) - . = "[user] fiddles with [src], and manages to \ - light [A]." + . = "[user] fiddles with [src], and manages to light [A]." activate() add_fingerprint(user) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 648a015d168..b9684f73fd5 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -124,9 +124,8 @@ /obj/item/assembly/prox_sensor/ui_data(mob/user) var/list/data = list() - var/time_left = time - data["seconds"] = round(time_left % 60) - data["minutes"] = round((time_left - data["seconds"]) / 60) + data["seconds"] = round(time % 60) + data["minutes"] = round((time - data["seconds"]) / 60) data["timing"] = timing data["scanning"] = scanning data["sensitivity"] = sensitivity @@ -152,6 +151,6 @@ if("input") var/value = text2num(params["adjust"]) if(value) - var/newtime = round(time+value) - time = CLAMP(newtime, 0, 600) + value = round(time + value) + time = clamp(value, 0, 600) . = TRUE diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 41f229b49ec..f58324f2d4f 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -8,7 +8,10 @@ custom_materials = list(/datum/material/iron=400, /datum/material/glass=120) wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE attachable = TRUE - + drop_sound = 'sound/items/handling/component_drop.ogg' + pickup_sound = 'sound/items/handling/component_pickup.ogg' + var/ui_x = 280 + var/ui_y = 132 var/code = DEFAULT_SIGNALER_CODE var/frequency = FREQ_SIGNALER var/datum/radio_frequency/radio_connection @@ -17,8 +20,6 @@ ///Holds a reference string to the mob, decides how much of a gamer you are. var/suicide_mob var/hearing_range = 1 - drop_sound = 'sound/items/handling/component_drop.ogg' - pickup_sound = 'sound/items/handling/component_pickup.ogg' /obj/item/assembly/signaler/suicide_act(mob/living/carbon/user) user.visible_message("[user] eats \the [src]! If it is signaled, [user.p_they()] will die!") @@ -47,7 +48,6 @@ . = ..() set_frequency(frequency) - /obj/item/assembly/signaler/Destroy() SSradio.remove_object(src,frequency) suicider = null @@ -64,14 +64,16 @@ holder.update_icon() return -/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) - if(!is_secured(user)) - return +/obj/item/assembly/signaler/ui_status(mob/user) + if(is_secured(user)) + return ..() + return UI_CLOSE + +/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) - var/ui_width = 280 - var/ui_height = 132 - ui = new(user, src, ui_key, "signaler", name, ui_width, ui_height, master_ui, state) + ui = new(user, src, ui_key, "signaler", name, ui_x, ui_y, master_ui, state) ui.open() /obj/item/assembly/signaler/ui_data(mob/user) @@ -80,7 +82,6 @@ data["code"] = code data["minFrequency"] = MIN_FREE_FREQ data["maxFrequency"] = MAX_FREE_FREQ - return data /obj/item/assembly/signaler/ui_act(action, params) @@ -109,7 +110,6 @@ update_icon() - /obj/item/assembly/signaler/attackby(obj/item/W, mob/user, params) if(issignaler(W)) var/obj/item/assembly/signaler/signaler2 = W @@ -131,9 +131,6 @@ if(usr) GLOB.lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") - - return - /obj/item/assembly/signaler/receive_signal(datum/signal/signal) . = FALSE if(!signal) @@ -153,7 +150,6 @@ LM.playsound_local(get_turf(src), 'sound/machines/triple_beep.ogg', ASSEMBLY_BEEP_VOLUME, TRUE) return TRUE - /obj/item/assembly/signaler/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency @@ -182,7 +178,6 @@ return return ..(signal) - // Embedded signaller used in anomalies. /obj/item/assembly/signaler/anomaly name = "anomaly core" diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index b6a761b4b34..c43fb260aad 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -99,9 +99,8 @@ /obj/item/assembly/timer/ui_data(mob/user) var/list/data = list() - var/time_left = time - data["seconds"] = round(time_left % 60) - data["minutes"] = round((time_left - data["seconds"]) / 60) + data["seconds"] = round(time % 60) + data["minutes"] = round((time - data["seconds"]) / 60) data["timing"] = timing data["loop"] = loop return data @@ -123,6 +122,7 @@ if("input") var/value = text2num(params["adjust"]) if(value) - time = min(max(round(time+value), 1), 600) + value = round(time + value) + time = clamp(value, 1, 600) saved_time = time . = TRUE diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index 185bddc9524..e33ae714172 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -321,7 +321,7 @@ var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY && (air.temperature <= FUSION_MAXIMUM_TEMPERATURE || reaction_energy <= 0)) //If above FUSION_MAXIMUM_TEMPERATURE, will only adjust temperature for endothermic reactions. - air.temperature = CLAMP(((air.temperature*old_heat_capacity + reaction_energy)/new_heat_capacity),TCMB,INFINITY) + air.temperature = clamp(((air.temperature*old_heat_capacity + reaction_energy)/new_heat_capacity),TCMB,INFINITY) return REACTING /datum/gas_reaction/nitrylformation //The formation of nitryl. Endothermic. Requires N2O as a catalyst. @@ -521,5 +521,5 @@ if(energy_released) var/new_heat_capacity = air.heat_capacity() if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) - air.temperature = CLAMP((air.temperature*old_heat_capacity + energy_released)/new_heat_capacity,TCMB,INFINITY) + air.temperature = clamp((air.temperature*old_heat_capacity + energy_released)/new_heat_capacity,TCMB,INFINITY) return REACTING diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 1dd9b52cf68..c670c07798f 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -301,7 +301,7 @@ if(target_move.can_crawl_through()) if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery)) user.forceMove(target_move.loc) //handle entering and so on. - user.visible_message("You hear something squeezing through the ducts...", "You climb out the ventilation system.") + user.visible_message("You hear something squeezing through the ducts...", "You climb out the ventilation system.") else var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets() if(pipenetdiff.len) @@ -313,7 +313,7 @@ playsound(src, 'sound/machines/ventcrawl.ogg', 50, TRUE, -3) else if(is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.forceMove(loc) - user.visible_message("You hear something squeezing through the ducts...", "You climb out the ventilation system.") + user.visible_message("You hear something squeezing through the ducts...", "You climb out the ventilation system.") //PLACEHOLDER COMMENT FOR ME TO READD THE 1 (?) DS DELAY THAT WAS IMPLEMENTED WITH A... TIMER? diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index 97eba613358..4bba6e94c04 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -159,13 +159,13 @@ pump_direction = 1 if("set_input_pressure" in signal.data) - input_pressure_min = CLAMP(text2num(signal.data["set_input_pressure"]),0,ONE_ATMOSPHERE*50) + input_pressure_min = clamp(text2num(signal.data["set_input_pressure"]),0,ONE_ATMOSPHERE*50) if("set_output_pressure" in signal.data) - output_pressure_max = CLAMP(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) + output_pressure_max = clamp(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) if("set_external_pressure" in signal.data) - external_pressure_bound = CLAMP(text2num(signal.data["set_external_pressure"]),0,ONE_ATMOSPHERE*50) + external_pressure_bound = clamp(text2num(signal.data["set_external_pressure"]),0,ONE_ATMOSPHERE*50) addtimer(CALLBACK(src, .proc/broadcast_status), 2) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index a421bad9415..cb994fb40c9 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -125,7 +125,7 @@ Passive gate is similar to the regular pump except: pressure = text2num(pressure) . = TRUE if(.) - target_pressure = CLAMP(pressure, 0, MAX_OUTPUT_PRESSURE) + target_pressure = clamp(pressure, 0, MAX_OUTPUT_PRESSURE) investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS) update_icon() @@ -147,7 +147,7 @@ Passive gate is similar to the regular pump except: on = !on if("set_output_pressure" in signal.data) - target_pressure = CLAMP(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) + target_pressure = clamp(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) if(on != old_on) investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index c4985ae7d05..cb9bc3e03c9 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -131,7 +131,7 @@ pressure = text2num(pressure) . = TRUE if(.) - target_pressure = CLAMP(pressure, 0, MAX_OUTPUT_PRESSURE) + target_pressure = clamp(pressure, 0, MAX_OUTPUT_PRESSURE) investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS) update_icon() @@ -153,7 +153,7 @@ on = !on if("set_output_pressure" in signal.data) - target_pressure = CLAMP(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) + target_pressure = clamp(text2num(signal.data["set_output_pressure"]),0,ONE_ATMOSPHERE*50) if(on != old_on) investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index f5046d9ed2c..fa44af56d49 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -149,7 +149,7 @@ rate = text2num(rate) . = TRUE if(.) - transfer_rate = CLAMP(rate, 0, MAX_TRANSFER_RATE) + transfer_rate = clamp(rate, 0, MAX_TRANSFER_RATE) investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS) update_icon() @@ -167,7 +167,7 @@ if("set_transfer_rate" in signal.data) var/datum/gas_mixture/air1 = airs[1] - transfer_rate = CLAMP(text2num(signal.data["set_transfer_rate"]),0,air1.volume) + transfer_rate = clamp(text2num(signal.data["set_transfer_rate"]),0,air1.volume) if(on != old_on) investigate_log("was turned [on ? "on" : "off"] by a remote signal", INVESTIGATE_ATMOS) diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 0bfbe53ea1a..b5d4614e9af 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -161,7 +161,7 @@ rate = text2num(rate) . = TRUE if(.) - transfer_rate = CLAMP(rate, 0, MAX_TRANSFER_RATE) + transfer_rate = clamp(rate, 0, MAX_TRANSFER_RATE) investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS) if("filter") filter_type = null diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 7927c697ee1..8e3f647d88d 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -162,7 +162,7 @@ pressure = text2num(pressure) . = TRUE if(.) - target_pressure = CLAMP(pressure, 0, MAX_OUTPUT_PRESSURE) + target_pressure = clamp(pressure, 0, MAX_OUTPUT_PRESSURE) investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS) if("node1") var/value = text2num(params["concentration"]) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index 530ea2a18a5..76f3f999c9e 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -122,7 +122,7 @@ if("set_volume_rate" in signal.data) var/number = text2num(signal.data["set_volume_rate"]) var/datum/gas_mixture/air_contents = airs[1] - volume_rate = CLAMP(number, 0, air_contents.volume) + volume_rate = clamp(number, 0, air_contents.volume) addtimer(CALLBACK(src, .proc/broadcast_status), 2) @@ -166,7 +166,7 @@ rate = text2num(rate) . = TRUE if(.) - volume_rate = CLAMP(rate, 0, MAX_TRANSFER_RATE) + volume_rate = clamp(rate, 0, MAX_TRANSFER_RATE) investigate_log("was set to [volume_rate] L/s by [key_name(usr)]", INVESTIGATE_ATMOS) update_icon() broadcast_status() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index 35470b47bde..4a48f490d9c 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -166,7 +166,7 @@ target = text2num(target) . = TRUE if(.) - target_temperature = CLAMP(target, min_temperature, max_temperature) + target_temperature = clamp(target, min_temperature, max_temperature) investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS) update_icon() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 3605c5f4120..ec64bd45fd7 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -212,13 +212,13 @@ if("set_internal_pressure" in signal.data) var/old_pressure = internal_pressure_bound - internal_pressure_bound = CLAMP(text2num(signal.data["set_internal_pressure"]),0,ONE_ATMOSPHERE*50) + internal_pressure_bound = clamp(text2num(signal.data["set_internal_pressure"]),0,ONE_ATMOSPHERE*50) if(old_pressure != internal_pressure_bound) investigate_log(" internal pressure was set to [internal_pressure_bound] by [key_name(signal_sender)]",INVESTIGATE_ATMOS) if("set_external_pressure" in signal.data) var/old_pressure = external_pressure_bound - external_pressure_bound = CLAMP(text2num(signal.data["set_external_pressure"]),0,ONE_ATMOSPHERE*50) + external_pressure_bound = clamp(text2num(signal.data["set_external_pressure"]),0,ONE_ATMOSPHERE*50) if(old_pressure != external_pressure_bound) investigate_log(" external pressure was set to [external_pressure_bound] by [key_name(signal_sender)]",INVESTIGATE_ATMOS) @@ -229,10 +229,10 @@ internal_pressure_bound = 0 if("adjust_internal_pressure" in signal.data) - internal_pressure_bound = CLAMP(internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),0,ONE_ATMOSPHERE*50) + internal_pressure_bound = clamp(internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),0,ONE_ATMOSPHERE*50) if("adjust_external_pressure" in signal.data) - external_pressure_bound = CLAMP(external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),0,ONE_ATMOSPHERE*50) + external_pressure_bound = clamp(external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),0,ONE_ATMOSPHERE*50) if("init" in signal.data) name = signal.data["init"] diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm index 6ed67319840..1d1f7ccac3b 100644 --- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm +++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm @@ -128,9 +128,9 @@ if(initialize_directions & dir) return ..() if((NORTH|EAST) & dir) - user.ventcrawl_layer = CLAMP(user.ventcrawl_layer + 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) + user.ventcrawl_layer = clamp(user.ventcrawl_layer + 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) if((SOUTH|WEST) & dir) - user.ventcrawl_layer = CLAMP(user.ventcrawl_layer - 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) + user.ventcrawl_layer = clamp(user.ventcrawl_layer - 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX) to_chat(user, "You align yourself with the [user.ventcrawl_layer]\th output.") /obj/machinery/atmospherics/pipe/layer_manifold/visible diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 74cc37dc5ac..91a3a8987dc 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -403,7 +403,7 @@ pressure = text2num(pressure) . = TRUE if(.) - release_pressure = CLAMP(round(pressure), can_min_release_pressure, can_max_release_pressure) + release_pressure = clamp(round(pressure), can_min_release_pressure, can_max_release_pressure) investigate_log("was set to [release_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS) if("valve") var/logmsg @@ -447,7 +447,7 @@ var/N = text2num(user_input) if(!N) return - timer_set = CLAMP(N,minimum_timer_set,maximum_timer_set) + timer_set = clamp(N,minimum_timer_set,maximum_timer_set) log_admin("[key_name(usr)] has activated a prototype valve timer") . = TRUE if("toggle_timer") diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index 062a1199147..438101a2b76 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -151,7 +151,7 @@ pressure = text2num(pressure) . = TRUE if(.) - pump.target_pressure = CLAMP(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE) + pump.target_pressure = clamp(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE) investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS) if("eject") if(holding) diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index b560aa8e13b..5d1060f7b11 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -476,7 +476,7 @@ force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.adm else return //if target is null and we don't have a specific target, cancel if (effectAnnounce) - deadchat_broadcast("A special package is being launched at the station!", turf_target = target) + deadchat_broadcast("A special package is being launched at the station!", turf_target = target, message_type=DEADCHAT_ANNOUNCEMENT) var/list/bouttaDie = list() for (var/mob/living/M in target) bouttaDie.Add(M) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 1e363479a64..c0dbc6e9933 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -878,8 +878,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) var/viewscale = getviewsize(view) var/x = viewscale[1] var/y = viewscale[2] - x = CLAMP(x+change, min, max) - y = CLAMP(y+change, min,max) + x = clamp(x+change, min, max) + y = clamp(y+change, min,max) change_view("[x]x[y]") /client/proc/update_movement_keys(datum/preferences/direct_prefs) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 2738563313e..4cc32b187d9 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -324,7 +324,7 @@ //LightToggle -/obj/item/clothing/head/helment/ComponentInitialize() +/obj/item/clothing/head/helmet/ComponentInitialize() . = ..() AddElement(/datum/element/update_icon_updates_onmob) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 37274476003..2c61e9cd5b6 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -760,7 +760,7 @@ /obj/item/clothing/suit/space/hardsuit/shielded/process() . = ..() if(recharge_rate && world.time > recharge_cooldown && current_charges < max_charges) - current_charges = CLAMP((current_charges + recharge_rate), 0, max_charges) + current_charges = clamp((current_charges + recharge_rate), 0, max_charges) playsound(loc, 'sound/magic/charge.ogg', 50, TRUE) if(current_charges == max_charges) playsound(loc, 'sound/machines/ding.ogg', 50, TRUE) diff --git a/code/modules/events/_event.dm b/code/modules/events/_event.dm index 7efdf73393d..f76f0e50675 100644 --- a/code/modules/events/_event.dm +++ b/code/modules/events/_event.dm @@ -94,7 +94,7 @@ if(random) log_game("Random Event triggering: [name] ([typepath])") if (alert_observers) - deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered!", "[name]") //STOP ASSUMING IT'S BADMINS! + deadchat_broadcast(" has just been[random ? " randomly" : ""] triggered!", "[name]", message_type=DEADCHAT_ANNOUNCEMENT) //STOP ASSUMING IT'S BADMINS! return E //Special admins setup diff --git a/code/modules/events/ghost_role.dm b/code/modules/events/ghost_role.dm index 5a2d2ec697f..5d763733235 100644 --- a/code/modules/events/ghost_role.dm +++ b/code/modules/events/ghost_role.dm @@ -36,7 +36,7 @@ else if(status == NOT_ENOUGH_PLAYERS) message_admins("[role_name] cannot be spawned due to lack of players \ signing up.") - deadchat_broadcast(" did not get enough candidates ([minimum_required]) to spawn.", "[role_name]") + deadchat_broadcast(" did not get enough candidates ([minimum_required]) to spawn.", "[role_name]", message_type=DEADCHAT_ANNOUNCEMENT) else if(status == SUCCESSFUL_SPAWN) message_admins("[role_name] spawned successfully.") if(spawned_mobs.len) diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm index aad4c7c1b24..f52adb3274d 100644 --- a/code/modules/events/immovable_rod.dm +++ b/code/modules/events/immovable_rod.dm @@ -127,8 +127,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 penetrate(clong) else if(istype(clong, type)) var/obj/effect/immovablerod/other = clong - visible_message("[src] collides with [other]!\ - ") + visible_message("[src] collides with [other]!") var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(2, get_turf(src)) smoke.start() diff --git a/code/modules/food_and_drinks/food/snacks_other.dm b/code/modules/food_and_drinks/food/snacks_other.dm index c512db31902..ec162f60e67 100644 --- a/code/modules/food_and_drinks/food/snacks_other.dm +++ b/code/modules/food_and_drinks/food/snacks_other.dm @@ -420,29 +420,17 @@ tastes = list("cherry" = 1, "crepe" = 1) foodtype = GRAIN | FRUIT | SUGAR -/obj/item/reagent_containers/food/snacks/lollipop - name = "lollipop" - desc = "A delicious lollipop. Makes for a great Valentine's present." - icon = 'icons/obj/lollipop.dmi' - icon_state = "lollipop_stick" - item_state = "lollipop_stick" +/obj/item/reagent_containers/food/snacks/chewable slot_flags = ITEM_SLOT_MASK - list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/iron = 10, /datum/reagent/consumable/sugar = 5, /datum/reagent/medicine/omnizine = 2) //Honk - var/mutable_appearance/head - var/headcolor = rgb(0, 0, 0) + ///How long it lasts before being deleted var/succ_dur = 180 + ///The delay between each time it will handle reagents var/succ_int = 100 + ///Stores the time set for the next handle_reagents var/next_succ = 0 - tastes = list("candy" = 1) - foodtype = JUNKFOOD | SUGAR -/obj/item/reagent_containers/food/snacks/lollipop/Initialize() - . = ..() - head = mutable_appearance('icons/obj/lollipop.dmi', "lollipop_head") - change_head_color(rgb(rand(0, 255), rand(0, 255), rand(0, 255))) - - //makes lollipops actually wearable as masks and still edible the old fashioned way. -/obj/item/reagent_containers/food/snacks/lollipop/proc/handle_reagents() + //makes snacks actually wearable as masks and still edible the old fashioned way. +/obj/item/reagent_containers/food/snacks/chewable/proc/handle_reagents() if(reagents.total_volume) if(iscarbon(loc)) var/mob/living/carbon/C = loc @@ -454,7 +442,7 @@ return reagents.remove_any(REAGENTS_METABOLISM) -/obj/item/reagent_containers/food/snacks/lollipop/process() +/obj/item/reagent_containers/food/snacks/chewable/process() if(iscarbon(loc)) if(succ_dur < 1) qdel(src) @@ -464,43 +452,85 @@ handle_reagents() next_succ = world.time + succ_int -/obj/item/reagent_containers/food/snacks/lollipop/equipped(mob/user, slot) +/obj/item/reagent_containers/food/snacks/chewable/equipped(mob/user, slot) . = ..() if(slot == ITEM_SLOT_MASK) START_PROCESSING(SSobj, src) else STOP_PROCESSING(SSobj, src) -/obj/item/reagent_containers/food/snacks/lollipop/Destroy() +/obj/item/reagent_containers/food/snacks/chewable/Destroy() STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/reagent_containers/food/snacks/lollipop/proc/change_head_color(C) +/obj/item/reagent_containers/food/snacks/chewable/lollipop + name = "lollipop" + desc = "A delicious lollipop. Makes for a great Valentine's present." + icon = 'icons/obj/lollipop.dmi' + icon_state = "lollipop_stick" + item_state = "lollipop_stick" + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/iron = 10, /datum/reagent/consumable/sugar = 5, /datum/reagent/medicine/omnizine = 2) //Honk + var/mutable_appearance/head + var/headcolor = rgb(0, 0, 0) + succ_dur = 180 + succ_int = 100 + next_succ = 0 + tastes = list("candy" = 1) + foodtype = JUNKFOOD | SUGAR + +/obj/item/reagent_containers/food/snacks/chewable/lollipop/Initialize() + . = ..() + head = mutable_appearance('icons/obj/lollipop.dmi', "lollipop_head") + change_head_color(rgb(rand(0, 255), rand(0, 255), rand(0, 255))) + +/obj/item/reagent_containers/food/snacks/chewable/lollipop/proc/change_head_color(C) headcolor = C cut_overlay(head) head.color = C add_overlay(head) -/obj/item/reagent_containers/food/snacks/lollipop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) +/obj/item/reagent_containers/food/snacks/chewable/lollipop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) ..(hit_atom) throw_speed = 1 throwforce = 0 -/obj/item/reagent_containers/food/snacks/lollipop/cyborg +/obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg var/spamchecking = TRUE -/obj/item/reagent_containers/food/snacks/lollipop/cyborg/Initialize() +/obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg/Initialize() . = ..() addtimer(CALLBACK(src, .proc/spamcheck), 1200) -/obj/item/reagent_containers/food/snacks/lollipop/cyborg/equipped(mob/living/user, slot) +/obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg/equipped(mob/living/user, slot) . = ..(user, slot) spamchecking = FALSE -/obj/item/reagent_containers/food/snacks/lollipop/cyborg/proc/spamcheck() +/obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg/proc/spamcheck() if(spamchecking) qdel(src) +/obj/item/reagent_containers/food/snacks/chewable/bubblegum + name = "bubblegum" + desc = "A rubbery strip of gum. Not exactly filling, but it keeps you busy." + icon_state = "bubblegum" + item_state = "bubblegum" + color = "#E48AB5" // craftable custom gums someday? + list_reagents = list(/datum/reagent/consumable/sugar = 5) + tastes = list("candy" = 1) + +/obj/item/reagent_containers/food/snacks/chewable/bubblegum/nicotine + name = "nicotine gum" + list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/consumable/menthol = 5) + tastes = list("mint" = 1) + color = "#60A584" + +/obj/item/reagent_containers/food/snacks/chewable/bubblegum/happiness + name = "HP+ gum" + desc = "A rubbery strip of gum. It smells funny." + list_reagents = list(/datum/reagent/drug/happiness = 15) + tastes = list("paint thinner" = 1) + color = "#EE35FF" + /obj/item/reagent_containers/food/snacks/gumball name = "gumball" desc = "A colorful, sugary gumball." diff --git a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm index d91968797c8..c417f472307 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm @@ -122,7 +122,7 @@ log_combat(usr, src, "dispensed [O] from", null, "with [stored_food[href_list["dispense"]]] remaining") if(href_list["portion"]) - portion = CLAMP(input("How much drink do you want to dispense per glass?") as num|null, 0, 50) + portion = clamp(input("How much drink do you want to dispense per glass?") as num|null, 0, 50) if (isnull(portion)) return diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index 829b79bc02b..ecc75ff9ba6 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -129,7 +129,7 @@ if (isnull(bomb_timer)) return - bomb_timer = CLAMP(CEILING(bomb_timer / 2, 1), BOMB_TIMER_MIN, BOMB_TIMER_MAX) + bomb_timer = clamp(CEILING(bomb_timer / 2, 1), BOMB_TIMER_MIN, BOMB_TIMER_MAX) bomb_defused = FALSE log_bomber(user, "has trapped a", src, "with [bomb] set to [bomb_timer * 2] seconds") diff --git a/code/modules/goonchat/browserOutput.dm b/code/modules/goonchat/browserOutput.dm index 903a911a21e..95811d30f5a 100644 --- a/code/modules/goonchat/browserOutput.dm +++ b/code/modules/goonchat/browserOutput.dm @@ -165,7 +165,7 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("tmp/iconCache.sav")) //Cache of ico /datum/chatOutput/proc/setMusicVolume(volume = "") if(volume) - adminMusicVolume = CLAMP(text2num(volume), 0, 100) + adminMusicVolume = clamp(text2num(volume), 0, 100) //Sends client connection details to the chat to handle and save /datum/chatOutput/proc/sendClientData() diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 11d7acdbe71..f71a4fefe10 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -314,7 +314,7 @@ else if(href_list["create"]) var/amount = (text2num(href_list["amount"])) //Can't be outside these (if you change this keep a sane limit) - amount = CLAMP(amount, 1, 10) + amount = clamp(amount, 1, 10) var/id = href_list["create"] if(!stored_research.researched_designs.Find(id)) //naughty naughty diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm index cc6995f36f4..a85b7ba05e3 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -202,8 +202,8 @@ if(!click_params || !click_params["icon-x"] || !click_params["icon-y"]) return //Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf) - W.pixel_x = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) - W.pixel_y = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) + W.pixel_x = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2) + W.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2) else return ..() diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index c902f18f391..2df185c4b84 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -914,26 +914,26 @@ /// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds./// /obj/machinery/hydroponics/proc/adjustNutri(adjustamt) - nutrilevel = CLAMP(nutrilevel + adjustamt, 0, maxnutri) + nutrilevel = clamp(nutrilevel + adjustamt, 0, maxnutri) /obj/machinery/hydroponics/proc/adjustWater(adjustamt) - waterlevel = CLAMP(waterlevel + adjustamt, 0, maxwater) + waterlevel = clamp(waterlevel + adjustamt, 0, maxwater) if(adjustamt>0) adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration. /obj/machinery/hydroponics/proc/adjustHealth(adjustamt) if(myseed && !dead) - plant_health = CLAMP(plant_health + adjustamt, 0, myseed.endurance) + plant_health = clamp(plant_health + adjustamt, 0, myseed.endurance) /obj/machinery/hydroponics/proc/adjustToxic(adjustamt) - toxic = CLAMP(toxic + adjustamt, 0, 100) + toxic = clamp(toxic + adjustamt, 0, 100) /obj/machinery/hydroponics/proc/adjustPests(adjustamt) - pestlevel = CLAMP(pestlevel + adjustamt, 0, 10) + pestlevel = clamp(pestlevel + adjustamt, 0, 10) /obj/machinery/hydroponics/proc/adjustWeeds(adjustamt) - weedlevel = CLAMP(weedlevel + adjustamt, 0, 10) + weedlevel = clamp(weedlevel + adjustamt, 0, 10) /obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 65a917d8fa7..c4b52acae1a 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -207,7 +207,7 @@ /// Setters procs /// /obj/item/seeds/proc/adjust_yield(adjustamt) if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable - yield = CLAMP(yield + adjustamt, 0, 10) + yield = clamp(yield + adjustamt, 0, 10) if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) yield = 1 // Mushrooms always have a minimum yield of 1. @@ -216,39 +216,39 @@ C.value = yield /obj/item/seeds/proc/adjust_lifespan(adjustamt) - lifespan = CLAMP(lifespan + adjustamt, 10, 100) + lifespan = clamp(lifespan + adjustamt, 10, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) if(C) C.value = lifespan /obj/item/seeds/proc/adjust_endurance(adjustamt) - endurance = CLAMP(endurance + adjustamt, 10, 100) + endurance = clamp(endurance + adjustamt, 10, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) if(C) C.value = endurance /obj/item/seeds/proc/adjust_production(adjustamt) if(yield != -1) - production = CLAMP(production + adjustamt, 1, 10) + production = clamp(production + adjustamt, 1, 10) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) if(C) C.value = production /obj/item/seeds/proc/adjust_potency(adjustamt) if(potency != -1) - potency = CLAMP(potency + adjustamt, 0, 100) + potency = clamp(potency + adjustamt, 0, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) if(C) C.value = potency /obj/item/seeds/proc/adjust_weed_rate(adjustamt) - weed_rate = CLAMP(weed_rate + adjustamt, 0, 10) + weed_rate = clamp(weed_rate + adjustamt, 0, 10) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) if(C) C.value = weed_rate /obj/item/seeds/proc/adjust_weed_chance(adjustamt) - weed_chance = CLAMP(weed_chance + adjustamt, 0, 67) + weed_chance = clamp(weed_chance + adjustamt, 0, 67) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) if(C) C.value = weed_chance @@ -257,7 +257,7 @@ /obj/item/seeds/proc/set_yield(adjustamt) if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable - yield = CLAMP(adjustamt, 0, 10) + yield = clamp(adjustamt, 0, 10) if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) yield = 1 // Mushrooms always have a minimum yield of 1. @@ -266,39 +266,39 @@ C.value = yield /obj/item/seeds/proc/set_lifespan(adjustamt) - lifespan = CLAMP(adjustamt, 10, 100) + lifespan = clamp(adjustamt, 10, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) if(C) C.value = lifespan /obj/item/seeds/proc/set_endurance(adjustamt) - endurance = CLAMP(adjustamt, 10, 100) + endurance = clamp(adjustamt, 10, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) if(C) C.value = endurance /obj/item/seeds/proc/set_production(adjustamt) if(yield != -1) - production = CLAMP(adjustamt, 1, 10) + production = clamp(adjustamt, 1, 10) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) if(C) C.value = production /obj/item/seeds/proc/set_potency(adjustamt) if(potency != -1) - potency = CLAMP(adjustamt, 0, 100) + potency = clamp(adjustamt, 0, 100) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) if(C) C.value = potency /obj/item/seeds/proc/set_weed_rate(adjustamt) - weed_rate = CLAMP(adjustamt, 0, 10) + weed_rate = clamp(adjustamt, 0, 10) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) if(C) C.value = weed_rate /obj/item/seeds/proc/set_weed_chance(adjustamt) - weed_chance = CLAMP(adjustamt, 0, 67) + weed_chance = clamp(adjustamt, 0, 67) var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) if(C) C.value = weed_chance diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index c8ec5cbc736..a589d35b344 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -266,7 +266,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums dat += "(Order book by SS13BN)

" dat += "" dat += "" - dat += libcomp_menu[CLAMP(page,1,libcomp_menu.len)] + dat += libcomp_menu[clamp(page,1,libcomp_menu.len)] dat += "" dat += "
AUTHORTITLECATEGORY
<<<< >>>>
" dat += "
(Return to main menu)
" diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm index 3d84a0a81d9..e219f08e159 100644 --- a/code/modules/lighting/lighting_object.dm +++ b/code/modules/lighting/lighting_object.dm @@ -144,6 +144,9 @@ /atom/movable/lighting_object/onTransitZ() return +/atom/movable/lighting_object/washed(var/washer) + return + // Override here to prevent things accidentally moving around overlays. /atom/movable/lighting_object/forceMove(atom/destination, no_tp=FALSE, harderforce = FALSE) if(harderforce) diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index 86b501c455d..e7d7fd4898d 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -93,7 +93,7 @@ gridSet.ycrd = text2num(dmmRegex.group[4]) gridSet.zcrd = text2num(dmmRegex.group[5]) - bounds[MAP_MINX] = min(bounds[MAP_MINX], CLAMP(gridSet.xcrd, x_lower, x_upper)) + bounds[MAP_MINX] = min(bounds[MAP_MINX], clamp(gridSet.xcrd, x_lower, x_upper)) bounds[MAP_MINZ] = min(bounds[MAP_MINZ], gridSet.zcrd) bounds[MAP_MAXZ] = max(bounds[MAP_MAXZ], gridSet.zcrd) @@ -113,15 +113,15 @@ if(gridLines.len && gridLines[gridLines.len] == "") gridLines.Cut(gridLines.len) // Remove only one blank line at the end. - bounds[MAP_MINY] = min(bounds[MAP_MINY], CLAMP(gridSet.ycrd, y_lower, y_upper)) + bounds[MAP_MINY] = min(bounds[MAP_MINY], clamp(gridSet.ycrd, y_lower, y_upper)) gridSet.ycrd += gridLines.len - 1 // Start at the top and work down - bounds[MAP_MAXY] = max(bounds[MAP_MAXY], CLAMP(gridSet.ycrd, y_lower, y_upper)) + bounds[MAP_MAXY] = max(bounds[MAP_MAXY], clamp(gridSet.ycrd, y_lower, y_upper)) var/maxx = gridSet.xcrd if(gridLines.len) //Not an empty map maxx = max(maxx, gridSet.xcrd + length(gridLines[1]) / key_len - 1) - bounds[MAP_MAXX] = CLAMP(max(bounds[MAP_MAXX], maxx), x_lower, x_upper) + bounds[MAP_MAXX] = clamp(max(bounds[MAP_MAXX], maxx), x_lower, x_upper) CHECK_TICK // Indicate failure to parse any coordinates by nulling bounds diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index d0bbaea8b6b..5b37d8b5265 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -856,13 +856,13 @@ force = 0 var/ghost_counter = ghost_check() - force = CLAMP((ghost_counter * 4), 0, 75) + force = clamp((ghost_counter * 4), 0, 75) user.visible_message("[user] strikes with the force of [ghost_counter] vengeful spirits!") ..() /obj/item/melee/ghost_sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) var/ghost_counter = ghost_check() - final_block_chance += CLAMP((ghost_counter * 5), 0, 75) + final_block_chance += clamp((ghost_counter * 5), 0, 75) owner.visible_message("[owner] is protected by a ring of [ghost_counter] ghosts!") return ..() diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index 0f2b8d70613..87c9a769d1d 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -116,7 +116,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs) var/list/logs = GLOB.silo_access_logs[REF(src)] var/len = LAZYLEN(logs) var/num_pages = 1 + round((len - 1) / 30) - var/page = CLAMP(log_page, 1, num_pages) + var/page = clamp(log_page, 1, num_pages) if(num_pages > 1) for(var/i in 1 to num_pages) if(i == page) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index fc70e23645c..b11cf37f123 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -503,7 +503,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp views |= i var/new_view = input("Choose your new view", "Modify view range", 7) as null|anything in views if(new_view) - client.change_view(CLAMP(new_view, 7, max_view)) + client.change_view(clamp(new_view, 7, max_view)) else client.change_view(CONFIG_GET(string/default_view)) diff --git a/code/modules/mob/living/carbon/alien/status_procs.dm b/code/modules/mob/living/carbon/alien/status_procs.dm index 7fd1d318723..0affc187a12 100644 --- a/code/modules/mob/living/carbon/alien/status_procs.dm +++ b/code/modules/mob/living/carbon/alien/status_procs.dm @@ -17,4 +17,4 @@ /mob/living/carbon/alien/AdjustStun(amount, updating = 1, ignore_canstun = 0) . = ..() if(!.) - move_delay_add = CLAMP(move_delay_add + round(amount/2), 0, 10) + move_delay_add = clamp(move_delay_add + round(amount/2), 0, 10) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 9a731ef6b9b..a823dee108f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1038,3 +1038,33 @@ if(mood) if(mood.sanity < SANITY_UNSTABLE) return TRUE + +/mob/living/carbon/washed(var/atom/washer) + . = ..() + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "shower", /datum/mood_event/nice_shower) + + for(var/obj/item/I in held_items) + I.washed(washer) + + if(back) + update_inv_back(0) + + var/list/obscured = check_obscured_slots() + + if(head && head.washed(washer)) + update_inv_head() + + if(glasses && !(ITEM_SLOT_EYES in obscured) && glasses.washed(washer)) + update_inv_glasses() + + if(wear_mask && !(ITEM_SLOT_MASK in obscured && wear_mask.washed(washer))) + update_inv_wear_mask() + + if(ears && !(HIDEEARS in obscured) && ears.washed(washer)) + update_inv_ears() + + if(wear_neck && !(ITEM_SLOT_NECK in obscured) && wear_neck.washed(washer)) + update_inv_neck() + + if(shoes && !(HIDESHOES in obscured) && shoes.washed(washer)) + update_inv_shoes() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f9bbab9ad37..3924395d2e2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1087,6 +1087,24 @@ remove_movespeed_modifier(MOVESPEED_ID_DAMAGE_SLOWDOWN_FLYING) +/mob/living/carbon/human/washed(var/atom/washer) + . = ..() + if(wear_suit) + update_inv_wear_suit() + else if(w_uniform && w_uniform.washed(washer)) + update_inv_w_uniform() + + if(!is_mouth_covered()) + lip_style = null + update_body() + if(belt && belt.washed(washer)) + update_inv_belt() + + var/list/obscured = check_obscured_slots() + + if(gloves && !(HIDEGLOVES in obscured) && gloves.washed(washer)) + SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) + /mob/living/carbon/human/adjust_nutrition(var/change) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return FALSE diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index b4a6139b8a8..850a09dcb5c 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -101,19 +101,19 @@ for(var/obj/item/I in held_items) if(!istype(I, /obj/item/clothing)) - var/final_block_chance = I.block_chance - (CLAMP((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example + var/final_block_chance = I.block_chance - (clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(wear_suit) - var/final_block_chance = wear_suit.block_chance - (CLAMP((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(w_uniform) - var/final_block_chance = w_uniform.block_chance - (CLAMP((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(wear_neck) - var/final_block_chance = wear_neck.block_chance - (CLAMP((armour_penetration-wear_neck.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = wear_neck.block_chance - (clamp((armour_penetration-wear_neck.armour_penetration)/2,0,100)) + block_chance_modifier if(wear_neck.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 22e0bf0d448..81cca37a37e 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -397,7 +397,7 @@ var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) // redirect the projectile P.firer = H - P.preparePixelProjectile(locate(CLAMP(new_x, 1, world.maxx), CLAMP(new_y, 1, world.maxy), H.z), H) + P.preparePixelProjectile(locate(clamp(new_x, 1, world.maxx), clamp(new_y, 1, world.maxy), H.z), H) return BULLET_ACT_FORCE_PIERCE return ..() diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm index e4dff2269ec..8e9874d0faa 100644 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm @@ -113,8 +113,8 @@ to_chat(victim, "[H] is draining your blood!") to_chat(H, "You drain some blood!") playsound(H, 'sound/items/drink.ogg', 30, TRUE, -2) - victim.blood_volume = CLAMP(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) - H.blood_volume = CLAMP(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM) + victim.blood_volume = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) + H.blood_volume = clamp(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM) if(!victim.blood_volume) to_chat(H, "You finish off [victim]'s blood supply.") diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 83709a8cc4d..64d05233ae5 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -212,7 +212,7 @@ //TOXINS/PLASMA if(Toxins_partialpressure > safe_tox_max) var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_tox_max) * 10 - adjustToxLoss(CLAMP(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE)) + adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE)) throw_alert("too_much_tox", /obj/screen/alert/too_much_tox) else clear_alert("too_much_tox") @@ -681,7 +681,7 @@ All effects don't start immediately, but rather get worse over time; the rate is amount = (amount > 0) ? min(amount, BODYTEMP_HEATING_MAX) : max(amount, BODYTEMP_COOLING_MAX) if(bodytemperature >= min_temp && bodytemperature <= max_temp) - bodytemperature = CLAMP(bodytemperature + amount,min_temp,max_temp) + bodytemperature = clamp(bodytemperature + amount,min_temp,max_temp) ///////// diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index 43d611e9c87..352b2b86626 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -39,10 +39,10 @@ clear_alert("high") /mob/living/carbon/adjust_disgust(amount) - disgust = CLAMP(disgust+amount, 0, DISGUST_LEVEL_MAXEDOUT) + disgust = clamp(disgust+amount, 0, DISGUST_LEVEL_MAXEDOUT) /mob/living/carbon/set_disgust(amount) - disgust = CLAMP(amount, 0, DISGUST_LEVEL_MAXEDOUT) + disgust = clamp(amount, 0, DISGUST_LEVEL_MAXEDOUT) ////////////////////////////////////////TRAUMAS///////////////////////////////////////// diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 8a8e275e699..cac062b25ff 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -149,7 +149,7 @@ /mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE, required_status) if(!forced && (status_flags & GODMODE)) return FALSE - bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) + bruteloss = clamp((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) if(updating_health) updatehealth() return amount @@ -160,7 +160,7 @@ /mob/living/proc/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE) if(!forced && (status_flags & GODMODE)) return FALSE - oxyloss = CLAMP((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) + oxyloss = clamp((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) if(updating_health) updatehealth() return amount @@ -179,7 +179,7 @@ /mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE) if(!forced && (status_flags & GODMODE)) return FALSE - toxloss = CLAMP((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) + toxloss = clamp((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) if(updating_health) updatehealth() return amount @@ -198,7 +198,7 @@ /mob/living/proc/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE) if(!forced && (status_flags & GODMODE)) return FALSE - fireloss = CLAMP((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) + fireloss = clamp((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) if(updating_health) updatehealth() return amount @@ -209,7 +209,7 @@ /mob/living/proc/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE) if(!forced && ( (status_flags & GODMODE) || HAS_TRAIT(src, TRAIT_NOCLONELOSS)) ) return FALSE - cloneloss = CLAMP((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) + cloneloss = clamp((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) if(updating_health) updatehealth() return amount diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index d39b8ce59f0..29d38f40df8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1085,7 +1085,7 @@ update_fire() /mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person - fire_stacks = CLAMP(fire_stacks + add_fire_stacks, -20, 20) + fire_stacks = clamp(fire_stacks + add_fire_stacks, -20, 20) if(on_fire && fire_stacks <= 0) ExtinguishMob() @@ -1113,6 +1113,11 @@ //Mobs on Fire end +//Washing +/mob/living/washed(var/atom/washer) + . = ..() + SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD) + // used by secbot and monkeys Crossed /mob/living/proc/knockOver(var/mob/living/carbon/C) if(C.key) //save us from monkey hordes diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index ee78a97f0ab..a5a5c7be6bd 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -58,9 +58,9 @@ /obj/item/proc/get_volume_by_throwforce_and_or_w_class() if(throwforce && w_class) - return CLAMP((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100 + return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100 else if(w_class) - return CLAMP(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 + return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 else return 0 diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 326f5136299..4e3f5359c11 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -1,10 +1,16 @@ -/mob/living/silicon/ai/attacked_by(obj/item/I, mob/living/user, def_zone) - if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt. +/mob/living/silicon/ai/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/aiModule)) + var/obj/item/aiModule/MOD = W + if(!mind) //A player mind is required for law procs to run antag checks. + to_chat(user, "[src] is entirely unresponsive!") + return + MOD.install(laws, user) //Proc includes a success mesage so we don't need another one + return + if(W.force && W.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt. spark_system.start() return ..() - /mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M) if(!SSticker.HasRoundStarted()) to_chat(M, "You cannot attack people before the game has started.") diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 89a627ce9e5..07aa17ea900 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -135,7 +135,7 @@ /mob/living/silicon/pai/proc/process_hack() if(cable && cable.machine && istype(cable.machine, /obj/machinery/door) && cable.machine == hackdoor && get_dist(src, hackdoor) <= 1) - hackprogress = CLAMP(hackprogress + 4, 0, 100) + hackprogress = clamp(hackprogress + 4, 0, 100) else temp = "Door Jack: Connection to airlock has been lost. Hack aborted." hackprogress = 0 @@ -283,7 +283,7 @@ update_stat() /mob/living/silicon/pai/process() - emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth) + emitterhealth = clamp((emitterhealth + emitterregen), -50, emittermaxhealth) /obj/item/paicard/attackby(obj/item/W, mob/user, params) ..() diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm index 65d9ff11745..3272173da24 100644 --- a/code/modules/mob/living/silicon/pai/pai_defense.dm +++ b/code/modules/mob/living/silicon/pai/pai_defense.dm @@ -74,7 +74,7 @@ return FALSE //No we're not flammable /mob/living/silicon/pai/proc/take_holo_damage(amount) - emitterhealth = CLAMP((emitterhealth - amount), -50, emittermaxhealth) + emitterhealth = clamp((emitterhealth - amount), -50, emittermaxhealth) if(emitterhealth < 0) fold_in(force = TRUE) to_chat(src, "The impact degrades your holochassis!") diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index d071d6cf21d..aa148447b39 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -21,7 +21,7 @@ if(cell && cell.charge) if(cell.charge <= 100) uneq_all() - var/amt = CLAMP((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell. + var/amt = clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell. cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick else uneq_all() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 89d4725e254..ada05cc9cfd 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -77,12 +77,12 @@ var/model = "" //The type of bot it is. var/bot_type = 0 //The type of bot it is, for radio control. var/data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC //The type of data HUD the bot uses. Diagnostic by default. - //This holds text for what the bot is mode doing, reported on the remote bot control interface. + //This holds text for what the bot is mode doing, reported on the remote bot control interface. This is in order of the defines for the mode defines in robots.dm, in order var/list/mode_name = list("In Pursuit","Preparing to Arrest", "Arresting", \ "Beginning Patrol", "Patrolling", "Summoned by PDA", \ "Cleaning", "Repairing", "Proceeding to work site", "Healing", \ "Proceeding to AI waypoint", "Navigating to Delivery Location", "Navigating to Home", \ - "Waiting for clear path", "Calculating navigation path", "Pinging beacon network", "Unable to reach destination") + "Waiting for clear path", "Calculating navigation path", "Pinging beacon network", "Unable to reach destination", "Chasing filth") var/datum/atom_hud/data/bot_path/path_hud = new /datum/atom_hud/data/bot_path() var/path_image_icon = 'icons/mob/aibots.dmi' var/path_image_icon_state = "path_indicator" diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index fe24fa7ced8..c89748d6d1f 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -450,3 +450,43 @@ F.name = created_name qdel(I) qdel(src) + +//Get cleaned +/obj/item/bot_assembly/hygienebot + name = "incomplete hygienebot assembly" + desc = "Clear out the swamp once and for all" + icon = 'icons/obj/watercloset.dmi' + icon_state = "drone" + created_name = "Hygienebot" + +/obj/item/bot_assembly/hygienebot/attackby(obj/item/I, mob/user, params) + . = ..() + switch(build_step) + if(ASSEMBLY_FIRST_STEP) + if(I.tool_behaviour == TOOL_WELDER) + if(I.use_tool(src, user, 0, volume=40)) + add_overlay("hs_hole") + to_chat(user, "You weld a water hole in [src]!") + build_step++ + + if(ASSEMBLY_SECOND_STEP) + if(!can_finish_build(I, user)) + return + if(istype(I, /obj/item/stack/ducts)) + var/obj/item/stack/ducts/D = I + if(D.get_amount() < 1) + to_chat(user, "You need one fluid duct to finish [src]") + return + to_chat(user, "You start to pipe up [src]...") + if(do_after(user, 40, target = src)) + if(D.get_amount() >= 1) + D.use(1) + to_chat(user, "You pipe up [src].") + build_step++ + else + return + var/mob/living/simple_animal/bot/hygienebot/H = new(drop_location()) + H.name = created_name + qdel(I) + qdel(src) + return TRUE diff --git a/code/modules/mob/living/simple_animal/bot/hygienebot.dm b/code/modules/mob/living/simple_animal/bot/hygienebot.dm new file mode 100644 index 00000000000..321d4828ce6 --- /dev/null +++ b/code/modules/mob/living/simple_animal/bot/hygienebot.dm @@ -0,0 +1,254 @@ +//Cleanbot +/mob/living/simple_animal/bot/hygienebot + name = "\improper Hygienebot" + desc = "A flying cleaning robot, he'll chase down people who can't shower properly!" + icon = 'icons/obj/watercloset.dmi' + icon_state = "drone" + density = FALSE + anchored = FALSE + health = 100 + maxHealth = 100 + radio_key = /obj/item/encryptionkey/headset_service + radio_channel = RADIO_CHANNEL_SERVICE //Service + bot_type = HYGIENE_BOT + model = "Cleanbot" + bot_core_type = /obj/machinery/bot_core/hygienebot + window_id = "autoclean" + window_name = "Automatic Crew Cleaner X2" + pass_flags = PASSMOB + path_image_color = "#993299" + allow_pai = FALSE + layer = ABOVE_MOB_LAYER + + var/mob/living/carbon/human/target + var/currentspeed = 5 + var/washing = FALSE + var/mad = FALSE + var/last_found + var/oldtarget_name + + var/mutable_appearance/water_overlay + var/mutable_appearance/fire_overlay + +/mob/living/simple_animal/bot/hygienebot/Initialize() + . = ..() + update_icon() + var/datum/job/janitor/J = new/datum/job/janitor + access_card.access += J.get_access() + prev_access = access_card.access + +/mob/living/simple_animal/bot/hygienebot/explode() + walk_to(src,0) + visible_message("[src] blows apart in a foamy explosion!") + do_sparks(3, TRUE, src) + on = FALSE + new /obj/effect/particle_effect/foam(loc) + + ..() + +/mob/living/simple_animal/bot/hygienebot/Cross(atom/movable/AM) + . = ..() + if(washing) + do_wash(AM) + +/mob/living/simple_animal/bot/hygienebot/Crossed(atom/movable/AM) + . = ..() + if(washing) + do_wash(AM) + +/mob/living/simple_animal/bot/hygienebot/update_icon_state() + . = ..() + if(on) + icon_state = "drone-on" + else + icon_state = "drone" + + +/mob/living/simple_animal/bot/hygienebot/update_overlays() + . = ..() + if(on) + var/mutable_appearance/fire_overlay = mutable_appearance(icon,"flame") + . +=fire_overlay + + + if(washing) + var/mutable_appearance/water_overlay = mutable_appearance(icon, emagged ? "dronefire" : "dronewater") + . += water_overlay + + +/mob/living/simple_animal/bot/hygienebot/turn_off() + ..() + mode = BOT_IDLE + +/mob/living/simple_animal/bot/hygienebot/bot_reset() + ..() + target = null + oldtarget_name = null + walk_to(src,0) + last_found = world.time + + +/mob/living/simple_animal/bot/hygienebot/Crossed(atom/movable/AM) + . = ..() + if(washing) + do_wash(AM) + +/mob/living/simple_animal/bot/hygienebot/Moved() + . = ..() + if(washing && isturf(loc) && !emagged) + var/turf/open/OT = loc + OT.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) + +/mob/living/simple_animal/bot/hygienebot/handle_automated_action() + if(!..()) + return + + if(washing) + do_wash(loc) + for(var/AM in loc) + do_wash(AM) + if(isopenturf(loc) && !emagged) + var/turf/open/tile = loc + tile.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) + + switch(mode) + if(BOT_IDLE) // idle + walk_to(src,0) + look_for_lowhygiene() // see if any disgusting fucks are in range + if(!mode && auto_patrol) // still idle, and set to patrol + mode = BOT_START_PATROL // switch to patrol mode + + if(BOT_HUNT) // hunting for stinkman + // if can't reach stinkman for long enough, don't give up, try harder. + if(emagged) //lol fuck em up + currentspeed = 8 + start_washing() + mad = TRUE + else + switch(frustration) + if(0 to 4) + currentspeed = 5 + stop_washing() + mad = FALSE + if(4 to INFINITY) + currentspeed = 2.5 + start_washing() + mad = TRUE + if(target) + if(target.loc == loc && isturf(target.loc)) //LADIES AND GENTLEMAN WE GOTEM PREPARE TO DUMP + start_washing() + if(mad) + speak("Well about fucking time you degenerate", "Fucking finally", "Thank god, you finally stopped") + playsound(loc, 'sound/effects/hygienebot_angry.ogg', 60, 1) + mad = FALSE + mode = BOT_SHOWERSTANCE + else + var/turf/olddist = get_dist(src, target) + walk_to(src, target,0, currentspeed) + if(mad && prob(60)) + playsound(loc, 'sound/effects/hygienebot_angry.ogg', 60, 1) + speak(pick("Get back here you foul smelling fucker.", "If you don't get back here right now I'm going to give you a fucking vasectomy.", "STOP RUNNING OR I WILL CUT YOUR ARTERIES!", "Just fucking let me clean you you arsehole!", "STOP. RUNNING.", "Either you stop running or I will fucking drag you out of an airlock.", "I just want to fucking clean you you troglodyte.", "If you don't come back here I'll put a green cloud around you cunt.")) + if((get_dist(src, target)) >= (olddist)) + frustration++ + else + frustration = 0 + else + back_to_idle() + + if(BOT_SHOWERSTANCE) + if(check_purity(target)) + speak("Enjoy your clean and tidy day!") + playsound(loc, 'sound/effects/hygienebot_happy.ogg', 60, 1) + back_to_idle() + return + if(!target) + last_found = world.time + if(target.loc != loc && !isturf(target.loc)) + back_to_hunt() + + if(BOT_START_PATROL) + look_for_lowhygiene() + start_patrol() + + if(BOT_PATROL) + look_for_lowhygiene() + bot_patrol() + +/mob/living/simple_animal/bot/hygienebot/proc/back_to_idle() + mode = BOT_IDLE + walk_to(src,0) + target = null + frustration = 0 + last_found = world.time + stop_washing() + INVOKE_ASYNC(src, .proc/handle_automated_action) + +/mob/living/simple_animal/bot/hygienebot/proc/back_to_hunt() + frustration = 0 + mode = BOT_HUNT + stop_washing() + INVOKE_ASYNC(src, .proc/handle_automated_action) + +/mob/living/simple_animal/bot/hygienebot/proc/look_for_lowhygiene() + for (var/mob/living/carbon/human/H in view(7,src)) //Find the NEET + if((H.name == oldtarget_name) && (world.time < last_found + 100)) + continue + if(!check_purity(H)) //Theyre impure + target = H + oldtarget_name = H.name + speak("Unhygienic client found. Please stand still so I can clean you.") + playsound(loc, 'sound/effects/hygienebot_happy.ogg', 60, 1) + visible_message("[src] points at [H.name]!") + mode = BOT_HUNT + INVOKE_ASYNC(src, .proc/handle_automated_action) + break + else + continue + +/mob/living/simple_animal/bot/hygienebot/proc/start_washing() + washing = TRUE + update_icon() + +/mob/living/simple_animal/bot/hygienebot/proc/stop_washing() + washing = FALSE + update_icon() + + + +/mob/living/simple_animal/bot/hygienebot/get_controls(mob/user) + var/list/dat = list() + dat += hack(user) + dat += showpai(user) + dat += {" +Hygienebot X2 controls

+Status: ["[on ? "On" : "Off"]"]
+Behaviour controls are [locked ? "locked" : "unlocked"]
+Maintenance panel is [open ? "opened" : "closed"]"} + + if(!locked || issilicon(user) || IsAdminGhost(user)) + dat += {"
Auto Patrol: ["[auto_patrol ? "On" : "Off"]"]"} + + return dat.Join("") + +/mob/living/simple_animal/bot/hygienebot/proc/check_purity(mob/living/L) + if(emagged && L.stat != DEAD) + return FALSE + + for(var/X in list(ITEM_SLOT_HEAD, ITEM_SLOT_MASK, ITEM_SLOT_ICLOTHING, ITEM_SLOT_OCLOTHING, ITEM_SLOT_FEET)) + + var/obj/item/I = L.get_item_by_slot(X) + if(I && HAS_BLOOD_DNA(I)) + return FALSE + return TRUE + +/mob/living/simple_animal/bot/hygienebot/proc/do_wash(atom/A) + if(emagged) + A.fire_act() + return //lol pranked no cleaning besides that + else + A.washed(src) + + + +/obj/machinery/bot_core/hygienebot + req_one_access = list(ACCESS_JANITOR, ACCESS_ROBOTICS) diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm index eda19be7af4..ee9fa2526bc 100644 --- a/code/modules/mob/living/simple_animal/damage_procs.dm +++ b/code/modules/mob/living/simple_animal/damage_procs.dm @@ -2,7 +2,7 @@ /mob/living/simple_animal/proc/adjustHealth(amount, updating_health = TRUE, forced = FALSE) if(!forced && (status_flags & GODMODE)) return FALSE - bruteloss = round(CLAMP(bruteloss + amount, 0, maxHealth),DAMAGE_PRECISION) + bruteloss = round(clamp(bruteloss + amount, 0, maxHealth),DAMAGE_PRECISION) if(updating_health) updatehealth() return amount diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index e09e85c4d51..d5b0495a5eb 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -107,8 +107,8 @@ Difficulty: Hard if(charging) return - anger_modifier = CLAMP(((maxHealth - health)/60),0,20) - enrage_time = initial(enrage_time) * CLAMP(anger_modifier / 20, 0.5, 1) + anger_modifier = clamp(((maxHealth - health)/60),0,20) + enrage_time = initial(enrage_time) * clamp(anger_modifier / 20, 0.5, 1) ranged_cooldown = world.time + 50 if(client) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 954cd200999..8ea53032b44 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -88,7 +88,7 @@ Difficulty: Very Hard chosen_attack_num = 4 /mob/living/simple_animal/hostile/megafauna/colossus/OpenFire() - anger_modifier = CLAMP(((maxHealth - health)/50),0,20) + anger_modifier = clamp(((maxHealth - health)/50),0,20) ranged_cooldown = world.time + 120 if(client) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index 8ba28edceaa..dca43d39498 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -104,7 +104,7 @@ Difficulty: Medium if(swooping) return - anger_modifier = CLAMP(((maxHealth - health)/50),0,20) + anger_modifier = clamp(((maxHealth - health)/50),0,20) ranged_cooldown = world.time + ranged_cooldown_time if(client) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 3d029161889..d861184b3c4 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -485,7 +485,7 @@ Difficulty: Hard /mob/living/simple_animal/hostile/megafauna/hierophant/proc/calculate_rage() //how angry we are overall did_reset = FALSE //oh hey we're doing SOMETHING, clearly we might need to heal if we recall - anger_modifier = CLAMP(((maxHealth - health) / 42),0,50) + anger_modifier = clamp(((maxHealth - health) / 42),0,50) burst_range = initial(burst_range) + round(anger_modifier * 0.08) beam_range = initial(beam_range) + round(anger_modifier * 0.12) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index dc674ba56ff..5977bfe68be 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -199,7 +199,7 @@ /mob/living/simple_animal/updatehealth() ..() - health = CLAMP(health, 0, maxHealth) + health = clamp(health, 0, maxHealth) /mob/living/simple_animal/update_stat() if(status_flags & GODMODE) diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index 96619bf5ca0..8ccf1fb6e4f 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -192,7 +192,7 @@ step_away(M,src) M.Friends = Friends.Copy() babies += M - M.mutation_chance = CLAMP(mutation_chance+(rand(5,-5)),0,100) + M.mutation_chance = clamp(mutation_chance+(rand(5,-5)),0,100) SSblackbox.record_feedback("tally", "slime_babies_born", 1, M.colour) if(original_nanites) diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index a1113001231..4cb0cbe892a 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -102,4 +102,4 @@ ///Adjust the body temperature of a mob, with min/max settings /mob/proc/adjust_bodytemperature(amount,min_temp=0,max_temp=INFINITY) if(bodytemperature >= min_temp && bodytemperature <= max_temp) - bodytemperature = CLAMP(bodytemperature + amount,min_temp,max_temp) + bodytemperature = clamp(bodytemperature + amount,min_temp,max_temp) diff --git a/code/modules/modular_computers/file_system/programs/arcade.dm b/code/modules/modular_computers/file_system/programs/arcade.dm index 2bc34b1027c..17db77381a2 100644 --- a/code/modules/modular_computers/file_system/programs/arcade.dm +++ b/code/modules/modular_computers/file_system/programs/arcade.dm @@ -10,15 +10,19 @@ ui_x = 450 ui_y = 350 - var/game_active = TRUE //Checks to see if a game is in progress. - var/pause_state = FALSE //This disables buttons in order to prevent multiple actions before the opponent's actions. + ///Returns TRUE if the game is being played. + var/game_active = TRUE + ///This disables buttom actions from having any impact if TRUE. Resets to FALSE when the player is allowed to make an action again. + var/pause_state = FALSE var/boss_hp = 45 var/boss_mp = 15 var/player_hp = 30 var/player_mp = 10 var/ticket_count = 0 - var/heads_up = "Nanotrasen says, winners make us money."//Shows the active display text for the app + ///Shows what text is shown on the app, usually showing the log of combat actions taken by the player. + var/heads_up = "Nanotrasen says, winners make us money." var/boss_name = "Cuban Pete's Minion" + ///Determines which boss image to use on the UI. var/boss_id = 1 /datum/computer_file/program/arcade/proc/game_check(mob/user) diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index b8e18fa465a..376e07aecfc 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -115,8 +115,7 @@ They *could* go in their appropriate files, but this is supposed to be modular update_icon() /obj/machinery/proc/AI_notify_hack() - var/turf/location = get_turf(src) - var/alertstr = "Network Alert: Hacking attempt detected[location?" in [location]":". Unable to pinpoint location"]." + var/alertstr = "Network Alert: Hacking attempt detected[get_area(src)?" in [get_area_name(src, TRUE)]":". Unable to pinpoint location"]." for(var/mob/living/silicon/ai/AI in GLOB.player_list) to_chat(AI, alertstr) diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 62ff1f78950..be8005cfc6a 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -55,12 +55,12 @@ return var/desired_y = input(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) as num|null - + if (isnull(desired_y)) return - picture_size_x = min(CLAMP(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) - picture_size_y = min(CLAMP(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) + picture_size_x = min(clamp(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) + picture_size_y = min(clamp(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT) /obj/item/camera/AltClick(mob/user) if(!user.canUseTopic(src, BE_CLOSE)) @@ -165,8 +165,8 @@ if(!isturf(target_turf)) blending = FALSE return FALSE - size_x = CLAMP(size_x, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) - size_y = CLAMP(size_y, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) + size_x = clamp(size_x, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) + size_y = clamp(size_y, 0, CAMERA_PICTURE_SIZE_HARD_LIMIT) var/list/desc = list("This is a photo of an area of [size_x+1] meters by [size_y+1] meters.") var/list/mobs_spotted = list() var/list/dead_spotted = list() @@ -186,7 +186,7 @@ T = SSmapping.get_turf_below(T) if(!T) break - + if(T && ((ai_user && GLOB.cameranet.checkTurfVis(placeholder)) || (placeholder in seen))) turfs += T for(var/mob/M in T) diff --git a/code/modules/plumbing/plumbers/_plumb_machinery.dm b/code/modules/plumbing/plumbers/_plumb_machinery.dm index 09ce731a747..3cd3099a4b9 100644 --- a/code/modules/plumbing/plumbers/_plumb_machinery.dm +++ b/code/modules/plumbing/plumbers/_plumb_machinery.dm @@ -41,9 +41,9 @@ return TRUE /obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced) - to_chat(user, "You start furiously plunging [name].") + to_chat(user, "You start furiously plunging [name].") if(do_after(user, 30, target = src)) - to_chat(user, "You finish plunging the [name].") + to_chat(user, "You finish plunging the [name].") reagents.reaction(get_turf(src), TOUCH) //splash on the floor reagents.clear_reagents() diff --git a/code/modules/plumbing/plumbers/acclimator.dm b/code/modules/plumbing/plumbers/acclimator.dm index d2bc505d7d1..0c1c099090d 100644 --- a/code/modules/plumbing/plumbers/acclimator.dm +++ b/code/modules/plumbing/plumbers/acclimator.dm @@ -91,15 +91,15 @@ switch(action) if("set_target_temperature") var/target = text2num(params["temperature"]) - target_temperature = CLAMP(target, 0, 1000) + target_temperature = clamp(target, 0, 1000) if("set_allowed_temperature_difference") var/target = text2num(params["temperature"]) - allowed_temperature_difference = CLAMP(target, 0, 1000) + allowed_temperature_difference = clamp(target, 0, 1000) if("toggle_power") enabled = !enabled if("change_volume") var/target = text2num(params["volume"]) - reagents.maximum_volume = CLAMP(round(target), 1, buffer) + reagents.maximum_volume = clamp(round(target), 1, buffer) #undef COOLING #undef HEATING diff --git a/code/modules/plumbing/plumbers/pill_press.dm b/code/modules/plumbing/plumbers/pill_press.dm index 6731f2f3dcf..3cb51379ed1 100644 --- a/code/modules/plumbing/plumbers/pill_press.dm +++ b/code/modules/plumbing/plumbers/pill_press.dm @@ -92,9 +92,9 @@ . = TRUE switch(action) if("change_pill_style") - pill_number = CLAMP(text2num(params["id"]), 1 , PILL_STYLE_COUNT) + pill_number = clamp(text2num(params["id"]), 1 , PILL_STYLE_COUNT) if("change_pill_size") - pill_size = CLAMP(text2num(params["volume"]), minimum_pill, maximum_pill) + pill_size = clamp(text2num(params["volume"]), minimum_pill, maximum_pill) if("change_pill_name") var/new_name = html_encode(params["name"]) if(findtext(new_name, "pill")) //names like pillatron and Pilliam are thus valid diff --git a/code/modules/plumbing/plumbers/splitters.dm b/code/modules/plumbing/plumbers/splitters.dm index 825f794a3d8..03bb680116f 100644 --- a/code/modules/plumbing/plumbers/splitters.dm +++ b/code/modules/plumbing/plumbers/splitters.dm @@ -14,7 +14,7 @@ var/transfer_side = 5 //the maximum you can set the transfer to var/max_transfer = 9 - + ui_x = 220 ui_y = 105 @@ -42,7 +42,7 @@ switch(action) if("set_amount") var/direction = params["target"] - var/value = CLAMP(text2num(params["amount"]), 1, max_transfer) + var/value = clamp(text2num(params["amount"]), 1, max_transfer) switch(direction) if("straight") transfer_straight = value diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index cf087e4eb8d..675769dbd23 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -197,7 +197,7 @@ GLOB.apcs_list -= src if(malfai && operating) - malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000) + malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000) area.power_light = FALSE area.power_equip = FALSE area.power_environ = FALSE @@ -1374,7 +1374,7 @@ /obj/machinery/power/apc/proc/set_broken() if(malfai && operating) - malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000) + malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000) operating = FALSE obj_break() if(occupier) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 67e77ab776f..f080a894523 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -206,7 +206,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri /obj/structure/cable/proc/surplus() if(powernet) - return CLAMP(powernet.avail-powernet.load, 0, powernet.avail) + return clamp(powernet.avail-powernet.load, 0, powernet.avail) else return 0 @@ -222,7 +222,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri /obj/structure/cable/proc/delayed_surplus() if(powernet) - return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail) + return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail) else return 0 diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 271942a9906..892b62976e3 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -176,7 +176,7 @@ /obj/item/stock_parts/cell/proc/get_electrocute_damage() if(charge >= 1000) - return CLAMP(20 + round(charge/25000), 20, 195) + rand(-5,5) + return clamp(20 + round(charge/25000), 20, 195) + rand(-5,5) else return 0 @@ -370,7 +370,7 @@ . = ..() if(. & EMP_PROTECT_SELF) return - charge = CLAMP((charge-(10000/severity)),0,maxcharge) + charge = clamp((charge-(10000/severity)),0,maxcharge) /obj/item/stock_parts/cell/emergency_light name = "miniature power cell" diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 07cf134589b..34914b1c990 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -336,7 +336,7 @@ . = ..() if(on && status == LIGHT_OK) var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE) - glowybit.alpha = CLAMP(light_power*250, 30, 200) + glowybit.alpha = clamp(light_power*250, 30, 200) . += glowybit // update the icon_state and luminosity of the light depending on its state diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index d9eb4ac9fb7..f4b2208a5cb 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -47,7 +47,7 @@ /obj/machinery/power/proc/surplus() if(powernet) - return CLAMP(powernet.avail-powernet.load, 0, powernet.avail) + return clamp(powernet.avail-powernet.load, 0, powernet.avail) else return 0 @@ -63,7 +63,7 @@ /obj/machinery/power/proc/delayed_surplus() if(powernet) - return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail) + return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail) else return 0 diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 9660e8359c5..1a6a725e4e7 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -96,6 +96,6 @@ /datum/powernet/proc/get_electrocute_damage() if(avail >= 1000) - return CLAMP(20 + round(avail/25000), 20, 195) + rand(-5,5) + return clamp(20 + round(avail/25000), 20, 195) + rand(-5,5) else return 0 diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 3befc9d8271..0ef53491aae 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -229,7 +229,7 @@ /obj/machinery/power/smes/proc/chargedisplay() - return CLAMP(round(5.5*charge/capacity),0,5) + return clamp(round(5.5*charge/capacity),0,5) /obj/machinery/power/smes/process() if(machine_stat & BROKEN) @@ -381,7 +381,7 @@ target = text2num(target) . = TRUE if(.) - input_level = CLAMP(target, 0, input_level_max) + input_level = clamp(target, 0, input_level_max) log_smes(usr) if("output") var/target = params["target"] @@ -403,7 +403,7 @@ target = text2num(target) . = TRUE if(.) - output_level = CLAMP(target, 0, output_level_max) + output_level = clamp(target, 0, output_level_max) log_smes(usr) /obj/machinery/power/smes/proc/log_smes(mob/user) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 8e5985bd3a7..a82e3b946ab 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -164,7 +164,7 @@ else //dot product of sun and panel -- Lambert's Cosine Law . = cos(azimuth_current - sun_azimuth) - . = CLAMP(round(., 0.01), 0, 1) + . = clamp(round(., 0.01), 0, 1) sunfrac = . /obj/machinery/power/solar/process() @@ -385,7 +385,7 @@ if(adjust) value = azimuth_rate + adjust if(value != null) - azimuth_rate = round(CLAMP(value, -2 * SSsun.base_rotation, 2 * SSsun.base_rotation), 0.01) + azimuth_rate = round(clamp(value, -2 * SSsun.base_rotation, 2 * SSsun.base_rotation), 0.01) return TRUE return FALSE if(action == "tracking") @@ -463,7 +463,7 @@ ///Rotates the panel to the passed angles /obj/machinery/power/solar_control/proc/set_panels(azimuth) - azimuth = CLAMP(round(azimuth, 0.01), -360, 719.99) + azimuth = clamp(round(azimuth, 0.01), -360, 719.99) if(azimuth >= 360) azimuth -= 360 if(azimuth < 0) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 989bdd03833..9f1357681da 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -336,7 +336,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //We vary volume by power, and handle OH FUCK FUSION IN COOLING LOOP noises. if(power) - soundloop.volume = CLAMP((50 + (power / 50)), 50, 100) + soundloop.volume = clamp((50 + (power / 50)), 50, 100) if(damage >= 300) soundloop.mid_sounds = list('sound/machines/sm/loops/delamming.ogg' = 1) else @@ -375,7 +375,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //((((some value between 0.5 and 1 * temp - ((273.15 + 40) * some values between 1 and 6)) * some number between 0.25 and knock your socks off / 150) * 0.25 //Heat and mols account for each other, a lot of hot mols are more damaging then a few //Mols start to have a positive effect on damage after 350 - damage = max(damage + (max(CLAMP(removed.total_moles() / 200, 0.5, 1) * removed.temperature - ((T0C + HEAT_PENALTY_THRESHOLD)*dynamic_heat_resistance), 0) * mole_heat_penalty / 150 ) * DAMAGE_INCREASE_MULTIPLIER, 0) + damage = max(damage + (max(clamp(removed.total_moles() / 200, 0.5, 1) * removed.temperature - ((T0C + HEAT_PENALTY_THRESHOLD)*dynamic_heat_resistance), 0) * mole_heat_penalty / 150 ) * DAMAGE_INCREASE_MULTIPLIER, 0) //Power only starts affecting damage when it is above 5000 damage = max(damage + (max(power - POWER_PENALTY_THRESHOLD, 0)/500) * DAMAGE_INCREASE_MULTIPLIER, 0) //Molar count only starts affecting damage when it is above 1800 @@ -405,14 +405,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //Can cause an overestimation of mol count, should stabalize things though. //Prevents huge bursts of gas/heat when a large amount of something is introduced //They range between 0 and 1 - plasmacomp += CLAMP(max(removed.gases[/datum/gas/plasma][MOLES]/combined_gas, 0) - plasmacomp, -1, gas_change_rate) - o2comp += CLAMP(max(removed.gases[/datum/gas/oxygen][MOLES]/combined_gas, 0) - o2comp, -1, gas_change_rate) - co2comp += CLAMP(max(removed.gases[/datum/gas/carbon_dioxide][MOLES]/combined_gas, 0) - co2comp, -1, gas_change_rate) - pluoxiumcomp += CLAMP(max(removed.gases[/datum/gas/pluoxium][MOLES]/combined_gas, 0) - pluoxiumcomp, -1, gas_change_rate) - tritiumcomp += CLAMP(max(removed.gases[/datum/gas/tritium][MOLES]/combined_gas, 0) - tritiumcomp, -1, gas_change_rate) - bzcomp += CLAMP(max(removed.gases[/datum/gas/bz][MOLES]/combined_gas, 0) - bzcomp, -1, gas_change_rate) - n2ocomp += CLAMP(max(removed.gases[/datum/gas/nitrous_oxide][MOLES]/combined_gas, 0) - n2ocomp, -1, gas_change_rate) - n2comp += CLAMP(max(removed.gases[/datum/gas/nitrogen][MOLES]/combined_gas, 0) - n2comp, -1, gas_change_rate) + plasmacomp += clamp(max(removed.gases[/datum/gas/plasma][MOLES]/combined_gas, 0) - plasmacomp, -1, gas_change_rate) + o2comp += clamp(max(removed.gases[/datum/gas/oxygen][MOLES]/combined_gas, 0) - o2comp, -1, gas_change_rate) + co2comp += clamp(max(removed.gases[/datum/gas/carbon_dioxide][MOLES]/combined_gas, 0) - co2comp, -1, gas_change_rate) + pluoxiumcomp += clamp(max(removed.gases[/datum/gas/pluoxium][MOLES]/combined_gas, 0) - pluoxiumcomp, -1, gas_change_rate) + tritiumcomp += clamp(max(removed.gases[/datum/gas/tritium][MOLES]/combined_gas, 0) - tritiumcomp, -1, gas_change_rate) + bzcomp += clamp(max(removed.gases[/datum/gas/bz][MOLES]/combined_gas, 0) - bzcomp, -1, gas_change_rate) + n2ocomp += clamp(max(removed.gases[/datum/gas/nitrous_oxide][MOLES]/combined_gas, 0) - n2ocomp, -1, gas_change_rate) + n2comp += clamp(max(removed.gases[/datum/gas/nitrogen][MOLES]/combined_gas, 0) - n2comp, -1, gas_change_rate) //We're concerned about pluoxium being too easy to abuse at low percents, so we make sure there's a substantial amount. if(pluoxiumcomp >= 0.15) @@ -436,12 +436,12 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //Given infinite time, powerloss_dynamic_scaling = co2comp //Some value between 0 and 1 if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD) //If there are more then 20 mols, or more then 20% co2 - powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling + CLAMP(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1) + powerloss_dynamic_scaling = clamp(powerloss_dynamic_scaling + clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1) else - powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling - 0.05,0, 1) + powerloss_dynamic_scaling = clamp(powerloss_dynamic_scaling - 0.05,0, 1) //Ranges from 0 to 1(1-(value between 0 and 1 * ranges from 1 to 1.5(mol / 500))) //We take the mol count, and scale it to be our inhibitor - powerloss_inhibitor = CLAMP(1-(powerloss_dynamic_scaling * CLAMP(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1) + powerloss_inhibitor = clamp(1-(powerloss_dynamic_scaling * clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1) //Releases stored power into the general pool //We get this by consuming shit or being scalpeled @@ -501,7 +501,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(!istype(l.glasses, /obj/item/clothing/glasses/meson)) var/D = sqrt(1 / max(1, get_dist(l, src))) l.hallucination += power * config_hallucination_power * D - l.hallucination = CLAMP(l.hallucination, 0, 200) + l.hallucination = clamp(l.hallucination, 0, 200) for(var/mob/living/l in range(src, round((power / 100) ** 0.25))) var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) ) @@ -515,12 +515,12 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //Handle high power zaps/anomaly generation if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point) //If the power is above 5000 or if the damage is above 550 if(removed && removed.temperature) - zap_cutoff = CLAMP(3000 - (power * (env.total_moles()) / 10) / env.return_temperature(), 350, 3000)//If the core is cold, it's easier to jump, ditto if there are a lot of mols + zap_cutoff = clamp(3000 - (power * (env.total_moles()) / 10) / env.return_temperature(), 350, 3000)//If the core is cold, it's easier to jump, ditto if there are a lot of mols else zap_cutoff = 1500 //We should always be able to zap our way out of the default enclosure //See supermatter_zap() for more details - var/range = CLAMP(power / env.return_pressure() * 10, 2, 8) + var/range = clamp(power / env.return_pressure() * 10, 2, 8) if(power > POWER_PENALTY_THRESHOLD) playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10) supermatter_zap(src, range, min(power*2, 20000)) @@ -531,7 +531,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) supermatter_zap(src, range, min(power*2, 20000)) else if (damage > damage_penalty_point && prob(20)) playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, TRUE, extrarange = 10) - supermatter_zap(src, range, CLAMP(power*2, 4000, 20000)) + supermatter_zap(src, range, clamp(power*2, 4000, 20000)) if(prob(15) && power > POWER_PENALTY_THRESHOLD) supermatter_pull(src, power/750) @@ -939,7 +939,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) var/turf/T = get_turf(target) var/pressure = max(1,T.return_air().return_pressure()) //We get our range with the strength of the zap and the pressure, the lower the former and the higher the latter the better - var/new_range = CLAMP(zap_str / pressure * 10, 2, 7) + var/new_range = clamp(zap_str / pressure * 10, 2, 7) if(prob(5)) zap_str = zap_str - (zap_str/10) supermatter_zap(target, new_range, zap_str, targets_copy) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 2ce2369f5b9..ab7a9ad61ae 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -65,7 +65,7 @@ pixel_x = -32 pixel_y = -32 for (var/ball in orbiting_balls) - var/range = rand(1, CLAMP(orbiting_balls.len, 3, 7)) + var/range = rand(1, clamp(orbiting_balls.len, 3, 7)) tesla_zap(ball, range, TESLA_MINI_POWER/7*range) else energy = 0 // ensure we dont have miniballs of miniballs diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 570e7566f8a..15238bfb3e8 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -175,7 +175,7 @@ ///Used by update_icon_state() and update_overlays() /obj/item/gun/energy/proc/get_charge_ratio() - return can_shoot() ? CEILING(CLAMP(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0 + return can_shoot() ? CEILING(clamp(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0 // Sets the ratio to 0 if the gun doesn't have enough charge to fire, or if its power cell is removed. /obj/item/gun/energy/suicide_act(mob/living/user) diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index 2ca43bca448..5e5fa7a0c06 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -317,7 +317,7 @@ AC.sync_stats() /obj/item/gun/energy/beam_rifle/proc/delay_penalty(amount) - aiming_time_left = CLAMP(aiming_time_left + amount, 0, aiming_time) + aiming_time_left = clamp(aiming_time_left + amount, 0, aiming_time) /obj/item/ammo_casing/energy/beam_rifle name = "particle acceleration lens" @@ -368,11 +368,11 @@ HS_BB.stun = projectile_stun HS_BB.impact_structure_damage = impact_structure_damage HS_BB.aoe_mob_damage = aoe_mob_damage - HS_BB.aoe_mob_range = CLAMP(aoe_mob_range, 0, 15) //Badmin safety lock + HS_BB.aoe_mob_range = clamp(aoe_mob_range, 0, 15) //Badmin safety lock HS_BB.aoe_fire_chance = aoe_fire_chance HS_BB.aoe_fire_range = aoe_fire_range HS_BB.aoe_structure_damage = aoe_structure_damage - HS_BB.aoe_structure_range = CLAMP(aoe_structure_range, 0, 15) //Badmin safety lock + HS_BB.aoe_structure_range = clamp(aoe_structure_range, 0, 15) //Badmin safety lock HS_BB.wall_devastate = wall_devastate HS_BB.wall_pierce_amount = wall_pierce_amount HS_BB.structure_pierce_amount = structure_piercing diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 3155af49079..f2d081e30ca 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -210,7 +210,7 @@ /obj/projectile/proc/vol_by_damage() if(src.damage) - return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then CLAMP the value between 30 and 100 + return clamp((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then CLAMP the value between 30 and 100 else return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume @@ -240,7 +240,7 @@ def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use. if(isturf(A) && hitsound_wall) - var/volume = CLAMP(vol_by_damage() + 20, 0, 100) + var/volume = clamp(vol_by_damage() + 20, 0, 100) if(suppressed) volume = 5 playsound(loc, hitsound_wall, volume, TRUE, -1) @@ -379,7 +379,7 @@ stack_trace("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!") qdel(src) return - var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z) + var/turf/target = locate(clamp(starting + xo, 1, world.maxx), clamp(starting + yo, 1, world.maxy), starting.z) setAngle(Get_Angle(src, target)) original_angle = Angle if(!nondirectional_sprite) @@ -509,10 +509,10 @@ if(!homing_target) return FALSE var/datum/point/PT = RETURN_PRECISE_POINT(homing_target) - PT.x += CLAMP(homing_offset_x, 1, world.maxx) - PT.y += CLAMP(homing_offset_y, 1, world.maxy) + PT.x += clamp(homing_offset_x, 1, world.maxx) + PT.y += clamp(homing_offset_y, 1, world.maxy) var/angle = closer_angle_difference(Angle, angle_between_points(RETURN_PRECISE_POINT(src), PT)) - setAngle(Angle + CLAMP(angle, -homing_turn_speed, homing_turn_speed)) + setAngle(Angle + clamp(angle, -homing_turn_speed, homing_turn_speed)) /obj/projectile/proc/set_homing_target(atom/A) if(!A || (!isturf(A) && !isturf(A.loc))) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 1fb04012245..3c03b53a770 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -646,7 +646,7 @@ /datum/reagents/proc/adjust_thermal_energy(J, min_temp = 2.7, max_temp = 1000) var/S = specific_heat() - chem_temp = CLAMP(chem_temp + (J / (S * total_volume)), 2.7, 1000) + chem_temp = clamp(chem_temp + (J / (S * total_volume)), 2.7, 1000) /datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, no_react = 0) if(!isnum(amount) || !amount) @@ -737,7 +737,7 @@ if (R.type == reagent) //clamp the removal amount to be between current reagent amount //and zero, to prevent removing more than the holder has stored - amount = CLAMP(amount, 0, R.volume) + amount = clamp(amount, 0, R.volume) R.volume -= amount update_total() if(!safety)//So it does not handle reactions when it need not to diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 6dde3fa2fdd..408d79e2323 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -135,7 +135,7 @@ target = text2num(target) . = TRUE if(.) - target_temperature = CLAMP(target, 0, 1000) + target_temperature = clamp(target, 0, 1000) if("eject") on = FALSE replace_beaker(usr) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index a6fa79938c3..fd993154675 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -246,7 +246,7 @@ amount = text2num(input(usr, "Max 10. Buffer content will be split evenly.", "How many to make?", 1)) - amount = CLAMP(round(amount), 0, 10) + amount = clamp(round(amount), 0, 10) if (amount <= 0) return FALSE // Get units per item @@ -272,7 +272,7 @@ "Maximum [vol_each_max] units per item.", "How many units to fill?", vol_each_max)) - vol_each = CLAMP(vol_each, 0, vol_each_max) + vol_each = clamp(vol_each, 0, vol_each_max) if(vol_each <= 0) return FALSE // Get item name diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index d7b8f3958ec..aadaa3d500f 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -59,7 +59,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) return 0 if(method == VAPOR) //smoke, foam, spray if(M.reagents) - var/modifier = CLAMP((1 - touch_protection), 0, 1) + var/modifier = clamp((1 - touch_protection), 0, 1) var/amount = round(reac_volume*modifier, 0.1) if(amount >= 0.5) M.reagents.add_reagent(type, amount) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 81d1b463707..5c0b69b4296 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1085,7 +1085,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/datum/antagonist/changeling/changeling = M.mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) changeling.chem_charges += metabolization_rate - changeling.chem_charges = CLAMP(changeling.chem_charges, 0, changeling.chem_storage) + changeling.chem_charges = clamp(changeling.chem_charges, 0, changeling.chem_storage) return ..() /datum/reagent/consumable/ethanol/irishcarbomb diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index 4980c0f2a77..94a1bd7c728 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -344,7 +344,7 @@ //Has to be at less than TRESHOLD_UNHUSK burn damage and have 100 isntabitaluri before unhusking. Corpses dont metabolize. if(HAS_TRAIT_FROM(M, TRAIT_HUSK, "burn") && Carbies.getFireLoss() < TRESHOLD_UNHUSK && Carbies.reagents.has_reagent(/datum/reagent/medicine/C2/instabitaluri, 100)) Carbies.cure_husk("burn") - Carbies.visible_message("With most of the burnt off flesh replaced, [Carbies] looks a lot healthier.") + Carbies.visible_message("With most of the burnt off flesh replaced, [Carbies] looks a lot healthier.") ..() return TRUE diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index c04a1d618bd..e20191c3358 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -369,9 +369,10 @@ name = "Happiness" description = "Fills you with ecstasic numbness and causes minor brain damage. Highly addictive. If overdosed causes sudden mood swings." reagent_state = LIQUID - color = "#FFF378" + color = "#EE35FF" addiction_threshold = 10 overdose_threshold = 20 + taste_description = "paint thinner" /datum/reagent/drug/happiness/on_mob_metabolize(mob/living/L) ..() diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index d067d2899ec..e2558f6ce1b 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -205,7 +205,7 @@ var/mob/living/carbon/patient = M if(reac_volume >= 5 && HAS_TRAIT_FROM(patient, TRAIT_HUSK, "burn") && patient.getFireLoss() < TRESHOLD_UNHUSK) //One carp yields 12u rezadone. patient.cure_husk("burn") - patient.visible_message("[patient]'s body rapidly absorbs moisture from the enviroment, taking on a more healthy appearance.") + patient.visible_message("[patient]'s body rapidly absorbs moisture from the enviroment, taking on a more healthy appearance.") /datum/reagent/medicine/spaceacillin name = "Spaceacillin" diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 21d30148e4e..ffffd95e74a 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1932,9 +1932,9 @@ /datum/reagent/peaceborg/confuse/on_mob_life(mob/living/carbon/M) if(M.confused < 6) - M.confused = CLAMP(M.confused + 3, 0, 5) + M.confused = clamp(M.confused + 3, 0, 5) if(M.dizziness < 6) - M.dizziness = CLAMP(M.dizziness + 3, 0, 5) + M.dizziness = clamp(M.dizziness + 3, 0, 5) if(prob(20)) to_chat(M, "You feel confused and disoriented.") ..() diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index a69dbc86866..49815c5e8d8 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -244,7 +244,7 @@ return holder.remove_reagent(/datum/reagent/sorium, created_volume*4) var/turf/T = get_turf(holder.my_atom) - var/range = CLAMP(sqrt(created_volume*4), 1, 6) + var/range = clamp(sqrt(created_volume*4), 1, 6) goonchem_vortex(T, 1, range) /datum/chemical_reaction/sorium_vortex @@ -253,7 +253,7 @@ /datum/chemical_reaction/sorium_vortex/on_reaction(datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) - var/range = CLAMP(sqrt(created_volume), 1, 6) + var/range = clamp(sqrt(created_volume), 1, 6) goonchem_vortex(T, 1, range) /datum/chemical_reaction/liquid_dark_matter @@ -265,7 +265,7 @@ return holder.remove_reagent(/datum/reagent/liquid_dark_matter, created_volume*3) var/turf/T = get_turf(holder.my_atom) - var/range = CLAMP(sqrt(created_volume*3), 1, 6) + var/range = clamp(sqrt(created_volume*3), 1, 6) goonchem_vortex(T, 0, range) /datum/chemical_reaction/ldm_vortex @@ -274,7 +274,7 @@ /datum/chemical_reaction/ldm_vortex/on_reaction(datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) - var/range = CLAMP(sqrt(created_volume/2), 1, 6) + var/range = clamp(sqrt(created_volume/2), 1, 6) goonchem_vortex(T, 0, range) /datum/chemical_reaction/flash_powder diff --git a/code/modules/reagents/reagent_containers/maunamug.dm b/code/modules/reagents/reagent_containers/maunamug.dm index a436b2014d4..39289d71c07 100644 --- a/code/modules/reagents/reagent_containers/maunamug.dm +++ b/code/modules/reagents/reagent_containers/maunamug.dm @@ -19,7 +19,7 @@ . = ..() . += "The status display reads: Current temperature: [reagents.chem_temp]K Current Charge:[cell ? "[cell.charge / cell.maxcharge * 100]%" : "No cell found"]." if(open) - . += "" + . += "The battery case is open." /obj/item/reagent_containers/glass/maunamug/process() ..() diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 13f29c06be2..e4ec49ad676 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -218,12 +218,6 @@ list_reagents = list(/datum/reagent/drug/aranesp = 10) icon_state = "pill3" -/obj/item/reagent_containers/pill/happiness - name = "happiness pill" - desc = "It has a creepy smiling face on it." - icon_state = "pill_happy" - list_reagents = list(/datum/reagent/drug/happiness = 10) - /obj/item/reagent_containers/pill/floorpill name = "floorpill" desc = "A strange pill found in the depths of maintenance" diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 1883878aac9..14724c41786 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -152,7 +152,7 @@ if(total_reagent_weight && amount_of_reagents) //don't bother if the container is empty - DIV/0 var/average_reagent_weight = total_reagent_weight / amount_of_reagents - spray_range = CLAMP(round((initial(spray_range) / average_reagent_weight) - ((amount_of_reagents - 1) * 1)), 3, 5) //spray distance between 3 and 5 tiles rounded down; extra reagents lose a tile + spray_range = clamp(round((initial(spray_range) / average_reagent_weight) - ((amount_of_reagents - 1) * 1)), 3, 5) //spray distance between 3 and 5 tiles rounded down; extra reagents lose a tile else spray_range = initial(spray_range) if(stream_mode == 0) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e444d7f2784..63ec7618bed 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -179,7 +179,7 @@ ///Used by update_icon() and update_overlays() /obj/item/reagent_containers/syringe/proc/get_rounded_vol() if(reagents && reagents.total_volume) - return CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15) + return clamp(round((reagents.total_volume / volume * 15),5), 1, 15) else return 0 diff --git a/code/modules/research/bepis.dm b/code/modules/research/bepis.dm index dcf9be28e91..79d8a1bfe2f 100644 --- a/code/modules/research/bepis.dm +++ b/code/modules/research/bepis.dm @@ -92,7 +92,7 @@ update_icon_state() say("Attempting to deposit 0 credits. Aborting.") return - deposit_value = CLAMP(round(deposit_value, 1), 1, 15000) + deposit_value = clamp(round(deposit_value, 1), 1, 15000) if(!account) say("Cannot find user account. Please swipe a valid ID.") return diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 776722ee515..ff9f3682a26 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -728,14 +728,6 @@ build_path = /obj/item/flamethrower/full category = list("hacked", "Security") -/datum/design/rpd - name = "Rapid Pipe Dispenser (RPD)" - id = "rpd" - build_type = AUTOLATHE - materials = list(/datum/material/iron = 75000, /datum/material/glass = 37500) - build_path = /obj/item/pipe_dispenser - category = list("hacked", "Construction") - /datum/design/electropack name = "Electropack" id = "electropack" diff --git a/code/modules/research/designs/tool_designs.dm b/code/modules/research/designs/tool_designs.dm index f1d83a9e766..bb48b7676fc 100644 --- a/code/modules/research/designs/tool_designs.dm +++ b/code/modules/research/designs/tool_designs.dm @@ -33,6 +33,14 @@ category = list("Tool Designs") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING +/datum/design/rpd + name = "Rapid Pipe Dispenser (RPD)" + id = "rpd_loaded" + build_type = PROTOLATHE + materials = list(/datum/material/iron = 75000, /datum/material/glass = 37500) + build_path = /obj/item/pipe_dispenser + category = list("Tool Designs") + departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO /datum/design/rcd_loaded name = "Rapid Construction Device" diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 5ba1e6a707e..295ad11a26c 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -522,10 +522,10 @@ use_power(500000) investigate_log("Experimentor has drained power from its APC", INVESTIGATE_EXPERIMENTOR) if(globalMalf == 99) - visible_message("[src] begins to glow and vibrate. It's going to blow!") + visible_message("[src] begins to glow and vibrate. It's going to blow!") addtimer(CALLBACK(src, .proc/boom), 50) if(globalMalf == 100) - visible_message("[src] begins to glow and vibrate. It's going to blow!") + visible_message("[src] begins to glow and vibrate. It's going to blow!") addtimer(CALLBACK(src, .proc/honk), 50) addtimer(CALLBACK(src, .proc/reset_exp), resetTime) diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index be80d0eea38..efc10ae0ba3 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -73,7 +73,7 @@ materials.set_local_size(total_storage) var/total_rating = 1.2 for(var/obj/item/stock_parts/manipulator/M in component_parts) - total_rating = CLAMP(total_rating - (M.rating * 0.1), 0, 1) + total_rating = clamp(total_rating - (M.rating * 0.1), 0, 1) if(total_rating == 0) efficiency_coeff = INFINITY else @@ -136,7 +136,7 @@ say("Mineral access is on hold, please contact the quartermaster.") return FALSE var/power = 1000 - amount = CLAMP(amount, 1, 50) + amount = clamp(amount, 1, 50) for(var/M in D.materials) power += round(D.materials[M] * amount / 35) power = min(3000, power) diff --git a/code/modules/research/nanites/extra_settings/number.dm b/code/modules/research/nanites/extra_settings/number.dm index 6e63ae067ed..75489635f55 100644 --- a/code/modules/research/nanites/extra_settings/number.dm +++ b/code/modules/research/nanites/extra_settings/number.dm @@ -16,7 +16,7 @@ value = text2num(value) if(!value || !isnum(value)) return - src.value = CLAMP(value, min, max) + src.value = clamp(value, min, max) /datum/nanite_extra_setting/number/get_copy() return new /datum/nanite_extra_setting/number(value, min, max, unit) diff --git a/code/modules/research/nanites/nanite_chamber_computer.dm b/code/modules/research/nanites/nanite_chamber_computer.dm index 69809f80cc0..79ccee7555c 100644 --- a/code/modules/research/nanites/nanite_chamber_computer.dm +++ b/code/modules/research/nanites/nanite_chamber_computer.dm @@ -72,14 +72,14 @@ if("set_safety") var/threshold = text2num(params["value"]) if(!isnull(threshold)) - chamber.set_safety(CLAMP(round(threshold, 1),0,500)) + chamber.set_safety(clamp(round(threshold, 1),0,500)) playsound(src, "terminal_type", 25, FALSE) chamber.occupant.investigate_log("'s nanites' safety threshold was set to [threshold] by [key_name(usr)] via [src] at [AREACOORD(src)].", INVESTIGATE_NANITES) . = TRUE if("set_cloud") var/cloud_id = text2num(params["value"]) if(!isnull(cloud_id)) - chamber.set_cloud(CLAMP(round(cloud_id, 1),0,100)) + chamber.set_cloud(clamp(round(cloud_id, 1),0,100)) playsound(src, "terminal_type", 25, FALSE) chamber.occupant.investigate_log("'s nanites' cloud id was set to [cloud_id] by [key_name(usr)] via [src] at [AREACOORD(src)].", INVESTIGATE_NANITES) . = TRUE diff --git a/code/modules/research/nanites/nanite_cloud_controller.dm b/code/modules/research/nanites/nanite_cloud_controller.dm index 208f562c12a..0a9f48021cb 100644 --- a/code/modules/research/nanites/nanite_cloud_controller.dm +++ b/code/modules/research/nanites/nanite_cloud_controller.dm @@ -174,7 +174,7 @@ var/cloud_id = new_backup_id if(!isnull(cloud_id)) playsound(src, 'sound/machines/terminal_prompt.ogg', 50, FALSE) - cloud_id = CLAMP(round(cloud_id, 1),1,100) + cloud_id = clamp(round(cloud_id, 1),1,100) generate_backup(cloud_id, usr) . = TRUE if("delete_backup") diff --git a/code/modules/research/nanites/nanite_programmer.dm b/code/modules/research/nanites/nanite_programmer.dm index f84f8247ee6..68d87bc02e2 100644 --- a/code/modules/research/nanites/nanite_programmer.dm +++ b/code/modules/research/nanites/nanite_programmer.dm @@ -86,13 +86,13 @@ var/target_code = params["target_code"] switch(target_code) if("activation") - program.activation_code = CLAMP(round(new_code, 1),0,9999) + program.activation_code = clamp(round(new_code, 1),0,9999) if("deactivation") - program.deactivation_code = CLAMP(round(new_code, 1),0,9999) + program.deactivation_code = clamp(round(new_code, 1),0,9999) if("kill") - program.kill_code = CLAMP(round(new_code, 1),0,9999) + program.kill_code = clamp(round(new_code, 1),0,9999) if("trigger") - program.trigger_code = CLAMP(round(new_code, 1),0,9999) + program.trigger_code = clamp(round(new_code, 1),0,9999) . = TRUE if("set_extra_setting") program.set_extra_setting(params["target_setting"], params["value"]) @@ -102,7 +102,7 @@ var/timer = text2num(params["delay"]) if(!isnull(timer)) playsound(src, "terminal_type", 25, FALSE) - timer = CLAMP(round(timer, 1), 0, 3600) + timer = clamp(round(timer, 1), 0, 3600) timer *= 10 //convert to deciseconds program.timer_restart = timer . = TRUE @@ -110,7 +110,7 @@ var/timer = text2num(params["delay"]) if(!isnull(timer)) playsound(src, "terminal_type", 25, FALSE) - timer = CLAMP(round(timer, 1), 0, 3600) + timer = clamp(round(timer, 1), 0, 3600) timer *= 10 //convert to deciseconds program.timer_shutdown = timer . = TRUE @@ -118,7 +118,7 @@ var/timer = text2num(params["delay"]) if(!isnull(timer)) playsound(src, "terminal_type", 25, FALSE) - timer = CLAMP(round(timer, 1), 0, 3600) + timer = clamp(round(timer, 1), 0, 3600) timer *= 10 //convert to deciseconds program.timer_trigger = timer . = TRUE @@ -126,7 +126,7 @@ var/timer = text2num(params["delay"]) if(!isnull(timer)) playsound(src, "terminal_type", 25, FALSE) - timer = CLAMP(round(timer, 1), 0, 3600) + timer = clamp(round(timer, 1), 0, 3600) timer *= 10 //convert to deciseconds program.timer_trigger_delay = timer . = TRUE diff --git a/code/modules/research/nanites/nanite_programs/weapon.dm b/code/modules/research/nanites/nanite_programs/weapon.dm index 69b9411a2a8..16f87bc6bde 100644 --- a/code/modules/research/nanites/nanite_programs/weapon.dm +++ b/code/modules/research/nanites/nanite_programs/weapon.dm @@ -84,7 +84,7 @@ /datum/nanite_program/explosive/on_trigger(comm_message) host_mob.visible_message("[host_mob] starts emitting a high-pitched buzzing, and [host_mob.p_their()] skin begins to glow...",\ "You start emitting a high-pitched buzzing, and your skin begins to glow...") - addtimer(CALLBACK(src, .proc/boom), CLAMP((nanites.nanite_volume * 0.35), 25, 150)) + addtimer(CALLBACK(src, .proc/boom), clamp((nanites.nanite_volume * 0.35), 25, 150)) /datum/nanite_program/explosive/proc/boom() var/nanite_amount = nanites.nanite_volume diff --git a/code/modules/research/nanites/nanite_remote.dm b/code/modules/research/nanites/nanite_remote.dm index 71aecc8f2cd..0d9361b5348 100644 --- a/code/modules/research/nanites/nanite_remote.dm +++ b/code/modules/research/nanites/nanite_remote.dm @@ -106,7 +106,7 @@ return var/new_code = text2num(params["code"]) if(!isnull(new_code)) - new_code = CLAMP(round(new_code, 1),0,9999) + new_code = clamp(round(new_code, 1),0,9999) code = new_code . = TRUE if("set_relay_code") @@ -114,7 +114,7 @@ return var/new_code = text2num(params["code"]) if(!isnull(new_code)) - new_code = CLAMP(round(new_code, 1),0,9999) + new_code = clamp(round(new_code, 1),0,9999) relay_code = new_code . = TRUE if("update_name") diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 0fb5f42a166..7fab2a9621e 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -153,7 +153,7 @@ display_name = "Advanced Engineering" description = "Pushing the boundaries of physics, one chainsaw-fist at a time." prereq_ids = list("engineering", "emp_basic") - design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "rcd_loaded") + design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "rcd_loaded", "rpd_loaded") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 2c265031e13..cc8c020152f 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -827,7 +827,7 @@ return to_chat(user, "You feed the slime the stabilizer. It is now less likely to mutate.") - M.mutation_chance = CLAMP(M.mutation_chance-15,0,100) + M.mutation_chance = clamp(M.mutation_chance-15,0,100) qdel(src) /obj/item/slimepotion/slime/mutator @@ -851,7 +851,7 @@ return to_chat(user, "You feed the slime the mutator. It is now more likely to mutate.") - M.mutation_chance = CLAMP(M.mutation_chance+12,0,100) + M.mutation_chance = clamp(M.mutation_chance+12,0,100) M.mutator_used = TRUE qdel(src) diff --git a/code/modules/ruins/spaceruin_code/TheDerelict.dm b/code/modules/ruins/spaceruin_code/TheDerelict.dm index 5d9dd2b25f5..81aa4dcadf8 100644 --- a/code/modules/ruins/spaceruin_code/TheDerelict.dm +++ b/code/modules/ruins/spaceruin_code/TheDerelict.dm @@ -76,7 +76,7 @@ ///Tries to charge from powernet excess, no upper limit except max charge. /obj/machinery/computer/vaultcontroller/proc/attempt_siphon() - var/surpluspower = CLAMP(attached_cable.surplus(), 0, (siphon_max - siphoned_power)) + var/surpluspower = clamp(attached_cable.surplus(), 0, (siphon_max - siphoned_power)) if(surpluspower) attached_cable.add_load(surpluspower) siphoned_power += surpluspower diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 31b415e0da6..ee639ab7d92 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(keycard_events, /datum/events, new) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF ui_x = 375 ui_y = 125 - + var/datum/callback/ev var/event = "" var/obj/machinery/keycard_auth/event_source @@ -105,10 +105,10 @@ GLOBAL_DATUM_INIT(keycard_events, /datum/events, new) message_admins("[ADMIN_LOOKUPFLW(triggerer)] triggered and [ADMIN_LOOKUPFLW(confirmer)] confirmed event [event]") var/area/A1 = get_area(triggerer) - deadchat_broadcast(" triggered [event] at [A1.name].", "[triggerer]", triggerer) + deadchat_broadcast(" triggered [event] at [A1.name].", "[triggerer]", triggerer, message_type=DEADCHAT_ANNOUNCEMENT) var/area/A2 = get_area(confirmer) - deadchat_broadcast(" confirmed [event] at [A2.name].", "[confirmer]", confirmer) + deadchat_broadcast(" confirmed [event] at [A2.name].", "[confirmer]", confirmer, message_type=DEADCHAT_ANNOUNCEMENT) switch(event) if(KEYCARD_RED_ALERT) set_security_level(SEC_LEVEL_RED) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index e532631a3af..f107963ac8a 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -832,13 +832,13 @@ var/change_per_engine = (1 - ENGINE_COEFF_MIN) / ENGINE_DEFAULT_MAXSPEED_ENGINES // 5 by default if(initial_engines > 0) change_per_engine = (1 - ENGINE_COEFF_MIN) / initial_engines // or however many it had - return CLAMP(1 - delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX) + return clamp(1 - delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX) if(new_value < initial_engines) var/delta = initial_engines - new_value var/change_per_engine = 1 //doesn't really matter should not be happening for 0 engine shuttles if(initial_engines > 0) change_per_engine = (ENGINE_COEFF_MAX - 1) / initial_engines //just linear drop to max delay - return CLAMP(1 + delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX) + return clamp(1 + delta * change_per_engine,ENGINE_COEFF_MIN,ENGINE_COEFF_MAX) /obj/docking_port/mobile/proc/in_flight() diff --git a/code/modules/spells/spell_types/curse.dm b/code/modules/spells/spell_types/curse.dm index 0ac35f8908e..3217fe07a67 100644 --- a/code/modules/spells/spell_types/curse.dm +++ b/code/modules/spells/spell_types/curse.dm @@ -8,7 +8,7 @@ GLOBAL_VAR_INIT(curse_of_madness_triggered, FALSE) GLOB.curse_of_madness_triggered = message // So latejoiners are also afflicted. - deadchat_broadcast("A Curse of Madness has stricken the station, shattering their minds with the awful secret: \"[message]\"") + deadchat_broadcast("A Curse of Madness has stricken the station, shattering their minds with the awful secret: \"[message]\"", message_type=DEADCHAT_ANNOUNCEMENT) for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == DEAD) diff --git a/code/modules/spells/spell_types/godhand.dm b/code/modules/spells/spell_types/godhand.dm index 0cb92807c2b..5cf7e7e1e50 100644 --- a/code/modules/spells/spell_types/godhand.dm +++ b/code/modules/spells/spell_types/godhand.dm @@ -4,10 +4,10 @@ var/catchphrase = "High Five!" var/on_use_sound = null var/obj/effect/proc_holder/spell/targeted/touch/attached_spell - icon = 'icons/obj/balloons.dmi' + icon = 'icons/obj/items_and_weapons.dmi' lefthand_file = 'icons/mob/inhands/misc/touchspell_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/touchspell_righthand.dmi' - icon_state = "syndballoon" + icon_state = "latexballon" item_state = null item_flags = NEEDS_PERMIT | ABSTRACT | DROPDEL w_class = WEIGHT_CLASS_HUGE diff --git a/code/modules/spells/spell_types/wizard.dm b/code/modules/spells/spell_types/wizard.dm index 29dd3193fca..51cb0faaf35 100644 --- a/code/modules/spells/spell_types/wizard.dm +++ b/code/modules/spells/spell_types/wizard.dm @@ -313,7 +313,7 @@ var/mob/living/M = AM M.Paralyze(stun_amt) to_chat(M, "You're thrown back by [user]!") - AM.safe_throw_at(throwtarget, ((CLAMP((maxthrow - (CLAMP(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user, force = repulse_force)//So stuff gets tossed around at the same time. + AM.safe_throw_at(throwtarget, ((clamp((maxthrow - (clamp(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user, force = repulse_force)//So stuff gets tossed around at the same time. /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno //i fixed conflicts only to find out that this is in the WIZARD file instead of the xeno file?! name = "Tail Sweep" diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 53968e64f8e..e6836c403c9 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -183,7 +183,7 @@ burn_dam += burn //We've dealt the physical damages, if there's room lets apply the stamina damage. - stamina_dam += round(CLAMP(stamina, 0, max_stamina_damage - stamina_dam), DAMAGE_PRECISION) + stamina_dam += round(clamp(stamina, 0, max_stamina_damage - stamina_dam), DAMAGE_PRECISION) if(owner && updating_health) @@ -288,7 +288,7 @@ C = source if(!original_owner) original_owner = source - else + else C = owner if(original_owner && owner != original_owner) //Foreign limb no_update = TRUE diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 4eaeebd7f94..d58499279a6 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -16,7 +16,7 @@ return FALSE var/obj/item/bodypart/affecting = C.get_bodypart(BODY_ZONE_CHEST) - affecting.receive_damage(CLAMP(brute_dam/2 * affecting.body_damage_coeff, 15, 50), CLAMP(burn_dam/2 * affecting.body_damage_coeff, 0, 50)) //Damage the chest based on limb's existing damage + affecting.receive_damage(clamp(brute_dam/2 * affecting.body_damage_coeff, 15, 50), clamp(burn_dam/2 * affecting.body_damage_coeff, 0, 50)) //Damage the chest based on limb's existing damage C.visible_message("[C]'s [src.name] has been violently dismembered!") C.emote("scream") SEND_SIGNAL(C, COMSIG_ADD_MOOD_EVENT, "dismembered", /datum/mood_event/dismembered) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 3c51ad92998..e0808c33c44 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -252,7 +252,7 @@ return var/range = input(user, "Enter range (0 - [max_light_beam_distance])", "Range Select", 0) as null|num - set_distance(CLAMP(range, 0, max_light_beam_distance)) + set_distance(clamp(range, 0, max_light_beam_distance)) assume_rgb(C) /obj/item/organ/eyes/robotic/glow/proc/assume_rgb(newcolor) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 57879cd6203..3cd63729c54 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -113,7 +113,7 @@ if(safe_oxygen_max) if(O2_pp > safe_oxygen_max) var/ratio = (breath_gases[/datum/gas/oxygen][MOLES]/safe_oxygen_max) * 10 - H.apply_damage_type(CLAMP(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type) + H.apply_damage_type(clamp(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type) H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy) else H.clear_alert("too_much_oxy") @@ -141,7 +141,7 @@ if(safe_nitro_max) if(N2_pp > safe_nitro_max) var/ratio = (breath_gases[/datum/gas/nitrogen][MOLES]/safe_nitro_max) * 10 - H.apply_damage_type(CLAMP(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type) + H.apply_damage_type(clamp(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type) H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro) else H.clear_alert("too_much_nitro") @@ -207,7 +207,7 @@ if(safe_toxins_max) if(Toxins_pp > safe_toxins_max) var/ratio = (breath_gases[/datum/gas/plasma][MOLES]/safe_toxins_max) * 10 - H.apply_damage_type(CLAMP(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type) + H.apply_damage_type(clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type) H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox) else H.clear_alert("too_much_tox") diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 998acb13a03..3c0c658a572 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -135,7 +135,7 @@ return if(maximum < damage) return - damage = CLAMP(damage + d, 0, maximum) + damage = clamp(damage + d, 0, maximum) var/mess = check_damage_thresholds(owner) prev_damage = damage if(mess && owner) diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 5863eedf6bb..6757d141031 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -124,4 +124,4 @@ to_chat(owner, "You absorb some of the shock into your body!") /obj/item/organ/stomach/ethereal/proc/adjust_charge(amount) - crystal_charge = CLAMP(crystal_charge + amount, ETHEREAL_CHARGE_NONE, ETHEREAL_CHARGE_DANGEROUS) + crystal_charge = clamp(crystal_charge + amount, ETHEREAL_CHARGE_NONE, ETHEREAL_CHARGE_DANGEROUS) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 149b3b15659..8b2feab8fee 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -546,8 +546,8 @@ GLOBAL_LIST_EMPTY(vending_products) throw_at(get_turf(fatty), 1, 1, spin=FALSE) /obj/machinery/vending/proc/untilt(mob/user) - user.visible_message("[user] rights [src].", \ - "You right [src].") + user.visible_message("[user] rights [src].", \ + "You right [src].") unbuckle_all_mobs(TRUE) @@ -638,7 +638,7 @@ GLOBAL_LIST_EMPTY(vending_products) return if(tilted && !user.buckled && !isAI(user)) - to_chat(user, "You begin righting [src].") + to_chat(user, "You begin righting [src].") if(do_after(user, 50, target=src)) untilt(user) return diff --git a/code/modules/vending/cigarette.dm b/code/modules/vending/cigarette.dm index b30c5b1340a..a5fbb472efc 100644 --- a/code/modules/vending/cigarette.dm +++ b/code/modules/vending/cigarette.dm @@ -15,6 +15,7 @@ /obj/item/storage/fancy/rollingpapers = 5) contraband = list(/obj/item/clothing/mask/vape = 5) premium = list(/obj/item/storage/fancy/cigarettes/cigpack_robustgold = 3, + /obj/item/storage/box/gum/nicotine = 2, /obj/item/lighter = 3, /obj/item/storage/fancy/cigarettes/cigars = 1, /obj/item/storage/fancy/cigarettes/cigars/havana = 1, diff --git a/code/modules/vending/medical.dm b/code/modules/vending/medical.dm index cf574c2fda6..00868bf96af 100644 --- a/code/modules/vending/medical.dm +++ b/code/modules/vending/medical.dm @@ -28,6 +28,7 @@ contraband = list(/obj/item/reagent_containers/pill/tox = 3, /obj/item/reagent_containers/pill/morphine = 4, /obj/item/reagent_containers/pill/multiver = 6, + /obj/item/storage/box/gum/happiness = 3, /obj/item/storage/box/hug/medical = 1) premium = list(/obj/item/reagent_containers/medigel/instabitaluri = 2, /obj/item/storage/pill_bottle/psicodine = 2, diff --git a/code/modules/vending/medical_wall.dm b/code/modules/vending/medical_wall.dm index 9de7b20fba6..1f7e5152af8 100644 --- a/code/modules/vending/medical_wall.dm +++ b/code/modules/vending/medical_wall.dm @@ -12,7 +12,8 @@ /obj/item/reagent_containers/medigel/aiuri = 2, /obj/item/reagent_containers/medigel/sterilizine = 1) contraband = list(/obj/item/reagent_containers/pill/tox = 2, - /obj/item/reagent_containers/pill/morphine = 2) + /obj/item/reagent_containers/pill/morphine = 2, + /obj/item/storage/box/gum/happiness = 1) armor = list("melee" = 100, "bullet" = 100, "laser" = 100, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50) resistance_flags = FIRE_PROOF refill_canister = /obj/item/vending_refill/wallmed diff --git a/code/modules/vending/snack.dm b/code/modules/vending/snack.dm index 611bf15886c..fefad806b8d 100644 --- a/code/modules/vending/snack.dm +++ b/code/modules/vending/snack.dm @@ -11,6 +11,7 @@ /obj/item/reagent_containers/food/snacks/sosjerky = 6, /obj/item/reagent_containers/food/snacks/no_raisin = 6, /obj/item/reagent_containers/food/drinks/dry_ramen = 3, + /obj/item/storage/box/gum = 3, /obj/item/reagent_containers/food/snacks/energybar = 6) contraband = list(/obj/item/reagent_containers/food/snacks/syndicake = 6, /obj/item/reagent_containers/food/snacks/candy/bronx = 1) diff --git a/html/changelog.html b/html/changelog.html index 6dfe744a0c3..be69f21ef19 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -51,6 +51,56 @@ -->
+

21 February 2020

+

AffectedArc07 updated:

+
    +
  • Linking your discord and BYOND accounts will now give you a role in the discord
  • +
+

Anonmare updated:

+
    +
  • AIs can now have their laws manually adjusted
  • +
  • AIs now spark when hit, like they always should've done.
  • +
+

ArcaneMusic updated:

+
    +
  • The boss's health bar on the NTOS Arcade app now properly shows the right value.
  • +
+

Arkatos updated:

+
    +
  • Tank Transfer Valve now uses tgui.
  • +
  • Fixed an issue where TTV assemblies could not be activated. Sorry gamers!
  • +
  • Fixed an issue where remote signaller would not close upon securing.
  • +
  • Added sanity checks to proximity sensor and timer to prevent timers from being modified while assembly is active.
  • +
+

Dennok updated:

+
    +
  • Rapid Pipe Dispenser (RPD) now available only in enginering protolathes.
  • +
+

Mickyan updated:

+
    +
  • Added bubble gum! Available in three- wait, two flavors! Regular, and nicotine flavored. Put it your mask slot to make bubbles!
  • +
+

Qustinnus updated:

+
    +
  • adds a showerbot, it showers people covered in blood, with force if necesary
  • +
+

ShizCalev updated:

+
    +
  • Fixed a typo that was causing helmets to not update icons when worn.
  • +
+

XDTM updated:

+
    +
  • Sixth sense (hearing deadchat while alive) will now only show player chat and not the dead-only announcements.
  • +
+

bobbahbrown updated:

+
    +
  • Cleaned up incomplete span elements
  • +
+

trollbreeder updated:

+
    +
  • Fixes an issue where Smite and Flesh to Stone were invisible in item form.
  • +
+

19 February 2020

ATHATH updated:

    @@ -1666,195 +1716,6 @@
    • #48281 Bees can now vent crawl
    - -

    20 December 2019

    -

    4dplanner updated:

    -
      -
    • herald cloak now works
    • -
    -

    Angustmeta updated:

    -
      -
    • fixed the sugar sack to stop looking like the rice sack
    • -
    -

    ArcaneMusic updated:

    -
      -
    • Stacks of plumbing duct can now be recycled in the autolathe.
    • -
    -

    Buggy123 updated:

    -
      -
    • Moved the "Observe" verb to ghost tab
    • -
    -

    Bumtickley00 updated:

    -
      -
    • Pills found in medkits now have their own unique colors
    • -
    -

    Coconutwarrior97 updated:

    -
      -
    • Added several new donk pocket types, and boxes, including sprites for each of course. Spicy-Pocket,Teriyaki-Pocket, Pizza-Pocket,Honk-Pocket,Gondola-Pocket and Berry-Pocket. This includes re-organizing them from the OTHER section in snacks_pastry.dm to a donk pocket section. Thanks to Farquaar for the box icons and some of the code! As well as latots for the donk pocket icons.
    • -
    • Added a Donk Pocket Variety crate, for 2000 credits, which includes 3 randomly selected donk pocket box types, excluding Gondola-Pocket.
    • -
    • Added a recipe for each new Donk Pocket type.
    • -
    • Added the new Donk Pocket types to the maint loot table.
    • -
    • Donk Pocket loot spawner object, credit to TheVekter for that, which was then added into the kitchens of all the main maps.
    • -
    • All Donk Pockets now follow the same naming scheme of X-Pocket.
    • -
    • Added craftable Donk Pocket boxes.
    • -
    -

    Ecobbomy updated:

    -
      -
    • Paystands have a few new functions. Examine your paystand with the registered card in hand to view these options!
    • -
    • there is a bling necklace subtype that allows you to sell items for credits, hassle-free (search "merchant" in the spawn menu)! Useful for merchant-based events.
    • -
    -

    Fury McFlurry updated:

    -
      -
    • Adds three new moth wings and markings!
    • -
    • They are named: Oakworm, Witchwing, Jungle.
    • -
    -

    JDHoffmann3 updated:

    -
      -
    • Vampires maintain blood volume when shapeshifting.
    • -
    -

    Jdawg1290 updated:

    -
      -
    • field generator floor shields should stay still now
    • -
    -

    Kerbin-Fiber updated:

    -
      -
    • Plumbing pipes aren't as clunky anymore.
    • -
    -

    LemonInTheDark updated:

    -
      -
    • Documented all of the supermatters's function process_atmos(). Check it out, it's dope
    • -
    • Fixed my 12am comments and a few spelling errors.
    • -
    -

    Mickyan updated:

    -
      -
    • Payouts and vending machine prices have been completely rebalanced
    • -
    -

    MrPerson updated:

    -
      -
    • Solar panels will visually rotate a lot more smoothly instead of being locked to only 8 directions.
    • -
    • Timed solar tracking is in degrees per minute. You're still not gonna use it though.
    • -
    -

    OnlineGirlfriend updated:

    -
      -
    • hot coco glass name and description
    • -
    • hot coco, tea, and coffee are now drink recipes (not food)
    • -
    • hot coco now has 20% chance of healing brute damage
    • -
    -

    PKPenguin321 updated:

    -
      -
    • Surgical drills have a fun new suicide.
    • -
    • Having waaay too much blood now makes you explode. Realistic!
    • -
    • Cleaned some very confusing code in subsystem/job.dm
    • -
    -

    RaveRadbury updated:

    -
      -
    • Space Mountain Wind Snowcones
    • -
    • snow cones do not require water to make
    • -
    • honey snow cones have more of an amber color
    • -
    • the mime snow cone has a grey straw so you can actually see it.
    • -
    • apple snow cones are also amber now
    • -
    • sodawater snow cones are actually Space Cola snow cones.
    • -
    • fruit salad snowcone tastes changed
    • -
    • mixed berry is now just berry
    • -
    • all snow cones can now taste of ice and water
    • -
    • clown snow cones recipe changed to require laughter, output 5u of their reagent like almost all other snow cones.
    • -
    • berry snow cones require and output 5u of berry juice
    • -
    • clown and pwrgame snowcones now contain the appropriate reagents
    • -
    • removed stray pixel on mime snowcone
    • -
    • Misspellings in snowcone titles and descriptions
    • -
    • Baguettes now have an attack verb. Try hitting somebody with one!
    • -
    • Meat donut recipe uses raw meat cutlets instead of raw meat slabs
    • -
    -

    Robotby updated:

    -
      -
    • borgs can now unbuckle users safely by clicking on themselves with help intent and no selected module OR by using the resist verb in the command bar/IC tab.
    • -
    -

    Ryll/Shaps updated:

    -
      -
    • A bunch of new achievements have been added! To name a few, there are achievements for holding up the captain with a rocket launcher as a nuclear operative, dying to inanimate objects, dying in a toilet, and getting watchlisted! Go do some dumb stuff!
    • -
    • AI's are no longer able to right tipped vending machines
    • -
    • Borgies can now attack and be attacked by vending machines! spelling: Untipping vending machines no longer shoes an errant /the
    • -
    -

    Skoglol updated:

    -
      -
    • All human intent suicides now work properly
    • -
    • New disarm intent suicide
    • -
    • Refactored language holders. Fixes a bunch of language related bugs and inconsistencies.
    • -
    • Transforms now apply new languages properly. Monkeys can no longer speak common.
    • -
    • Species changes will now give you the relevant languages.
    • -
    • PDA sorting mode is no longer inverted.
    • -
    • Some dynamic mode threat spending/refunding and threat logging fixes.
    • -
    • Fixed a bug causing some midround antag ghost rolls to fail. Dynamic midround nightmare should now spawn again.
    • -
    • Soul stones can once again be used on catatonics.
    • -
    • AI will now only be notified of new shells once.
    • -
    • Abandoned crates will no longer explode roundstart. Some loot has been fixed.
    • -
    -

    TheChosenEvilOne updated:

    -
      -
    • Arrival deadchat message will no longer colour other text in the deadchat colour.
    • -
    -

    TheVekter updated:

    -
      -
    • The Cult should now actually be able to draw runes in the Library.
    • -
    • Added brass sheets to the Sheet Snatcher's whitelist.
    • -
    • Added Chili con Carnival, a new chili dish that requires the clown's shoes to make! (Sprite by ArcaneMusic)
    • -
    • Apothecary access should now work correctly on all maps.
    • -
    • Fixed the crafting menu.
    • -
    • Due to its age, the E.X.P.E.R.I-Mentor might be prone to exploding in very, very rare scenarios. Please take care in its use.
    • -
    • Increased the amount of research gained for discovering a strange object's true nature.
    • -
    • The E.X.P.E.R.I-Mentor will now produce research notes instead of feeding points directly into the server.
    • -
    • Strange objects have a more informational examine string.
    • -
    • Reduced the overall amount of passive research generation by a small amount.
    • -
    • Adds a cooldown to the Deathgasp emote
    • -
    -

    Yenwodyah updated:

    -
      -
    • Bear traps and bolas apply slowdown correctly again
    • -
    • Blood-red hardsuits now properly update their slowdown when you toggle helmet modes
    • -
    -

    actioninja updated:

    -
      -
    • pandemic now uses tgui-next
    • -
    • tgui-next portable atmos
    • -
    • Nanite damage sensor have extra settings again
    • -
    -

    bobbahbrown updated:

    -
      -
    • Removed some stinky smells from hailer mask code.
    • -
    -

    carshalash updated:

    -
      -
    • Makes Hot Coco actually consumable
    • -
    -

    fludd12 updated:

    -
      -
    • You can now craft something vaguely like a pen out of some wood and ash.
    • -
    -

    nightred updated:

    -
      -
    • Moved the Biogenerator to be shared with the kitchen
    • -
    • Hallway counter to the kitchen
    • -
    • Changed the layout of the kitchen
    • -
    -

    stylemistake updated:

    -
      -
    • Fancy tgui mode now works on IE8 (not perfect. but certainly usable).
    • -
    -

    swindly updated:

    -
      -
    • Assemblies in chemical grenades are removed when wrenched while there are no beakers inside instead of only when there is a beaker inside
    • -
    • Makes encryption keys be put in the hands of the user when able instead of being dropped on the floor when removed from headsets
    • -
    -

    tralezab updated:

    -
      -
    • The Plasma Fist now builds energy up for a new explosive move!
    • -
    • drones are no longer allowed to leave their station, they will die upon doing so
    • -
    • renamed boring ice peppers to chilly peppers
    • -
    -

    zxaber updated:

    -
      -
    • Added logging for when an Exosuit Console is used to EMP a mech.
    • -
GoonStation 13 Development Team diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 8a875661a77..891f4e0ec5f 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -37316,3 +37316,35 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. the skin. The initial idea was for footwear, but we all know what you're really going to do with it. Research can be continued at your station's B.E.P.I.S. unit. +2020-02-21: + AffectedArc07: + - rscadd: Linking your discord and BYOND accounts will now give you a role in the + discord + Anonmare: + - rscadd: AIs can now have their laws manually adjusted + - bugfix: AIs now spark when hit, like they always should've done. + ArcaneMusic: + - bugfix: The boss's health bar on the NTOS Arcade app now properly shows the right + value. + Arkatos: + - rscadd: Tank Transfer Valve now uses tgui. + - bugfix: Fixed an issue where TTV assemblies could not be activated. Sorry gamers! + - bugfix: Fixed an issue where remote signaller would not close upon securing. + - bugfix: Added sanity checks to proximity sensor and timer to prevent timers from + being modified while assembly is active. + Dennok: + - rscadd: Rapid Pipe Dispenser (RPD) now available only in enginering protolathes. + Mickyan: + - rscadd: Added bubble gum! Available in three- wait, two flavors! Regular, and + nicotine flavored. Put it your mask slot to make bubbles! + Qustinnus: + - rscadd: adds a showerbot, it showers people covered in blood, with force if necesary + ShizCalev: + - bugfix: Fixed a typo that was causing helmets to not update icons when worn. + XDTM: + - tweak: Sixth sense (hearing deadchat while alive) will now only show player chat + and not the dead-only announcements. + bobbahbrown: + - code_imp: Cleaned up incomplete span elements + trollbreeder: + - bugfix: Fixes an issue where Smite and Flesh to Stone were invisible in item form. diff --git a/html/changelogs/AutoChangeLog-pr-49374.yml b/html/changelogs/AutoChangeLog-pr-49374.yml deleted file mode 100644 index a8b36d88894..00000000000 --- a/html/changelogs/AutoChangeLog-pr-49374.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "AffectedArc07" -delete-after: True -changes: - - rscadd: "Linking your discord and BYOND accounts will now give you a role in the discord" diff --git a/icons/mob/clothing/mask.dmi b/icons/mob/clothing/mask.dmi index 7ae1fd2c793..31a3613e08f 100644 Binary files a/icons/mob/clothing/mask.dmi and b/icons/mob/clothing/mask.dmi differ diff --git a/icons/obj/food/food.dmi b/icons/obj/food/food.dmi index fc15ca37181..08a4de094f4 100644 Binary files a/icons/obj/food/food.dmi and b/icons/obj/food/food.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 405e3a13a1d..e34d4553ee5 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ diff --git a/icons/obj/watercloset.dmi b/icons/obj/watercloset.dmi index 38a340ec15b..31e85ee7e9b 100644 Binary files a/icons/obj/watercloset.dmi and b/icons/obj/watercloset.dmi differ diff --git a/sound/effects/hygienebot_angry.ogg b/sound/effects/hygienebot_angry.ogg new file mode 100644 index 00000000000..d184cc38e21 Binary files /dev/null and b/sound/effects/hygienebot_angry.ogg differ diff --git a/sound/effects/hygienebot_happy.ogg b/sound/effects/hygienebot_happy.ogg new file mode 100644 index 00000000000..ca3b9159c37 Binary files /dev/null and b/sound/effects/hygienebot_happy.ogg differ diff --git a/tgstation.dme b/tgstation.dme index e6c0e77a55f..345c44db3bc 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2235,6 +2235,7 @@ #include "code\modules\mob\living\simple_animal\bot\firebot.dm" #include "code\modules\mob\living\simple_animal\bot\floorbot.dm" #include "code\modules\mob\living\simple_animal\bot\honkbot.dm" +#include "code\modules\mob\living\simple_animal\bot\hygienebot.dm" #include "code\modules\mob\living\simple_animal\bot\medbot.dm" #include "code\modules\mob\living\simple_animal\bot\mulebot.dm" #include "code\modules\mob\living\simple_animal\bot\secbot.dm" @@ -2990,4 +2991,4 @@ #include "interface\menu.dm" #include "interface\stylesheet.dm" #include "interface\skin.dmf" -// END_INCLUDE +// END_INCLUDE \ No newline at end of file diff --git a/tgui/packages/tgui/interfaces/NtosArcade.js b/tgui/packages/tgui/interfaces/NtosArcade.js index 73f4c3b9afe..73903d70042 100644 --- a/tgui/packages/tgui/interfaces/NtosArcade.js +++ b/tgui/packages/tgui/interfaces/NtosArcade.js @@ -50,7 +50,7 @@ export const NtosArcade = props => { {