From 3d83b55cf649da7743112419db7254eb291bbd78 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Tue, 15 Aug 2017 10:49:55 -0500 Subject: [PATCH] Annihilates the colons! --- code/__HELPERS/_lists.dm | 4 +-- code/__HELPERS/icons.dm | 28 ++++++++------- code/datums/mind.dm | 12 +++---- code/game/communications.dm | 2 +- code/game/machinery/overview.dm | 6 ++-- code/game/machinery/robot_fabricator.dm | 36 +++++++++---------- code/game/mecha/mecha.dm | 4 +-- code/game/objects/items/devices/scanners.dm | 2 +- .../objects/items/devices/transfer_valve.dm | 6 ++-- code/modules/admin/DB_ban/functions.dm | 16 ++++----- code/modules/admin/verbs/adminjump.dm | 4 +-- code/modules/admin/verbs/debug.dm | 24 ++++++------- code/modules/admin/verbs/diagnostics.dm | 5 +-- code/modules/assembly/bomb.dm | 3 +- code/modules/hydroponics/grown/chili.dm | 10 +++--- code/modules/mob/living/carbon/carbon.dm | 7 ++-- .../mob/living/silicon/pai/software.dm | 3 +- .../modules/ninja/suit/suit_initialisation.dm | 2 +- code/modules/paperwork/photography.dm | 5 +-- .../chemistry/reagents/food_reagents.dm | 2 +- 20 files changed, 93 insertions(+), 88 deletions(-) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 9c64fb8b74..9646f03252 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -320,7 +320,7 @@ return r // Returns the key based on the index -#define KEYBYINDEX(L, index) (((index <= L:len) && (index > 0)) ? L[index] : null) +#define KEYBYINDEX(L, index) (((index <= length(L)) && (index > 0)) ? L[index] : null) /proc/count_by_type(list/L, type) var/i = 0 @@ -468,7 +468,7 @@ . |= key_list[key] //Picks from the list, with some safeties, and returns the "default" arg if it fails -#define DEFAULTPICK(L, default) ((islist(L) && L:len) ? pick(L) : default) +#define DEFAULTPICK(L, default) ((islist(L) && length(L)) ? pick(L) : default) #define LAZYINITLIST(L) if (!L) L = list() #define UNSETEMPTY(L) if (L && !L.len) L = null #define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } } diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 04ea69a43f..ef20844c91 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -712,7 +712,8 @@ The _flatIcons list is a cache for generated icon files. if(!current) curIndex++ //Try the next layer continue - currentLayer = current:layer + var/image/I = current + currentLayer = I.layer if(currentLayer<0) // Special case for FLY_LAYER if(currentLayer <= -1000) return flat if(pSet == 0) // Underlay @@ -747,22 +748,22 @@ The _flatIcons list is a cache for generated icon files. // Dimensions of overlay being added var/{addX1;addX2;addY1;addY2} - for(var/I in layers) - - if(I:alpha == 0) + for(var/V in layers) + var/image/I = V + if(I.alpha == 0) continue if(I == copy) // 'I' is an /image based on the object being flattened. curblend = BLEND_OVERLAY - add = icon(I:icon, I:icon_state, I:dir) + add = icon(I.icon, I.icon_state, I.dir) else // 'I' is an appearance object. add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend) // Find the new dimensions of the flat icon to fit the added overlay - addX1 = min(flatX1, I:pixel_x+1) - addX2 = max(flatX2, I:pixel_x+add.Width()) - addY1 = min(flatY1, I:pixel_y+1) - addY2 = max(flatY2, I:pixel_y+add.Height()) + addX1 = min(flatX1, I.pixel_x+1) + addX2 = max(flatX2, I.pixel_x+add.Width()) + addY1 = min(flatY1, I.pixel_y+1) + addY2 = max(flatY2, I.pixel_y+add.Height()) if(addX1!=flatX1 || addX2!=flatX2 || addY1!=flatY1 || addY2!=flatY2) // Resize the flattened icon so the new icon fits @@ -771,7 +772,7 @@ The _flatIcons list is a cache for generated icon files. flatY1=addY1;flatY2=addY2 // Blend the overlay into the flattened icon - flat.Blend(add, blendMode2iconMode(curblend), I:pixel_x + 2 - flatX1, I:pixel_y + 2 - flatY1) + flat.Blend(add, blendMode2iconMode(curblend), I.pixel_x + 2 - flatX1, I.pixel_y + 2 - flatY1) if(A.color) flat.Blend(A.color, ICON_MULTIPLY) @@ -782,10 +783,11 @@ The _flatIcons list is a cache for generated icon files. /proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A. - for(var/I in A.overlays)//For every image in overlays. var/image/I will not work, don't try it. - if(I:layer>A.layer) + for(var/V in A.overlays)//For every image in overlays. var/image/I will not work, don't try it. + var/image/I = V + if(I.layer>A.layer) continue//If layer is greater than what we need, skip it. - var/icon/image_overlay = new(I:icon,I:icon_state)//Blend only works with icon objects. + var/icon/image_overlay = new(I.icon,I.icon_state)//Blend only works with icon objects. //Also, icons cannot directly set icon_state. Slower than changing variables but whatever. alpha_mask.Blend(image_overlay,ICON_OR)//OR so they are lumped together in a nice overlay. return alpha_mask//And now return the mask. diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 7017149d53..d943e417e5 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -805,11 +805,11 @@ possible_targets += possible_target.current var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current + var/list/objective_list = typecacheof(list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon)) + if (is_type_in_typecache(objective, objective_list) && objective.target) + def_target = objective.target.current - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + var/mob/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets if (!new_target) return @@ -817,12 +817,12 @@ if (new_target == "Free objective") new_objective = new objective_path new_objective.owner = src - new_objective:target = null + new_objective.target = null new_objective.explanation_text = "Free objective" else new_objective = new objective_path new_objective.owner = src - new_objective:target = new_target:mind + new_objective.target = new_target.mind //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. new_objective.update_explanation_text() diff --git a/code/game/communications.dm b/code/game/communications.dm index 66bb91ef59..19c3f87460 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -292,7 +292,7 @@ GLOBAL_VAR_INIT(RADIO_MAGNETS, "9") /datum/signal/proc/debug_print() if (source) - . = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n" + . = "signal = {source = '[source]' [COORD(source)]\n" else . = "signal = {source = '[source]' ()\n" for (var/i in data) diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index ffcb36678a..0cf97586c3 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -96,7 +96,8 @@ colour2 = rgb(255,128,0) if(ismob(AM)) - if(AM:client) + var/mob/M = AM + if(M.client) colour = rgb(255,0,0) else colour = rgb(255,128,128) @@ -242,7 +243,8 @@ colour = rgb(255,255,0) if(ismob(AM)) - if(AM:client) + var/mob/M = AM + if(M.client) colour = rgb(255,0,0) else colour = rgb(255,128,128) diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm index 2183ec6448..20fd729304 100644 --- a/code/game/machinery/robot_fabricator.dm +++ b/code/game/machinery/robot_fabricator.dm @@ -11,31 +11,29 @@ idle_power_usage = 20 active_power_usage = 5000 -/obj/machinery/robotic_fabricator/attackby(obj/item/O, mob/user, params) +/obj/machinery/robotic_fabricator/attackby(obj/item/O, mob/living/user, params) if (istype(O, /obj/item/stack/sheet/metal)) - if (src.metal_amount < 150000) - var/count = 0 - src.add_overlay("fab-load-metal") - spawn(15) - if(O) - if(!O:amount) - return - while(metal_amount < 150000 && O:amount) - src.metal_amount += O:materials[MAT_METAL] /*O:height * O:width * O:length * 100000*/ - O:amount-- - count++ - - if (O:amount < 1) - qdel(O) - - to_chat(user, "You insert [count] metal sheet\s into \the [src].") - cut_overlay("fab-load-metal") - updateDialog() + if (metal_amount < 150000) + add_overlay("fab-load-metal") + addtimer(CALLBACK(src, .proc/FinishLoadingMetal, O, user), 15) else to_chat(user, "\The [src] is full.") else return ..() +/obj/machinery/robotic_fabricator/proc/FinishLoadingMetal(obj/item/stack/sheet/metal/M, mob/living/user) + cut_overlay("fab-load-metal") + if(QDELETED(M) || QDELETED(user)) + return + var/count = 0 + while(metal_amount < 150000 && !QDELETED(M)) + metal_amount += M.materials[MAT_METAL] + M.use(1) + count++ + + to_chat(user, "You insert [count] metal sheet\s into \the [src].") + updateDialog() + /obj/machinery/robotic_fabricator/power_change() if (powered()) stat &= ~NOPOWER diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 5564cd2c0a..5d5879206b 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -713,8 +713,8 @@ AI.remote_control = src AI.canmove = 1 //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow. AI.can_shunt = 0 //ONE AI ENTERS. NO AI LEAVES. - to_chat(AI, "[AI.can_dominate_mechs ? "Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!" \ - : "You have been uploaded to a mech's onboard computer."]") + to_chat(AI, AI.can_dominate_mechs ? "Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!" :\ + "You have been uploaded to a mech's onboard computer.") to_chat(AI, "Use Middle-Mouse to activate mech functions and equipment. Click normally for AI interactions.") if(interaction == AI_TRANS_FROM_CARD) GrantActions(AI, FALSE) //No eject/return to core action for AI uploaded by card diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 3d7e575215..ae84bd2f2c 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -147,7 +147,7 @@ MASS SPECTROMETER if (M.getCloneLoss()) to_chat(user, "\tSubject appears to have [M.getCloneLoss() > 30 ? "severe" : "minor"] cellular damage.") if (M.reagents && M.reagents.get_reagent_amount("epinephrine")) - to_chat(user, "\tBloodstream analysis located [M.reagents:get_reagent_amount("epinephrine")] units of rejuvenation chemicals.") + to_chat(user, "\tBloodstream analysis located [M.reagents.get_reagent_amount("epinephrine")] units of rejuvenation chemicals.") if (M.getBrainLoss() >= 100 || !M.getorgan(/obj/item/organ/brain)) to_chat(user, "\tSubject brain function is non-existent.") else if (M.getBrainLoss() >= 60) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index c21ff386bd..4663e2142a 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -8,7 +8,7 @@ desc = "Regulates the transfer of air between two tanks" var/obj/item/weapon/tank/tank_one var/obj/item/weapon/tank/tank_two - var/obj/item/device/attached_device + var/obj/item/device/assembly/attached_device var/mob/attacher = null var/valve_open = FALSE var/toggle = 1 @@ -99,8 +99,8 @@ toggle_valve() else if(attached_device) if(href_list["rem_device"]) - attached_device.loc = get_turf(src) - attached_device:holder = null + attached_device.forceMove(get_turf(src)) + attached_device.holder = null attached_device = null update_icon() if(href_list["device"]) diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index 23bf656b8c..e580b306b3 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -83,10 +83,10 @@ var/a_computerid var/a_ip - if(src.owner && istype(src.owner, /client)) - a_ckey = src.owner:ckey - a_computerid = src.owner:computer_id - a_ip = src.owner:address + if(istype(owner)) + a_ckey = owner.ckey + a_computerid = owner.computer_id + a_ip = owner.address if(blockselfban) if(a_ckey == ckey) @@ -309,12 +309,12 @@ to_chat(usr, "Database update failed due to multiple bans having the same ID. Contact the database admin.") return - if(!src.owner || !istype(src.owner, /client)) + if(!istype(owner)) return - var/unban_ckey = src.owner:ckey - var/unban_computerid = src.owner:computer_id - var/unban_ip = src.owner:address + var/unban_ckey = owner.ckey + var/unban_computerid = owner.computer_id + var/unban_ip = owner.address var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = INET_ATON('[unban_ip]') WHERE id = [id]" var/datum/DBQuery/query_unban = SSdbcore.NewQuery(sql_update) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 7f4dd3ebb9..ec1091bb3c 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -84,11 +84,11 @@ var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) + var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) if(!selection) to_chat(src, "No keys found.") return - var/mob/M = selection:mob + var/mob/M = selection.mob log_admin("[key_name(usr)] jumped to [key_name(M)]") message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index c69628c625..66438d1fac 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -316,10 +316,8 @@ GLOBAL_PROTECT(AdminProcCallCount) alert("Wait until the game starts") return if(ishuman(M)) - log_admin("[key_name(src)] has alienized [M.key].") - spawn(0) - M:Alienize() - SSblackbox.add_details("admin_verb","Make Alien") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + INVOKE_ASYNC(M, /mob/living/carbon/human/proc/Alienize) + SSblackbox.add_details("admin_verb","Make Alien") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] made [key_name(M)] into an alien.") message_admins("[key_name_admin(usr)] made [key_name(M)] into an alien.") else @@ -333,10 +331,8 @@ GLOBAL_PROTECT(AdminProcCallCount) alert("Wait until the game starts") return if(ishuman(M)) - log_admin("[key_name(src)] has slimeized [M.key].") - spawn(0) - M:slimeize() - SSblackbox.add_details("admin_verb","Make Slime") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + INVOKE_ASYNC(M, /mob/living/carbon/human/proc/slimeize) + SSblackbox.add_details("admin_verb","Make Slime") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] made [key_name(M)] into a slime.") message_admins("[key_name_admin(usr)] made [key_name(M)] into a slime.") else @@ -461,12 +457,14 @@ GLOBAL_PROTECT(AdminProcCallCount) if(worn) if(istype(worn, /obj/item/device/pda)) - worn:id = id - id.loc = worn + var/obj/item/device/pda/PDA = worn + PDA.id = id + id.forceMove(PDA) else if(istype(worn, /obj/item/weapon/storage/wallet)) - worn:front_id = id - id.loc = worn - worn.update_icon() + var/obj/item/weapon/storage/wallet/W = worn + W.front_id = id + id.forceMove(W) + W.update_icon() else H.equip_to_slot(id,slot_wear_id) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 15b619f653..a4482154d8 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -78,8 +78,9 @@ continue output += "  [filters[filter]]: [f.len]
" for (var/device in f) - if (isobj(device)) - output += "    [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)])
" + if (istype(device, /atom)) + var/atom/A = device + output += "    [device] ([A.x],[A.y],[A.z] in area [get_area(device)])
" else output += "    [device]
" diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 2853fefcbf..f0fa90aa20 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -44,7 +44,8 @@ qdel(src) return - if((istype(W, /obj/item/weapon/weldingtool) && W:welding)) + var/obj/item/weapon/weldingtool/WT = W + if((istype(WT) && WT.welding)) if(!status) status = TRUE GLOB.bombers += "[key_name(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]" diff --git a/code/modules/hydroponics/grown/chili.dm b/code/modules/hydroponics/grown/chili.dm index 7707a4d438..66bd823a89 100644 --- a/code/modules/hydroponics/grown/chili.dm +++ b/code/modules/hydroponics/grown/chili.dm @@ -71,21 +71,21 @@ name = "ghost chili" desc = "It seems to be vibrating gently." icon_state = "ghostchilipepper" - var/mob/held_mob + var/mob/living/carbon/human/held_mob filling_color = "#F8F8FF" bitesize_mod = 4 origin_tech = "biotech=4;magnets=5" /obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/attack_hand(mob/user) ..() - if( ismob(src.loc) ) - held_mob = src.loc + if( ismob(loc) ) + held_mob = loc START_PROCESSING(SSobj, src) /obj/item/weapon/reagent_containers/food/snacks/grown/ghost_chili/process() - if(held_mob && src.loc == held_mob) + if(held_mob && loc == held_mob) if(held_mob.is_holding(src)) - if(hasvar(held_mob,"gloves") && held_mob:gloves) + if(istype(held_mob) && held_mob.gloves) return held_mob.bodytemperature += 15 * TEMPERATURE_DAMAGE_COEFFICIENT if(prob(10)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 9179221137..8f5720164e 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -51,9 +51,10 @@ var/obj/item/item_in_hand = src.get_active_held_item() if(item_in_hand) //this segment checks if the item in your hand is twohanded. - if(istype(item_in_hand, /obj/item/weapon/twohanded)) - if(item_in_hand:wielded == 1) - to_chat(usr, "Your other hand is too busy holding the [item_in_hand.name]") + var/obj/item/weapon/twohanded/TH = item_in_hand + if(istype(TH)) + if(TH.wielded == 1) + to_chat(usr, "Your other hand is too busy holding [TH]") return var/oindex = active_hand_index active_hand_index = held_index diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 77874ad403..719b17c734 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -619,7 +619,8 @@ src.paiInterface() if(hackprogress >= 100) src.hackprogress = 0 - src.cable.machine:open() + var/obj/machinery/door/D = cable.machine + D.open() sleep(50) // Update every 5 seconds // Digital Messenger diff --git a/code/modules/ninja/suit/suit_initialisation.dm b/code/modules/ninja/suit/suit_initialisation.dm index b723ade381..5fb3fe8a62 100644 --- a/code/modules/ninja/suit/suit_initialisation.dm +++ b/code/modules/ninja/suit/suit_initialisation.dm @@ -70,7 +70,7 @@ addtimer(CALLBACK(src, .proc/deinitialize_three, delay, U), delay) /obj/item/clothing/suit/space/space_ninja/proc/deinitialize_three(delay, mob/living/carbon/human/U) - to_chat(U, "Logging off, [U:real_name]. Shutting down SpiderOS.") + to_chat(U, "Logging off, [U.real_name]. Shutting down SpiderOS.") addtimer(CALLBACK(src, .proc/deinitialize_four, delay, U), delay) /obj/item/clothing/suit/space/space_ninja/proc/deinitialize_four(delay, mob/living/carbon/human/U) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index b1896f930a..4755f3d64a 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -222,8 +222,9 @@ var/offX = 32 * (A.x - center.x) + A.pixel_x + 33 var/offY = 32 * (A.y - center.y) + A.pixel_y + 33 if(ismovableatom(A)) - offX += A:step_x - offY += A:step_y + var/atom/movable/AM = A + offX += AM.step_x + offY += AM.step_y res.Blend(img, blendMode2iconMode(A.blend_mode), offX, offY) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 1fae98e2f3..72001d5ca9 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -390,7 +390,7 @@ T.MakeSlippery(min_wet_time = 10, wet_time_to_add = reac_volume*2) var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T) if(hotspot) - var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() ) + var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles()) lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0) lowertemp.react() T.assume_air(lowertemp)